Commit a74467d4 by Richard Stallman

(floating_exact_log2, standard_68881_constant_p):

(standard_sun_fpa_constant_p): Use REAL_VALUE_FROM_CONST_DOUBLE.
(print_operand): Likewise.

From-SVN: r2377
parent 396f9edb
...@@ -1255,7 +1255,6 @@ int ...@@ -1255,7 +1255,6 @@ int
standard_68881_constant_p (x) standard_68881_constant_p (x)
rtx x; rtx x;
{ {
union {double d; int i[2];} u;
register double d; register double d;
/* fmovecr must be emulated on the 68040, so it shouldn't be used at all. */ /* fmovecr must be emulated on the 68040, so it shouldn't be used at all. */
...@@ -1267,14 +1266,7 @@ standard_68881_constant_p (x) ...@@ -1267,14 +1266,7 @@ standard_68881_constant_p (x)
return 0; return 0;
#endif #endif
#ifdef HOST_WORDS_BIG_ENDIAN REAL_VALUE_FROM_CONST_DOUBLE (d, x);
u.i[0] = CONST_DOUBLE_LOW (x);
u.i[1] = CONST_DOUBLE_HIGH (x);
#else
u.i[0] = CONST_DOUBLE_HIGH (x);
u.i[1] = CONST_DOUBLE_LOW (x);
#endif
d = u.d;
if (d == 0) if (d == 0)
return 0x0f; return 0x0f;
...@@ -1306,7 +1298,6 @@ int ...@@ -1306,7 +1298,6 @@ int
floating_exact_log2 (x) floating_exact_log2 (x)
rtx x; rtx x;
{ {
union {double d; int i[2];} u;
register double d, d1; register double d, d1;
int i; int i;
...@@ -1315,14 +1306,7 @@ floating_exact_log2 (x) ...@@ -1315,14 +1306,7 @@ floating_exact_log2 (x)
return 0; return 0;
#endif #endif
#ifdef HOST_WORDS_BIG_ENDIAN REAL_VALUE_FROM_CONST_DOUBLE (d, x);
u.i[0] = CONST_DOUBLE_LOW (x);
u.i[1] = CONST_DOUBLE_HIGH (x);
#else
u.i[0] = CONST_DOUBLE_HIGH (x);
u.i[1] = CONST_DOUBLE_LOW (x);
#endif
d = u.d;
if (! (d > 0)) if (! (d > 0))
return 0; return 0;
...@@ -1366,7 +1350,6 @@ int ...@@ -1366,7 +1350,6 @@ int
standard_sun_fpa_constant_p (x) standard_sun_fpa_constant_p (x)
rtx x; rtx x;
{ {
union {double d; int i[2];} u;
register double d; register double d;
#if HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT #if HOST_FLOAT_FORMAT != TARGET_FLOAT_FORMAT
...@@ -1374,10 +1357,7 @@ standard_sun_fpa_constant_p (x) ...@@ -1374,10 +1357,7 @@ standard_sun_fpa_constant_p (x)
return 0; return 0;
#endif #endif
REAL_VALUE_FROM_CONST_DOUBLE (d, x);
u.i[0] = CONST_DOUBLE_LOW (x);
u.i[1] = CONST_DOUBLE_HIGH (x);
d = u.d;
if (d == 0.0) if (d == 0.0)
return 0x200; /* 0 once 0x1ff is anded with it */ return 0x200; /* 0 once 0x1ff is anded with it */
...@@ -1619,17 +1599,17 @@ print_operand (file, op, letter) ...@@ -1619,17 +1599,17 @@ print_operand (file, op, letter)
#endif #endif
else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == SFmode) else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == SFmode)
{ {
union { double d; int i[2]; } u; double d;
union { float f; int i; } u1; union { float f; int i; } u1;
PRINT_OPERAND_EXTRACT_FLOAT (op); REAL_VALUE_FROM_CONST_DOUBLE (d, op);
u1.f = u.d; u1.f = d;
PRINT_OPERAND_PRINT_FLOAT (letter, file); PRINT_OPERAND_PRINT_FLOAT (letter, file);
} }
else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) != DImode) else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) != DImode)
{ {
union { double d; int i[2]; } u; double d;
PRINT_OPERAND_EXTRACT_FLOAT (op); REAL_VALUE_FROM_CONST_DOUBLE (d, op);
ASM_OUTPUT_DOUBLE_OPERAND (file, u.d); ASM_OUTPUT_DOUBLE_OPERAND (file, d);
} }
else else
{ {
......
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