]> git.ipfire.org Git - thirdparty/gcc.git/commit
[RISC-V][PR target/117690] Add missing shift in constant synthesis
authorJeff Law <jlaw@ventanamicro.com>
Thu, 21 Nov 2024 23:21:07 +0000 (16:21 -0700)
committerJeff Law <jlaw@ventanamicro.com>
Thu, 21 Nov 2024 23:21:07 +0000 (16:21 -0700)
commit9b7917b34fa54d5b4ff0094ef4d949c6ac50f02e
tree28a757ea0b8ca7eb4a392e8805ec5d6df894a4e8
parentffeee625c53d882171af436222a7b18ed9ed89e1
[RISC-V][PR target/117690] Add missing shift in constant synthesis

As hinted out in the BZ, we were missing a left shift in the constant synthesis
in the case where the upper 32 bits can be synthesized using a shNadd of the
low 32 bits.

This adjusts the synthesis to add the missing left shift and adjusts the cost
to account for the additional instruction.

Regression tested on riscv64-elf in my tester.  Waiting for the pre-commit
tester before moving forward.

PR target/117690
gcc/
* config/riscv/riscv.cc (riscv_build_integer): Add missing left
shift when using shNadd to derive upper 32 bits from lower 32 bits.

gcc/testsuite
* gcc.target/riscv/pr117690.c: New test.
* gcc.target/riscv/synthesis-13.c: Adjust expected output.
gcc/config/riscv/riscv.cc
gcc/testsuite/gcc.target/riscv/pr117690.c [new file with mode: 0644]
gcc/testsuite/gcc.target/riscv/synthesis-13.c