diff options
author | kobalicek <kobalicek.petr@gmail.com> | 2022-10-18 19:43:48 +0300 |
---|---|---|
committer | kobalicek <kobalicek.petr@gmail.com> | 2022-10-18 19:43:48 +0300 |
commit | 8f2c237b8315a7d662e0e67d06807296a7bbe5ab (patch) | |
tree | 82df5eec21dabe5d3cd0094cb4725f1c4d3f5a8d | |
parent | 15a603661871b86c048e697f0e6cd17374dcecc0 (diff) |
Added x86::Mem::cloneResized() to complement cloneAdjusted() and cloneBroadcasted()
-rw-r--r-- | src/asmjit/x86/x86operand.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/asmjit/x86/x86operand.h b/src/asmjit/x86/x86operand.h index e4c3275..8781be1 100644 --- a/src/asmjit/x86/x86operand.h +++ b/src/asmjit/x86/x86operand.h @@ -790,15 +790,23 @@ public: //! Clones the memory operand. inline constexpr Mem clone() const noexcept { return Mem(*this); } - //! Creates a new copy of this memory operand adjusted by `off`. + //! Creates a copy of this memory operand adjusted by `off`. inline Mem cloneAdjusted(int64_t off) const noexcept { Mem result(*this); result.addOffset(off); return result; } - inline constexpr Mem cloneBroadcasted(Broadcast b) const noexcept { - return Mem((_signature & ~Signature{kSignatureMemBroadcastMask}) | Signature::fromValue<kSignatureMemBroadcastMask>(b), _baseId, _data[0], int32_t(_data[1])); + //! Creates a copy of this memory operand resized to `size`. + inline Mem cloneResized(uint32_t size) const noexcept { + Mem result(*this); + result.setSize(size); + return result; + } + + //! Creates a copy of this memory operand with a broadcast `bcst`. + inline constexpr Mem cloneBroadcasted(Broadcast bcst) const noexcept { + return Mem((_signature & ~Signature{kSignatureMemBroadcastMask}) | Signature::fromValue<kSignatureMemBroadcastMask>(bcst), _baseId, _data[0], int32_t(_data[1])); } //! \} |