diff options
author | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2022-05-11 12:12:57 +0200 |
---|---|---|
committer | Philipp Tomsich <philipp.tomsich@vrull.eu> | 2022-06-14 13:37:51 +0200 |
commit | 0247ad3e0f4a574273b42344fbaa9346599948f9 (patch) | |
tree | bb8248fe9dfa6c982c32b9a1f321f42157cf63a1 /libgo | |
parent | 4bf0dcb0492c40be7e0603b13a8b5949609388dd (diff) | |
download | gcc-0247ad3e0f4a574273b42344fbaa9346599948f9.zip gcc-0247ad3e0f4a574273b42344fbaa9346599948f9.tar.gz gcc-0247ad3e0f4a574273b42344fbaa9346599948f9.tar.bz2 |
RISC-V: Split slli+sh[123]add.uw opportunities to avoid zext.w
When encountering a prescaled (biased) value as a candidate for
sh[123]add.uw, the combine pass will present this as shifted by the
aggregate amount (prescale + shift-amount) with an appropriately
adjusted mask constant that has fewer than 32 bits set.
E.g., here's the failing expression seen in combine for a prescale of
1 and a shift of 2 (note how 0x3fffffff8 >> 3 is 0x7fffffff).
Trying 7, 8 -> 10:
7: r78:SI=r81:DI#0<<0x1
REG_DEAD r81:DI
8: r79:DI=zero_extend(r78:SI)
REG_DEAD r78:SI
10: r80:DI=r79:DI<<0x2+r82:DI
REG_DEAD r79:DI
REG_DEAD r82:DI
Failed to match this instruction:
(set (reg:DI 80 [ cD.1491 ])
(plus:DI (and:DI (ashift:DI (reg:DI 81)
(const_int 3 [0x3]))
(const_int 17179869176 [0x3fffffff8]))
(reg:DI 82)))
To address this, we introduce a splitter handling these cases.
Signed-off-by: Philipp Tomsich <philipp.tomsich@vrull.eu>
Co-developed-by: Manolis Tsamis <manolis.tsamis@vrull.eu>
gcc/ChangeLog:
* config/riscv/bitmanip.md: Add split to handle opportunities
for slli + sh[123]add.uw
gcc/testsuite/ChangeLog:
* gcc.target/riscv/zba-shadd.c: New test.
Diffstat (limited to 'libgo')
0 files changed, 0 insertions, 0 deletions