]> git.ipfire.org Git - thirdparty/gcc.git/commit
RISC-V: Fix the illegal operands for the XTheadMemidx extension.
authorJin Ma <jinma@linux.alibaba.com>
Thu, 9 Nov 2023 07:40:08 +0000 (15:40 +0800)
committerKito Cheng <kito.cheng@sifive.com>
Thu, 9 Nov 2023 07:59:39 +0000 (15:59 +0800)
commit5e9fb75840e10bff5850ee610ca94c889c9a78e5
tree37d89a5289b52e3010f4488fc8231d1b6e907b5c
parentf586515accd0bafffba88ab906c6c43534a2ad94
RISC-V: Fix the illegal operands for the XTheadMemidx extension.

The pattern "*extend<SHORT:mode><SUPERQI:mode>2_bitmanip" and
"*zero_extendhi<GPR:mode>2_bitmanip" in bitmanip.md are similar
to the pattern "*th_memidx_bb_extendqi<SUPERQI:mode>2" and
"*th_memidx_bb_zero_extendhi<GPR:mode>2" in thead.md, which will
cause the wrong instruction to be generated and report the
following error in binutils:
Assembler messages:
Error: illegal operands `lb a5,(a0),1,0'

In fact, the correct instruction is "th.lbia a5,(a0),1,0".

gcc/ChangeLog:

* config/riscv/bitmanip.md: Avoid the conflict between
zbb and xtheadmemidx in patterns.

gcc/testsuite/ChangeLog:

* gcc.target/riscv/xtheadfmemidx-uindex-zbb.c: New test.
gcc/config/riscv/bitmanip.md
gcc/testsuite/gcc.target/riscv/xtheadfmemidx-uindex-zbb.c [new file with mode: 0644]