Jit64: Inline GP fast check in Cleanup.

This commit is contained in:
degasus 2017-11-18 15:05:27 +01:00
parent 36ad887a19
commit 6ad63c1b35
4 changed files with 10 additions and 2 deletions

View File

@ -53,6 +53,7 @@ void DoState(PointerWrap& p)
void Init()
{
ResetGatherPipe();
PowerPC::ppcState.gather_pipe_base_ptr = s_gather_pipe;
memset(s_gather_pipe, 0, sizeof(s_gather_pipe));
}
@ -66,7 +67,7 @@ void ResetGatherPipe()
SetGatherPipeCount(0);
}
static void UpdateGatherPipe()
void UpdateGatherPipe()
{
size_t pipe_count = GetGatherPipeCount();
size_t processed;

View File

@ -21,6 +21,7 @@ void DoState(PointerWrap& p);
// ResetGatherPipe
void ResetGatherPipe();
void UpdateGatherPipe();
void CheckGatherPipe();
void FastCheckGatherPipe();

View File

@ -355,9 +355,14 @@ bool Jit64::Cleanup()
if (jo.optimizeGatherPipe && js.fifoBytesSinceCheck > 0)
{
MOV(64, R(RSCRATCH), PPCSTATE(gather_pipe_ptr));
SUB(64, R(RSCRATCH), PPCSTATE(gather_pipe_base_ptr));
CMP(64, R(RSCRATCH), Imm32(GPFifo::GATHER_PIPE_SIZE));
FixupBranch exit = J_CC(CC_L);
ABI_PushRegistersAndAdjustStack({}, 0);
ABI_CallFunction(GPFifo::FastCheckGatherPipe);
ABI_CallFunction(GPFifo::UpdateGatherPipe);
ABI_PopRegistersAndAdjustStack({}, 0);
SetJumpTarget(exit);
did_something = true;
}

View File

@ -95,6 +95,7 @@ struct PowerPCState
// gather pipe pointer for JIT access
u8* gather_pipe_ptr;
u8* gather_pipe_base_ptr;
#if _M_X86_64
// This member exists for the purpose of an assertion in x86 JitBase.cpp