Commit 3c84bf1b by Jeff Law

pa.c (singlemove_string): Use zdepi and ldil to load constants into registers when appropriate.

	* pa.c (singlemove_string): Use zdepi and ldil to load constants
	into registers when appropriate.

From-SVN: r4799
parent 60343c3b
...@@ -890,12 +890,7 @@ read_only_operand (operand) ...@@ -890,12 +890,7 @@ read_only_operand (operand)
/* Return the best assembler insn template /* Return the best assembler insn template
for moving operands[1] into operands[0] as a fullword. for moving operands[1] into operands[0] as a fullword. */
For CONST_DOUBLE and CONST_INT we should also check for
other values we can load directly via zdepi, ldil, etc.
??? Do this for 2.5. */
char * char *
singlemove_string (operands) singlemove_string (operands)
rtx *operands; rtx *operands;
...@@ -917,16 +912,40 @@ singlemove_string (operands) ...@@ -917,16 +912,40 @@ singlemove_string (operands)
operands[1] = gen_rtx (CONST_INT, VOIDmode, i); operands[1] = gen_rtx (CONST_INT, VOIDmode, i);
if (INT_14_BITS (operands[1])) /* See if we can handle this constant in a single instruction. */
return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0"); if (cint_ok_for_move (INTVAL (operands[1])))
{
int intval = INTVAL (operands[1]);
if (intval == 0)
return "copy 0,%0";
else if (VAL_14_BITS_P (intval))
return "ldi %1,%0";
else if ((intval & 0x7ff) == 0)
return "ldil L'%1,%0";
else if (zdepi_cint_p (intval))
return "zdepi %Z1,%0";
}
else else
return "ldil L'%1,%0\n\tldo R'%1(%0),%0"; return "ldil L'%1,%0\n\tldo R'%1(%0),%0";
} }
else if (GET_CODE (operands[1]) == CONST_INT) else if (GET_CODE (operands[1]) == CONST_INT)
{ {
if (INT_14_BITS (operands[1])) /* See if we can handle this in a single instruction. */
return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0"); if (cint_ok_for_move (INTVAL (operands[1])))
{
int intval = INTVAL (operands[1]);
if (intval == 0)
return "copy 0,%0";
else if (VAL_14_BITS_P (intval))
return "ldi %1,%0";
else if ((intval & 0x7ff) == 0)
return "ldil L'%1,%0";
else if (zdepi_cint_p (intval))
return "zdepi %Z1,%0";
}
else else
return "ldil L'%1,%0\n\tldo R'%1(%0),%0"; return "ldil L'%1,%0\n\tldo R'%1(%0),%0";
} }
......
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