}
return c;
}
-
-/* Check a `double' value for validity for a particular machine mode. */
-
-static const char *const float_strings[] =
-{
- "1.70141173319264430e+38", /* 2^127 (2^24 - 1) / 2^24 */
- "-1.70141173319264430e+38",
- "2.93873587705571877e-39", /* 2^-128 */
- "-2.93873587705571877e-39"
-};
-
-static REAL_VALUE_TYPE float_values[4];
-
-static int inited_float_values = 0;
-
-
-int
-check_float_value (mode, d, overflow)
- enum machine_mode mode;
- REAL_VALUE_TYPE *d;
- int overflow;
-{
- if (inited_float_values == 0)
- {
- int i;
- for (i = 0; i < 4; i++)
- {
- float_values[i] = REAL_VALUE_ATOF (float_strings[i], DFmode);
- }
-
- inited_float_values = 1;
- }
-
- if (overflow)
- {
- memcpy (d, &float_values[0], sizeof (REAL_VALUE_TYPE));
- return 1;
- }
-
- if ((mode) == SFmode)
- {
- REAL_VALUE_TYPE r;
- memcpy (&r, d, sizeof (REAL_VALUE_TYPE));
- if (REAL_VALUES_LESS (float_values[0], r))
- {
- memcpy (d, &float_values[0], sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- else if (REAL_VALUES_LESS (r, float_values[1]))
- {
- memcpy (d, &float_values[1], sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- else if (REAL_VALUES_LESS (dconst0, r)
- && REAL_VALUES_LESS (r, float_values[2]))
- {
- memcpy (d, &dconst0, sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- else if (REAL_VALUES_LESS (r, dconst0)
- && REAL_VALUES_LESS (float_values[3], r))
- {
- memcpy (d, &dconst0, sizeof (REAL_VALUE_TYPE));
- return 1;
- }
- }
-
- return 0;
-}
\f
#if VMS_TARGET
/* Additional support code for VMS target. */