diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp index 74362c12c1..12e46b0530 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_Integer.cpp @@ -862,13 +862,20 @@ void Jit64::subfic(UGeckoInstruction inst) { INSTRUCTION_START JITDISABLE(bJITIntegerOff); - int a = inst.RA, d = inst.RD; + int a = inst.RA, d = inst.RD, imm = inst.SIMM_16; + + if (gpr.IsImm(a)) + { + u32 i = imm, j = gpr.Imm32(a); + gpr.SetImmediate32(d, i - j); + FinalizeCarry(j == 0 || (i > j - 1)); + return; + } RCOpArg Ra = gpr.Use(a, RCMode::Read); RCX64Reg Rd = gpr.Bind(d, RCMode::Write); RegCache::Realize(Ra, Rd); - int imm = inst.SIMM_16; if (d == a) { if (imm == 0)