From a51eb5fd195a68df2df6fe2e19052c5c9be3b472 Mon Sep 17 00:00:00 2001 From: comex Date: Fri, 4 Oct 2013 20:33:39 -0400 Subject: [PATCH] Fix idle skipping. It incorrectly continued to test EAX after it was changed to load directly to the assigned register. Also switch from a flush to ABI_PushRegistersAndAdjustStack, to avoid needless flushing in the no-idle case. --- Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp index d63aee55e7..37d274fcc8 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_LoadStore.cpp @@ -122,15 +122,17 @@ void Jit64::lXXx(UGeckoInstruction inst) gpr.BindToRegister(d, false, true); SafeLoadToReg(gpr.RX(d), gpr.R(a), accessSize, offset, RegistersInUse(), signExtend); - gpr.Flush(FLUSH_ALL); - fpr.Flush(FLUSH_ALL); - // if it's still 0, we can wait until the next event - TEST(32, R(EAX), R(EAX)); + TEST(32, gpr.R(d), gpr.R(d)); FixupBranch noIdle = J_CC(CC_NZ); + u32 registersInUse = RegistersInUse(); + ABI_PushRegistersAndAdjustStack(registersInUse, false); + ABI_CallFunctionC((void *)&PowerPC::OnIdle, PowerPC::ppcState.gpr[a] + (s32)(s16)inst.SIMM_16); + ABI_PopRegistersAndAdjustStack(registersInUse, false); + // ! we must continue executing of the loop after exception handling, maybe there is still 0 in r0 //MOV(32, M(&PowerPC::ppcState.pc), Imm32(js.compilerPC)); WriteExceptionExit();