Skip to content

Commit

Permalink
JitRegCache: Add RCOpArg::ExtractWithByteOffset
Browse files Browse the repository at this point in the history
  • Loading branch information
MerryMage committed Oct 28, 2018
1 parent ae1bd7a commit 367a0bb
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp
Expand Up @@ -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))
Expand Down
3 changes: 3 additions & 0 deletions Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.h
Expand Up @@ -47,6 +47,9 @@ class RCOpArg
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;
Expand Down

0 comments on commit 367a0bb

Please sign in to comment.