diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index 91504ede1a..a8e6c7451f 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -422,36 +422,39 @@ void Interpreter::fresx(UGeckoInstruction inst) void Interpreter::frsqrtex(UGeckoInstruction inst) { const double b = rPS0(inst.FB); - const double result = Common::ApproximateReciprocalSquareRoot(b); + + const auto compute_result = [inst](double value) { + const double result = Common::ApproximateReciprocalSquareRoot(value); + rPS0(inst.FD) = result; + PowerPC::UpdateFPRF(result); + }; if (b < 0.0) { SetFPException(FPSCR_VXSQRT); if (FPSCR.VE == 0) - PowerPC::UpdateFPRF(result); + compute_result(b); } else if (b == 0.0) { SetFPException(FPSCR_ZX); if (FPSCR.ZE == 0) - PowerPC::UpdateFPRF(result); + compute_result(b); } else if (Common::IsSNAN(b)) { SetFPException(FPSCR_VXSNAN); if (FPSCR.VE == 0) - PowerPC::UpdateFPRF(result); + compute_result(b); } else { - PowerPC::UpdateFPRF(result); + compute_result(b); } - rPS0(inst.FD) = result; - if (inst.Rc) Helper_UpdateCR1(); }