aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorDavid S. Miller <davem@redhat.com>2002-04-02 22:31:45 -0800
committerDavid S. Miller <davem@gcc.gnu.org>2002-04-02 22:31:45 -0800
commit0acf409fdc1266c03caf70c778e8a79ce2f59261 (patch)
treecf6c6c93667ba926e8a1992e32c838432372c9e3 /gcc
parent856544448eef7428a40531f04d5c15207db36274 (diff)
downloadgcc-0acf409fdc1266c03caf70c778e8a79ce2f59261.zip
gcc-0acf409fdc1266c03caf70c778e8a79ce2f59261.tar.gz
gcc-0acf409fdc1266c03caf70c778e8a79ce2f59261.tar.bz2
sparc.md (ldd peephole2s): Fix final arg to mems_ok_for_ldd_peep when the order of the loads being...
2002-04-02 David S. Miller <davem@redhat.com> * config/sparc/sparc.md (ldd peephole2s): Fix final arg to mems_ok_for_ldd_peep when the order of the loads being examined is reversed. * config/sparc/sparc.c (mems_ok_for_ldd_peep): Expand upon existing comment to increase comprehension of this situation. From-SVN: r51796
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/sparc/sparc.c14
-rw-r--r--gcc/config/sparc/sparc.md4
3 files changed, 24 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f24e240..d452251 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2002-04-02 David S. Miller <davem@redhat.com>
+
+ * config/sparc/sparc.md (ldd peephole2s): Fix final arg to
+ mems_ok_for_ldd_peep when the order of the loads being examined
+ is reversed.
+ * config/sparc/sparc.c (mems_ok_for_ldd_peep): Expand upon
+ existing comment to increase comprehension of this situation.
+
2002-04-02 Zack Weinberg <zack@codesourcery.com>
* config/sh/sh.md: Don't use union real_extract.
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 4071f5a..7df4df6 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -5798,6 +5798,20 @@ registers_ok_for_ldd_peep (reg1, reg2)
ld [%o0 + 4], %o1
to
ldd [%o0], %o0
+ nor:
+ ld [%g3 + 4], %g3
+ ld [%g3], %g2
+ to
+ ldd [%g3], %g2
+
+ But, note that the transformation from:
+ ld [%g2 + 4], %g3
+ ld [%g2], %g2
+ to
+ ldd [%g2], %g2
+ is perfectly fine. Thus, the peephole2 patterns always pass us
+ the destination register of the first load, never the second one.
+
For stores we don't have a similar problem, so dependent_reg_rtx is
NULL_RTX. */
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 2426db5..d783fea 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -9062,7 +9062,7 @@
(set (match_operand:SI 2 "register_operand" "")
(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[2])"
+ && mems_ok_for_ldd_peep (operands[3], operands[1], operands[0])"
[(set (match_dup 2)
(match_dup 3))]
"operands[3] = change_address (operands[3], DImode, NULL);
@@ -9087,7 +9087,7 @@
(set (match_operand:SF 2 "register_operand" "")
(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[2])"
+ && mems_ok_for_ldd_peep (operands[3], operands[1], operands[0])"
[(set (match_dup 2)
(match_dup 3))]
"operands[3] = change_address (operands[3], DFmode, NULL);