Core: remove usage of fpclassify in CheckFPUInput32 and CheckFPUResult32
This commit is contained in:
parent
0ddeb6b981
commit
62b29622ca
|
@ -3165,14 +3165,13 @@ bool R4300iOp::TestCop1UsableException(void)
|
||||||
|
|
||||||
bool R4300iOp::CheckFPUInput32(const float & Value)
|
bool R4300iOp::CheckFPUInput32(const float & Value)
|
||||||
{
|
{
|
||||||
int Type = fpclassify(Value);
|
if ((*((uint32_t *)&Value) & 0x7F800000) == 0x00000000 && (*((uint32_t *)&Value) & 0x007FFFFF) != 0x00000000) // Sub Normal
|
||||||
if (Type == FP_SUBNORMAL)
|
|
||||||
{
|
{
|
||||||
FPStatusReg & StatusReg = (FPStatusReg &)_FPCR[31];
|
FPStatusReg & StatusReg = (FPStatusReg &)_FPCR[31];
|
||||||
StatusReg.Cause.UnimplementedOperation = 1;
|
StatusReg.Cause.UnimplementedOperation = 1;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if (Type == FP_NAN)
|
if ((*((uint32_t *)&Value) & 0x7F800000) == 0x7F800000 && (*((uint32_t *)&Value) & 0x007FFFFF) != 0x00000000) // Nan
|
||||||
{
|
{
|
||||||
uint32_t Value32 = *(uint32_t *)&Value;
|
uint32_t Value32 = *(uint32_t *)&Value;
|
||||||
FPStatusReg & StatusReg = (FPStatusReg &)_FPCR[31];
|
FPStatusReg & StatusReg = (FPStatusReg &)_FPCR[31];
|
||||||
|
@ -3279,12 +3278,11 @@ bool R4300iOp::CheckFPUInput64Conv(const double & Value)
|
||||||
|
|
||||||
bool R4300iOp::CheckFPUResult32(float & Result)
|
bool R4300iOp::CheckFPUResult32(float & Result)
|
||||||
{
|
{
|
||||||
int fptype = fpclassify(Result);
|
if ((*((uint32_t *)&Result) & 0x7F800000) == 0x7F800000 && (*((uint32_t *)&Result) & 0x007FFFFF) != 0x00000000) // Nan
|
||||||
if (fptype == FP_NAN)
|
|
||||||
{
|
{
|
||||||
*((uint32_t *)&Result) = 0x7fbfffff;
|
*((uint32_t *)&Result) = 0x7fbfffff;
|
||||||
}
|
}
|
||||||
else if (fptype == FP_SUBNORMAL)
|
else if ((*((uint32_t *)&Result) & 0x7F800000) == 0x00000000 && (*((uint32_t *)&Result) & 0x007FFFFF) != 0x00000000) // Sub Normal
|
||||||
{
|
{
|
||||||
FPStatusReg & StatusReg = (FPStatusReg &)_FPCR[31];
|
FPStatusReg & StatusReg = (FPStatusReg &)_FPCR[31];
|
||||||
if (!StatusReg.FlushSubnormals || StatusReg.Enable.Underflow || StatusReg.Enable.Inexact)
|
if (!StatusReg.FlushSubnormals || StatusReg.Enable.Underflow || StatusReg.Enable.Inexact)
|
||||||
|
|
Loading…
Reference in New Issue