mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
Jit: Fix syscall outside delay slot.
Doesn't happen in real games, but useful in debug code.
This commit is contained in:
parent
80be3166af
commit
33b073c545
@ -612,6 +612,11 @@ void ArmJit::Comp_Syscall(MIPSOpcode op)
|
||||
RestoreRoundingMode();
|
||||
js.downcountAmount = -offset;
|
||||
|
||||
if (!js.inDelaySlot) {
|
||||
gpr.SetRegImm(SCRATCHREG1, GetCompilerPC() + 4);
|
||||
MovToPC(SCRATCHREG1);
|
||||
}
|
||||
|
||||
FlushAll();
|
||||
|
||||
SaveDowncount();
|
||||
|
@ -594,6 +594,11 @@ void Arm64Jit::Comp_Syscall(MIPSOpcode op)
|
||||
RestoreRoundingMode();
|
||||
js.downcountAmount = -offset;
|
||||
|
||||
if (!js.inDelaySlot) {
|
||||
gpr.SetRegImm(SCRATCH1, GetCompilerPC() + 4);
|
||||
MovToPC(SCRATCH1);
|
||||
}
|
||||
|
||||
FlushAll();
|
||||
|
||||
SaveStaticRegisters();
|
||||
|
@ -380,6 +380,11 @@ void IRFrontend::Comp_Syscall(MIPSOpcode op) {
|
||||
ir.Write(IROp::Downcount, 0, dcAmount & 0xFF, dcAmount >> 8);
|
||||
js.downcountAmount = 0;
|
||||
|
||||
// If not in a delay slot, we need to update PC.
|
||||
if (!js.inDelaySlot) {
|
||||
ir.Write(IROp::SetPCConst, 0, ir.AddConstant(GetCompilerPC() + 4));
|
||||
}
|
||||
|
||||
FlushAll();
|
||||
|
||||
RestoreRoundingMode();
|
||||
|
@ -787,6 +787,10 @@ void Jit::Comp_Syscall(MIPSOpcode op)
|
||||
RestoreRoundingMode();
|
||||
js.downcountAmount = -offset;
|
||||
|
||||
if (!js.inDelaySlot) {
|
||||
MOV(32, M(&mips_->pc), Imm32(GetCompilerPC() + 4));
|
||||
}
|
||||
|
||||
#ifdef USE_PROFILER
|
||||
// When profiling, we can't skip CallSyscall, since it times syscalls.
|
||||
ABI_CallFunctionC(&CallSyscall, op.encoding);
|
||||
|
Loading…
x
Reference in New Issue
Block a user