mirror of
https://github.com/reactos/reactos.git
synced 2025-06-14 15:08:30 +00:00
[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. svn path=/trunk/; revision=67819
This commit is contained in:
parent
a6d59a04f6
commit
ec471e2759
3 changed files with 5 additions and 4 deletions
|
@ -1626,13 +1626,14 @@ Fast486FpuNormalize(PFAST486_STATE State,
|
||||||
{
|
{
|
||||||
UINT LeadingZeros;
|
UINT LeadingZeros;
|
||||||
|
|
||||||
if (FPU_IS_NORMALIZED(Data)) return TRUE;
|
|
||||||
if (FPU_IS_ZERO(Data))
|
if (FPU_IS_ZERO(Data))
|
||||||
{
|
{
|
||||||
Data->Exponent = 0;
|
Data->Exponent = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (FPU_IS_NORMALIZED(Data)) return TRUE;
|
||||||
|
|
||||||
LeadingZeros = CountLeadingZeros64(Data->Mantissa);
|
LeadingZeros = CountLeadingZeros64(Data->Mantissa);
|
||||||
|
|
||||||
if (LeadingZeros < Data->Exponent)
|
if (LeadingZeros < Data->Exponent)
|
||||||
|
|
|
@ -277,7 +277,7 @@ Fast486FpuFromInteger(PFAST486_STATE State,
|
||||||
|
|
||||||
if (Value < 0LL)
|
if (Value < 0LL)
|
||||||
{
|
{
|
||||||
Result->Sign = 1;
|
Result->Sign = TRUE;
|
||||||
Value = -Value;
|
Value = -Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -804,7 +804,7 @@ Fast486FpuMultiply(PFAST486_STATE State,
|
||||||
TempResult.Sign = FirstOperand->Sign ^ SecondOperand->Sign;
|
TempResult.Sign = FirstOperand->Sign ^ SecondOperand->Sign;
|
||||||
|
|
||||||
/* Calculate the exponent */
|
/* 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 */
|
/* Calculate the mantissa */
|
||||||
UnsignedMult128(FirstOperand->Mantissa,
|
UnsignedMult128(FirstOperand->Mantissa,
|
||||||
|
|
|
@ -63,7 +63,7 @@
|
||||||
#define FPU_REAL8_INFINITY 0x7FF0000000000000ULL
|
#define FPU_REAL8_INFINITY 0x7FF0000000000000ULL
|
||||||
#define FPU_REAL8_INDEFINITE 0xFFF8000000000000ULL
|
#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_ZERO(x) ((x)->Mantissa == 0ULL)
|
||||||
#define FPU_IS_NAN(x) ((x)->Exponent == (FPU_MAX_EXPONENT + 1))
|
#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))
|
#define FPU_IS_INFINITY(x) (FPU_IS_NAN(x) && ((x)->Mantissa == FPU_MANTISSA_HIGH_BIT))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue