Jit64: Use utility function for function calls in dcbx.

We have these for a reason. I think this also fixes a theoretical
problem when `ABI_PARAM1 == loop_counter` where the first MOV destroys
the second's value; I'm not sure if this can actually happen in practice
though.
This commit is contained in:
Admiral H. Curtiss 2023-03-28 03:57:56 +02:00 committed by JosJuice
parent 1bf593f65a
commit e24e52af3c
1 changed files with 4 additions and 7 deletions

View File

@ -361,16 +361,13 @@ void Jit64::dcbx(UGeckoInstruction inst)
ABI_PushRegistersAndAdjustStack(registersInUse, 0); ABI_PushRegistersAndAdjustStack(registersInUse, 0);
if (make_loop) if (make_loop)
{ {
MOV(32, R(ABI_PARAM2), R(effective_address)); ABI_CallFunctionPRR(JitInterface::InvalidateICacheLinesFromJIT, &m_system.GetJitInterface(),
MOV(32, R(ABI_PARAM3), R(loop_counter)); effective_address, loop_counter);
MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(&m_system.GetJitInterface())));
ABI_CallFunction(JitInterface::InvalidateICacheLinesFromJIT);
} }
else else
{ {
MOV(32, R(ABI_PARAM2), R(effective_address)); ABI_CallFunctionPR(JitInterface::InvalidateICacheLineFromJIT, &m_system.GetJitInterface(),
MOV(64, R(ABI_PARAM1), Imm64(reinterpret_cast<u64>(&m_system.GetJitInterface()))); effective_address);
ABI_CallFunction(JitInterface::InvalidateICacheLineFromJIT);
} }
ABI_PopRegistersAndAdjustStack(registersInUse, 0); ABI_PopRegistersAndAdjustStack(registersInUse, 0);
asm_routines.ResetStack(*this); asm_routines.ResetStack(*this);