Permalink
Browse files

JitRegCache: Add RegistersInUse

  • Loading branch information...
MerryMage committed Oct 15, 2018
1 parent 096392f commit 08c41090b22d393166d19f95cb33ddfe57622ac7
@@ -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()
@@ -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();
@@ -247,6 +247,7 @@ class RegCache
bool IsAllUnlocked() const;

void PreloadRegisters(BitSet32 regs);
BitSet32 RegistersInUse() const;

protected:
friend class RCOpArg;

0 comments on commit 08c4109

Please sign in to comment.