aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1993-06-28 18:16:02 +0000
committerRichard Stallman <rms@gnu.org>1993-06-28 18:16:02 +0000
commit3b76513aee76adbfa5a19dd2d7a27fdae1e02940 (patch)
tree64c2327fbfd58d0a77dc7dc058fb43a05a410937
parentfd956e81b750254faf40a2ebce419a99ff823853 (diff)
downloadgcc-3b76513aee76adbfa5a19dd2d7a27fdae1e02940.zip
gcc-3b76513aee76adbfa5a19dd2d7a27fdae1e02940.tar.gz
gcc-3b76513aee76adbfa5a19dd2d7a27fdae1e02940.tar.bz2
(output_move_double): Use new local var highest_first to make sure addreg1 gets handled in the overlap case.
(output_move_double): Use new local var highest_first to make sure addreg1 gets handled in the overlap case. In 2-reg-overlap case, really use proper reg in new address. From-SVN: r4788
-rw-r--r--gcc/config/i860/i860.c17
-rw-r--r--gcc/config/sparc/sparc.c17
2 files changed, 22 insertions, 12 deletions
diff --git a/gcc/config/i860/i860.c b/gcc/config/i860/i860.c
index e8f20cc..da7d0ab 100644
--- a/gcc/config/i860/i860.c
+++ b/gcc/config/i860/i860.c
@@ -572,6 +572,7 @@ output_move_double (operands)
enum { REGOP, OFFSOP, MEMOP, PUSHOP, POPOP, CNSTOP, RNDOP } optype0, optype1;
rtx latehalf[2];
rtx addreg0 = 0, addreg1 = 0;
+ int highest_first = 0;
/* First classify both operands. */
@@ -690,18 +691,19 @@ output_move_double (operands)
xops[0] = latehalf[0];
xops[1] = op0;
output_asm_insn ("adds %1,%0,%1", xops);
- operands[1] = gen_rtx (MEM, DImode, latehalf[0]);
+ operands[1] = gen_rtx (MEM, DImode, op0);
latehalf[1] = adj_offsettable_operand (operands[1], 4);
+ addreg1 = 0;
}
/* Do the late half first. */
- output_asm_insn (singlemove_string (latehalf), latehalf);
- /* Then clobber. */
- return singlemove_string (operands);
+ highest_first = 1;
}
- /* Normal case: do the two words, low-numbered first. */
+ /* Normal case: do the two words, low-numbered first.
+ Overlap case (highest_first set): do high-numbered word first. */
- output_asm_insn (singlemove_string (operands), operands);
+ if (! highest_first)
+ output_asm_insn (singlemove_string (operands), operands);
CC_STATUS_PARTIAL_INIT;
/* Make any unoffsettable addresses point at high-numbered word. */
@@ -719,6 +721,9 @@ output_move_double (operands)
if (addreg1)
output_asm_insn ("adds -0x4,%0,%0", &addreg1);
+ if (highest_first)
+ output_asm_insn (singlemove_string (operands), operands);
+
return "";
}
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 361d332..42c5627 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -1061,6 +1061,7 @@ output_move_double (operands)
rtx latehalf[2];
rtx addreg0 = 0;
rtx addreg1 = 0;
+ int highest_first = 0;
/* First classify both operands. */
@@ -1166,18 +1167,19 @@ output_move_double (operands)
xops[0] = latehalf[0];
xops[1] = op0;
output_asm_insn ("add %1,%0,%1", xops);
- operands[1] = gen_rtx (MEM, DImode, latehalf[0]);
+ operands[1] = gen_rtx (MEM, DImode, op0);
latehalf[1] = adj_offsettable_operand (operands[1], 4);
+ addreg1 = 0;
}
/* Do the late half first. */
- output_asm_insn (singlemove_string (latehalf), latehalf);
- /* Then clobber. */
- return singlemove_string (operands);
+ highest_first = 1;
}
- /* Normal case: do the two words, low-numbered first. */
+ /* Normal case: do the two words, low-numbered first.
+ Overlap case (highest_first set): do high-numbered word first. */
- output_asm_insn (singlemove_string (operands), operands);
+ if (! highest_first)
+ output_asm_insn (singlemove_string (operands), operands);
/* Make any unoffsettable addresses point at high-numbered word. */
if (addreg0)
@@ -1194,6 +1196,9 @@ output_move_double (operands)
if (addreg1)
output_asm_insn ("add %0,-0x4,%0", &addreg1);
+ if (highest_first)
+ output_asm_insn (singlemove_string (operands), operands);
+
return "";
}