sparc.c (sparc_emit_set_symbolic_const64): If we are given conflicting registers...

* config/sparc/sparc.c (sparc_emit_set_symbolic_const64): If
we are given conflicting registers, switch to the other one we
had allocated for us.
* config/sparc/sparc.md (reload_indi, reload_outdi): Pass op[2]
as TImode so we know when the "other" register is available.

From-SVN: r49412
This commit is contained in:
DJ Delorie 2002-02-01 16:54:39 -05:00 committed by DJ Delorie
parent 1c24f830c5
commit 3968de80f8
3 changed files with 37 additions and 15 deletions

View File

@ -1,3 +1,11 @@
2002-02-01 DJ Delorie <dj@redhat.com>
* config/sparc/sparc.c (sparc_emit_set_symbolic_const64): If
we are given conflicting registers, switch to the other one we
had allocated for us.
* config/sparc/sparc.md (reload_indi, reload_outdi): Pass op[2]
as TImode so we know when the "other" register is available.
2002-02-01 David O'Brien <obrien@FreeBSD.org> 2002-02-01 David O'Brien <obrien@FreeBSD.org>
* config/sparc/sol2-sld-64.h: Include sparc/biarch64.h rather than * config/sparc/sol2-sld-64.h: Include sparc/biarch64.h rather than

View File

@ -1366,6 +1366,14 @@ sparc_emit_set_symbolic_const64 (op0, op1, temp1)
rtx op1; rtx op1;
rtx temp1; rtx temp1;
{ {
rtx ti_temp1 = 0;
if (temp1 && GET_MODE (temp1) == TImode)
{
ti_temp1 = temp1;
temp1 = gen_rtx_REG (DImode, REGNO (temp1));
}
switch (sparc_cmodel) switch (sparc_cmodel)
{ {
case CM_MEDLOW: case CM_MEDLOW:
@ -1419,12 +1427,16 @@ sparc_emit_set_symbolic_const64 (op0, op1, temp1)
sllx %temp3, 32, %temp5 sllx %temp3, 32, %temp5
or %temp4, %temp5, %reg */ or %temp4, %temp5, %reg */
/* Getting this right wrt. reloading is really tricky. /* It is possible that one of the registers we got for operands[2]
We _MUST_ have a separate temporary at this point, might coincide with that of operands[0] (which is why we made
if we don't barf immediately instead of generating it TImode). Pick the other one to use as our scratch. */
incorrect code. */
if (rtx_equal_p (temp1, op0)) if (rtx_equal_p (temp1, op0))
abort (); {
if (ti_temp1)
temp1 = gen_rtx_REG (DImode, REGNO (temp1) + 1);
else
abort();
}
emit_insn (gen_sethh (op0, op1)); emit_insn (gen_sethh (op0, op1));
emit_insn (gen_setlm (temp1, op1)); emit_insn (gen_setlm (temp1, op1));
@ -1462,12 +1474,16 @@ sparc_emit_set_symbolic_const64 (op0, op1, temp1)
} }
else else
{ {
/* Getting this right wrt. reloading is really tricky. /* It is possible that one of the registers we got for operands[2]
We _MUST_ have a separate temporary at this point, might coincide with that of operands[0] (which is why we made
so we barf immediately instead of generating it TImode). Pick the other one to use as our scratch. */
incorrect code. */ if (rtx_equal_p (temp1, op0))
if (temp1 == op0) {
abort (); if (ti_temp1)
temp1 = gen_rtx_REG (DImode, REGNO (temp1) + 1);
else
abort();
}
emit_insn (gen_embmedany_textuhi (op0, op1)); emit_insn (gen_embmedany_textuhi (op0, op1));
emit_insn (gen_embmedany_texthi (temp1, op1)); emit_insn (gen_embmedany_texthi (temp1, op1));

View File

@ -2734,8 +2734,7 @@
&& ! flag_pic" && ! flag_pic"
" "
{ {
sparc_emit_set_symbolic_const64 (operands[0], operands[1], sparc_emit_set_symbolic_const64 (operands[0], operands[1], operands[2]);
gen_rtx_REG (DImode, REGNO (operands[2])));
DONE; DONE;
}") }")
@ -2748,8 +2747,7 @@
&& ! flag_pic" && ! flag_pic"
" "
{ {
sparc_emit_set_symbolic_const64 (operands[0], operands[1], sparc_emit_set_symbolic_const64 (operands[0], operands[1], operands[2]);
gen_rtx_REG (DImode, REGNO (operands[2])));
DONE; DONE;
}") }")