mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 21:14:35 +03:00
Added x86::Mem::cloneResized() to complement cloneAdjusted() and cloneBroadcasted()
This commit is contained in:
@@ -790,15 +790,23 @@ public:
|
|||||||
//! Clones the memory operand.
|
//! Clones the memory operand.
|
||||||
inline constexpr Mem clone() const noexcept { return Mem(*this); }
|
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 {
|
inline Mem cloneAdjusted(int64_t off) const noexcept {
|
||||||
Mem result(*this);
|
Mem result(*this);
|
||||||
result.addOffset(off);
|
result.addOffset(off);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline constexpr Mem cloneBroadcasted(Broadcast b) const noexcept {
|
//! Creates a copy of this memory operand resized to `size`.
|
||||||
return Mem((_signature & ~Signature{kSignatureMemBroadcastMask}) | Signature::fromValue<kSignatureMemBroadcastMask>(b), _baseId, _data[0], int32_t(_data[1]));
|
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]));
|
||||||
}
|
}
|
||||||
|
|
||||||
//! \}
|
//! \}
|
||||||
|
|||||||
Reference in New Issue
Block a user