]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
[riscv] Fix sync builtins unspec->unspecv
authorNathan Sidwell <nathan@acm.org>
Thu, 28 May 2026 12:35:17 +0000 (08:35 -0400)
committerNathan Sidwell <nathan@acm.org>
Fri, 29 May 2026 12:54:24 +0000 (08:54 -0400)
gcc/
* config/riscv/sync.md: Move & rename atomic unspec enums to unspecv
enum. Use renamed UNSPECV_$NAME enums.
* config/riscv/sync-rvwmo.md: Use renamed UNSPECV_$NAME enums.
* config/riscv/sync-ztso.md: Use renamed UNSPECV_$NAME enums.

gcc/config/riscv/sync-rvwmo.md
gcc/config/riscv/sync-ztso.md
gcc/config/riscv/sync.md

index be2a7303854993e523ceca2b9dff40e5b721c3c0..3d40938883767baa5969faffcc7ecf9c1fec6713 100644 (file)
@@ -51,7 +51,7 @@
        (unspec_volatile:ANYI
            [(match_operand:ANYI 1 "memory_operand" "A")
             (match_operand:SI 2 "const_int_operand")]  ;; model
-        UNSPEC_ATOMIC_LOAD))]
+        UNSPECV_ATOMIC_LOAD))]
   "!TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
@@ -81,7 +81,7 @@
        (unspec_volatile:ANYI
            [(match_operand:ANYI 1 "reg_or_0_operand" "rJ")
             (match_operand:SI 2 "const_int_operand")]  ;; model
-        UNSPEC_ATOMIC_STORE))]
+        UNSPECV_ATOMIC_STORE))]
   "!TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
index 4f3eddd0da0dd198aad6caa9869433af5f82150c..9bdd9e291d92bc25b205b3f1f138737c8c763d56 100644 (file)
@@ -45,7 +45,7 @@
        (unspec_volatile:ANYI
            [(match_operand:ANYI 1 "memory_operand" "A")
             (match_operand:SI 2 "const_int_operand")]  ;; model
-        UNSPEC_ATOMIC_LOAD))]
+        UNSPECV_ATOMIC_LOAD))]
   "TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
