diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 91e879fd69..040444c721 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -2649,14 +2649,9 @@ void Jit64::cntlzwx(UGeckoInstruction inst) int s = inst.RS; bool needs_test = false; - if (gpr.IsImm(s)) - { - gpr.SetImmediate32(a, static_cast(std::countl_zero(gpr.Imm32(s)))); - } - else { RCX64Reg Ra = gpr.Bind(a, RCMode::Write); - RCOpArg Rs = gpr.Use(s, RCMode::Read); + RCOpArg Rs = gpr.UseNoImm(s, RCMode::Read); RegCache::Realize(Ra, Rs); if (cpu_info.bLZCNT) diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index d3103f27fd..4972b3e77b 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -523,19 +523,10 @@ void JitArm64::cntlzwx(UGeckoInstruction inst) int a = inst.RA; int s = inst.RS; - if (gpr.IsImm(s)) - { - gpr.SetImmediate(a, static_cast(std::countl_zero(gpr.GetImm(s)))); - if (inst.Rc) - ComputeRC0(gpr.GetImm(a)); - } - else - { - gpr.BindToRegister(a, a == s); - CLZ(gpr.R(a), gpr.R(s)); - if (inst.Rc) - ComputeRC0(gpr.R(a)); - } + gpr.BindToRegister(a, a == s); + CLZ(gpr.R(a), gpr.R(s)); + if (inst.Rc) + ComputeRC0(gpr.R(a)); } void JitArm64::negx(UGeckoInstruction inst) diff --git a/Source/Core/Core/PowerPC/JitCommon/ConstantPropagation.cpp b/Source/Core/Core/PowerPC/JitCommon/ConstantPropagation.cpp index 3aecc0f531..630929efbc 100644 --- a/Source/Core/Core/PowerPC/JitCommon/ConstantPropagation.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/ConstantPropagation.cpp @@ -3,6 +3,8 @@ #include "Core/PowerPC/JitCommon/ConstantPropagation.h" +#include + #include "Core/PowerPC/PPCTables.h" namespace JitCommon @@ -107,6 +109,9 @@ ConstantPropagationResult ConstantPropagation::EvaluateTable31S(UGeckoInstructio switch (inst.SUBOP10) { + case 26: // cntlzwx + a = std::countl_zero(s); + break; case 922: // extshx a = s32(s16(s)); break;