mirror of
https://github.com/asmjit/asmjit.git
synced 2025-12-18 13:04:36 +03:00
[BUG] Fixed a macro expansion from wordptr to word_ptr (only rip addressing affected)
This commit is contained in:
@@ -2442,50 +2442,50 @@ ASMJIT_API X86Mem ptr_abs(Ptr p, int32_t disp = 0, uint32_t size = 0) noexcept;
|
||||
ASMJIT_API X86Mem ptr_abs(Ptr p, const X86Reg& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) noexcept;
|
||||
|
||||
//! \internal
|
||||
#define ASMJIT_EXPAND_PTR_REG(_Prefix_, _Size_) \
|
||||
#define ASMJIT_EXPAND_PTR_REG(prefix, size) \
|
||||
/*! Create `[base.reg + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpReg& base, int32_t disp = 0) noexcept { \
|
||||
return X86Mem(base, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpReg& base, int32_t disp = 0) noexcept { \
|
||||
return X86Mem(base, disp, size); \
|
||||
} \
|
||||
/*! Create `[base.reg + (index.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpReg& base, const X86GpReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpReg& base, const X86GpReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[base.reg + (xmm.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpReg& base, const X86XmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpReg& base, const X86XmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[base.reg + (ymm.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpReg& base, const X86YmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpReg& base, const X86YmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[label + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const Label& label, int32_t disp = 0) noexcept { \
|
||||
return ptr(label, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const Label& label, int32_t disp = 0) noexcept { \
|
||||
return ptr(label, disp, size); \
|
||||
} \
|
||||
/*! Create `[label + (index.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const Label& label, const X86GpReg& index, uint32_t shift, int32_t disp = 0) noexcept { \
|
||||
return ptr(label, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const Label& label, const X86GpReg& index, uint32_t shift, int32_t disp = 0) noexcept { \
|
||||
return ptr(label, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[RIP + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##ptr(const X86RipReg& rip_, int32_t disp = 0) noexcept { \
|
||||
return ptr(rip_, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86RipReg& rip_, int32_t disp = 0) noexcept { \
|
||||
return ptr(rip_, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + (index.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, const X86GpReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, const X86GpReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + (xmm.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, const X86XmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, const X86XmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + (ymm.reg << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, const X86YmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, const X86YmmReg& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, index, shift, disp, size); \
|
||||
}
|
||||
|
||||
ASMJIT_EXPAND_PTR_REG(byte, 1)
|
||||
@@ -2528,38 +2528,38 @@ static ASMJIT_INLINE X86Mem ptr(const Label& label, const X86GpVar& index, uint3
|
||||
ASMJIT_API X86Mem ptr_abs(Ptr p, const X86Var& index, uint32_t shift = 0, int32_t disp = 0, uint32_t size = 0) noexcept;
|
||||
|
||||
//! \internal
|
||||
#define ASMJIT_EXPAND_PTR_VAR(_Prefix_, _Size_) \
|
||||
#define ASMJIT_EXPAND_PTR_VAR(prefix, size) \
|
||||
/*! Create `[base.var + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpVar& base, int32_t disp = 0) noexcept { \
|
||||
return X86Mem(base, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpVar& base, int32_t disp = 0) noexcept { \
|
||||
return X86Mem(base, disp, size); \
|
||||
} \
|
||||
/*! Create `[base.var + (index.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpVar& base, const X86GpVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpVar& base, const X86GpVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[base.var + (xmm.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpVar& base, const X86XmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpVar& base, const X86XmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[base.var + (ymm.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const X86GpVar& base, const X86YmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const X86GpVar& base, const X86YmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr(base, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[label + (index.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr(const Label& label, const X86GpVar& index, uint32_t shift, int32_t disp = 0) noexcept { \
|
||||
return ptr(label, index, shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr(const Label& label, const X86GpVar& index, uint32_t shift, int32_t disp = 0) noexcept { \
|
||||
return ptr(label, index, shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + (index.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, const X86GpVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, reinterpret_cast<const X86Var&>(index), shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, const X86GpVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, reinterpret_cast<const X86Var&>(index), shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + (xmm.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, const X86XmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, reinterpret_cast<const X86Var&>(index), shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, const X86XmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, reinterpret_cast<const X86Var&>(index), shift, disp, size); \
|
||||
} \
|
||||
/*! Create `[p + (ymm.var << shift) + disp]` memory operand. */ \
|
||||
static ASMJIT_INLINE X86Mem _Prefix_##_ptr##_abs(Ptr p, const X86YmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, reinterpret_cast<const X86Var&>(index), shift, disp, _Size_); \
|
||||
static ASMJIT_INLINE X86Mem prefix##_ptr##_abs(Ptr p, const X86YmmVar& index, uint32_t shift = 0, int32_t disp = 0) noexcept { \
|
||||
return ptr_abs(p, reinterpret_cast<const X86Var&>(index), shift, disp, size); \
|
||||
}
|
||||
|
||||
ASMJIT_EXPAND_PTR_VAR(byte, 1)
|
||||
|
||||
Reference in New Issue
Block a user