From 7bfeffe32f9f1aa7ead0eaaa746eaaaee67e0be6 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 28 May 2018 16:03:56 -0400 Subject: [PATCH] Interpreter_FPUtils: Unset FPSCR.FI and FPSCR.FR when FPSCR.ZX is set in NI_div() Another bit of behavior that we weren't performing correctly is the unsetting of FPSCR.FI and FPSCR.FR when FPSCR.ZX is supposed to be set. This is supported in PEM's section 3.3.6.1 where the following is stated: " When a zero divide condition occurs, the following actions are taken: - Zero divide exception condition bit is set FPSCR[ZX] = 1. - FPSCR[FR, FI] are cleared. " And so, this fixes that behavior. --- Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h index 511d34f073..c8ffc262d4 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h @@ -134,6 +134,8 @@ inline double NI_div(double a, double b) else { SetFPException(FPSCR_ZX); + FPSCR.FI = 0; + FPSCR.FR = 0; } } else if (std::isinf(a) && std::isinf(b))