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:
parent
286b6110f1
commit
011fe86d01
|
@ -166,7 +166,7 @@ int RegCache::SanityCheck() const
|
||||||
|
|
||||||
void RegCache::DiscardRegContentsIfCached(int preg)
|
void RegCache::DiscardRegContentsIfCached(int preg)
|
||||||
{
|
{
|
||||||
if (regs[preg].away && regs[preg].location.IsSimpleReg())
|
if (IsBound(preg))
|
||||||
{
|
{
|
||||||
X64Reg xr = regs[preg].location.GetSimpleReg();
|
X64Reg xr = regs[preg].location.GetSimpleReg();
|
||||||
xregs[xr].free = true;
|
xregs[xr].free = true;
|
||||||
|
|
|
@ -93,7 +93,7 @@ public:
|
||||||
const OpArg &R(int preg) const {return regs[preg].location;}
|
const OpArg &R(int preg) const {return regs[preg].location;}
|
||||||
X64Reg RX(int preg) const
|
X64Reg RX(int preg) const
|
||||||
{
|
{
|
||||||
if (regs[preg].away && regs[preg].location.IsSimpleReg())
|
if (IsBound(preg))
|
||||||
return regs[preg].location.GetSimpleReg();
|
return regs[preg].location.GetSimpleReg();
|
||||||
PanicAlert("Not so simple - %i", preg);
|
PanicAlert("Not so simple - %i", preg);
|
||||||
return (X64Reg)-1;
|
return (X64Reg)-1;
|
||||||
|
@ -111,6 +111,11 @@ public:
|
||||||
return xregs[xreg].free && !xlocks[xreg];
|
return xregs[xreg].free && !xlocks[xreg];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsBound(int preg) const
|
||||||
|
{
|
||||||
|
return regs[preg].away && regs[preg].location.IsSimpleReg();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
X64Reg GetFreeXReg();
|
X64Reg GetFreeXReg();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue