mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 22:49:00 +01:00
JitArm64: Optimize Arm64GPRCache::FlushRegisters/FlushCRRegisters
This way, the number of loop iterations is equal to the number of set bits in the bitset rather than the number of bits in the bitset, which is a good improvement because usually very few bits are set.
This commit is contained in:
parent
2ea95f5835
commit
6a9f565ac4
@ -241,9 +241,7 @@ void Arm64GPRCache::FlushRegister(size_t index, bool maintain_state, ARM64Reg tm
|
||||
|
||||
void Arm64GPRCache::FlushRegisters(BitSet32 regs, bool maintain_state, ARM64Reg tmp_reg)
|
||||
{
|
||||
for (size_t i = 0; i < GUEST_GPR_COUNT; ++i)
|
||||
{
|
||||
if (regs[i])
|
||||
for (int i : regs)
|
||||
{
|
||||
ASSERT_MSG(DYNA_REC, m_guest_registers[GUEST_GPR_OFFSET + i].GetType() != RegType::Discarded,
|
||||
"Attempted to flush discarded register");
|
||||
@ -278,13 +276,10 @@ void Arm64GPRCache::FlushRegisters(BitSet32 regs, bool maintain_state, ARM64Reg
|
||||
FlushRegister(GUEST_GPR_OFFSET + i, maintain_state, tmp_reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Arm64GPRCache::FlushCRRegisters(BitSet8 regs, bool maintain_state, ARM64Reg tmp_reg)
|
||||
{
|
||||
for (size_t i = 0; i < GUEST_CR_COUNT; ++i)
|
||||
{
|
||||
if (regs[i])
|
||||
for (int i : regs)
|
||||
{
|
||||
ASSERT_MSG(DYNA_REC, m_guest_registers[GUEST_CR_OFFSET + i].GetType() != RegType::Discarded,
|
||||
"Attempted to flush discarded register");
|
||||
@ -292,7 +287,6 @@ void Arm64GPRCache::FlushCRRegisters(BitSet8 regs, bool maintain_state, ARM64Reg
|
||||
FlushRegister(GUEST_CR_OFFSET + i, maintain_state, tmp_reg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Arm64GPRCache::Flush(FlushMode mode, ARM64Reg tmp_reg)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user