Correctly detect inexact result in FPU (patch by No Name)

This commit is contained in:
Stanislav Shwartsman 2006-08-28 18:48:51 +00:00
parent 47992d9606
commit ea1127f235

View File

@ -441,8 +441,10 @@ floatx80 roundAndPackFloatx80(int roundingPrecision,
zSigExact = zSig0;
zSig0 += roundIncrement;
if (zSig0 < roundIncrement) {
// Basically scale by shifting right and keep overflow
++zExp;
zSig0 = BX_CONST64(0x8000000000000000);
zSigExact >>= 1; // must scale also, or else later tests will fail
}
roundIncrement = roundMask + 1;
if (roundNearestEven && (roundBits<<1 == roundIncrement))
@ -512,6 +514,7 @@ floatx80 roundAndPackFloatx80(int roundingPrecision,
if (zSig0 == 0) {
zExp++;
zSig0 = BX_CONST64(0x8000000000000000);
zSigExact >>= 1; // must scale also, or else later tests will fail
}
else {
zSig0 &= ~(((Bit64u) (zSig1<<1) == 0) & roundNearestEven);