Jit64: Fix Dispatcher ABI (downcount) violation

The dispatcher requires that the flags contain the downcount state.
This commit is contained in:
EmptyChaos 2016-09-12 07:56:56 +00:00
parent 54a643a4a3
commit 070fe7f499
2 changed files with 5 additions and 5 deletions

View File

@ -612,7 +612,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc
// Downcount flag check. The last block decremented downcounter, and the flag should still be
// available.
FixupBranch skip = J_CC(CC_NBE);
FixupBranch skip = J_CC(CC_G);
MOV(32, PPCSTATE(pc), Imm32(js.blockStart));
JMP(asm_routines.doTiming, true); // downcount hit zero - go doTiming.
SetJumpTarget(skip);
@ -675,7 +675,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc
ABI_CallFunctionC(JitInterface::CompileExceptionCheck,
(u32)JitInterface::ExceptionType::EXCEPTIONS_PAIRED_QUANTIZE);
ABI_PopRegistersAndAdjustStack({}, 0);
JMP(asm_routines.dispatcher, true);
JMP(asm_routines.dispatcherNoCheck, true);
SwitchToNearCode();
// Insert a check that the GQRs are still the value we expect at

View File

@ -69,9 +69,9 @@ void Jit64AsmRoutineManager::Generate()
SUB(32, PPCSTATE(downcount), R(RSCRATCH2));
dispatcher = GetCodePtr();
// The result of slice decrementation should be in flags if somebody jumped here
// IMPORTANT - We jump on negative, not carry!!!
FixupBranch bail = J_CC(CC_BE, true);
// Expected result of SUB(32, PPCSTATE(downcount), Imm32(block_cycles)) is in RFLAGS.
// Branch if downcount is <= 0 (signed).
FixupBranch bail = J_CC(CC_LE, true);
FixupBranch dbg_exit;