From b88d0aa53f6098212efa3a379734e57d7b6f164f Mon Sep 17 00:00:00 2001 From: calc84maniac Date: Tue, 3 Jan 2012 00:37:43 -0500 Subject: [PATCH] x86 shift of 0 doesn't update flags, check the value manually --- .../Core/Src/PowerPC/Jit64/Jit_Integer.cpp | 26 +++++++------------ 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp index b0be8517c7..0be20dc4e6 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_Integer.cpp @@ -1652,10 +1652,6 @@ void Jit64::srwx(UGeckoInstruction inst) { u32 amount = (u32)gpr.R(b).offset; gpr.SetImmediate32(a, (amount & 0x20) ? 0 : ((u32)gpr.R(s).offset >> (amount & 0x1f))); - if (inst.Rc) - { - ComputeRC(gpr.R(a)); - } } else { @@ -1672,13 +1668,14 @@ void Jit64::srwx(UGeckoInstruction inst) XOR(32, gpr.R(a), gpr.R(a)); SetJumpTarget(branch); SHR(32, gpr.R(a), R(ECX)); - if (inst.Rc) - { - GenerateRC(); - } gpr.UnlockAll(); gpr.UnlockAllX(); } + // Shift of 0 doesn't update flags, so compare manually just in case + if (inst.Rc) + { + ComputeRC(gpr.R(a)); + } } void Jit64::slwx(UGeckoInstruction inst) @@ -1693,10 +1690,6 @@ void Jit64::slwx(UGeckoInstruction inst) { u32 amount = (u32)gpr.R(b).offset; gpr.SetImmediate32(a, (amount & 0x20) ? 0 : (u32)gpr.R(s).offset << amount); - if (inst.Rc) - { - ComputeRC(gpr.R(a)); - } } else { @@ -1713,13 +1706,14 @@ void Jit64::slwx(UGeckoInstruction inst) XOR(32, gpr.R(a), gpr.R(a)); SetJumpTarget(branch); SHL(32, gpr.R(a), R(ECX)); - if (inst.Rc) - { - GenerateRC(); - } gpr.UnlockAll(); gpr.UnlockAllX(); } + // Shift of 0 doesn't update flags, so compare manually just in case + if (inst.Rc) + { + ComputeRC(gpr.R(a)); + } } void Jit64::srawx(UGeckoInstruction inst)