diff options
author | Raphael Moreira Zinsly <rzinsly@ventanamicro.com> | 2023-05-19 20:54:34 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2023-05-19 20:54:34 -0600 |
commit | 9000da00dd70988f30d43806bae33b22ee6b9904 (patch) | |
tree | 5bb494d86dff0036db26e18dd61487bc4ba79470 /gcc/expr.cc | |
parent | 5df01f89b7f49c2750de4acf3a9b93a08210c627 (diff) | |
download | gcc-9000da00dd70988f30d43806bae33b22ee6b9904.zip gcc-9000da00dd70988f30d43806bae33b22ee6b9904.tar.gz gcc-9000da00dd70988f30d43806bae33b22ee6b9904.tar.bz2 |
RISC-V: Fix CTZ unnecessary sign extension [PR #106888]
Changes since v1:
- Remove subreg from operand 1.
-- >8 --
We were not able to match the CTZ sign extend pattern on RISC-V
because it gets optimized to zero extend and/or to ANDI patterns.
For the ANDI case, combine scrambles the RTL and generates the
extension by using subregs.
gcc/ChangeLog:
PR target/106888
* config/riscv/bitmanip.md
(<bitmanip_optab>disi2): Match with any_extend.
(<bitmanip_optab>disi2_sext): New pattern to match
with sign extend using an ANDI instruction.
gcc/testsuite/ChangeLog:
PR target/106888
* gcc.target/riscv/pr106888.c: New test.
* gcc.target/riscv/zbbw.c: Check for ANDI.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions