mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-24 23:11:14 +01:00
JitRegCache: Add RCOpArg::ExtractWithByteOffset
This commit is contained in:
parent
ae1bd7a6b0
commit
367a0bb672
@ -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 @@ public:
|
||||
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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user