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.
This commit is contained in:
comex 2013-10-04 20:33:39 -04:00
parent 3679f9ba60
commit a51eb5fd19
1 changed files with 6 additions and 4 deletions

View File

@ -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();