Roger Sayle 2907bfc341 PR target/106231: Optimize (any_extend:DI (ctz:SI ...)) on x86_64.
This patch resolves PR target/106231 by providing insns that recognize
(zero_extend:DI (ctz:SI ...)) and (sign_extend:DI (ctz:SI ...)).  The
result of ctz:SI is always between 0 and 32 (or undefined), so
sign_extension is the same as zero_extension, and the result is already
extended in the destination register.

Things are a little complicated, because the existing implementation
of *ctzsi2 handles multiple cases, including false dependencies, which
we continue to support in this patch.

2022-07-18  Roger Sayle  <roger@nextmovesoftware.com>

gcc/ChangeLog
	PR target/106231
	* config/i386/i386.md (*ctzsidi2_<s>ext): New insn_and_split
	to recognize any_extend:DI of ctz:SI which is implicitly extended.
	(*ctzsidi2_<s>ext_falsedep): New define_insn to model a DImode
	extended ctz:SI that has preceding xor to break false dependency.

gcc/testsuite/ChangeLog
	PR target/106231
	* gcc.target/i386/pr106231-1.c: New test case.
	* gcc.target/i386/pr106231-2.c: New test case.
2022-07-18 07:44:38 +01:00
2022-06-02 00:16:32 +00:00
2022-07-05 00:16:36 +00:00
2022-07-13 00:16:33 +00:00
2022-06-03 00:16:40 +00:00
2022-07-09 00:16:54 +00:00
2022-06-28 00:16:58 +00:00
2022-06-04 00:16:27 +00:00
2022-07-16 00:16:30 +00:00
2022-05-21 00:16:32 +00:00
2022-06-26 00:16:33 +00:00
2022-06-30 00:16:46 +00:00
2022-07-13 00:16:33 +00:00
2022-07-15 00:16:22 +00:00
2022-06-03 00:16:40 +00:00
2022-07-05 00:16:36 +00:00
2022-07-07 00:16:46 +00:00
2022-07-16 00:16:30 +00:00
2022-07-15 00:16:22 +00:00
2022-05-21 00:16:32 +00:00
2022-05-28 09:38:29 -06:00
2022-07-16 00:16:30 +00:00
2022-06-28 09:41:07 -03: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.
S
Description
Yggdrasil port of the GNU Compiler Collection
Readme 978 MiB
Languages
C++ 33%
C 27.4%
Ada 13%
Go 7.1%
D 7%
Other 12.1%