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

full word.

From-SVN: r13194
This commit is contained in:
Richard Kenner 1996-11-16 17:40:22 -05:00
parent 60814f4054
commit e01a2cecba
1 changed files with 17 additions and 0 deletions

View File

@ -1254,6 +1254,7 @@ operand_subword (op, i, validate_address, mode)
if (((HOST_FLOAT_FORMAT == TARGET_FLOAT_FORMAT
&& HOST_BITS_PER_WIDE_INT == BITS_PER_WORD)
|| flag_pretend_float)
&& sizeof (float) * 8 == HOST_BITS_PER_WIDE_INT
&& GET_MODE_CLASS (mode) == MODE_FLOAT
&& GET_MODE_SIZE (mode) == UNITS_PER_WORD
&& GET_CODE (op) == CONST_DOUBLE)
@ -1266,6 +1267,22 @@ operand_subword (op, i, validate_address, mode)
u.f = d;
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 */
/* The only remaining cases that we can handle are integers.