Commit 2718204c by Michael Hayes Committed by Michael Hayes

c4x.c (c4x_legitimize_address): Don't generate a LO_SUM address for HImode or…

c4x.c (c4x_legitimize_address): Don't generate a LO_SUM address for HImode or HFmode but instead force address...

	* config/c4x/c4x.c (c4x_legitimize_address): Don't generate a
 	LO_SUM address for HImode or HFmode but instead force address into
 	a register so that it is offsettable.
	(c4x_emit_move_sequence): Handle LO_SUM immediate address.

From-SVN: r25087
parent de67f00e
Tue Feb 9 10:52:27 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (c4x_legitimize_address): Don't generate a
LO_SUM address for HImode or HFmode but instead force address into
a register so that it is offsettable.
(c4x_emit_move_sequence): Handle LO_SUM immediate address.
Tue Feb 9 10:46:42 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz> Tue Feb 9 10:46:42 1999 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for * config/c4x/c4x.c (c4x_address_cost): Return cost of 1 for
......
...@@ -1015,7 +1015,6 @@ c4x_null_epilogue_p () ...@@ -1015,7 +1015,6 @@ c4x_null_epilogue_p ()
return 0; return 0;
} }
int int
c4x_emit_move_sequence (operands, mode) c4x_emit_move_sequence (operands, mode)
rtx *operands; rtx *operands;
...@@ -1030,7 +1029,15 @@ c4x_emit_move_sequence (operands, mode) ...@@ -1030,7 +1029,15 @@ c4x_emit_move_sequence (operands, mode)
&& ! (stik_const_operand (op1, mode) && ! push_operand (op0, mode))) && ! (stik_const_operand (op1, mode) && ! push_operand (op0, mode)))
op1 = force_reg (mode, op1); op1 = force_reg (mode, op1);
if (symbolic_operand (op1, mode)) if (GET_CODE (op1) == LO_SUM
&& GET_MODE (op1) == Pmode
&& dp_reg_operand (XEXP (op1, 0), mode))
{
/* expand_increment will sometimes create a LO_SUM immediate
address. */
op1 = XEXP (op1, 1);
}
else if (symbolic_operand (op1, mode))
{ {
if (TARGET_LOAD_ADDRESS) if (TARGET_LOAD_ADDRESS)
{ {
...@@ -1426,12 +1433,23 @@ c4x_legitimize_address (orig, mode) ...@@ -1426,12 +1433,23 @@ c4x_legitimize_address (orig, mode)
{ {
if (GET_CODE (orig) == SYMBOL_REF) if (GET_CODE (orig) == SYMBOL_REF)
{ {
rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO); if (mode == HImode || mode == HFmode)
{
if (! TARGET_SMALL) /* We need to force the address into
emit_insn (gen_set_ldp (dp_reg, orig)); a register so that it is offsettable. */
rtx addr_reg = gen_reg_rtx (Pmode);
return gen_rtx_LO_SUM (Pmode, dp_reg, orig); emit_move_insn (addr_reg, orig);
return addr_reg;
}
else
{
rtx dp_reg = gen_rtx_REG (Pmode, DP_REGNO);
if (! TARGET_SMALL)
emit_insn (gen_set_ldp (dp_reg, orig));
return gen_rtx_LO_SUM (Pmode, dp_reg, orig);
}
} }
return NULL_RTX; return NULL_RTX;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment