From bfa5dcc8913def1e1decf8e834cb64694ed0aa5d Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 21 Feb 2015 22:56:22 -0500 Subject: [PATCH] Interpreter: Set the FPCC bits correctly for ordered/unordered FP compares Setting the whole FPRF is slightly incorrect, this should only modify the FPCC bits; the class bit should be preserved. --- .../PowerPC/Interpreter/Interpreter_FloatingPoint.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index a469e3ccbb..26cb1edf7d 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -52,7 +52,9 @@ void Interpreter::Helper_FloatCompareOrdered(UGeckoInstruction _inst, double fa, compareResult = FPCC::FE; } - FPSCR.FPRF = compareResult; + // Clear and set the FPCC bits accordingly. + FPSCR.FPRF = (FPSCR.FPRF & ~0xF) | compareResult; + SetCRField(_inst.CRFD, compareResult); } @@ -83,7 +85,9 @@ void Interpreter::Helper_FloatCompareUnordered(UGeckoInstruction _inst, double f compareResult = FPCC::FE; } - FPSCR.FPRF = compareResult; + // Clear and set the FPCC bits accordingly. + FPSCR.FPRF = (FPSCR.FPRF & ~0xF) | compareResult; + SetCRField(_inst.CRFD, compareResult); }