5 Stubs to check for extremities of (IEEE) floats,
6 the tests have been (artfully) lifted from the hbc-0.9999.3 (lib/fltcode.c)
10 - avoid hard-wiring the fact that on an
11 Alpha we repr. a StgFloat as a double.
12 (introduce int equivalent of {ASSIGN,PK}_FLT? )
17 #include "ieee-flpt.h"
18 #include "floatExtreme.h"
28 #ifdef IEEE_FLOATING_POINT
34 union { double d; int i[2]; } u;
42 hx |= (unsigned int)(lx|(-lx))>>31;
44 r = (int)((unsigned int)(hx))>>31;
52 union { double d; int i[2]; } u;
65 isDoubleDenormalized(d)
68 union { double d; int i[2]; } u;
73 iexp = high & (0x7ff << 20);
78 isDoubleNegativeZero(d)
81 union { double d; int i[2]; } u;
85 return (u.i[H] == 0x80000000 && u.i[L] == 0);
88 /* Same tests, this time for StgFloats. */
94 #if !defined(alpha_TARGET_OS)
95 /* StgFloat = double on alphas */
96 return (isDoubleNaN(f));
98 union { StgFloat f; int i; } u;
103 u.i = 0x7f800000 - u.i;
104 r = (int)(((unsigned int)(u.i))>>31);
113 #if !defined(alpha_TARGET_OS)
114 /* StgFloat = double on alphas */
115 return (isDoubleInfinite(f));
118 union { StgFloat f; int i; } u;
128 isFloatDenormalized(f)
131 #if !defined(alpha_TARGET_OS)
132 /* StgFloat = double on alphas */
133 return (isDoubleDenormalized(f));
136 union { StgFloat f; int i; } u;
139 iexp = u.i & (0xff << 23);
145 isFloatNegativeZero(f)
148 #if !defined(alpha_TARGET_OS)
149 /* StgFloat = double on alphas */
150 return (isDoubleNegativeZero(f));
152 union { StgFloat f; int i; } u;
155 return (u.i == (int)0x80000000);
162 StgInt isDoubleNaN(d) StgDouble d; { return 0; }
163 StgInt isDoubleInfinite(d) StgDouble d; { return 0; }
164 StgInt isDoubleDenormalized(d) StgDouble d; { return 0; }
165 StgInt isDoubleNegativeZero(d) StgDouble d; { return 0; }
166 StgInt isFloatNaN(f) StgFloat f; { return 0; }
167 StgInt isFloatInfinite(f) StgFloat f; { return 0; }
168 StgInt isFloatDenormalized(f) StgFloat f; { return 0; }
169 StgInt isFloatNegativeZero(f) StgFloat f; { return 0; }