diff --git a/src/dynarmic/backend/arm64/reg_alloc.cpp b/src/dynarmic/backend/arm64/reg_alloc.cpp index 3cc12d4c..4b5906d2 100644 --- a/src/dynarmic/backend/arm64/reg_alloc.cpp +++ b/src/dynarmic/backend/arm64/reg_alloc.cpp @@ -71,6 +71,10 @@ IR::AccType Argument::GetImmediateAccType() const { return value.GetAccType(); } +HostLoc::Kind Argument::CurrentLocationKind() const { + return reg_alloc.ValueLocation(value.GetInst())->kind; +} + bool HostLocInfo::Contains(const IR::Inst* value) const { return std::find(values.begin(), values.end(), value) != values.end(); } diff --git a/src/dynarmic/backend/arm64/reg_alloc.h b/src/dynarmic/backend/arm64/reg_alloc.h index 864d8f56..dd2c2c65 100644 --- a/src/dynarmic/backend/arm64/reg_alloc.h +++ b/src/dynarmic/backend/arm64/reg_alloc.h @@ -50,6 +50,11 @@ public: IR::Cond GetImmediateCond() const; IR::AccType GetImmediateAccType() const; + // Only valid if not immediate + HostLoc::Kind CurrentLocationKind() const; + bool IsInGpr() const { return !IsImmediate() && CurrentLocationKind() == HostLoc::Kind::Gpr; } + bool IsInFpr() const { return !IsImmediate() && CurrentLocationKind() == HostLoc::Kind::Fpr; } + private: friend class RegAlloc; explicit Argument(RegAlloc& reg_alloc) @@ -218,6 +223,7 @@ public: void AssertNoMoreUses() const; private: + friend struct Argument; template friend struct RAReg;