Merge pull request #12178 from JosJuice/jit-gp-pc

Jit: Use correct address when checking fifoWriteAddresses
This commit is contained in:
Admiral H. Curtiss 2023-09-10 15:58:23 +02:00 committed by GitHub
commit d16bedd5c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 129 additions and 118 deletions

View File

@ -949,8 +949,12 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
js.isLastInstruction = true; js.isLastInstruction = true;
} }
if (i != 0)
{
// Gather pipe writes using a non-immediate address are discovered by profiling. // Gather pipe writes using a non-immediate address are discovered by profiling.
bool gatherPipeIntCheck = js.fifoWriteAddresses.find(op.address) != js.fifoWriteAddresses.end(); const u32 prev_address = m_code_buffer[i - 1].address;
bool gatherPipeIntCheck =
js.fifoWriteAddresses.find(prev_address) != js.fifoWriteAddresses.end();
// Gather pipe writes using an immediate address are explicitly tracked. // Gather pipe writes using an immediate address are explicitly tracked.
if (jo.optimizeGatherPipe && if (jo.optimizeGatherPipe &&
@ -997,6 +1001,7 @@ bool Jit64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
SetJumpTarget(noCPInt); SetJumpTarget(noCPInt);
SetJumpTarget(noExtIntEnable); SetJumpTarget(noExtIntEnable);
} }
}
if (HandleFunctionHooking(op.address)) if (HandleFunctionHooking(op.address))
break; break;

View File

@ -1047,8 +1047,12 @@ bool JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
fpr_used[op.fregOut] = true; fpr_used[op.fregOut] = true;
fpr.UpdateLastUsed(fpr_used); fpr.UpdateLastUsed(fpr_used);
if (i != 0)
{
// Gather pipe writes using a non-immediate address are discovered by profiling. // Gather pipe writes using a non-immediate address are discovered by profiling.
bool gatherPipeIntCheck = js.fifoWriteAddresses.find(op.address) != js.fifoWriteAddresses.end(); const u32 prev_address = m_code_buffer[i - 1].address;
bool gatherPipeIntCheck =
js.fifoWriteAddresses.find(prev_address) != js.fifoWriteAddresses.end();
if (jo.optimizeGatherPipe && if (jo.optimizeGatherPipe &&
(js.fifoBytesSinceCheck >= GPFifo::GATHER_PIPE_SIZE || js.mustCheckFifo)) (js.fifoBytesSinceCheck >= GPFifo::GATHER_PIPE_SIZE || js.mustCheckFifo))
@ -1071,7 +1075,8 @@ bool JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
// Inline exception check // Inline exception check
LDR(IndexType::Unsigned, ARM64Reg::W30, PPC_REG, PPCSTATE_OFF(Exceptions)); LDR(IndexType::Unsigned, ARM64Reg::W30, PPC_REG, PPCSTATE_OFF(Exceptions));
FixupBranch no_ext_exception = TBZ(ARM64Reg::W30, MathUtil::IntLog2(EXCEPTION_EXTERNAL_INT)); FixupBranch no_ext_exception =
TBZ(ARM64Reg::W30, MathUtil::IntLog2(EXCEPTION_EXTERNAL_INT));
FixupBranch exception = B(); FixupBranch exception = B();
SwitchToFarCode(); SwitchToFarCode();
const u8* done_here = GetCodePtr(); const u8* done_here = GetCodePtr();
@ -1132,6 +1137,7 @@ bool JitArm64::DoJit(u32 em_address, JitBlock* b, u32 nextPC)
gpr.Unlock(WA); gpr.Unlock(WA);
} }
}
if (HandleFunctionHooking(op.address)) if (HandleFunctionHooking(op.address))
break; break;