aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Law <law@gcc.gnu.org>1993-06-29 20:28:38 -0600
committerJeff Law <law@gcc.gnu.org>1993-06-29 20:28:38 -0600
commit3c84bf1b0f6a338cef5cf5e5e7d2c08a1bf64a3d (patch)
tree467826ea2e82bb999539db4880a3706ccfe913fa
parent60343c3baa8439c2024431c329bac6b2ab5c8190 (diff)
downloadgcc-3c84bf1b0f6a338cef5cf5e5e7d2c08a1bf64a3d.zip
gcc-3c84bf1b0f6a338cef5cf5e5e7d2c08a1bf64a3d.tar.gz
gcc-3c84bf1b0f6a338cef5cf5e5e7d2c08a1bf64a3d.tar.bz2
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
-rw-r--r--gcc/config/pa/pa.c39
1 files changed, 29 insertions, 10 deletions
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 84fab97..142e97f 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -890,12 +890,7 @@ read_only_operand (operand)
/* Return the best assembler insn template
- 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. */
-
+ for moving operands[1] into operands[0] as a fullword. */
char *
singlemove_string (operands)
rtx *operands;
@@ -917,16 +912,40 @@ singlemove_string (operands)
operands[1] = gen_rtx (CONST_INT, VOIDmode, i);
- if (INT_14_BITS (operands[1]))
- return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0");
+ /* See if we can handle this constant in a single instruction. */
+ 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
return "ldil L'%1,%0\n\tldo R'%1(%0),%0";
}
else if (GET_CODE (operands[1]) == CONST_INT)
{
- if (INT_14_BITS (operands[1]))
- return (INTVAL (operands[1]) == 0 ? "copy 0,%0" : "ldi %1,%0");
+ /* See if we can handle this in a single instruction. */
+ 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
return "ldil L'%1,%0\n\tldo R'%1(%0),%0";
}