CPU/Recompiler: Use register pairs for pop callee saved too

This commit is contained in:
Connor McLaughlin 2020-10-19 00:13:08 +10:00
parent 11c25c68c5
commit 7a82cae2bd
1 changed files with 24 additions and 5 deletions

View File

@ -356,11 +356,30 @@ u32 RegisterCache::PopCalleeSavedRegisters(bool commit)
DebugAssert((m_state.host_reg_state[reg] & (HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated)) ==
(HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated));
m_code_generator.EmitPopHostReg(reg, i - 1);
if (commit)
m_state.host_reg_state[reg] &= ~HostRegState::CalleeSavedAllocated;
count++;
i--;
if (i > 1)
{
const HostReg reg2 = m_state.callee_saved_order[i - 2];
DebugAssert((m_state.host_reg_state[reg2] & (HostRegState::CalleeSaved | HostRegState::CalleeSavedAllocated)) ==
(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);
if (commit)
m_state.callee_saved_order_count = 0;