aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/generated/shape_i16.c
diff options
context:
space:
mode:
authorAustin Law <austinklaw@gmail.com>2025-08-17 09:03:51 -0600
committerJeff Law <jlaw@ventanamicro.com>2025-08-17 09:04:47 -0600
commit6f63044a7ae63a276a4f6d3108849e093c690bc6 (patch)
treecfea30b8fad638881bf0ed16649b01ff92f9bba0 /libgfortran/generated/shape_i16.c
parent80f6911ed340ea73f28f1aaafbc0143a3d8c21cc (diff)
downloadgcc-6f63044a7ae63a276a4f6d3108849e093c690bc6.zip
gcc-6f63044a7ae63a276a4f6d3108849e093c690bc6.tar.gz
gcc-6f63044a7ae63a276a4f6d3108849e093c690bc6.tar.bz2
[PR target/121213] Avoid unnecessary constant load in amoswap
PR 121213 shows an unnecessary "li target,0" in an atomic exchange loop on RISC-V. The source operand for an amoswap instruction should allow (const_int 0) in addition to GPRs. So the operand's predicate is changed to "reg_or_0_operand". The corresponding constraint is also changed to allow a reg or the constant 0. With the source operand no longer tied to the destination operand we do not need the earlyclobber for the destination, so the destination operand's constraint is adjusted accordingly. This patch does not address the unnecessary sign extension reported in the PR. Tested with no regressions on riscv32-elf and riscv64-elf. PR target/121213 gcc/ * config/riscv/sync.md (amo_atomic_exchange<mode>): Allow (const_int 0) as input operand. Do not tie input to output. No longer earlyclobber the output. gcc/testsuite * gcc.target/riscv/amo/pr121213.c: New test.
Diffstat (limited to 'libgfortran/generated/shape_i16.c')
0 files changed, 0 insertions, 0 deletions