Merge pull request #4200 from EmptyChaos/jit64-dispatch-bug

Jit64: Fix Dispatcher ABI error
This commit is contained in:
shuffle2
2016-10-02 20:41:39 -07:00
committed by GitHub
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 // Downcount flag check. The last block decremented downcounter, and the flag should still be
// available. // available.
FixupBranch skip = J_CC(CC_NBE); FixupBranch skip = J_CC(CC_G);
MOV(32, PPCSTATE(pc), Imm32(js.blockStart)); MOV(32, PPCSTATE(pc), Imm32(js.blockStart));
JMP(asm_routines.doTiming, true); // downcount hit zero - go doTiming. JMP(asm_routines.doTiming, true); // downcount hit zero - go doTiming.
SetJumpTarget(skip); SetJumpTarget(skip);
@ -675,7 +675,7 @@ const u8* Jit64::DoJit(u32 em_address, PPCAnalyst::CodeBuffer* code_buf, JitBloc
ABI_CallFunctionC(JitInterface::CompileExceptionCheck, ABI_CallFunctionC(JitInterface::CompileExceptionCheck,
(u32)JitInterface::ExceptionType::EXCEPTIONS_PAIRED_QUANTIZE); (u32)JitInterface::ExceptionType::EXCEPTIONS_PAIRED_QUANTIZE);
ABI_PopRegistersAndAdjustStack({}, 0); ABI_PopRegistersAndAdjustStack({}, 0);
JMP(asm_routines.dispatcher, true); JMP(asm_routines.dispatcherNoCheck, true);
SwitchToNearCode(); SwitchToNearCode();
// Insert a check that the GQRs are still the value we expect at // 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)); SUB(32, PPCSTATE(downcount), R(RSCRATCH2));
dispatcher = GetCodePtr(); dispatcher = GetCodePtr();
// The result of slice decrementation should be in flags if somebody jumped here // Expected result of SUB(32, PPCSTATE(downcount), Imm32(block_cycles)) is in RFLAGS.
// IMPORTANT - We jump on negative, not carry!!! // Branch if downcount is <= 0 (signed).
FixupBranch bail = J_CC(CC_BE, true); FixupBranch bail = J_CC(CC_LE, true);
FixupBranch dbg_exit; FixupBranch dbg_exit;