aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Wilson <wilson@gcc.gnu.org>1994-09-29 17:31:34 -0700
committerJim Wilson <wilson@gcc.gnu.org>1994-09-29 17:31:34 -0700
commit63f7136fd89b12e2a76b546474ae5ec88fb1f62a (patch)
tree616398ace3755c646e53294910e5bf57088b00fe
parent57cb9b60874ba518f04b3e5592f3c63c03771b06 (diff)
downloadgcc-63f7136fd89b12e2a76b546474ae5ec88fb1f62a.zip
gcc-63f7136fd89b12e2a76b546474ae5ec88fb1f62a.tar.gz
gcc-63f7136fd89b12e2a76b546474ae5ec88fb1f62a.tar.bz2
(movdf+3): Handle overlapping registers in define_split.
From-SVN: r8176
-rw-r--r--gcc/config/sparc/sparc.md25
1 files changed, 21 insertions, 4 deletions
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 2b68258..8440955 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -2039,6 +2039,8 @@
[(set_attr "type" "store,load,move,store,load")
(set_attr "length" "1,1,2,3,3")])
+;; Must handle overlapping registers here, since parameters can be unaligned
+;; in registers.
;; ??? Do we need a v9 version of this?
(define_split
[(set (match_operand:DF 0 "register_operand" "")
@@ -2047,10 +2049,25 @@
[(set (match_dup 2) (match_dup 3))
(set (match_dup 4) (match_dup 5))]
"
-{ operands[2] = operand_subword (operands[0], 0, 0, DFmode);
- operands[3] = operand_subword (operands[1], 0, 0, DFmode);
- operands[4] = operand_subword (operands[0], 1, 0, DFmode);
- operands[5] = operand_subword (operands[1], 1, 0, DFmode); }")
+{
+ rtx first_set = operand_subword (operands[0], 0, 0, DFmode);
+ rtx second_use = operand_subword (operands[1], 1, 0, DFmode);
+
+ if (REGNO (first_set) == REGNO (second_use))
+ {
+ operands[2] = operand_subword (operands[0], 1, 0, DFmode);
+ operands[3] = second_use;
+ operands[4] = first_set;
+ operands[5] = operand_subword (operands[1], 0, 0, DFmode);
+ }
+ else
+ {
+ operands[2] = first_set;
+ operands[3] = operand_subword (operands[1], 0, 0, DFmode);
+ operands[4] = operand_subword (operands[0], 1, 0, DFmode);
+ operands[5] = second_use;
+ }
+}")
(define_insn ""
[(set (mem:DF (match_operand:SI 0 "symbolic_operand" "i,i"))