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 asmjit::x86::Vec

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::fromTypeAndId(
RegType type,
uint32_t id
)constexprstaticnoexcept[¶]

Creates a new register from register type and id.

OperandSignature Reg::baseSignature() constconstexprnoexcept[¶]

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::hasBaseSignature(
uint32_t signature
) constconstexprnoexcept[1/3][¶]

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

bool Reg::hasBaseSignature(
const OperandSignature& signature
) constconstexprnoexcept[2/3][¶]

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

bool Reg::hasBaseSignature(
const Reg& other
) constconstexprnoexcept[3/3][¶]

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

RegType Reg::regType() constconstexprnoexcept[¶]

Returns the type of the register.

RegGroup Reg::regGroup() constconstexprnoexcept[¶]

Returns the group this register belongs to.

bool Reg::isSame(
const Reg& other
) constconstexprnoexcept[¶]

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 isSame() should give the same answer, however, if any of these two contains garbage or other metadata in the upper 8 bytes then isSame() may return true in cases in which equals() returns false.

bool Reg::isValid() constconstexprnoexcept[¶]

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

bool Reg::isPhysReg() constconstexprnoexcept[¶]

Tests whether this is a physical register.

bool Reg::isVirtReg() constconstexprnoexcept[¶]

Tests whether this is a virtual register.

bool Reg::isReg(
RegType regType
) constconstexprnoexcept[1/9][¶]

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

bool Reg::isReg(
RegType regType,
uint32_t regId
) constconstexprnoexcept[2/9][¶]

Tests whether the register is of the given register type regType having the given id regId.

bool Reg::isReg(
RegGroup regGroup
) constconstexprnoexcept[3/9][¶]

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

bool Reg::isReg(
RegGroup regGroup,
uint32_t regId
) constconstexprnoexcept[4/9][¶]

Tests whether the register is of the given register group regGroup having the given id regId.

bool Reg::isPc() constconstexprnoexcept[¶]

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

bool Reg::isGp() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isGp8() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp8(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isGp8Lo() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp8Lo(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isGp8Hi() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp8Hi(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isGp16() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp16(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isGp32() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp32(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isGp64() constconstexprnoexcept[1/2][¶]

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

bool Reg::isGp64(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec8() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec8(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec16() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec16(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec32() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec32(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec64() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec64(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec128() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec128(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec256() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec256(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isVec512() constconstexprnoexcept[1/2][¶]

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

bool Reg::isVec512(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isMaskReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isMaskReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isKReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isKReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isTileReg() constconstexprnoexcept[1/2][¶]

Tests whether the register is a tile register.

bool Reg::isTileReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isTmmReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isTmmReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isSegmentReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isSegmentReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isControlReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isControlReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isDebugReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isDebugReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isMmReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isMmReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isStReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isStReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::isBndReg() constconstexprnoexcept[1/2][¶]

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

bool Reg::isBndReg(
uint32_t regId
) constconstexprnoexcept[2/2][¶]

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

bool Reg::hasSize() constconstexprnoexcept[1/2][¶]

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

bool Reg::hasSize(
uint32_t s
) constconstexprnoexcept[2/2][¶]

Tests whether the register size matches size s.

uint32_t Reg::size() constconstexprnoexcept[¶]

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() constconstexprnoexcept[¶]

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::setPredicate(
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::resetPredicate()constexprnoexcept[¶]

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

Reg Reg::clone() constconstexprnoexcept[¶]

Clones the register operand.

template<typename RegT>
RegT Reg::cloneAs() constconstexprnoexcept[1/2][¶]

Casts this register to RegT by also changing its signature.

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

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

Casts this register to other by also changing its signature.

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

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

Sets the register id to id.

template<typename RegT>
void Reg::setSignatureT()constexprnoexcept[¶]

Sets a 32-bit operand signature based on traits of RegT.

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

Sets the register signature and id.

bool Operand_::isReg() constconstexprnoexcept[5/9][¶]

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

bool Operand_::isReg(
RegType regType
) constconstexprnoexcept[6/9][¶]

Tests whether the operand is a register matching the given register type.

bool Operand_::isReg(
RegType regType,
uint32_t regId
) constconstexprnoexcept[7/9][¶]

Tests whether the operand is register and of register type regType and regId.

bool Operand_::isReg(
RegGroup regGroup
) constconstexprnoexcept[8/9][¶]

Tests whether the operand is a register of the provided register group regGroup.

bool Operand_::isReg(
RegGroup regGroup,
uint32_t regId
) constconstexprnoexcept[9/9][¶]

Tests whether the operand is register and of register group regGroup and regId.

uint32_t Reg::kIdBad = 0xFFuconstexprstatic[¶]

None or any register (mostly internal).

uint32_t Reg::kBaseSignatureMaskconstexprstatic[¶]

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