[msp430] support volatile mems in more patterns
diff mbox

Message ID 201312132159.rBDLx6DU030428@greed.delorie.com
State New
Headers show

Commit Message

DJ Delorie Dec. 13, 2013, 9:59 p.m. UTC
I went through all the patterns in the msp430 backend and converted
all those that are volatile-safe to allow volatile MEM operands.
Committed.

	* config/msp430/msp430.md (movqi): replace general_operand with
	msp_general_operand and nonimmediate_operand with
	msp_nonimmediate_operand to allow volatile operands.
	(movhi): Likewise.
	(movpsi): Likewise.
	(addpsi3): Likewise.
	(addhi3): Likewise.
	(addhi3_cy): Likewise.
	(addchi4_cy): Likewise.
	(xor<mode>3): Likewise.
	(ome_cmpl<mode>2): Likewise.
	(extendqihi2): Likewise.
	(zero_extendqihi2): Likewise.
	(zero_extendhipsi2): Likewise.
	(truncpsihi2): Likewise.
	(srai_1): Likewise.

Comments

Mike Stump Dec. 13, 2013, 10:19 p.m. UTC | #1
On Dec 13, 2013, at 1:59 PM, DJ Delorie <dj@redhat.com> wrote:
> I went through all the patterns in the msp430 backend and converted
> all those that are volatile-safe to allow volatile MEM operands.
> Committed.
> 
> 	* config/msp430/msp430.md (movqi): replace general_operand with
> 	msp_general_operand and nonimmediate_operand with
> 	msp_nonimmediate_operand to allow volatile operands.

Oohh, Ahhh…  Nice.

Patch
diff mbox

Index: gcc/config/msp430/msp430.md
===================================================================
--- gcc/config/msp430/msp430.md	(revision 205974)
+++ gcc/config/msp430/msp430.md	(working copy)
@@ -172,8 +172,8 @@ 
 )
 
 (define_insn "movqi"
-  [(set (match_operand:QI 0 "nonimmediate_operand" "=rYs,rm")
-	(match_operand:QI 1 "general_operand" "riYs,rmi"))]
+  [(set (match_operand:QI 0 "msp_nonimmediate_operand" "=rYs,rm")
+	(match_operand:QI 1 "msp_general_operand" "riYs,rmi"))]
   ""
   "@
   MOV.B\t%1, %0
@@ -181,8 +181,8 @@ 
 )
 
 (define_insn "movhi"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rYs,rm")
-	(match_operand:HI 1 "general_operand" "riYs,rmi"))]
+  [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=rYs,rm")
+	(match_operand:HI 1 "msp_general_operand" "riYs,rmi"))]
   ""
   "@
   MOV.W\t%1, %0
