From dfea5cb00d3525d230b3c1d15c108b019a0c9d14 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Wed, 23 May 2018 21:28:14 -0400 Subject: [PATCH] Interpreter_FPUtils: Set the FPSCR.VX bit if any invalid operation exception bits are set The VX bit is intended to be a summary bit indicating the occurrence of any kind of invalid operation. Therefore, whenever an invalid operation exception is set, also set VX. This corrects our CR flag setting for multiple instructions in certain scenarios. This corrects flag setting cases in fadd, fadds, fctiw, fctiwz, fdiv, frsp, frsqrte, fsub, and fsubs (and technically every floating-point instruction that we make more accurate in the future with regards to flag setting). --- 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 d6ff00356a..70e0a01643 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FPUtils.h @@ -31,7 +31,9 @@ inline void SetFPException(u32 mask) { FPSCR.FX = 1; } + FPSCR.Hex |= mask; + FPSCR.VX = (FPSCR.Hex & FPSCR_VX_ANY) != 0; } inline void SetFI(int FI)