]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
LoongArch: Add '(clobber (mem:BLK (scratch)))' to PLV instruction templates.
authorLulu Cheng <chenglulu@loongson.cn>
Mon, 25 Apr 2022 01:18:39 +0000 (09:18 +0800)
committerLulu Cheng <chenglulu@loongson.cn>
Wed, 27 Apr 2022 11:55:10 +0000 (19:55 +0800)
gcc/ChangeLog:

* config/loongarch/loongarch.md: Add '(clobber (mem:BLK (scratch)))'
to PLV instruction templates.

gcc/config/loongarch/loongarch.md

index 6c57c8b70254633f474caa7fa0aa930c566f008b..5a7641703b54a60ee0690da171bfda981fad31d9 100644 (file)
 
 (define_insn "loongarch_ibar"
   [(unspec_volatile:SI
-      [(match_operand 0 "const_uimm15_operand")] UNSPECV_IBAR)]
+      [(match_operand 0 "const_uimm15_operand")]
+       UNSPECV_IBAR)
+   (clobber (mem:BLK (scratch)))]
   ""
   "ibar\t%0")
 
 (define_insn "loongarch_dbar"
   [(unspec_volatile:SI
-      [(match_operand 0 "const_uimm15_operand")] UNSPECV_DBAR)]
+      [(match_operand 0 "const_uimm15_operand")]
+       UNSPECV_DBAR)
+   (clobber (mem:BLK (scratch)))]
   ""
   "dbar\t%0")
 
 
 (define_insn "loongarch_syscall"
   [(unspec_volatile:SI
-      [(match_operand 0 "const_uimm15_operand")] UNSPECV_SYSCALL)]
+      [(match_operand 0 "const_uimm15_operand")]
+       UNSPECV_SYSCALL)
+   (clobber (mem:BLK (scratch)))]
   ""
   "syscall\t%0")
 
 (define_insn "loongarch_break"
   [(unspec_volatile:SI
-      [(match_operand 0 "const_uimm15_operand")] UNSPECV_BREAK)]
+      [(match_operand 0 "const_uimm15_operand")]
+       UNSPECV_BREAK)
+   (clobber (mem:BLK (scratch)))]
   ""
   "break\t%0")
 
 (define_insn "loongarch_csrrd_<d>"
   [(set (match_operand:GPR 0 "register_operand" "=r")
        (unspec_volatile:GPR [(match_operand  1 "const_uimm14_operand")]
-                             UNSPECV_CSRRD))]
+                             UNSPECV_CSRRD))
+   (clobber (mem:BLK (scratch)))]
   ""
   "csrrd\t%0,%1"
   [(set_attr "type" "load")
          (unspec_volatile:GPR
            [(match_operand:GPR 1 "register_operand" "0")
             (match_operand 2 "const_uimm14_operand")]
-            UNSPECV_CSRWR))]
+            UNSPECV_CSRWR))
+   (clobber (mem:BLK (scratch)))]
   ""
   "csrwr\t%0,%2"
   [(set_attr "type" "store")
            [(match_operand:GPR 1 "register_operand" "0")
             (match_operand:GPR 2 "register_operand" "q")
             (match_operand 3 "const_uimm14_operand")]
-            UNSPECV_CSRXCHG))]
+            UNSPECV_CSRXCHG))
+   (clobber (mem:BLK (scratch)))]
   ""
   "csrxchg\t%0,%2,%3"
   [(set_attr "type" "load")
 (define_insn "loongarch_iocsrrd_<size>"
   [(set (match_operand:QHWD 0 "register_operand" "=r")
        (unspec_volatile:QHWD [(match_operand:SI 1 "register_operand" "r")]
-                             UNSPECV_IOCSRRD))]
+                             UNSPECV_IOCSRRD))
+   (clobber (mem:BLK (scratch)))]
   ""
   "iocsrrd.<size>\t%0,%1"
   [(set_attr "type" "load")
 (define_insn "loongarch_iocsrwr_<size>"
   [(unspec_volatile:QHWD [(match_operand:QHWD 0 "register_operand" "r")
                          (match_operand:SI 1 "register_operand" "r")]
-                         UNSPECV_IOCSRWR)]
+                         UNSPECV_IOCSRWR)
+   (clobber (mem:BLK (scratch)))]
   ""
   "iocsrwr.<size>\t%0,%1"
   [(set_attr "type" "load")
   [(unspec_volatile:X [(match_operand 0 "const_uimm5_operand")
                       (match_operand:X 1 "register_operand" "r")
                       (match_operand 2 "const_imm12_operand")]
-                      UNSPECV_CACOP)]
+                      UNSPECV_CACOP)
+   (clobber (mem:BLK (scratch)))]
   ""
   "cacop\t%0,%1,%2"
   [(set_attr "type" "load")
   [(unspec_volatile:X [(match_operand:X 0 "register_operand" "r")
                       (match_operand:X 1 "register_operand" "r")
                       (match_operand 2 "const_uimm5_operand")]
-                      UNSPECV_LDDIR)]
+                      UNSPECV_LDDIR)
+   (clobber (mem:BLK (scratch)))]
   ""
   "lddir\t%0,%1,%2"
   [(set_attr "type" "load")
 (define_insn "loongarch_ldpte_<d>"
   [(unspec_volatile:X [(match_operand:X 0 "register_operand" "r")
                       (match_operand 1 "const_uimm5_operand")]
-                      UNSPECV_LDPTE)]
+                      UNSPECV_LDPTE)
+   (clobber (mem:BLK (scratch)))]
   ""
   "ldpte\t%0,%1"
   [(set_attr "type" "load")