@@ -70,7 +70,7 @@
        (unspec_volatile:ANYI
            [(match_operand:ANYI 1 "reg_or_0_operand" "rJ")
             (match_operand:SI 2 "const_int_operand")]  ;; model
-        UNSPEC_ATOMIC_STORE))]
+        UNSPECV_ATOMIC_STORE))]
   "TARGET_ZTSO"
   {
     enum memmodel model = (enum memmodel) INTVAL (operands[2]);
index fa8a9410f72ad193bb7db3f33932dbaf3c3d59bc..a046519c8351501e7e6157a2e3c6792131baa705 100644 (file)
 ;; <http://www.gnu.org/licenses/>.
 
 (define_c_enum "unspec" [
-  UNSPEC_COMPARE_AND_SWAP
-  UNSPEC_COMPARE_AND_SWAP_SUBWORD
-  UNSPEC_SYNC_OLD_OP
-  UNSPEC_SYNC_OLD_OP_SUBWORD
-  UNSPEC_SYNC_OLD_OP_ZABHA
-  UNSPEC_SYNC_EXCHANGE
-  UNSPEC_SYNC_EXCHANGE_SUBWORD
-  UNSPEC_SYNC_EXCHANGE_ZABHA
-  UNSPEC_ATOMIC_LOAD
-  UNSPEC_ATOMIC_STORE
   UNSPEC_MEMORY_BARRIER
 ])
 
+(define_c_enum "unspecv" [
+  UNSPECV_COMPARE_AND_SWAP
+  UNSPECV_COMPARE_AND_SWAP_SUBWORD
+  UNSPECV_SYNC_OLD_OP
+  UNSPECV_SYNC_OLD_OP_SUBWORD
+  UNSPECV_SYNC_OLD_OP_ZABHA
+  UNSPECV_SYNC_EXCHANGE
+  UNSPECV_SYNC_EXCHANGE_SUBWORD
+  UNSPECV_SYNC_EXCHANGE_ZABHA
+  UNSPECV_ATOMIC_LOAD
+  UNSPECV_ATOMIC_STORE
+])
+
 ;; Memory barriers.
 
 (define_expand "mem_thread_fence"
@@ -96,7 +99,7 @@
          [(any_atomic:SHORT (match_dup 0)
                     (match_operand:SHORT 1 "reg_or_0_operand" "rJ"))
           (match_operand:SI 2 "const_int_operand")] ;; model
-        UNSPEC_SYNC_OLD_OP_ZABHA))]
+        UNSPECV_SYNC_OLD_OP_ZABHA))]
   "TARGET_ZABHA"
   "amo<insn>.<amobh>%A2\tzero,%z1,%0"
   [(set_attr "type" "atomic")
          [(any_atomic:GPR (match_dup 0)
                     (match_operand:GPR 1 "reg_or_0_operand" "rJ"))
           (match_operand:SI 2 "const_int_operand")] ;; model
-        UNSPEC_SYNC_OLD_OP))]
+        UNSPECV_SYNC_OLD_OP))]
   "TARGET_ZAAMO"
   "amo<insn>.<amo>%A2\tzero,%z1,%0"
   [(set_attr "type" "atomic")
          [(any_atomic:GPR (match_dup 0)
                     (match_operand:GPR 1 "reg_or_0_operand" "rJ"))
           (match_operand:SI 2 "const_int_operand")] ;; model
-        UNSPEC_SYNC_OLD_OP))
+        UNSPECV_SYNC_OLD_OP))
    (clobber (match_scratch:GPR 3 "=&r"))]           ;; tmp_1
   "!TARGET_ZAAMO && TARGET_ZALRSC"
   {
          [(any_atomic:GPR (match_dup 1)
                     (match_operand:GPR 2 "reg_or_0_operand" "rJ"))
           (match_operand:SI 3 "const_int_operand")] ;; model
-        UNSPEC_SYNC_OLD_OP))]
+        UNSPECV_SYNC_OLD_OP))]
   "TARGET_ZAAMO"
   "amo<insn>.<amo>%A3\t%0,%z2,%1"
   [(set_attr "type" "atomic")
          [(any_atomic:GPR (match_dup 1)
                     (match_operand:GPR 2 "arith_operand" "rI"))
           (match_operand:SI 3 "const_int_operand")] ;; model
-        UNSPEC_SYNC_OLD_OP))
+        UNSPECV_SYNC_OLD_OP))
    (clobber (match_scratch:GPR 4 "=&r"))]        ;; tmp_1
   "!TARGET_ZAAMO && TARGET_ZALRSC"
   {
          [(any_atomic:SI (match_dup 1)
                     (match_operand:SI 2 "arith_operand" "rI")) ;; value for op
           (match_operand:SI 3 "const_int_operand")]               ;; model
-        UNSPEC_SYNC_OLD_OP_SUBWORD))
+        UNSPECV_SYNC_OLD_OP_SUBWORD))
     (use (match_operand:SI 4 "arith_operand" "rI"))       ;; mask
     (use (match_operand:SI 5 "arith_operand" "rI"))       ;; not_mask
     (clobber (match_scratch:SI 6 "=&r"))                          ;; tmp_1
          [(not:SI (and:SI (match_dup 1)
                           (match_operand:SI 2 "arith_operand" "rI")))    ;; value for op
           (match_operand:SI 3 "const_int_operand")]                      ;; mask
-        UNSPEC_SYNC_OLD_OP_SUBWORD))
+        UNSPECV_SYNC_OLD_OP_SUBWORD))
     (use (match_operand:SI 4 "arith_operand" "rI"))              ;; mask
     (use (match_operand:SI 5 "arith_operand" "rI"))              ;; not_mask
     (clobber (match_scratch:SI 6 "=&r"))                                 ;; tmp_1
          [(any_atomic:SHORT (match_dup 1)
                     (match_operand:SHORT 2 "reg_or_0_operand" "rJ"))
           (match_operand:SI 3 "const_int_operand")] ;; model
