diff --git a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp index a6b88a8cb1..f61fbe49a5 100644 --- a/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp +++ b/Source/Core/Core/PowerPC/JitArm64/JitArm64_Integer.cpp @@ -1394,6 +1394,18 @@ void JitArm64::divwx(UGeckoInstruction inst) gpr.Unlock(WA); } + else if (divisor == 2 || divisor == -2) + { + ARM64Reg RA = gpr.R(a); + ARM64Reg RD = gpr.R(d); + + ADD(RD, RA, RA, ArithOption(RA, ShiftType::LSR, 31)); + + if (divisor < 0) + NEG(RD, RD, ArithOption(RD, ShiftType::ASR, 1)); + else + ASR(RD, RD, 1); + } else if (MathUtil::IsPow2(divisor) || MathUtil::IsPow2(-static_cast(divisor))) { const u32 abs_val = static_cast(std::abs(static_cast(divisor)));