From: Kito Cheng Date: Mon, 20 Feb 2023 13:47:01 +0000 (+0800) Subject: RISC-V: prefetch.* only take base register with zero-offset for the address X-Git-Tag: basepoints/gcc-14~1065 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b943d5771e1cdaba3004c4ca692ffa9e1a094f8d;p=thirdparty%2Fgcc.git RISC-V: prefetch.* only take base register with zero-offset for the address Catched by running gcc.c-torture/execute/builtin-prefetch-2.c with -march=rv64gc_zicbop. gcc/ChangeLog: * config/riscv/riscv.md (prefetch): Use r instead of p for the address operand. (riscv_prefetchi_): Ditto. --- diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 487059ebe973..a5507fadc2d9 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -3066,7 +3066,7 @@ ) (define_insn "prefetch" - [(prefetch (match_operand 0 "address_operand" "p") + [(prefetch (match_operand 0 "address_operand" "r") (match_operand 1 "imm5_operand" "i") (match_operand 2 "const_int_operand" "n"))] "TARGET_ZICBOP" @@ -3080,7 +3080,7 @@ }) (define_insn "riscv_prefetchi_" - [(unspec_volatile:X [(match_operand:X 0 "address_operand" "p") + [(unspec_volatile:X [(match_operand:X 0 "address_operand" "r") (match_operand:X 1 "imm5_operand" "i")] UNSPECV_PREI)] "TARGET_ZICBOP"