Merge pull request #6958 from lioncash/rsqrte
Interpreter_FloatingPoint: Handle SNaN flag setting in frsqrte
This commit is contained in:
commit
3d44dc3981
|
@ -424,19 +424,36 @@ void Interpreter::fresx(UGeckoInstruction inst)
|
||||||
|
|
||||||
void Interpreter::frsqrtex(UGeckoInstruction inst)
|
void Interpreter::frsqrtex(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
double b = rPS0(inst.FB);
|
const double b = rPS0(inst.FB);
|
||||||
|
const double result = Common::ApproximateReciprocalSquareRoot(b);
|
||||||
|
|
||||||
if (b < 0.0)
|
if (b < 0.0)
|
||||||
{
|
{
|
||||||
SetFPException(FPSCR_VXSQRT);
|
SetFPException(FPSCR_VXSQRT);
|
||||||
|
|
||||||
|
if (FPSCR.VE == 0)
|
||||||
|
PowerPC::UpdateFPRF(result);
|
||||||
}
|
}
|
||||||
else if (b == 0.0)
|
else if (b == 0.0)
|
||||||
{
|
{
|
||||||
SetFPException(FPSCR_ZX);
|
SetFPException(FPSCR_ZX);
|
||||||
|
|
||||||
|
if (FPSCR.ZE == 0)
|
||||||
|
PowerPC::UpdateFPRF(result);
|
||||||
|
}
|
||||||
|
else if (Common::IsSNAN(b))
|
||||||
|
{
|
||||||
|
SetFPException(FPSCR_VXSNAN);
|
||||||
|
|
||||||
|
if (FPSCR.VE == 0)
|
||||||
|
PowerPC::UpdateFPRF(result);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PowerPC::UpdateFPRF(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
rPS0(inst.FD) = Common::ApproximateReciprocalSquareRoot(b);
|
rPS0(inst.FD) = result;
|
||||||
PowerPC::UpdateFPRF(rPS0(inst.FD));
|
|
||||||
|
|
||||||
if (inst.Rc)
|
if (inst.Rc)
|
||||||
Helper_UpdateCR1();
|
Helper_UpdateCR1();
|
||||||
|
|
Loading…
Reference in New Issue