Commit e01a2cec by Richard Kenner

(operand_subword): Avoid confusion if sizeof (float) is less than a

full word.

From-SVN: r13194
parent 60814f40
...@@ -1254,6 +1254,7 @@ operand_subword (op, i, validate_address, mode) ...@@ -1254,6 +1254,7 @@ operand_subword (op, i, validate_address, mode)
if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD) && HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|| flag_pretend_float) || flag_pretend_float)
&& sizeof (float) * 8 == HOST_BITS_PER_WIDE_INT
&& GET_MODE_CLASS (mode) == MODE_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD && GET_MODE_SIZE (mode) == UNITS_PER_WORD
&& GET_CODE (op) == CONST_DOUBLE) && GET_CODE (op) == CONST_DOUBLE)
...@@ -1266,6 +1267,22 @@ operand_subword (op, i, validate_address, mode) ...@@ -1266,6 +1267,22 @@ operand_subword (op, i, validate_address, mode)
u.f = d; u.f = d;
return GEN_INT (u.i); return GEN_INT (u.i);
} }
if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|| flag_pretend_float)
&& sizeof (double) * 8 == HOST_BITS_PER_WIDE_INT
&& GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
&& GET_CODE (op) == CONST_DOUBLE)
{
double d;
union {double d; HOST_WIDE_INT i; } u;
REAL_VALUE_FROM_CONST_DOUBLE (d, op);
u.d = d;
return GEN_INT (u.i);
}
#endif /* no REAL_ARITHMETIC */ #endif /* no REAL_ARITHMETIC */
/* The only remaining cases that we can handle are integers. /* The only remaining cases that we can handle are integers.
......
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