From 0ef1fcdeb9bbbc80245b53efeb2bc38aed1e4bcf Mon Sep 17 00:00:00 2001 From: MerryMage Date: Mon, 28 Dec 2020 12:49:48 +0000 Subject: [PATCH] Jit_Integer: rlwinix: Handle immediate mask == 0xFFFFFFFF case --- Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index eab1246a58..791febaf0a 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -1649,17 +1649,24 @@ void Jit64::rlwimix(UGeckoInstruction inst) int a = inst.RA; int s = inst.RS; + const u32 mask = MakeRotationMask(inst.MB, inst.ME); + if (gpr.IsImm(a, s)) { - const u32 mask = MakeRotationMask(inst.MB, inst.ME); gpr.SetImmediate32(a, (gpr.Imm32(a) & ~mask) | (Common::RotateLeft(gpr.Imm32(s), inst.SH) & mask)); if (inst.Rc) ComputeRC(a); } + else if (gpr.IsImm(s) && mask == 0xFFFFFFFF) + { + gpr.SetImmediate32(a, Common::RotateLeft(gpr.Imm32(s), inst.SH)); + + if (inst.Rc) + ComputeRC(a); + } else { - const u32 mask = MakeRotationMask(inst.MB, inst.ME); bool needs_test = false; if (mask == 0 || (a == s && inst.SH == 0)) {