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);
243 flag aSign, bSign, zSign;
244 int16 aExp, bExp, zExp;
245 bits64 aSig, bSig, zSig0, zSig1;
253 zSign = aSign ^ bSign;
256 if (aSig || ((bExp == 0x7FF) && bSig))
257 return propagateFloat64NaN (a, b);
258 if ((bExp | bSig) == 0)
261 return float64_default_nan;
268 return propagateFloat64NaN (a, b);
269 if ((aExp | aSig) == 0)
272 return float64_default_nan;
288 zExp = aExp + bExp - 0x3FF;
289 aSig = (aSig |
LIT64 (0x0010000000000000)) << 10;
290 bSig = (bSig |
LIT64 (0x0010000000000000)) << 11;
291 mul64To128 (aSig, bSig, &zSig0, &zSig1);
292 zSig0 |= (zSig1 != 0);
293 if (0 <= (
sbits64) (zSig0 << 1))
INLINE int16 extractFloat64Exp(float64 a)
INLINE flag extractFloat64Sign(float64 a)
static float64 roundAndPackFloat64(flag zSign, int16 zExp, bits64 zSig)
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
int8 float_exception_flags
#define float_round_nearest_even
signed long long int sbits64
#define float_flag_inexact
#define float_round_to_zero
INLINE bits64 extractFloat64Frac(float64 a)
unsigned long long int bits64