From 83774f72adbdf48f51afe1891ea2c6c4d4c5a65c Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 2 Jun 2018 20:26:18 -0400 Subject: [PATCH] Interpreter_FloatingPoint: Unset FPSCR.FI and FPSCR.FR if a division by zero exception occurs in fres and frsqrte Within the programming environments manual, part of the behavior of a zero divide exception condition is that FI and FR be cleared. --- .../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 3782c748a5..acf7c93afb 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -397,6 +397,8 @@ void Interpreter::fresx(UGeckoInstruction inst) if (b == 0.0) { SetFPException(FPSCR_ZX); + FPSCR.FI = 0; + FPSCR.FR = 0; if (FPSCR.ZE == 0) compute_result(b); @@ -441,6 +443,8 @@ void Interpreter::frsqrtex(UGeckoInstruction inst) else if (b == 0.0) { SetFPException(FPSCR_ZX); + FPSCR.FI = 0; + FPSCR.FR = 0; if (FPSCR.ZE == 0) compute_result(b);