Permalink
Browse files

JitRegCache: Add RCOpArg::ExtractWithByteOffset

  • Loading branch information...
MerryMage committed Oct 15, 2018
1 parent ae1bd7a commit 367a0bb672807927e22aadac9d4fa8c96c3b922e
@@ -110,6 +110,19 @@ OpArg RCOpArg::Location() const
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()
{
if (const preg_t* preg = std::get_if<preg_t>(&contents))
@@ -47,6 +47,9 @@ class RCOpArg
bool IsSimpleReg(Gen::X64Reg reg) const { return Location().IsSimpleReg(reg); }
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();
bool IsImm() const;

0 comments on commit 367a0bb

Please sign in to comment.