From 1a0a33518b1236ec1a28453ddf5838031d8c67af Mon Sep 17 00:00:00 2001 From: Fiora Date: Tue, 26 Aug 2014 21:37:45 -0700 Subject: [PATCH] Bugfixes for fmul rounding Fix the places I forgot to add Force25Bit, and fix an incredibly silly typo bug --- .../Interpreter/Interpreter_FloatingPoint.cpp | 12 ++++++------ .../Core/PowerPC/Interpreter/Interpreter_Paired.cpp | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp index f0ef426e5f..66264aaab7 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_FloatingPoint.cpp @@ -481,8 +481,8 @@ void Interpreter::fmsubx(UGeckoInstruction _inst) void Interpreter::fmsubsx(UGeckoInstruction _inst) { - rPS0(_inst.FD) = rPS1(_inst.FD) = - ForceSingle(NI_msub(rPS0(_inst.FA), rPS0(_inst.FC), rPS0(_inst.FB))); + double c_value = Force25Bit(rPS0(_inst.FC)); + rPS0(_inst.FD) = rPS1(_inst.FD) = ForceSingle(NI_msub(rPS0(_inst.FA), c_value, rPS0(_inst.FB))); UpdateFPRF(rPS0(_inst.FD)); if (_inst.Rc) @@ -500,8 +500,8 @@ void Interpreter::fnmaddx(UGeckoInstruction _inst) void Interpreter::fnmaddsx(UGeckoInstruction _inst) { - rPS0(_inst.FD) = rPS1(_inst.FD) = - ForceSingle(-NI_madd(rPS0(_inst.FA), rPS0(_inst.FC), rPS0(_inst.FB))); + double c_value = Force25Bit(rPS0(_inst.FC)); + rPS0(_inst.FD) = rPS1(_inst.FD) = ForceSingle(-NI_madd(rPS0(_inst.FA), c_value, rPS0(_inst.FB))); UpdateFPRF(rPS0(_inst.FD)); if (_inst.Rc) @@ -520,8 +520,8 @@ void Interpreter::fnmsubx(UGeckoInstruction _inst) // fnmsubsx does not handle QNAN properly - see NI_msub void Interpreter::fnmsubsx(UGeckoInstruction _inst) { - rPS0(_inst.FD) = rPS1(_inst.FD) = - ForceSingle(-NI_msub(rPS0(_inst.FA), rPS0(_inst.FC), rPS0(_inst.FB))); + double c_value = Force25Bit(rPS0(_inst.FC)); + rPS0(_inst.FD) = rPS1(_inst.FD) = ForceSingle(-NI_msub(rPS0(_inst.FA), c_value, rPS0(_inst.FB))); UpdateFPRF(rPS0(_inst.FD)); if (_inst.Rc) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Paired.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Paired.cpp index 0888e79042..5f7b6580e5 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Paired.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Paired.cpp @@ -349,7 +349,7 @@ void Interpreter::ps_sum1(UGeckoInstruction _inst) void Interpreter::ps_muls0(UGeckoInstruction _inst) { - double c0 = Force25Bit(rPS1(_inst.FC)); + double c0 = Force25Bit(rPS0(_inst.FC)); double p0 = ForceSingle(NI_mul(rPS0(_inst.FA), c0)); double p1 = ForceSingle(NI_mul(rPS1(_inst.FA), c0)); rPS0(_inst.FD) = p0;