Commit 0c235d7e by Torbjorn Granlund

(singlemove_string): Handle SFmode constants again. Simplify.

(zdepi_cint_p): Make some variables HOST_WIDE_INT.
(lhs_lshift_cint_operand): Likewise.
(output_and): Likewise.
(output_ior): Likewise.

From-SVN: r9222
parent 1d306530
...@@ -403,7 +403,7 @@ int ...@@ -403,7 +403,7 @@ int
zdepi_cint_p (x) zdepi_cint_p (x)
unsigned HOST_WIDE_INT x; unsigned HOST_WIDE_INT x;
{ {
unsigned lsb_mask, t; unsigned HOST_WIDE_INT lsb_mask, t;
/* This might not be obvious, but it's at least fast. /* This might not be obvious, but it's at least fast.
This function is critcal; we don't have the time loops would take. */ This function is critcal; we don't have the time loops would take. */
...@@ -471,7 +471,7 @@ lhs_lshift_cint_operand (op, mode) ...@@ -471,7 +471,7 @@ lhs_lshift_cint_operand (op, mode)
rtx op; rtx op;
enum machine_mode mode; enum machine_mode mode;
{ {
unsigned x; unsigned HOST_WIDE_INT x;
if (GET_CODE (op) != CONST_INT) if (GET_CODE (op) != CONST_INT)
return 0; return 0;
x = INTVAL (op) >> 4; x = INTVAL (op) >> 4;
...@@ -1037,63 +1037,38 @@ char * ...@@ -1037,63 +1037,38 @@ char *
singlemove_string (operands) singlemove_string (operands)
rtx *operands; rtx *operands;
{ {
HOST_WIDE_INT intval;
if (GET_CODE (operands[0]) == MEM) if (GET_CODE (operands[0]) == MEM)
return "stw %r1,%0"; return "stw %r1,%0";
else if (GET_CODE (operands[1]) == MEM) if (GET_CODE (operands[1]) == MEM)
return "ldw %1,%0"; return "ldw %1,%0";
else if (GET_CODE (operands[1]) == CONST_DOUBLE if (GET_CODE (operands[1]) == CONST_DOUBLE)
&& GET_MODE (operands[1]) == SFmode)
{ {
abort (); long i;
#if 0 REAL_VALUE_TYPE d;
/* Switched off since it is wrong, and should never really be used
anyway. If we want to switch this on again, we have to make it use
the REAL_ARITHMETIC stuff. */
int i;
union real_extract u;
union float_extract { float f; int i; } v;
bcopy (&CONST_DOUBLE_LOW (operands[1]), &u, sizeof u); if (GET_MODE (operands[1]) != SFmode)
v.f = REAL_VALUE_TRUNCATE (SFmode, u.d); abort ();
i = v.i;
operands[1] = GEN_INT (i); /* Translate the CONST_DOUBLE to a CONST_INT with the same target
bit pattern. */
REAL_VALUE_FROM_CONST_DOUBLE (d, operands[1]);
REAL_VALUE_TO_TARGET_SINGLE (d, i);
/* See if we can handle this constant in a single instruction. */ operands[1] = GEN_INT (i);
if (cint_ok_for_move (INTVAL (operands[1]))) /* Fall through to CONST_INT case. */
{
HOST_WIDE_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";
#endif
} }
if (GET_CODE (operands[1]) == CONST_INT)
else if (GET_CODE (operands[1]) == CONST_INT)
{ {
/* See if we can handle this in a single instruction. */ intval = INTVAL (operands[1]);
if (cint_ok_for_move (INTVAL (operands[1])))
{ if (VAL_14_BITS_P (intval))
int intval = INTVAL (operands[1]); return "ldi %1,%0";
else if ((intval & 0x7ff) == 0)
if (intval == 0) return "ldil L'%1,%0";
return "copy 0,%0"; else if (zdepi_cint_p (intval))
else if (VAL_14_BITS_P (intval)) return "zdepi %Z1,%0";
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";
} }
...@@ -1731,7 +1706,7 @@ output_and (operands) ...@@ -1731,7 +1706,7 @@ output_and (operands)
{ {
if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0) if (GET_CODE (operands[2]) == CONST_INT && INTVAL (operands[2]) != 0)
{ {
unsigned mask = INTVAL (operands[2]); unsigned HOST_WIDE_INT mask = INTVAL (operands[2]);
int ls0, ls1, ms0, p, len; int ls0, ls1, ms0, p, len;
for (ls0 = 0; ls0 < 32; ls0++) for (ls0 = 0; ls0 < 32; ls0++)
...@@ -1780,7 +1755,7 @@ char * ...@@ -1780,7 +1755,7 @@ char *
output_ior (operands) output_ior (operands)
rtx *operands; rtx *operands;
{ {
unsigned mask = INTVAL (operands[2]); unsigned HOST_WIDE_INT mask = INTVAL (operands[2]);
int bs0, bs1, p, len; int bs0, bs1, p, len;
if (INTVAL (operands[2]) == 0) if (INTVAL (operands[2]) == 0)
...@@ -1794,7 +1769,7 @@ output_ior (operands) ...@@ -1794,7 +1769,7 @@ output_ior (operands)
if ((mask & (1 << bs1)) == 0) if ((mask & (1 << bs1)) == 0)
break; break;
if (bs1 != 32 && ((unsigned) 1 << bs1) <= mask) if (bs1 != 32 && ((unsigned HOST_WIDE_INT) 1 << bs1) <= mask)
abort(); abort();
p = 31 - bs0; p = 31 - bs0;
......
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