Author: aandrejevic Date: Mon May 18 04:42:22 2015 New Revision: 67819
URL: http://svn.reactos.org/svn/reactos?rev=67819&view=rev Log: [FAST486] - Zero is not a denormalized number. - In Fast486FpuMultiply, we must account for the fact that the resulting mantissa also has the "decimal point" at the second position.
Modified: trunk/reactos/lib/fast486/common.inl trunk/reactos/lib/fast486/fpu.c trunk/reactos/lib/fast486/fpu.h
Modified: trunk/reactos/lib/fast486/common.inl URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/common.inl?rev=... ============================================================================== --- trunk/reactos/lib/fast486/common.inl [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/common.inl [iso-8859-1] Mon May 18 04:42:22 2015 @@ -1626,12 +1626,13 @@ { UINT LeadingZeros;
- if (FPU_IS_NORMALIZED(Data)) return TRUE; if (FPU_IS_ZERO(Data)) { Data->Exponent = 0; return TRUE; } + + if (FPU_IS_NORMALIZED(Data)) return TRUE;
LeadingZeros = CountLeadingZeros64(Data->Mantissa);
Modified: trunk/reactos/lib/fast486/fpu.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.c?rev=67819... ============================================================================== --- trunk/reactos/lib/fast486/fpu.c [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fpu.c [iso-8859-1] Mon May 18 04:42:22 2015 @@ -277,7 +277,7 @@
if (Value < 0LL) { - Result->Sign = 1; + Result->Sign = TRUE; Value = -Value; }
@@ -804,7 +804,7 @@ TempResult.Sign = FirstOperand->Sign ^ SecondOperand->Sign;
/* Calculate the exponent */ - Exponent = (LONG)FirstOperand->Exponent + (LONG)SecondOperand->Exponent - FPU_REAL10_BIAS; + Exponent = (LONG)FirstOperand->Exponent + (LONG)SecondOperand->Exponent - FPU_REAL10_BIAS + 1;
/* Calculate the mantissa */ UnsignedMult128(FirstOperand->Mantissa,
Modified: trunk/reactos/lib/fast486/fpu.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/fast486/fpu.h?rev=67819... ============================================================================== --- trunk/reactos/lib/fast486/fpu.h [iso-8859-1] (original) +++ trunk/reactos/lib/fast486/fpu.h [iso-8859-1] Mon May 18 04:42:22 2015 @@ -63,7 +63,7 @@ #define FPU_REAL8_INFINITY 0x7FF0000000000000ULL #define FPU_REAL8_INDEFINITE 0xFFF8000000000000ULL
-#define FPU_IS_NORMALIZED(x) (!FPU_IS_ZERO(x) && (((x)->Mantissa & FPU_MANTISSA_HIGH_BIT) != 0ULL)) +#define FPU_IS_NORMALIZED(x) (FPU_IS_ZERO(x) || (((x)->Mantissa & FPU_MANTISSA_HIGH_BIT) != 0ULL)) #define FPU_IS_ZERO(x) ((x)->Mantissa == 0ULL) #define FPU_IS_NAN(x) ((x)->Exponent == (FPU_MAX_EXPONENT + 1)) #define FPU_IS_INFINITY(x) (FPU_IS_NAN(x) && ((x)->Mantissa == FPU_MANTISSA_HIGH_BIT))