Patchwork [committed] Fix HImode add pattern on PA

login
register
mail settings
Submitter John David Anglin
Date Oct. 5, 2012, 9:13 p.m.
Message ID <20121005211340.GA11890@hiauly1.hia.nrc.ca>
Download mbox | patch
Permalink /patch/189600/
State New
Headers show

Comments

John David Anglin - Oct. 5, 2012, 9:13 p.m.
The attached change fixes a reload failure encountered testing another
change.  It occurred for a constant that didn't match the "J" constraint.
The change makes the HImode pattern the same as the corresponding SImode
pattern.

Tested on hppa-unknown-linux-gn, hppa2.0w-hp-hpux11.11 and
hppa64-hp-hpux11.11.  Committed to 4.6, 4.7 and trunk.

Dave

Patch

Index: config/pa/pa.md
===================================================================
--- config/pa/pa.md	(revision 191943)
+++ config/pa/pa.md	(working copy)
@@ -2881,15 +2881,17 @@ 
   [(set_attr "type" "store")
    (set_attr "length" "4")])
 
-(define_insn ""
-  [(set (match_operand:HI 0 "register_operand" "=r")
-	(plus:HI (match_operand:HI 1 "register_operand" "r")
-		 (match_operand 2 "const_int_operand" "J")))]
+(define_insn "addhi3"
+  [(set (match_operand:HI 0 "register_operand" "=r,r")
+	(plus:HI (match_operand:HI 1 "register_operand" "%r,r")
+		 (match_operand:HI 2 "arith14_operand" "r,J")))]
   ""
-  "ldo %2(%1),%0"
-  [(set_attr "type" "binary")
+  "@
+   {addl|add,l} %1,%2,%0
+   ldo %2(%1),%0"
+  [(set_attr "type" "binary,binary")
    (set_attr "pa_combine_type" "addmove")
-   (set_attr "length" "4")])
+   (set_attr "length" "4,4")])
 
 (define_expand "movqi"
   [(set (match_operand:QI 0 "general_operand" "")