Tamar Christina 443fc6ade9 middle-end: Use addhn for compression instead of inclusive OR when reducing comparison values
Given a sequence such as

int foo ()
{
#pragma GCC unroll 4
  for (int i = 0; i < N; i++)
    if (a[i] == 124)
      return 1;

  return 0;
}

where a[i] is long long, we will unroll the loop and use an OR reduction for
early break on Adv. SIMD.  Afterwards the sequence is followed by a compression
sequence to compress the 128-bit vectors into 64-bits for use by the branch.

However if we have support for add halving and narrowing then we can instead of
using an OR, use an ADDHN which will do the combining and narrowing.

Note that for now I only do the last OR, however if we have more than one level
of unrolling we could technically chain them.  I will revisit this in another
up coming early break series, however an unroll of 2 is fairly common.

gcc/ChangeLog:

	* internal-fn.def (VEC_TRUNC_ADD_HIGH): New.
	* doc/generic.texi: Document it.
	* optabs.def (vec_trunc_add_high): New.
	* doc/md.texi: Document it.
	* tree-vect-stmts.cc (vectorizable_early_exit): Use addhn if supported.

gcc/testsuite/ChangeLog:

	* gcc.target/aarch64/vect-early-break-addhn_1.c: New test.
	* gcc.target/aarch64/vect-early-break-addhn_2.c: New test.
	* gcc.target/aarch64/vect-early-break-addhn_3.c: New test.
	* gcc.target/aarch64/vect-early-break-addhn_4.c: New test.
2025-09-12 08:30:55 +01:00
2025-09-11 00:20:14 +00:00
2025-08-29 00:19:55 +00:00
2025-09-02 00:19:26 +00:00
2025-08-31 00:18:58 +00:00
2025-09-06 00:20:34 +00:00
2025-09-03 00:20:18 +00:00
2025-09-07 00:20:16 +00:00
2025-09-08 00:20:50 +00:00
2025-09-12 00:20:54 +00:00
2025-09-02 00:19:26 +00:00
2025-09-05 00:19:51 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 4.2 GiB
Languages
C++ 30.8%
C 30.2%
Ada 14.4%
D 6.1%
Go 5.7%
Other 12.3%