Merge pull request #9213 from JosJuice/flush-ternary

Simplify Arm64GPRCache::Flush
This commit is contained in:
LC 2020-11-02 02:32:04 -05:00 committed by GitHub
commit c3bc079c81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 14 deletions

View File

@ -239,20 +239,7 @@ void Arm64GPRCache::FlushCRRegisters(BitSet32 regs, bool maintain_state)
void Arm64GPRCache::Flush(FlushMode mode, PPCAnalyst::CodeOp* op) void Arm64GPRCache::Flush(FlushMode mode, PPCAnalyst::CodeOp* op)
{ {
BitSet32 to_flush; FlushRegisters(BitSet32(~0U), mode == FLUSH_MAINTAIN_STATE);
for (size_t i = 0; i < GUEST_GPR_COUNT; ++i)
{
bool flush = true;
if (m_guest_registers[i].GetType() == REG_REG)
{
// Has to be flushed if it isn't in a callee saved register
ARM64Reg host_reg = m_guest_registers[i].GetReg();
flush = IsCalleeSaved(host_reg) ? flush : true;
}
to_flush[i] = flush;
}
FlushRegisters(to_flush, mode == FLUSH_MAINTAIN_STATE);
FlushCRRegisters(BitSet32(~0U), mode == FLUSH_MAINTAIN_STATE); FlushCRRegisters(BitSet32(~0U), mode == FLUSH_MAINTAIN_STATE);
} }