aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.cc
diff options
context:
space:
mode:
authorRoger Sayle <roger@nextmovesoftware.com>2022-07-18 07:44:38 +0100
committerRoger Sayle <roger@nextmovesoftware.com>2022-07-18 07:44:38 +0100
commit2907bfc3412dd8aef6c6acc17f2152a4e0ac4979 (patch)
tree3fa532064cc1c2d1d393d0ad90905d3bd604f2fb /gcc/tree-cfg.cc
parent43c2505b31adfdef2214318484aaae987fd9e1e0 (diff)
downloadgcc-2907bfc3412dd8aef6c6acc17f2152a4e0ac4979.zip
gcc-2907bfc3412dd8aef6c6acc17f2152a4e0ac4979.tar.gz
gcc-2907bfc3412dd8aef6c6acc17f2152a4e0ac4979.tar.bz2
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.
Diffstat (limited to 'gcc/tree-cfg.cc')
0 files changed, 0 insertions, 0 deletions