JitRegCache: Add RCOpArg::ExtractWithByteOffset
This commit is contained in:
parent
ae1bd7a6b0
commit
367a0bb672
|
@ -110,6 +110,19 @@ OpArg RCOpArg::Location() const
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
OpArg RCOpArg::ExtractWithByteOffset(int offset)
|
||||||
|
{
|
||||||
|
if (offset == 0)
|
||||||
|
return Location();
|
||||||
|
|
||||||
|
ASSERT(rc);
|
||||||
|
const preg_t preg = std::get<preg_t>(contents);
|
||||||
|
rc->StoreFromRegister(preg, RegCache::FlushMode::MaintainState);
|
||||||
|
OpArg result = rc->GetDefaultLocation(preg);
|
||||||
|
result.AddMemOffset(offset);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
void RCOpArg::Unlock()
|
void RCOpArg::Unlock()
|
||||||
{
|
{
|
||||||
if (const preg_t* preg = std::get_if<preg_t>(&contents))
|
if (const preg_t* preg = std::get_if<preg_t>(&contents))
|
||||||
|
|
|
@ -47,6 +47,9 @@ public:
|
||||||
bool IsSimpleReg(Gen::X64Reg reg) const { return Location().IsSimpleReg(reg); }
|
bool IsSimpleReg(Gen::X64Reg reg) const { return Location().IsSimpleReg(reg); }
|
||||||
Gen::X64Reg GetSimpleReg() const { return Location().GetSimpleReg(); }
|
Gen::X64Reg GetSimpleReg() const { return Location().GetSimpleReg(); }
|
||||||
|
|
||||||
|
// Use to extract bytes from a register using the regcache. offset is in bytes.
|
||||||
|
Gen::OpArg ExtractWithByteOffset(int offset);
|
||||||
|
|
||||||
void Unlock();
|
void Unlock();
|
||||||
|
|
||||||
bool IsImm() const;
|
bool IsImm() const;
|
||||||
|
|
Loading…
Reference in New Issue