IndexAssemblerasmjit::Reg

asmjit::Reg Class Reference [¶]

Inheritance diagram for asmjit::Reg:
asmjit::Operand asmjit::Operand_ asmjit::UniGp asmjit::UniVec asmjit::x86::Bnd asmjit::x86::CReg asmjit::x86::DReg asmjit::x86::KReg asmjit::x86::Mm asmjit::x86::Rip asmjit::x86::SReg asmjit::x86::St asmjit::x86::Tmm

Unified physical or virtual register operand.

Member Functions

Overloaded Operators

Signature Accessors

Register Accessors

Public Member Functions inherited from asmjit::Operand
Public Member Functions inherited from asmjit::Operand_

Constants

Construction & Destruction

Additional Inherited Members

Public Attributes inherited from asmjit::Operand_
Static Public Attributes inherited from asmjit::Operand_
Public Types inherited from asmjit::Operand_
Static Public Member Functions inherited from asmjit::Operand_

Reg::Reg()constexprnoexcept[1/4][¶]

Creates a dummy register operand.

Reg::Reg(
const Reg& other
)constexprnoexcept[2/4][¶]

Creates a new register operand which is the same as other .

Reg::Reg(
const Reg& other,
uint32_t id
)constexprnoexcept[3/4][¶]

Creates a new register operand compatible with other, but with a different id.

Reg::Reg(
const Signature& signature,
uint32_t id
)constexprnoexcept[4/4][¶]

Creates a register initialized to the given signature and id.

Reg Reg::from_type_and_id(
RegType type,
uint32_t id
)constexprstaticnoexcept[¶]

Creates a new register from register type and id.

OperandSignature Reg::base_signature() constnodiscardconstexprnoexcept[¶]

Returns base signature of the register associated with each register type.

Base signature only contains the operand type, register type, register group, and register size. It doesn't contain element type, predicate, or other architecture-specific data. Base signature is a signature that is provided by RegTraits.

bool Reg::has_base_signature(
uint32_t signature
) constnodiscardconstexprnoexcept[1/3][¶]

Tests whether the operand's base signature matches the given signature signature.

bool Reg::has_base_signature(
const OperandSignature& signature
) constnodiscardconstexprnoexcept[2/3][¶]

Tests whether the operand's base signature matches the given signature signature.

bool Reg::has_base_signature(
const Reg& other
) constnodiscardconstexprnoexcept[3/3][¶]

Tests whether the operand's base signature matches the base signature of the other operand.

RegType Reg::reg_type() constnodiscardconstexprnoexcept[¶]

Returns the type of the register.

RegGroup Reg::reg_group() constnodiscardconstexprnoexcept[¶]

Returns the group this register belongs to.

bool Reg::is_same(
const Reg& other
) constnodiscardconstexprnoexcept[¶]

Tests whether this register is the same as other.

This is just an optimization. Registers by default only use the first 8 bytes of Operand data, so this method takes advantage of this knowledge and only compares these 8 bytes. If both operands were created correctly both equals() and is_same() should give the same answer, however, if any of these two contains garbage or other metadata in the upper 8 bytes then is_same() may return true in cases in which equals() returns false.

bool Reg::is_valid() constnodiscardconstexprnoexcept[¶]

Tests whether the register is valid (either virtual or physical).

bool Reg::is_phys_reg() constnodiscardconstexprnoexcept[¶]

Tests whether this is a physical register.

bool Reg::is_virt_reg() constnodiscardconstexprnoexcept[¶]

Tests whether this is a virtual register.

bool Reg::is_reg(
RegType reg_type
) constnodiscardconstexprnoexcept[1/5][¶]

Tests whether the register is of the given register type reg_type.

bool Reg::is_reg(
RegType reg_type,
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/5][¶]

Tests whether the register is of the given register type reg_type having the given id reg_id.

bool Reg::is_reg(
RegGroup reg_group
) constnodiscardconstexprnoexcept[3/5][¶]

Tests whether the register is of the given register group reg_group.

bool Reg::is_reg(
RegGroup reg_group,
uint32_t reg_id
) constnodiscardconstexprnoexcept[4/5][¶]

Tests whether the register is of the given register group reg_group having the given id reg_id.

bool Reg::is_pc() constnodiscardconstexprnoexcept[¶]

Tests whether the operand is a general purpose register of any type.

bool Reg::is_gp() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a general purpose register of any type.

