RegCache: merge fpr+gpr StoreFromRegister
This commit is contained in:
parent
fd9bfddde7
commit
9e9b71fa87
|
@ -256,7 +256,7 @@ void GPRRegCache::BindToRegister(int i, bool doLoad, bool makeDirty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GPRRegCache::StoreFromRegister(int i)
|
void RegCache::StoreFromRegister(int i)
|
||||||
{
|
{
|
||||||
if (regs[i].away)
|
if (regs[i].away)
|
||||||
{
|
{
|
||||||
|
@ -276,12 +276,17 @@ void GPRRegCache::StoreFromRegister(int i)
|
||||||
}
|
}
|
||||||
OpArg newLoc = GetDefaultLocation(i);
|
OpArg newLoc = GetDefaultLocation(i);
|
||||||
if (doStore)
|
if (doStore)
|
||||||
emit->MOV(32, newLoc, regs[i].location);
|
StoreRegister(i, newLoc);
|
||||||
regs[i].location = newLoc;
|
regs[i].location = newLoc;
|
||||||
regs[i].away = false;
|
regs[i].away = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GPRRegCache::StoreRegister(int preg, OpArg newLoc)
|
||||||
|
{
|
||||||
|
emit->MOV(32, newLoc, regs[preg].location);
|
||||||
|
}
|
||||||
|
|
||||||
void FPURegCache::BindToRegister(int i, bool doLoad, bool makeDirty)
|
void FPURegCache::BindToRegister(int i, bool doLoad, bool makeDirty)
|
||||||
{
|
{
|
||||||
_assert_msg_(DYNA_REC, !regs[i].location.IsImm(), "WTF - load - imm");
|
_assert_msg_(DYNA_REC, !regs[i].location.IsImm(), "WTF - load - imm");
|
||||||
|
@ -312,22 +317,9 @@ void FPURegCache::BindToRegister(int i, bool doLoad, bool makeDirty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void FPURegCache::StoreFromRegister(int i)
|
void FPURegCache::StoreRegister(int preg, OpArg newLoc)
|
||||||
{
|
{
|
||||||
_assert_msg_(DYNA_REC, !regs[i].location.IsImm(), "WTF - store - imm");
|
emit->MOVAPD(newLoc, regs[preg].location.GetSimpleReg());
|
||||||
if (regs[i].away)
|
|
||||||
{
|
|
||||||
X64Reg xr = regs[i].location.GetSimpleReg();
|
|
||||||
_assert_msg_(DYNA_REC, xr < xregs.size(), "WTF - store - invalid reg");
|
|
||||||
OpArg newLoc = GetDefaultLocation(i);
|
|
||||||
if (xregs[xr].dirty)
|
|
||||||
emit->MOVAPD(newLoc, xr);
|
|
||||||
xregs[xr].free = true;
|
|
||||||
xregs[xr].dirty = false;
|
|
||||||
xregs[xr].ppcReg = -1;
|
|
||||||
regs[i].location = newLoc;
|
|
||||||
regs[i].away = false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RegCache::Flush()
|
void RegCache::Flush()
|
||||||
|
|
|
@ -71,7 +71,8 @@ public:
|
||||||
//TODO - instead of doload, use "read", "write"
|
//TODO - instead of doload, use "read", "write"
|
||||||
//read only will not set dirty flag
|
//read only will not set dirty flag
|
||||||
virtual void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true) = 0;
|
virtual void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true) = 0;
|
||||||
virtual void StoreFromRegister(int preg) = 0;
|
void StoreFromRegister(int preg);
|
||||||
|
virtual void StoreRegister(int preg, OpArg newLoc) = 0;
|
||||||
|
|
||||||
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
|
||||||
|
@ -107,7 +108,7 @@ class GPRRegCache : public RegCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true) override;
|
void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true) override;
|
||||||
void StoreFromRegister(int preg) override;
|
void StoreRegister(int preg, OpArg newLoc) override;
|
||||||
OpArg GetDefaultLocation(int reg) const override;
|
OpArg GetDefaultLocation(int reg) const override;
|
||||||
const int *GetAllocationOrder(int &count) override;
|
const int *GetAllocationOrder(int &count) override;
|
||||||
void SetImmediate32(int preg, u32 immValue);
|
void SetImmediate32(int preg, u32 immValue);
|
||||||
|
@ -118,7 +119,7 @@ class FPURegCache : public RegCache
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true) override;
|
void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true) override;
|
||||||
void StoreFromRegister(int preg) override;
|
void StoreRegister(int preg, OpArg newLoc) override;
|
||||||
const int *GetAllocationOrder(int &count) override;
|
const int *GetAllocationOrder(int &count) override;
|
||||||
OpArg GetDefaultLocation(int reg) const override;
|
OpArg GetDefaultLocation(int reg) const override;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue