From 3b76513aee76adbfa5a19dd2d7a27fdae1e02940 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 28 Jun 1993 18:16:02 +0000 Subject: [PATCH] (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 --- gcc/config/i860/i860.c | 17 +++++++++++------ gcc/config/sparc/sparc.c | 17 +++++++++++------ 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/gcc/config/i860/i860.c b/gcc/config/i860/i860.c index e8f20cc1dbb..da7d0ab91e9 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 361d3323531..42c56275ed9 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 ""; } -- 2.30.2