summaryrefslogtreecommitdiff
path: root/gcc/config/sparc/sparc.md
diff options
context:
space:
mode:
authorebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-14 10:13:12 +0000
committerebotcazou <ebotcazou@138bc75d-0d04-0410-961f-82ee72b054a4>2013-10-14 10:13:12 +0000
commit6618159665d165e4e9035700a9abd3b8ccbfa24c (patch)
treee80ba9a544aabc55280794421e06a31c62a46ffc /gcc/config/sparc/sparc.md
parent5c28cb53f9a5dd1172ba75799595210cb49f67b5 (diff)
downloadgcc-6618159665d165e4e9035700a9abd3b8ccbfa24c.tar.gz
PR bootstrap/58509
* config/sparc/sparc-protos.h (widen_mem_for_ldd_peep): Declare. (registers_ok_for_ldd_peep): Move around. * config/sparc/sparc.c (widen_mem_for_ldd_peep): New. * config/sparc/sparc.md (widening peepholes): Use it. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@203518 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/sparc/sparc.md')
-rw-r--r--gcc/config/sparc/sparc.md87
1 files changed, 48 insertions, 39 deletions
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 174a6b1ea5f..be7bbe977a2 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -6971,9 +6971,10 @@
(const_int 0))]
"TARGET_V9
&& mems_ok_for_ldd_peep (operands[0], operands[1], NULL_RTX)"
- [(set (match_dup 0)
- (const_int 0))]
- "operands[0] = widen_memory_access (operands[0], DImode, 0);")
+ [(set (match_dup 0) (const_int 0))]
+{
+ operands[0] = widen_mem_for_ldd_peep (operands[0], operands[1], DImode);
+})
(define_peephole2
[(set (match_operand:SI 0 "memory_operand" "")
@@ -6982,9 +6983,10 @@
(const_int 0))]
"TARGET_V9
&& mems_ok_for_ldd_peep (operands[1], operands[0], NULL_RTX)"
- [(set (match_dup 1)
- (const_int 0))]
- "operands[1] = widen_memory_access (operands[1], DImode, 0);")
+ [(set (match_dup 1) (const_int 0))]
+{
+ operands[1] = widen_mem_for_ldd_peep (operands[1], operands[0], DImode);
+})
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
@@ -6993,10 +6995,11 @@
(match_operand:SI 3 "memory_operand" ""))]
"registers_ok_for_ldd_peep (operands[0], operands[2])
&& mems_ok_for_ldd_peep (operands[1], operands[3], operands[0])"
- [(set (match_dup 0)
- (match_dup 1))]
- "operands[1] = widen_memory_access (operands[1], DImode, 0);
- operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));")
+ [(set (match_dup 0) (match_dup 1))]
+{
+ operands[1] = widen_mem_for_ldd_peep (operands[1], operands[3], DImode);
+ operands[0] = gen_rtx_REG (DImode, REGNO (operands[0]));
+})
(define_peephole2
[(set (match_operand:SI 0 "memory_operand" "")
@@ -7005,10 +7008,11 @@
(match_operand:SI 3 "register_operand" ""))]
"registers_ok_for_ldd_peep (operands[1], operands[3])
&& mems_ok_for_ldd_peep (operands[0], operands[2], NULL_RTX)"
- [(set (match_dup 0)
- (match_dup 1))]
- "operands[0] = widen_memory_access (operands[0], DImode, 0);
- operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));")
+ [(set (match_dup 0) (match_dup 1))]
+{
+ operands[0] = widen_mem_for_ldd_peep (operands[0], operands[2], DImode);
+ operands[1] = gen_rtx_REG (DImode, REGNO (operands[1]));
+})
(define_peephole2
[(set (match_operand:SF 0 "register_operand" "")
@@ -7017,10 +7021,11 @@
(match_operand:SF 3 "memory_operand" ""))]
"registers_ok_for_ldd_peep (operands[0], operands[2])
&& mems_ok_for_ldd_peep (operands[1], operands[3], operands[0])"
- [(set (match_dup 0)
- (match_dup 1))]
- "operands[1] = widen_memory_access (operands[1], DFmode, 0);
- operands[0] = gen_rtx_REG (DFmode, REGNO (operands[0]));")
+ [(set (match_dup 0) (match_dup 1))]
+{
+ operands[1] = widen_mem_for_ldd_peep (operands[1], operands[3], DFmode);
+ operands[0] = gen_rtx_REG (DFmode, REGNO (operands[0]));
+})
(define_peephole2
[(set (match_operand:SF 0 "memory_operand" "")
@@ -7029,10 +7034,11 @@
(match_operand:SF 3 "register_operand" ""))]
"registers_ok_for_ldd_peep (operands[1], operands[3])
&& mems_ok_for_ldd_peep (operands[0], operands[2], NULL_RTX)"
- [(set (match_dup 0)
- (match_dup 1))]
- "operands[0] = widen_memory_access (operands[0], DFmode, 0);
- operands[1] = gen_rtx_REG (DFmode, REGNO (operands[1]));")
+ [(set (match_dup 0) (match_dup 1))]
+{
+ operands[0] = widen_mem_for_ldd_peep (operands[0], operands[2], DFmode);
+ operands[1] = gen_rtx_REG (DFmode, REGNO (operands[1]));
+})
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
@@ -7041,10 +7047,11 @@
(match_operand:SI 3 "memory_operand" ""))]
"registers_ok_for_ldd_peep (operands[2], operands[0])
&& mems_ok_for_ldd_peep (operands[3], operands[1], operands[0])"
- [(set (match_dup 2)
- (match_dup 3))]
- "operands[3] = widen_memory_access (operands[3], DImode, 0);
- operands[2] = gen_rtx_REG (DImode, REGNO (operands[2]));")
+ [(set (match_dup 2) (match_dup 3))]
+{
+ operands[3] = widen_mem_for_ldd_peep (operands[3], operands[1], DImode);
+ operands[2] = gen_rtx_REG (DImode, REGNO (operands[2]));
+})
(define_peephole2
[(set (match_operand:SI 0 "memory_operand" "")
@@ -7053,11 +7060,11 @@
(match_operand:SI 3 "register_operand" ""))]
"registers_ok_for_ldd_peep (operands[3], operands[1])
&& mems_ok_for_ldd_peep (operands[2], operands[0], NULL_RTX)"
- [(set (match_dup 2)
- (match_dup 3))]
- "operands[2] = widen_memory_access (operands[2], DImode, 0);
- operands[3] = gen_rtx_REG (DImode, REGNO (operands[3]));
- ")
+ [(set (match_dup 2) (match_dup 3))]
+{
+ operands[2] = widen_mem_for_ldd_peep (operands[2], operands[0], DImode);
+ operands[3] = gen_rtx_REG (DImode, REGNO (operands[3]));
+})
(define_peephole2
[(set (match_operand:SF 0 "register_operand" "")
@@ -7066,10 +7073,11 @@
(match_operand:SF 3 "memory_operand" ""))]
"registers_ok_for_ldd_peep (operands[2], operands[0])
&& mems_ok_for_ldd_peep (operands[3], operands[1], operands[0])"
- [(set (match_dup 2)
- (match_dup 3))]
- "operands[3] = widen_memory_access (operands[3], DFmode, 0);
- operands[2] = gen_rtx_REG (DFmode, REGNO (operands[2]));")
+ [(set (match_dup 2) (match_dup 3))]
+{
+ operands[3] = widen_mem_for_ldd_peep (operands[3], operands[1], DFmode);
+ operands[2] = gen_rtx_REG (DFmode, REGNO (operands[2]));
+})
(define_peephole2
[(set (match_operand:SF 0 "memory_operand" "")
@@ -7078,10 +7086,11 @@
(match_operand:SF 3 "register_operand" ""))]
"registers_ok_for_ldd_peep (operands[3], operands[1])
&& mems_ok_for_ldd_peep (operands[2], operands[0], NULL_RTX)"
- [(set (match_dup 2)
- (match_dup 3))]
- "operands[2] = widen_memory_access (operands[2], DFmode, 0);
- operands[3] = gen_rtx_REG (DFmode, REGNO (operands[3]));")
+ [(set (match_dup 2) (match_dup 3))]
+{
+ operands[2] = widen_mem_for_ldd_peep (operands[2], operands[0], DFmode);
+ operands[3] = gen_rtx_REG (DFmode, REGNO (operands[3]));
+})
;; Optimize the case of following a reg-reg move with a test
;; of reg just moved. Don't allow floating point regs for operand 0 or 1.