diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index 4529d2ebe8..69f3a93de8 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -272,12 +272,31 @@ void Interpreter::fselx(UGeckoInstruction inst) // PS1 is said to be undefined void Interpreter::frspx(UGeckoInstruction inst) // round to single { - double b = rPS0(inst.FB); - double rounded = ForceSingle(b); - SetFI(b != rounded); - FPSCR.FR = fabs(rounded) > fabs(b); - PowerPC::UpdateFPRF(rounded); - rPS0(inst.FD) = rPS1(inst.FD) = rounded; + const double b = rPS0(inst.FB); + const double rounded = ForceSingle(b); + + if (MathUtil::IsSNAN(b)) + { + SetFPException(FPSCR_VXSNAN); + + if (FPSCR.VE == 0) + { + rPS0(inst.FD) = rounded; + rPS1(inst.FD) = rounded; + PowerPC::UpdateFPRF(b); + } + + SetFI(0); + FPSCR.FR = 0; + } + else + { + SetFI(b != rounded); + FPSCR.FR = fabs(rounded) > fabs(b); + PowerPC::UpdateFPRF(rounded); + rPS0(inst.FD) = rounded; + rPS1(inst.FD) = rounded; + } if (inst.Rc) Helper_UpdateCR1();