-        UNSPEC_SYNC_OLD_OP_ZABHA))]
+        UNSPECV_SYNC_OLD_OP_ZABHA))]
    "TARGET_ZABHA"
    "amo<insn>.<amobh>%A3\t%0,%z2,%1"
    [(set_attr "type" "atomic")
        (unspec_volatile:GPR
          [(match_operand:GPR 1 "memory_operand" "+A")
           (match_operand:SI 3 "const_int_operand")] ;; model
-         UNSPEC_SYNC_EXCHANGE))
+         UNSPECV_SYNC_EXCHANGE))
    (set (match_dup 1)
        (match_operand:GPR 2 "reg_or_0_operand" "rJ"))]
   "TARGET_ZAAMO"
     (sign_extend:DI (unspec_volatile:SI
       [(match_operand:SI 1 "memory_operand" "+A")
        (match_operand:SI 3 "const_int_operand")] ;; model
-      UNSPEC_SYNC_EXCHANGE)))
+      UNSPECV_SYNC_EXCHANGE)))
    (set (match_dup 1)
     (match_operand:SI 2 "reg_or_0_operand" "rJ"))]
   "TARGET_64BIT && TARGET_ZAAMO"
        (unspec_volatile:GPR
          [(match_operand:GPR 1 "memory_operand" "+A")
           (match_operand:SI 3 "const_int_operand")] ;; model
-         UNSPEC_SYNC_EXCHANGE))
+         UNSPECV_SYNC_EXCHANGE))
    (set (match_dup 1)
        (match_operand:GPR 2 "reg_or_0_operand" "rJ"))
    (clobber (match_scratch:GPR 4 "=&r"))]        ;; tmp_1
        (unspec_volatile:SHORT
          [(match_operand:SHORT 1 "memory_operand" "+A")
           (match_operand:SI 3 "const_int_operand")] ;; model
-         UNSPEC_SYNC_EXCHANGE_ZABHA))
+         UNSPECV_SYNC_EXCHANGE_ZABHA))
    (set (match_dup 1)
        (match_operand:SHORT 2 "reg_or_0_operand" "rJ"))]
   "TARGET_ZABHA"
        (unspec_volatile:SI
          [(match_operand:SI 2 "arith_operand" "rI")     ;; value
           (match_operand:SI 3 "const_int_operand")]     ;; model
-      UNSPEC_SYNC_EXCHANGE_SUBWORD))
+      UNSPECV_SYNC_EXCHANGE_SUBWORD))
     (use (match_operand:SI 4 "arith_operand" "rI"))     ;; not_mask
     (clobber (match_scratch:SI 5 "=&r"))]               ;; tmp_1
   "TARGET_ZALRSC && TARGET_INLINE_SUBWORD_ATOMIC"
                              (match_operand:GPR 3 "reg_or_0_operand" "rJ") ;; desired val
                              (match_operand:SI 4 "const_int_operand")      ;; mod_s
                              (match_operand:SI 5 "const_int_operand")]     ;; mod_f
-        UNSPEC_COMPARE_AND_SWAP))]
+        UNSPECV_COMPARE_AND_SWAP))]
   "TARGET_ZACAS"
   {
     enum memmodel model_success = (enum memmodel) INTVAL (operands[4]);
                              (match_operand:GPR 3 "reg_or_0_operand" "rJ")
                              (match_operand:SI 4 "const_int_operand")  ;; mod_s
                              (match_operand:SI 5 "const_int_operand")] ;; mod_f
-        UNSPEC_COMPARE_AND_SWAP))
+        UNSPECV_COMPARE_AND_SWAP))
    (clobber (match_scratch:GPR 6 "=&r"))]
   "TARGET_ZALRSC"
   {
                                (match_operand:SHORT 3 "reg_or_0_operand" "rJ") ;; desired_val
                                (match_operand:SI 4 "const_int_operand")        ;; mod_s
                                (match_operand:SI 5 "const_int_operand")]       ;; mod_f
-        UNSPEC_COMPARE_AND_SWAP))]
+        UNSPECV_COMPARE_AND_SWAP))]
   "TARGET_ZACAS && TARGET_ZABHA"
   {
     enum memmodel model_success = (enum memmodel) INTVAL (operands[4]);
    (set (match_dup 1)
        (unspec_volatile:SI [(match_operand:SI 2 "reg_or_0_operand" "rJ")  ;; expected value
                             (match_operand:SI 3 "arith_operand" "rI")] ;; desired value
-        UNSPEC_COMPARE_AND_SWAP_SUBWORD))
+        UNSPECV_COMPARE_AND_SWAP_SUBWORD))
        (match_operand:SI 4 "const_int_operand")                ;; model
        (use (match_operand:SI 5 "arith_operand" "rI"))         ;; mask
        (use (match_operand:SI 6 "arith_operand" "rI"))         ;; not_mask