@@ -211,8 +211,8 @@ 
 
 ;; Some MOVX.A cases can be done with MOVA, this is only a few of them.
 (define_insn "movpsi"
-  [(set (match_operand:PSI 0 "nonimmediate_operand" "=r,Ya,rm")
-	(match_operand:PSI 1 "general_operand" "riYa,r,rmi"))]
+  [(set (match_operand:PSI 0 "msp_nonimmediate_operand" "=r,Ya,rm")
+	(match_operand:PSI 1 "msp_general_operand" "riYa,r,rmi"))]
   ""
   "@
   MOV%A0\t%1, %0
@@ -237,9 +237,9 @@ 
 ;; Math
 
 (define_insn "addpsi3"
-  [(set (match_operand:PSI           0 "nonimmediate_operand" "=r,rm")
-	(plus:PSI (match_operand:PSI 1 "nonimmediate_operand" "%0,0")
-		  (match_operand:PSI 2 "general_operand"      "rLs,rmi")))]
+  [(set (match_operand:PSI           0 "msp_nonimmediate_operand" "=r,rm")
+	(plus:PSI (match_operand:PSI 1 "msp_nonimmediate_operand" "%0,0")
+		  (match_operand:PSI 2 "msp_general_operand"      "rLs,rmi")))]
   ""
   "@
   ADDA\t%2, %0
@@ -247,9 +247,9 @@ 
 )
 
 (define_insn "addqi3"
-  [(set (match_operand:QI          0 "nonimmediate_operand" "=rYs,rm")
-	(plus:QI (match_operand:QI 1 "nonimmediate_operand" "%0,0")
-		 (match_operand:QI 2 "general_operand"      "riYs,rmi")))]
+  [(set (match_operand:QI          0 "msp_nonimmediate_operand" "=rYs,rm")
+	(plus:QI (match_operand:QI 1 "msp_nonimmediate_operand" "%0,0")
+		 (match_operand:QI 2 "msp_general_operand"      "riYs,rmi")))]
   ""
   "@
    ADD.B\t%2, %0
@@ -257,9 +257,9 @@ 
 )
 
 (define_insn "addhi3"
-  [(set (match_operand:HI           0 "nonimmediate_operand" "=rYs,rm")
-	(plus:HI (match_operand:HI  1 "nonimmediate_operand" "%0,0")
-		  (match_operand:HI 2 "general_operand"      "riYs,rmi")))]
+  [(set (match_operand:HI           0 "msp_nonimmediate_operand" "=rYs,rm")
+	(plus:HI (match_operand:HI  1 "msp_nonimmediate_operand" "%0,0")
+		  (match_operand:HI 2 "msp_general_operand"      "riYs,rmi")))]
   ""
   "@
    ADD.W\t%2, %0
@@ -316,9 +316,9 @@ 
 ; that are not single_set() very well.
 
 (define_insn "addhi3_cy"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
-	(plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
-		 (match_operand:HI 2 "general_operand" "r,rm")))
+  [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=r,rm")
+	(plus:HI (match_operand:HI 1 "msp_nonimmediate_operand" "%0,0")
+		 (match_operand:HI 2 "msp_general_operand" "r,rm")))
    (set (reg:BI CARRY)
 	(truncate:BI (lshiftrt:SI (plus:SI (zero_extend:SI (match_dup 1))
 					   (zero_extend:SI (match_dup 2)))
@@ -347,9 +347,9 @@ 
 
 ; Version of addhi that adds the carry, for SImode adds.
 (define_insn "addchi4_cy"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=r,rm")
-	(plus:HI (plus:HI (match_operand:HI 1 "nonimmediate_operand" "%0,0")
-			  (match_operand:HI 2 "general_operand" "ri,rmi"))
+  [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=r,rm")
+	(plus:HI (plus:HI (match_operand:HI 1 "msp_nonimmediate_operand" "%0,0")
+			  (match_operand:HI 2 "msp_general_operand" "ri,rmi"))
 		 (zero_extend:HI (reg:BI CARRY))))
    ]
   ""
@@ -487,9 +487,9 @@ 
 )
 
 (define_insn "xor<mode>3"
-  [(set (match_operand:QHI 0 "nonimmediate_operand" "=rYs,rm")
-	(xor:QHI (match_operand:QHI 1 "nonimmediate_operand" "%0,0")
-		 (match_operand:QHI 2 "general_operand" "riYs,rmi")))]
+  [(set (match_operand:QHI 0 "msp_nonimmediate_operand" "=rYs,rm")
+	(xor:QHI (match_operand:QHI 1 "msp_nonimmediate_operand" "%0,0")
+		 (match_operand:QHI 2 "msp_general_operand" "riYs,rmi")))]
   ""
   "@
    XOR%x0%B0\t%2, %0
@@ -498,8 +498,8 @@ 
 
 ;; Macro : XOR #~0, %0
 (define_insn "one_cmpl<mode>2"
-  [(set (match_operand:QHI 0 "nonimmediate_operand" "=rYs,m")
-	(not:QHI (match_operand:QHI 1 "nonimmediate_operand" "0,0")))]
+  [(set (match_operand:QHI 0 "msp_nonimmediate_operand" "=rYs,m")
+	(not:QHI (match_operand:QHI 1 "msp_nonimmediate_operand" "0,0")))]
   ""
   "@
    INV%x0%B0\t%0
@@ -507,8 +507,8 @@ 
 )
 
 (define_insn "extendqihi2"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rYs,m")
-	(sign_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,0")))]
+  [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=rYs,m")
+	(sign_extend:HI (match_operand:QI 1 "msp_nonimmediate_operand" "0,0")))]
   ""
   "@
    SXT%X0\t%0
@@ -516,8 +516,8 @@ 
 )
 
 (define_insn "zero_extendqihi2"
-  [(set (match_operand:HI 0 "nonimmediate_operand" "=rYs,m")
-	(zero_extend:HI (match_operand:QI 1 "nonimmediate_operand" "0,0")))]
+  [(set (match_operand:HI 0 "msp_nonimmediate_operand" "=rYs,m")
+	(zero_extend:HI (match_operand:QI 1 "msp_nonimmediate_operand" "0,0")))]
   ""
   "@
    AND\t#0xff, %0
@@ -536,14 +536,14 @@ 
 )
    
 (define_insn "zero_extendhipsi2"
-  [(set (match_operand:PSI 0 "nonimmediate_operand" "=r,m")
-	(zero_extend:PSI (match_operand:HI 1 "nonimmediate_operand" "rm,r")))]
+  [(set (match_operand:PSI 0 "msp_nonimmediate_operand" "=r,m")
+	(zero_extend:PSI (match_operand:HI 1 "msp_nonimmediate_operand" "rm,r")))]
   ""
   "MOVX\t%1, %0"
 )
 
 (define_insn "truncpsihi2"
-  [(set (match_operand:HI               0 "nonimmediate_operand" "=rm")
+  [(set (match_operand:HI               0 "msp_nonimmediate_operand" "=rm")
 	(truncate:HI (match_operand:PSI 1 "register_operand"      "r")))]
   ""
   "MOVX\t%1, %0"
@@ -769,8 +769,8 @@ 
 )
 
 (define_insn "srai_1"
-  [(set (match_operand:HI              0 "nonimmediate_operand" "=rm")
-	(ashiftrt:HI (match_operand:HI 1 "general_operand"      "0")
+  [(set (match_operand:HI              0 "msp_nonimmediate_operand" "=rm")
+	(ashiftrt:HI (match_operand:HI 1 "msp_general_operand"      "0")
 		     (const_int 1)))]
   ""
   "RRA.W\t%0"