aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Sinan <sinan.lin@linux.alibaba.com>2023-02-28 13:00:36 +0800
committerKito Cheng <kito.cheng@sifive.com>2023-03-05 16:59:16 +0800
commit9debb240a4b1a711c0648fd9e4385dbde5ad45fd (patch)
tree414af6f3f45df664df8806f4a0e95939de43cfc2
parent2858bf16d33673044f49b106c8eb71dd423c5967 (diff)
downloadgcc-9debb240a4b1a711c0648fd9e4385dbde5ad45fd.zip
gcc-9debb240a4b1a711c0648fd9e4385dbde5ad45fd.tar.gz
gcc-9debb240a4b1a711c0648fd9e4385dbde5ad45fd.tar.bz2
RISC-V: Fix wrong partial subreg check for bsetidisi
The partial subreg check should be for subreg operand(operand 1) instead of the immediate operand(operand 2). This change also fix pr68648.c in zbs. gcc/ChangeLog: * config/riscv/bitmanip.md: Fix wrong index in the check. Reviewed-by: <philipp.tomsich@vrull.eu>
-rw-r--r--gcc/config/riscv/bitmanip.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/config/riscv/bitmanip.md b/gcc/config/riscv/bitmanip.md
index 14d18ed..58a86bd 100644
--- a/gcc/config/riscv/bitmanip.md
+++ b/gcc/config/riscv/bitmanip.md
@@ -442,7 +442,7 @@
(ior:DI (sign_extend:DI (match_operand:SI 1 "register_operand" "r"))
(match_operand 2 "single_bit_mask_operand" "i")))]
"TARGET_ZBS && TARGET_64BIT
- && !partial_subreg_p (operands[2])"
+ && !partial_subreg_p (operands[1])"
"bseti\t%0,%1,%S2"
[(set_attr "type" "bitmanip")])