From 179d73ac0d2873ebf2dedd7a4069ea5ded4a66f1 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 1 Jun 2018 19:05:43 -0400 Subject: [PATCH] Interpreter_FloatingPoint: Clear FPSCR.FI and FPSCR.FR if an SNaN is an input to fres In the PEM manual, within Table 3-12, which lists what should occur for invalid operation exceptions, the FPSCR.FI and FPSCR.FR bits are listed as "Cleared" for when FPSCR.VE is unset and set. So we clear these bits as well to match hardware behavior. --- .../Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index 5578a4b9bb..91504ede1a 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -404,6 +404,8 @@ void Interpreter::fresx(UGeckoInstruction inst) else if (Common::IsSNAN(b)) { SetFPException(FPSCR_VXSNAN); + FPSCR.FI = 0; + FPSCR.FR = 0; if (FPSCR.VE == 0) compute_result(b);