JitRegCache: Add RegistersInUse

This commit is contained in:
MerryMage 2018-10-15 21:02:20 +01:00
parent 096392f295
commit 08c41090b2
3 changed files with 14 additions and 9 deletions

View File

@ -967,15 +967,8 @@ BitSet8 Jit64::ComputeStaticGQRs(const PPCAnalyst::CodeBlock& cb) const
BitSet32 Jit64::CallerSavedRegistersInUse() const
{
BitSet32 result;
for (size_t i = 0; i < NUM_XREGS; i++)
{
if (!gpr.IsFreeX(i))
result[i] = true;
if (!fpr.IsFreeX(i))
result[16 + i] = true;
}
return result & ABI_ALL_CALLER_SAVED;
BitSet32 in_use = gpr.RegistersInUse() | (fpr.RegistersInUse() << 16);
return in_use & ABI_ALL_CALLER_SAVED;
}
void Jit64::EnableBlockLink()

View File

@ -677,6 +677,17 @@ void RegCache::PreloadRegisters(BitSet32 to_preload)
}
}
BitSet32 RegCache::RegistersInUse() const
{
BitSet32 result;
for (size_t i = 0; i < m_xregs.size(); i++)
{
if (!m_xregs[i].IsFree())
result[i] = true;
}
return result;
}
void RegCache::NewLock(preg_t preg)
{
m_regs[preg].Lock();

View File

@ -247,6 +247,7 @@ public:
bool IsAllUnlocked() const;
void PreloadRegisters(BitSet32 regs);
BitSet32 RegistersInUse() const;
protected:
friend class RCOpArg;