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.
This commit is contained in:
degasus 2013-11-21 05:16:58 +01:00
parent 286b6110f1
commit 011fe86d01
2 changed files with 7 additions and 2 deletions

View File

@ -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;

View File

@ -93,7 +93,7 @@ public:
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;
@ -111,6 +111,11 @@ public:
return xregs[xreg].free && !xlocks[xreg];
}
bool IsBound(int preg) const
{
return regs[preg].away && regs[preg].location.IsSimpleReg();
}
X64Reg GetFreeXReg();