]> gcc.gnu.org Git - gcc.git/commitdiff
RISC-V: Let non-atomic targets use optimized amo loads/stores
authorPatrick O'Neill <patrick@rivosinc.com>
Mon, 30 Oct 2023 22:51:46 +0000 (15:51 -0700)
committerPatrick O'Neill <patrick@rivosinc.com>
Tue, 31 Oct 2023 17:15:33 +0000 (10:15 -0700)
Non-atomic targets are currently prevented from using the optimized fencing for
seq_cst load/seq_cst store. This patch removes that constraint.

gcc/ChangeLog:

* config/riscv/sync-rvwmo.md (atomic_load_rvwmo<mode>): Remove
TARGET_ATOMIC constraint
(atomic_store_rvwmo<mode>): Ditto.
* config/riscv/sync-ztso.md (atomic_load_ztso<mode>): Ditto.
(atomic_store_ztso<mode>): Ditto.
* config/riscv/sync.md (atomic_load<mode>): Ditto.
(atomic_store<mode>): Ditto.

Signed-off-by: Patrick O'Neill <patrick@rivosinc.com>
gcc/config/riscv/sync-rvwmo.md
gcc/config/riscv/sync-ztso.md
gcc/config/riscv/sync.md

index cb641ea9ec33e10e7a52f0c51ccd5b383fc84d5a..c35eae153342c69075c17d6ce1855ae9d9abc9cf 100644 (file)
@@ -52,7 +52,7 @@
            [(match_operand:GPR 1 "memory_operand" "A")
             (match_operand:SI 2 "const_int_operand")]  ;; model
         UNSPEC_ATOMIC_LOAD))]
-  "TARGET_ATOMIC && !TARGET_ZTSO"
+  "!TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
     model = memmodel_base (model);
@@ -78,7 +78,7 @@
            [(match_operand:GPR 1 "reg_or_0_operand" "rJ")
             (match_operand:SI 2 "const_int_operand")]  ;; model
         UNSPEC_ATOMIC_STORE))]
-  "TARGET_ATOMIC && !TARGET_ZTSO"
+  "!TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
     model = memmodel_base (model);
index 7bb15b7ab8cd2cc09ea92b47d05da9bc79d42a4d..6fdfa912a2ca8b08affae82ede37c3a68441a407 100644 (file)
@@ -46,7 +46,7 @@
            [(match_operand:GPR 1 "memory_operand" "A")
             (match_operand:SI 2 "const_int_operand")]  ;; model
         UNSPEC_ATOMIC_LOAD))]
-  "TARGET_ATOMIC && TARGET_ZTSO"
+  "TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
     model = memmodel_base (model);
@@ -66,7 +66,7 @@
            [(match_operand:GPR 1 "reg_or_0_operand" "rJ")
             (match_operand:SI 2 "const_int_operand")]  ;; model
         UNSPEC_ATOMIC_STORE))]
-  "TARGET_ATOMIC && TARGET_ZTSO"
+  "TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
     model = memmodel_base (model);
index 6ff3493b5ceda2f39fa5d8d68a258e40f5db90a5..ec9d4b4f59ef3beec1541b85cd629816cf1d2dc2 100644 (file)
@@ -60,7 +60,7 @@
   [(match_operand:GPR 0 "register_operand")
    (match_operand:GPR 1 "memory_operand")
    (match_operand:SI 2 "const_int_operand")] ;; model
-  "TARGET_ATOMIC"
+  ""
   {
     if (TARGET_ZTSO)
       emit_insn (gen_atomic_load_ztso<mode> (operands[0], operands[1],
@@ -75,7 +75,7 @@
   [(match_operand:GPR 0 "memory_operand")
    (match_operand:GPR 1 "reg_or_0_operand")
    (match_operand:SI 2 "const_int_operand")] ;; model
-  "TARGET_ATOMIC"
+  ""
   {
     if (TARGET_ZTSO)
       emit_insn (gen_atomic_store_ztso<mode> (operands[0], operands[1],
This page took 0.070088 seconds and 5 git commands to generate.