From 39d78b3210ddc3b77f57678998431773333c4f55 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Mon, 9 Jun 1997 17:15:48 -0400 Subject: [PATCH] (check_float_value): Underflow and overflow constants are different for FLOAT_VAX and default targets. From-SVN: r14190 --- gcc/config/alpha/alpha.c | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c index 46f621a2c61..df888311fd4 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; -- 2.30.2