mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
CPU/Recompiler: Use register pairs for pop callee saved too
This commit is contained in:
parent
11c25c68c5
commit
7a82cae2bd
|
@ -356,11 +356,30 @@ u32 RegisterCache::PopCalleeSavedRegisters(bool commit)
|
||||||
DebugAssert((m_state.host_reg_state[reg] & (HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated)) ==
|
DebugAssert((m_state.host_reg_state[reg] & (HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated)) ==
|
||||||
(HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated));
|
(HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated));
|
||||||
|
|
||||||
m_code_generator.EmitPopHostReg(reg, i - 1);
|
if (i > 1)
|
||||||
if (commit)
|
{
|
||||||
m_state.host_reg_state[reg] &= ~HostRegState::CalleeSavedAllocated;
|
const HostReg reg2 = m_state.callee_saved_order[i - 2];
|
||||||
count++;
|
DebugAssert((m_state.host_reg_state[reg2] & (HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated)) ==
|
||||||
i--;
|
(HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated));
|
||||||
|
|
||||||
|
m_code_generator.EmitPopHostRegPair(reg2, reg, i - 1);
|
||||||
|
i -= 2;
|
||||||
|
count += 2;
|
||||||
|
|
||||||
|
if (commit)
|
||||||
|
{
|
||||||
|
m_state.host_reg_state[reg] &= ~HostRegState::CalleeSavedAllocated;
|
||||||
|
m_state.host_reg_state[reg2] &= ~HostRegState::CalleeSavedAllocated;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_code_generator.EmitPopHostReg(reg, i - 1);
|
||||||
|
if (commit)
|
||||||
|
m_state.host_reg_state[reg] &= ~HostRegState::CalleeSavedAllocated;
|
||||||
|
count++;
|
||||||
|
i--;
|
||||||
|
}
|
||||||
} while (i > 0);
|
} while (i > 0);
|
||||||
if (commit)
|
if (commit)
|
||||||
m_state.callee_saved_order_count = 0;
|
m_state.callee_saved_order_count = 0;
|
||||||
|
|
Loading…
Reference in a new issue