Commit f70308d4 by Georg-Johann Lay Committed by Georg-Johann Lay

re PR target/54815 ([avr] missed optimization with operations with constant operands)

	PR target/54815
	* config/avr/avr.md (*add<mode>3, add<mode>3, addpsi3): Make
	constraint alternative "r,0,r" slighly more expensive.
	(sub<mode>3,
	(andqi3, andhi3, andpsi3, andsi3): Ditto.
	(iorqi3, iorhi3, iorpsi3, iorsi3): Ditto.
	(xorhi3, xorpsi3, xorsi3): Ditto.

From-SVN: r192198
parent b122a75f
2012-10-08 Georg-Johann Lay <avr@gjlay.de>
PR target/54815
* config/avr/avr.md (*add<mode>3, add<mode>3, addpsi3): Make
constraint alternative "r,0,r" slighly more expensive.
(sub<mode>3,
(andqi3, andhi3, andpsi3, andsi3): Ditto.
(iorqi3, iorhi3, iorpsi3, iorsi3): Ditto.
(xorhi3, xorpsi3, xorsi3): Ditto.
2012-10-08 Oleg Endo <olegendo@gcc.gnu.org> 2012-10-08 Oleg Endo <olegendo@gcc.gnu.org>
PR target/54760 PR target/54760
......
...@@ -1177,7 +1177,7 @@ ...@@ -1177,7 +1177,7 @@
;; "*addhq3" "*adduhq3" ;; "*addhq3" "*adduhq3"
;; "*addha3" "*adduha3" ;; "*addha3" "*adduha3"
(define_insn "*add<mode>3" (define_insn "*add<mode>3"
[(set (match_operand:ALL2 0 "register_operand" "=?r,d,!w ,d") [(set (match_operand:ALL2 0 "register_operand" "=??r,d,!w ,d")
(plus:ALL2 (match_operand:ALL2 1 "register_operand" "%0,0,0 ,0") (plus:ALL2 (match_operand:ALL2 1 "register_operand" "%0,0,0 ,0")
(match_operand:ALL2 2 "nonmemory_or_const_operand" "r,s,IJ YIJ,n Ynn")))] (match_operand:ALL2 2 "nonmemory_or_const_operand" "r,s,IJ YIJ,n Ynn")))]
"" ""
...@@ -1244,7 +1244,7 @@ ...@@ -1244,7 +1244,7 @@
;; "addsq3" "addusq3" ;; "addsq3" "addusq3"
;; "addsa3" "addusa3" ;; "addsa3" "addusa3"
(define_insn "add<mode>3" (define_insn "add<mode>3"
[(set (match_operand:ALL4 0 "register_operand" "=r,d ,r") [(set (match_operand:ALL4 0 "register_operand" "=??r,d ,r")
(plus:ALL4 (match_operand:ALL4 1 "register_operand" "%0,0 ,0") (plus:ALL4 (match_operand:ALL4 1 "register_operand" "%0,0 ,0")
(match_operand:ALL4 2 "nonmemory_operand" "r,i ,n Ynn"))) (match_operand:ALL4 2 "nonmemory_operand" "r,i ,n Ynn")))
(clobber (match_scratch:QI 3 "=X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X ,&d"))]
...@@ -1302,7 +1302,7 @@ ...@@ -1302,7 +1302,7 @@
(set_attr "cc" "set_n")]) (set_attr "cc" "set_n")])
(define_insn "addpsi3" (define_insn "addpsi3"
[(set (match_operand:PSI 0 "register_operand" "=r,d ,d,r") [(set (match_operand:PSI 0 "register_operand" "=??r,d ,d,r")
(plus:PSI (match_operand:PSI 1 "register_operand" "%0,0 ,0,0") (plus:PSI (match_operand:PSI 1 "register_operand" "%0,0 ,0,0")
(match_operand:PSI 2 "nonmemory_operand" "r,s ,n,n"))) (match_operand:PSI 2 "nonmemory_operand" "r,s ,n,n")))
(clobber (match_scratch:QI 3 "=X,X ,X,&d"))] (clobber (match_scratch:QI 3 "=X,X ,X,&d"))]
...@@ -1356,7 +1356,7 @@ ...@@ -1356,7 +1356,7 @@
;; "subqi3" ;; "subqi3"
;; "subqq3" "subuqq3" ;; "subqq3" "subuqq3"
(define_insn "sub<mode>3" (define_insn "sub<mode>3"
[(set (match_operand:ALL1 0 "register_operand" "=r,d ,r ,r ,r ,r") [(set (match_operand:ALL1 0 "register_operand" "=??r,d ,r ,r ,r ,r")
(minus:ALL1 (match_operand:ALL1 1 "register_operand" "0,0 ,0 ,0 ,0 ,0") (minus:ALL1 (match_operand:ALL1 1 "register_operand" "0,0 ,0 ,0 ,0 ,0")
(match_operand:ALL1 2 "nonmemory_or_const_operand" "r,n Ynn,Y01,Ym1,Y02,Ym2")))] (match_operand:ALL1 2 "nonmemory_or_const_operand" "r,n Ynn,Y01,Ym1,Y02,Ym2")))]
"" ""
...@@ -1374,7 +1374,7 @@ ...@@ -1374,7 +1374,7 @@
;; "subhq3" "subuhq3" ;; "subhq3" "subuhq3"
;; "subha3" "subuha3" ;; "subha3" "subuha3"
(define_insn "sub<mode>3" (define_insn "sub<mode>3"
[(set (match_operand:ALL2 0 "register_operand" "=r,d ,*r") [(set (match_operand:ALL2 0 "register_operand" "=??r,d ,*r")
(minus:ALL2 (match_operand:ALL2 1 "register_operand" "0,0 ,0") (minus:ALL2 (match_operand:ALL2 1 "register_operand" "0,0 ,0")
(match_operand:ALL2 2 "nonmemory_or_const_operand" "r,i Ynn,Ynn"))) (match_operand:ALL2 2 "nonmemory_or_const_operand" "r,i Ynn,Ynn")))
(clobber (match_scratch:QI 3 "=X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X ,&d"))]
...@@ -1411,7 +1411,7 @@ ...@@ -1411,7 +1411,7 @@
;; "subsq3" "subusq3" ;; "subsq3" "subusq3"
;; "subsa3" "subusa3" ;; "subsa3" "subusa3"
(define_insn "sub<mode>3" (define_insn "sub<mode>3"
[(set (match_operand:ALL4 0 "register_operand" "=r,d ,r") [(set (match_operand:ALL4 0 "register_operand" "=??r,d ,r")
(minus:ALL4 (match_operand:ALL4 1 "register_operand" "0,0 ,0") (minus:ALL4 (match_operand:ALL4 1 "register_operand" "0,0 ,0")
(match_operand:ALL4 2 "nonmemory_or_const_operand" "r,n Ynn,Ynn"))) (match_operand:ALL4 2 "nonmemory_or_const_operand" "r,n Ynn,Ynn")))
(clobber (match_scratch:QI 3 "=X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X ,&d"))]
...@@ -2932,7 +2932,7 @@ ...@@ -2932,7 +2932,7 @@
; and ; and
(define_insn "andqi3" (define_insn "andqi3"
[(set (match_operand:QI 0 "register_operand" "=r,d") [(set (match_operand:QI 0 "register_operand" "=??r,d")
(and:QI (match_operand:QI 1 "register_operand" "%0,0") (and:QI (match_operand:QI 1 "register_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "r,i")))] (match_operand:QI 2 "nonmemory_operand" "r,i")))]
"" ""
...@@ -2943,7 +2943,7 @@ ...@@ -2943,7 +2943,7 @@
(set_attr "cc" "set_zn,set_zn")]) (set_attr "cc" "set_zn,set_zn")])
(define_insn "andhi3" (define_insn "andhi3"
[(set (match_operand:HI 0 "register_operand" "=r,d,d,r ,r") [(set (match_operand:HI 0 "register_operand" "=??r,d,d,r ,r")
(and:HI (match_operand:HI 1 "register_operand" "%0,0,0,0 ,0") (and:HI (match_operand:HI 1 "register_operand" "%0,0,0,0 ,0")
(match_operand:HI 2 "nonmemory_operand" "r,s,n,Ca2,n"))) (match_operand:HI 2 "nonmemory_operand" "r,s,n,Ca2,n")))
(clobber (match_scratch:QI 3 "=X,X,X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X,X,X ,&d"))]
...@@ -2961,7 +2961,7 @@ ...@@ -2961,7 +2961,7 @@
(set_attr "cc" "set_n,set_n,clobber,clobber,clobber")]) (set_attr "cc" "set_n,set_n,clobber,clobber,clobber")])
(define_insn "andpsi3" (define_insn "andpsi3"
[(set (match_operand:PSI 0 "register_operand" "=r,d,r ,r") [(set (match_operand:PSI 0 "register_operand" "=??r,d,r ,r")
(and:PSI (match_operand:PSI 1 "register_operand" "%0,0,0 ,0") (and:PSI (match_operand:PSI 1 "register_operand" "%0,0,0 ,0")
(match_operand:PSI 2 "nonmemory_operand" "r,n,Ca3,n"))) (match_operand:PSI 2 "nonmemory_operand" "r,n,Ca3,n")))
(clobber (match_scratch:QI 3 "=X,X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
...@@ -2979,7 +2979,7 @@ ...@@ -2979,7 +2979,7 @@
(set_attr "cc" "set_n,clobber,clobber,clobber")]) (set_attr "cc" "set_n,clobber,clobber,clobber")])
(define_insn "andsi3" (define_insn "andsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d,r ,r") [(set (match_operand:SI 0 "register_operand" "=??r,d,r ,r")
(and:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0") (and:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0")
(match_operand:SI 2 "nonmemory_operand" "r,n,Ca4,n"))) (match_operand:SI 2 "nonmemory_operand" "r,n,Ca4,n")))
(clobber (match_scratch:QI 3 "=X,X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
...@@ -3014,7 +3014,7 @@ ...@@ -3014,7 +3014,7 @@
;; ior ;; ior
(define_insn "iorqi3" (define_insn "iorqi3"
[(set (match_operand:QI 0 "register_operand" "=r,d") [(set (match_operand:QI 0 "register_operand" "=??r,d")
(ior:QI (match_operand:QI 1 "register_operand" "%0,0") (ior:QI (match_operand:QI 1 "register_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "r,i")))] (match_operand:QI 2 "nonmemory_operand" "r,i")))]
"" ""
...@@ -3025,7 +3025,7 @@ ...@@ -3025,7 +3025,7 @@
(set_attr "cc" "set_zn,set_zn")]) (set_attr "cc" "set_zn,set_zn")])
(define_insn "iorhi3" (define_insn "iorhi3"
[(set (match_operand:HI 0 "register_operand" "=r,d,d,r ,r") [(set (match_operand:HI 0 "register_operand" "=??r,d,d,r ,r")
(ior:HI (match_operand:HI 1 "register_operand" "%0,0,0,0 ,0") (ior:HI (match_operand:HI 1 "register_operand" "%0,0,0,0 ,0")
(match_operand:HI 2 "nonmemory_operand" "r,s,n,Co2,n"))) (match_operand:HI 2 "nonmemory_operand" "r,s,n,Co2,n")))
(clobber (match_scratch:QI 3 "=X,X,X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X,X,X ,&d"))]
...@@ -3043,7 +3043,7 @@ ...@@ -3043,7 +3043,7 @@
(set_attr "cc" "set_n,set_n,clobber,clobber,clobber")]) (set_attr "cc" "set_n,set_n,clobber,clobber,clobber")])
(define_insn "iorpsi3" (define_insn "iorpsi3"
[(set (match_operand:PSI 0 "register_operand" "=r,d,r ,r") [(set (match_operand:PSI 0 "register_operand" "=??r,d,r ,r")
(ior:PSI (match_operand:PSI 1 "register_operand" "%0,0,0 ,0") (ior:PSI (match_operand:PSI 1 "register_operand" "%0,0,0 ,0")
(match_operand:PSI 2 "nonmemory_operand" "r,n,Co3,n"))) (match_operand:PSI 2 "nonmemory_operand" "r,n,Co3,n")))
(clobber (match_scratch:QI 3 "=X,X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
...@@ -3061,7 +3061,7 @@ ...@@ -3061,7 +3061,7 @@
(set_attr "cc" "set_n,clobber,clobber,clobber")]) (set_attr "cc" "set_n,clobber,clobber,clobber")])
(define_insn "iorsi3" (define_insn "iorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,d,r ,r") [(set (match_operand:SI 0 "register_operand" "=??r,d,r ,r")
(ior:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0") (ior:SI (match_operand:SI 1 "register_operand" "%0,0,0 ,0")
(match_operand:SI 2 "nonmemory_operand" "r,n,Co4,n"))) (match_operand:SI 2 "nonmemory_operand" "r,n,Co4,n")))
(clobber (match_scratch:QI 3 "=X,X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X,X ,&d"))]
...@@ -3092,7 +3092,7 @@ ...@@ -3092,7 +3092,7 @@
(set_attr "cc" "set_zn")]) (set_attr "cc" "set_zn")])
(define_insn "xorhi3" (define_insn "xorhi3"
[(set (match_operand:HI 0 "register_operand" "=r,r ,r") [(set (match_operand:HI 0 "register_operand" "=??r,r ,r")
(xor:HI (match_operand:HI 1 "register_operand" "%0,0 ,0") (xor:HI (match_operand:HI 1 "register_operand" "%0,0 ,0")
(match_operand:HI 2 "nonmemory_operand" "r,Cx2,n"))) (match_operand:HI 2 "nonmemory_operand" "r,Cx2,n")))
(clobber (match_scratch:QI 3 "=X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X ,&d"))]
...@@ -3108,7 +3108,7 @@ ...@@ -3108,7 +3108,7 @@
(set_attr "cc" "set_n,clobber,clobber")]) (set_attr "cc" "set_n,clobber,clobber")])
(define_insn "xorpsi3" (define_insn "xorpsi3"
[(set (match_operand:PSI 0 "register_operand" "=r,r ,r") [(set (match_operand:PSI 0 "register_operand" "=??r,r ,r")
(xor:PSI (match_operand:PSI 1 "register_operand" "%0,0 ,0") (xor:PSI (match_operand:PSI 1 "register_operand" "%0,0 ,0")
(match_operand:PSI 2 "nonmemory_operand" "r,Cx3,n"))) (match_operand:PSI 2 "nonmemory_operand" "r,Cx3,n")))
(clobber (match_scratch:QI 3 "=X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X ,&d"))]
...@@ -3126,7 +3126,7 @@ ...@@ -3126,7 +3126,7 @@
(set_attr "cc" "set_n,clobber,clobber")]) (set_attr "cc" "set_n,clobber,clobber")])
(define_insn "xorsi3" (define_insn "xorsi3"
[(set (match_operand:SI 0 "register_operand" "=r,r ,r") [(set (match_operand:SI 0 "register_operand" "=??r,r ,r")
(xor:SI (match_operand:SI 1 "register_operand" "%0,0 ,0") (xor:SI (match_operand:SI 1 "register_operand" "%0,0 ,0")
(match_operand:SI 2 "nonmemory_operand" "r,Cx4,n"))) (match_operand:SI 2 "nonmemory_operand" "r,Cx4,n")))
(clobber (match_scratch:QI 3 "=X,X ,&d"))] (clobber (match_scratch:QI 3 "=X,X ,&d"))]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment