From c620b113ad2a37290a132f1b3a24be9cb84ec39d Mon Sep 17 00:00:00 2001 From: kobalicek Date: Sun, 7 Jan 2024 21:31:56 +0100 Subject: [PATCH] Added API to set BaseMem base+index types --- src/asmjit/core/operand.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/asmjit/core/operand.h b/src/asmjit/core/operand.h index 723bbb3..d14f9fa 100644 --- a/src/asmjit/core/operand.h +++ b/src/asmjit/core/operand.h @@ -390,8 +390,8 @@ struct OperandSignature { ASMJIT_INLINE_NODEBUG void setRegType(RegType regType) noexcept { setField(uint32_t(regType)); } ASMJIT_INLINE_NODEBUG void setRegGroup(RegGroup regGroup) noexcept { setField(uint32_t(regGroup)); } - ASMJIT_INLINE_NODEBUG void setMemBaseType(RegGroup baseType) noexcept { setField(uint32_t(baseType)); } - ASMJIT_INLINE_NODEBUG void setMemIndexType(RegGroup indexType) noexcept { setField(uint32_t(indexType)); } + ASMJIT_INLINE_NODEBUG void setMemBaseType(RegType baseType) noexcept { setField(uint32_t(baseType)); } + ASMJIT_INLINE_NODEBUG void setMemIndexType(RegType indexType) noexcept { setField(uint32_t(indexType)); } ASMJIT_INLINE_NODEBUG void setPredicate(uint32_t predicate) noexcept { setField(predicate); } ASMJIT_INLINE_NODEBUG void setSize(uint32_t size) noexcept { setField(size); } @@ -1524,8 +1524,13 @@ public: //! Sets the id of the BASE register (without modifying its type). ASMJIT_INLINE_NODEBUG void setBaseId(uint32_t id) noexcept { _baseId = id; } + //! Sets the register type of the BASE register (without modifying its id). + ASMJIT_INLINE_NODEBUG void setBaseType(RegType regType) noexcept { _signature.setMemBaseType(regType); } + //! Sets the id of the INDEX register (without modifying its type). ASMJIT_INLINE_NODEBUG void setIndexId(uint32_t id) noexcept { _data[kDataMemIndexId] = id; } + //! Sets the register type of the INDEX register (without modifying its id). + ASMJIT_INLINE_NODEBUG void setIndexType(RegType regType) noexcept { _signature.setMemIndexType(regType); } //! Sets the base register to type and id of the given `base` operand. ASMJIT_INLINE_NODEBUG void setBase(const BaseReg& base) noexcept { return _setBase(base.type(), base.id()); }