diff options
author | Andrew Pinski <quic_apinski@quicinc.com> | 2024-08-28 15:03:53 -0700 |
---|---|---|
committer | Andrew Pinski <quic_apinski@quicinc.com> | 2024-08-29 08:24:45 -0700 |
commit | 215c7e3084ea9ec75dcc803f73c94b36e2751e54 (patch) | |
tree | 988851fcedab9e44231ac03976f81d8ae55826d1 /gcc/gdbhooks.py | |
parent | cdd5dd2125ca850aa8599f76bed02509590541ef (diff) | |
download | gcc-215c7e3084ea9ec75dcc803f73c94b36e2751e54.zip gcc-215c7e3084ea9ec75dcc803f73c94b36e2751e54.tar.gz gcc-215c7e3084ea9ec75dcc803f73c94b36e2751e54.tar.bz2 |
expand: Allow widdening optab when expanding popcount==1 [PR116508]
After adding popcount{qi,hi}2 to the aarch64 backend, I noticed that
the expansion for popcount==1 was no longer trying to do the trick
of handling popcount==1 as `(arg ^ (arg - 1)) > arg - 1`. The problem
is the expansion was using OPTAB_DIRECT, when using OPTAB_WIDEN
will allow modes which are smaller than SImode (in the aarch64 case).
Note QImode's cost still needs some improvements so part of popcnt-eq-1.c
is xfailed. Though there is a check to make sure the costs are compared now.
Built and tested on aarch64-linux-gnu.
PR middle-end/116508
gcc/ChangeLog:
* internal-fn.cc (expand_POPCOUNT): Use OPTAB_WIDEN for PLUS and
XOR/AND expansion.
gcc/testsuite/ChangeLog:
* gcc.target/aarch64/popcnt-eq-1.c: New test.
Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
Diffstat (limited to 'gcc/gdbhooks.py')
0 files changed, 0 insertions, 0 deletions