ULONG MultiplicandLow, MultiplicandHigh, MultiplierLow, MultiplierHigh;
ULONG IntermediateLow, IntermediateHigh;
ULONGLONG LowProduct, Intermediate, Intermediate1, Intermediate2;
-
+
MultiplicandLow = (ULONG)(Multiplicand & 0xFFFFFFFFULL);
MultiplicandHigh = (ULONG)(Multiplicand >> 32);
MultiplierLow = (ULONG)(Multiplier & 0xFFFFFFFFULL);
Result->Mantissa = (ULONGLONG)Value;
ZeroCount = CountLeadingZeros64(Result->Mantissa);
-
+
Result->Mantissa <<= ZeroCount;
Result->Exponent = FPU_REAL10_BIAS + 63 - ZeroCount;
}
*Result = 0LL;
return TRUE;
}
-
+
if (FPU_IS_NAN(Value) || !FPU_IS_NORMALIZED(Value)
|| (UnbiasedExp < 0) || (UnbiasedExp > 63))
{
else TempResult.Sign = FALSE;
/* Invert the negative mantissa */
- if (FirstAdjusted.Sign) FirstAdjusted.Mantissa = -FirstAdjusted.Mantissa;
- if (SecondAdjusted.Sign) SecondAdjusted.Mantissa = -SecondAdjusted.Mantissa;
+ if (FirstAdjusted.Sign) FirstAdjusted.Mantissa = -(LONGLONG)FirstAdjusted.Mantissa;
+ if (SecondAdjusted.Sign) SecondAdjusted.Mantissa = -(LONGLONG)SecondAdjusted.Mantissa;
/* Calculate the mantissa of the result */
TempResult.Mantissa = FirstAdjusted.Mantissa + SecondAdjusted.Mantissa;
TempResult.Exponent++;
}
}
-
+
/* Normalize the result and return it */
Fast486FpuNormalize(State, &TempResult);
*Result = TempResult;
}
if (FPU_IS_INFINITY(FirstOperand) || FPU_IS_INFINITY(SecondOperand))
- {
+ {
/* The result will be infinity */
Result->Sign = FirstOperand->Sign ^ SecondOperand->Sign;
Result->Exponent = FPU_MAX_EXPONENT + 1;
{
/* Raise the underflow exception */
State->FpuStatus.Ue = TRUE;
-
+
if (!State->FpuControl.Um)
{
Fast486FpuException(State);
if (State->FpuControl.Im)
{
- /* Return the indefinite NaN */
+ /* Return the indefinite NaN */
Result->Sign = TRUE;
Result->Exponent = FPU_MAX_EXPONENT + 1;
Result->Mantissa = FPU_INDEFINITE_MANTISSA;
/* Divide the two mantissas */
Remainder = UnsignedDivMod128(0ULL,
/* Notice the 64 above - this is the high part */
- FirstOperand->Mantissa,
+ FirstOperand->Mantissa,
SecondOperand->Mantissa,
&QuotientLow,
&QuotientHigh);
SourceOperand = &MemoryData;
/* Perform the requested operation */
- Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
+ Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
#endif
}
Value.Exponent = *((PUSHORT)&Buffer[8]) & (FPU_MAX_EXPONENT + 1);
Value.Sign = *((PUCHAR)&Buffer[9]) >> 7;
- Fast486FpuPush(State, &Value);
+ Fast486FpuPush(State, &Value);
break;
}
return;
}
- Fast486FpuPop(State);
+ Fast486FpuPop(State);
break;
}
case 0x20:
/* FDISI */
case 0x21:
+ /* FSETPM */
+ case 0x24:
+ /* FRSTPM */
+ case 0x25:
{
/* These do nothing */
break;
}
/* Perform the requested operation */
- Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
+ Fast486FpuArithmeticOperation(State, ModRegRm.Register, SourceOperand, DestOperand);
if (!ModRegRm.Memory) Fast486FpuPop(State);
#endif
return;
}
- Fast486FpuPop(State);
+ Fast486FpuPop(State);
break;
}