mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
Interpreter: simplify fres
This commit is contained in:
parent
174ada3a62
commit
b78310bbe5
@ -209,23 +209,23 @@ double ApproximateReciprocal(double val)
|
||||
|
||||
// Special case 0
|
||||
if (mantissa == 0 && exponent == 0)
|
||||
return sign ? -std::numeric_limits<double>::infinity() : std::numeric_limits<double>::infinity();
|
||||
return std::copysign(std::numeric_limits<double>::infinity(), valf);
|
||||
|
||||
// Special case NaN-ish numbers
|
||||
if (exponent == (0x7FFLL << 52))
|
||||
{
|
||||
if (mantissa == 0)
|
||||
return sign ? -0.0 : 0.0;
|
||||
return std::copysign(0.0, valf);
|
||||
return 0.0 + valf;
|
||||
}
|
||||
|
||||
// Special case small inputs
|
||||
if (exponent < (895LL << 52))
|
||||
return sign ? -std::numeric_limits<float>::max() : std::numeric_limits<float>::max();
|
||||
return std::copysign(std::numeric_limits<float>::max(), valf);
|
||||
|
||||
// Special case large inputs
|
||||
if (exponent >= (1149LL << 52))
|
||||
return sign ? -0.0f : 0.0f;
|
||||
return std::copysign(0.0, valf);
|
||||
|
||||
exponent = (0x7FDLL << 52) - exponent;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user