aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1997-06-09 17:15:48 -0400
committerRichard Kenner <kenner@gcc.gnu.org>1997-06-09 17:15:48 -0400
commit39d78b3210ddc3b77f57678998431773333c4f55 (patch)
treebed86d524b08ec26cdfbbcaf8ac050c07b97b697 /gcc
parent9a8fde947ceb5dcde0debda60ae949f08de72a99 (diff)
downloadgcc-39d78b3210ddc3b77f57678998431773333c4f55.zip
gcc-39d78b3210ddc3b77f57678998431773333c4f55.tar.gz
gcc-39d78b3210ddc3b77f57678998431773333c4f55.tar.bz2
(check_float_value): Underflow and overflow constants are different
for FLOAT_VAX and default targets. From-SVN: r14190
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/alpha/alpha.c34
1 files changed, 22 insertions, 12 deletions
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index 46f621a..df88831 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -2959,13 +2959,20 @@ final_prescan_insn (insn, opvec, noperands)
static char *float_strings[] =
{
+ /* These are for FLOAT_VAX. */
"1.70141173319264430e+38", /* 2^127 (2^24 - 1) / 2^24 */
"-1.70141173319264430e+38",
"2.93873587705571877e-39", /* 2^-128 */
- "-2.93873587705571877e-39"
+ "-2.93873587705571877e-39",
+ /* These are for the default broken IEEE mode, which traps
+ on infinity or denormal numbers. */
+ "3.402823466385288598117e+38", /* 2^128 (1 - 2^-24) */
+ "-3.402823466385288598117e+38",
+ "1.1754943508222875079687e-38", /* 2^-126 */
+ "-1.1754943508222875079687e-38",
};
-static REAL_VALUE_TYPE float_values[4];
+static REAL_VALUE_TYPE float_values[8];
static int inited_float_values = 0;
int
@@ -2978,13 +2985,10 @@ check_float_value (mode, d, overflow)
if (TARGET_IEEE || TARGET_IEEE_CONFORMANT || TARGET_IEEE_WITH_INEXACT)
return 0;
- if (TARGET_FLOAT_VAX)
- return 0;
-
if (inited_float_values == 0)
{
int i;
- for (i = 0; i < 4; i++)
+ for (i = 0; i < 8; i++)
float_values[i] = REAL_VALUE_ATOF (float_strings[i], DFmode);
inited_float_values = 1;
@@ -2993,28 +2997,34 @@ check_float_value (mode, d, overflow)
if (mode == SFmode)
{
REAL_VALUE_TYPE r;
+ REAL_VALUE_TYPE *fvptr;
+
+ if (TARGET_FLOAT_VAX)
+ fvptr = &float_values[0];
+ else
+ fvptr = &float_values[4];
bcopy ((char *) d, (char *) &r, sizeof (REAL_VALUE_TYPE));
- if (REAL_VALUES_LESS (float_values[0], r))
+ if (REAL_VALUES_LESS (fvptr[0], r))
{
- bcopy ((char *) &float_values[0], (char *) d,
+ bcopy ((char *) &fvptr[0], (char *) d,
sizeof (REAL_VALUE_TYPE));
return 1;
}
- else if (REAL_VALUES_LESS (r, float_values[1]))
+ else if (REAL_VALUES_LESS (r, fvptr[1]))
{
- bcopy ((char *) &float_values[1], (char *) d,
+ bcopy ((char *) &fvptr[1], (char *) d,
sizeof (REAL_VALUE_TYPE));
return 1;
}
else if (REAL_VALUES_LESS (dconst0, r)
- && REAL_VALUES_LESS (r, float_values[2]))
+ && REAL_VALUES_LESS (r, fvptr[2]))
{
bcopy ((char *) &dconst0, (char *) d, sizeof (REAL_VALUE_TYPE));
return 1;
}
else if (REAL_VALUES_LESS (r, dconst0)
- && REAL_VALUES_LESS (float_values[3], r))
+ && REAL_VALUES_LESS (fvptr[3], r))
{
bcopy ((char *) &dconst0, (char *) d, sizeof (REAL_VALUE_TYPE));
return 1;