From 55b509b7398a3d5ef78de314d58d6d8014e763ae Mon Sep 17 00:00:00 2001 From: Fiora Date: Fri, 9 Jan 2015 05:59:51 -0800 Subject: [PATCH] Interpreter: fix slwx --- Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp | 2 +- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp index 37b1a46e8e..954cc26205 100644 --- a/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp +++ b/Source/Core/Core/PowerPC/Interpreter/Interpreter_Integer.cpp @@ -329,7 +329,7 @@ void Interpreter::orcx(UGeckoInstruction _inst) void Interpreter::slwx(UGeckoInstruction _inst) { u32 amount = rGPR[_inst.RB]; - rGPR[_inst.RA] = (amount & 0x20) ? 0 : rGPR[_inst.RS] << amount; + rGPR[_inst.RA] = (amount & 0x20) ? 0 : rGPR[_inst.RS] << (amount & 0x1f); if (_inst.Rc) Helper_UpdateCR0(rGPR[_inst.RA]); diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index a272d120dd..c0015a19e0 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1680,7 +1680,7 @@ void Jit64::slwx(UGeckoInstruction inst) if (gpr.R(b).IsImm() && gpr.R(s).IsImm()) { u32 amount = (u32)gpr.R(b).offset; - gpr.SetImmediate32(a, (amount & 0x20) ? 0 : (u32)gpr.R(s).offset << amount); + gpr.SetImmediate32(a, (amount & 0x20) ? 0 : (u32)gpr.R(s).offset << (amount & 0x1f)); if (inst.Rc) ComputeRC(gpr.R(a)); }