From 21add26b71c8af145dfe472dbd215df475c6cb57 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 2 Jun 2018 15:30:51 -0400 Subject: [PATCH] Interpreter_FloatingPoint: Clear FPSCR.FI and FPSCR.FR in invalid operation cases As explained within 179d73ac0d2873ebf2dedd7a4069ea5ded4a66f1, the table within the Programming Environments Manual for PowerPC lists the FI and FR bits as cleared for invalid operation cases. So, we amend the relevant cases here in order to be accurate to hardware. --- .../Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index a8e6c7451f..3782c748a5 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -432,6 +432,8 @@ void Interpreter::frsqrtex(UGeckoInstruction inst) if (b < 0.0) { SetFPException(FPSCR_VXSQRT); + FPSCR.FI = 0; + FPSCR.FR = 0; if (FPSCR.VE == 0) compute_result(b); @@ -446,6 +448,8 @@ void Interpreter::frsqrtex(UGeckoInstruction inst) else if (Common::IsSNAN(b)) { SetFPException(FPSCR_VXSNAN); + FPSCR.FI = 0; + FPSCR.FR = 0; if (FPSCR.VE == 0) compute_result(b);