Merge pull request #6955 from lioncash/nan
Interpreter_FloatingPoint: Set FPSCR.VXSNAN if input to fres is a signaling NaN
This commit is contained in:
commit
9d1785718f
|
@ -394,15 +394,29 @@ void Interpreter::fdivsx(UGeckoInstruction inst)
|
||||||
// Single precision only.
|
// Single precision only.
|
||||||
void Interpreter::fresx(UGeckoInstruction inst)
|
void Interpreter::fresx(UGeckoInstruction inst)
|
||||||
{
|
{
|
||||||
double b = rPS0(inst.FB);
|
const double b = rPS0(inst.FB);
|
||||||
rPS0(inst.FD) = rPS1(inst.FD) = Common::ApproximateReciprocal(b);
|
const double result = Common::ApproximateReciprocal(b);
|
||||||
|
|
||||||
|
rPS0(inst.FD) = rPS1(inst.FD) = result;
|
||||||
|
|
||||||
if (b == 0.0)
|
if (b == 0.0)
|
||||||
{
|
{
|
||||||
SetFPException(FPSCR_ZX);
|
SetFPException(FPSCR_ZX);
|
||||||
}
|
|
||||||
|
|
||||||
PowerPC::UpdateFPRF(rPS0(inst.FD));
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
if (inst.Rc)
|
if (inst.Rc)
|
||||||
Helper_UpdateCR1();
|
Helper_UpdateCR1();
|
||||||
|
|
Loading…
Reference in New Issue