bool Reg::is_gp(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a general purpose register of any type having the given id reg_id.

bool Reg::is_gp8() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is an 8-bit low or high general purpose register (X86|X86_64).

bool Reg::is_gp8(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is an 8-bit low or high general purpose register having the given id reg_id (X86|X86_64).

bool Reg::is_gp8_lo() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is an 8-bit low general purpose register (X86|X86_64).

bool Reg::is_gp8_lo(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is an 8-bit low general purpose register having the given id reg_id (X86|X86_64).

bool Reg::is_gp8_hi() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is an 8-bit high general purpose register (X86|X86_64 only - AH, BH, CH, DH).

bool Reg::is_gp8_hi(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is an 8-bit high general purpose register having the given id reg_id (X86|X86_64).

bool Reg::is_gp16() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 16-bit general purpose register (X86|X86_64).

bool Reg::is_gp16(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 16-bit general purpose register having the given id reg_id (X86|X86_64).

bool Reg::is_gp32() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 32-bit general purpose register.

bool Reg::is_gp32(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 32-bit general purpose register having the given id reg_id.

bool Reg::is_gp64() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 64-bit general purpose register.

bool Reg::is_gp64(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 64-bit general purpose register having the given id reg_id.

bool Reg::is_vec() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a vector register of any size.

bool Reg::is_vec(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a vector register of any size having the given id reg_id.

bool Reg::is_vec8() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is an 8-bit vector register or view (AArch64).

bool Reg::is_vec8(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is an 8-bit vector register or view having the given id reg_id (AArch64).

bool Reg::is_vec16() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 16-bit vector register or view (AArch64).

bool Reg::is_vec16(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 16-bit vector register or view having the given id reg_id (AArch64).

bool Reg::is_vec32() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 32-bit vector register or view (AArch32, AArch64).

bool Reg::is_vec32(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 32-bit vector register or view having the given id reg_id (AArch32/AArch64).

bool Reg::is_vec64() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 64-bit vector register or view (AArch32/AArch64).

bool Reg::is_vec64(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 64-bit vector register or view having the given id reg_id (AArch32/AArch64).

bool Reg::is_vec128() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 128-bit vector register or view (X86|X86_64/AArch32/AArch64).

bool Reg::is_vec128(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 128-bit vector register or view having the given id reg_id (X86|X86_64/AArch32/AArch64).

bool Reg::is_vec256() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 256-bit vector register or view (X86|X86_64).

bool Reg::is_vec256(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 256-bit vector register or view having the given id reg_id (X86|X86_64).

bool Reg::is_vec512() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a 512-bit vector register or view (X86|X86_64).

bool Reg::is_vec512(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a 512-bit vector register or view having the given id reg_id (X86|X86_64).

bool Reg::is_mask_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a mask register of any size.

bool Reg::is_mask_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a mask register of any size having the given id reg_id (X86|X86_64/AArch64).

bool Reg::is_kreg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a mask register (K register on X86|X86_64) - alias of is_mask_reg().

bool Reg::is_kreg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a mask register (K register on X86|X86_64) of any size having the given id reg_id (X86|X86_64/AArch64).

bool Reg::is_tile_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a tile register.

bool Reg::is_tile_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a tile register of the given id reg_id.

bool Reg::is_tmm_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a tile register (TMM register on X86_64) - alias of is_tile_reg().

bool Reg::is_tmm_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a tile register (TMM register on X86_64) of the given id reg_id - alias of is_tile_reg().

bool Reg::is_segment_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a segment register (X86|X86_64).

bool Reg::is_segment_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a segment register having the given id reg_id (X86|X86_64).

bool Reg::is_control_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a control register (X86|X86_64).

bool Reg::is_control_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a control register having the given id reg_id (X86|X86_64).

bool Reg::is_debug_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a debug register (X86|X86_64).

bool Reg::is_debug_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a debug register of the given id reg_id (X86|X86_64).

bool Reg::is_mm_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is an MMX register (X86|X64).

bool Reg::is_mm_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is an MMX register of the given id reg_id (X86|X64).

bool Reg::is_st_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is an FPU register (ST register on X86|X86_64) (X86|X64).

bool Reg::is_st_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is an FPU register (ST register on X86|X86_64) of the given id reg_id (X86|X64).

bool Reg::is_bnd_reg() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register is a BND register (X86|X64).

bool Reg::is_bnd_reg(
uint32_t reg_id
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register is a BND register of the given id reg_id (X86|X64).

bool Reg::has_size() constnodiscardconstexprnoexcept[1/2][¶]

Tests whether the register specifies a size (i.e. the size is not zero).

bool Reg::has_size(
uint32_t s
) constnodiscardconstexprnoexcept[2/2][¶]

Tests whether the register size matches size s.

uint32_t Reg::size() constnodiscardconstexprnoexcept[¶]

Returns the size of the register in bytes. If the register size depends on architecture (like x86::CReg and x86::DReg) the size returned should be the greatest possible (so it should return 64-bit size in such case).

uint32_t Reg::predicate() constnodiscardconstexprnoexcept[¶]

Returns operation predicate of the register (ARM/AArch64).

The meaning depends on architecture, for example on ARM hardware this describes arm::ShiftOp of the register.

void Reg::set_predicate(
uint32_t predicate
)constexprnoexcept[¶]

Sets operation predicate of the register to predicate (ARM/AArch64).

The meaning depends on architecture, for example on ARM hardware this describes arm::ShiftOp of the register.

void Reg::reset_predicate()constexprnoexcept[¶]

Resets shift operation type of the register to the default value (ARM/AArch64).

Reg Reg::clone() constnodiscardconstexprnoexcept[¶]

Clones the register operand.

template<typename RegT>
RegT Reg::clone_as() constnodiscardconstexprnoexcept[1/2][¶]

Casts this register to RegT by also changing its signature.

Note

Improper use of clone_as() can lead to hard-to-debug errors.

template<typename RegT>
RegT Reg::clone_as(
const RegT& other
) constnodiscardconstexprnoexcept[2/2][¶]

Casts this register to other by also changing its signature.

Note

Improper use of clone_as() can lead to hard-to-debug errors.

void Reg::set_id(
uint32_t id
)constexprnoexcept[¶]

Sets the register id to id.

void Reg::set_signature_and_id(
const OperandSignature& signature,
uint32_t id
)constexprnoexcept[¶]

Sets the register signature and id.

bool Operand_::is_reg() constnodiscardconstexprnoexcept[5/5][¶]

Tests whether the operand is a register (OperandType::kReg).

uint32_t Reg::kIdBad = 0xFFustaticconstexpr[¶]

None or any register (mostly internal).

uint32_t Reg::kBaseSignatureMaskstaticconstexpr[¶]

Initial value:
=
Signature::kOpTypeMask |
Signature::kRegTypeMask |
Signature::kRegGroupMask |
Signature::kSizeMask