Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
jit64: add regcache option IsBound
Lots of x86 instructions are different on memory vs registers.
So to generate code, we often have to check if a ppc register is already bound to a x86 register.
  • Loading branch information
degasus committed Nov 21, 2013
1 parent 286b611 commit 011fe86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.cpp
Expand Up @@ -166,7 +166,7 @@ int RegCache::SanityCheck() const

void RegCache::DiscardRegContentsIfCached(int preg)
{
if (regs[preg].away && regs[preg].location.IsSimpleReg())
if (IsBound(preg))
{
X64Reg xr = regs[preg].location.GetSimpleReg();
xregs[xr].free = true;
Expand Down
7 changes: 6 additions & 1 deletion Source/Core/Core/Src/PowerPC/Jit64/JitRegCache.h
Expand Up @@ -93,7 +93,7 @@ class RegCache
const OpArg &R(int preg) const {return regs[preg].location;}
X64Reg RX(int preg) const
{
if (regs[preg].away && regs[preg].location.IsSimpleReg())
if (IsBound(preg))
return regs[preg].location.GetSimpleReg();
PanicAlert("Not so simple - %i", preg);
return (X64Reg)-1;
Expand All @@ -111,6 +111,11 @@ class RegCache
return xregs[xreg].free && !xlocks[xreg];
}

bool IsBound(int preg) const
{
return regs[preg].away && regs[preg].location.IsSimpleReg();
}


X64Reg GetFreeXReg();

Expand Down

0 comments on commit 011fe86

Please sign in to comment.