65 #include "softfloat-macros" 75 #include "softfloat-specialize" 85 return a &
LIT64 (0x000FFFFFFFFFFFFF);
97 return (a >> 52) & 0x7FF;
125 shiftCount = countLeadingZeros64 (aSig) - 11;
126 *zSigPtr = aSig << shiftCount;
127 *zExpPtr = 1 - shiftCount;
146 return (((
bits64) zSign) << 63) + (((
bits64) zExp) << 52) + zSig;
176 flag roundNearestEven, isTiny;
177 int16 roundIncrement, roundBits;
181 roundIncrement = 0x200;
182 if (!roundNearestEven)
190 roundIncrement = 0x3FF;
203 roundBits = zSig & 0x3FF;
204 if (0x7FD <= (
bits16) zExp)
207 || ((zExp == 0x7FD) && ((
sbits64) (zSig + roundIncrement) < 0)))
210 return packFloat64 (zSign, 0x7FF, 0) - (roundIncrement == 0);
216 || (zSig + roundIncrement <
LIT64 (0x8000000000000000));
217 shift64RightJamming (zSig, -zExp, &zSig);
219 roundBits = zSig & 0x3FF;
220 if (isTiny && roundBits)
226 zSig = (zSig + roundIncrement) >> 10;
227 zSig &= ~(((roundBits ^ 0x200) == 0) & roundNearestEven);
244 flag aSign, bSign, zSign;
245 int16 aExp, bExp, zExp;
246 bits64 aSig, bSig, zSig0, zSig1;
254 zSign = aSign ^ bSign;
257 if (aSig || ((bExp == 0x7FF) && bSig))
258 return propagateFloat64NaN (a, b);
259 if ((bExp | bSig) == 0)
262 return float64_default_nan;
269 return propagateFloat64NaN (a, b);
270 if ((aExp | aSig) == 0)
273 return float64_default_nan;
289 zExp = aExp + bExp - 0x3FF;
290 aSig = (aSig |
LIT64 (0x0010000000000000)) << 10;
291 bSig = (bSig |
LIT64 (0x0010000000000000)) << 11;
292 mul64To128 (aSig, bSig, &zSig0, &zSig1);
293 zSig0 |= (zSig1 != 0);
294 if (0 <= (
sbits64) (zSig0 << 1))
INLINE int16 extractFloat64Exp(float64 a)
INLINE flag extractFloat64Sign(float64 a)
unsigned short int bits16
INLINE float64 packFloat64(flag zSign, int16 zExp, bits64 zSig)
static void normalizeFloat64Subnormal(bits64 aSig, int16 *zExpPtr, bits64 *zSigPtr)
float64 float64_mul(float64 a, float64 b)
#define float_flag_invalid
#define float_flag_overflow
#define float_flag_underflow
#define float_tininess_before_rounding
unsigned long long float64
float64 __attribute__((noinline))
int8 float_exception_flags
#define float_round_nearest_even
signed long long int sbits64
static float64 roundAndPackFloat64(flag zSign, int16 zExp, bits64 zSig)
#define float_flag_inexact
#define float_round_to_zero
INLINE bits64 extractFloat64Frac(float64 a)
unsigned long long int bits64