diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index fb56ce7060..70dfea5f99 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -7,6 +7,7 @@ #include "Common/Assert.h" #include "Common/BitUtils.h" #include "Common/CommonTypes.h" +#include "Common/MathUtil.h" #include "Core/Core.h" #include "Core/CoreTiming.h" @@ -894,6 +895,15 @@ bool JitArm64::MultiplyImmediate(u32 imm, int a, int d, bool rc) if (rc) ComputeRC0(gpr.R(d)); } + else if (MathUtil::IsPow2(imm)) + { + const int shift = IntLog2(imm); + + gpr.BindToRegister(d, d == a); + LSL(gpr.R(d), gpr.R(a), shift); + if (rc) + ComputeRC0(gpr.R(d)); + } else { // Immediate did not match any known special cases.