make VU jumps relative: pass instruction relative location CMIPSInstructionFactory

This commit is contained in:
Mahmood - Zer0xFF 2022-10-18 20:01:20 +01:00 committed by Jean-Philip Desjardins
parent 6f0ab037d9
commit 2f4f10e91c
16 changed files with 53 additions and 42 deletions

View file

@ -206,7 +206,7 @@ void CBasicBlock::CompileRange(CMipsJitter* jitter)
m_context.m_pArch->CompileInstruction(
address,
jitter,
&m_context);
&m_context, address - m_begin);
//Sanity check
assert(jitter->IsStackEmpty());
}
@ -275,7 +275,9 @@ void CBasicBlock::CompileEpilog(CMipsJitter* jitter)
}
jitter->Else();
{
jitter->PushCst(m_end + 4);
jitter->PushRel(offsetof(CMIPS, m_State.nPC));
jitter->PushCst(m_end - m_begin + 4);
jitter->Add();
jitter->PullRel(offsetof(CMIPS, m_State.nPC));
#if !defined(AOT_BUILD_CACHE) && !defined(__EMSCRIPTEN__)