asmjit::BaseReg Class Reference

Physical or virtual register operand.

Static Public Attributes

Public Types

- Public Types inherited from asmjit::Operand_

Member Functions

Construction & Destruction
Overloaded Operators
Accessors
- Public Member Functions inherited from asmjit::Operand
- Public Member Functions inherited from asmjit::Operand_

Static Functions

Static Functions
- Static Public Member Functions inherited from asmjit::Operand_

Additional Inherited Members

- Public Attributes inherited from asmjit::Operand_

Member Enumeration Documentation

BaseReg::RegType : uint32_tenum

Architecture neutral register types.

These must be reused by any platform that contains that types. All GP and VEC registers are also allowed by design to be part of a BASE|INDEX of a memory operand.

ConstantDescription
kTypeNone 

No register - unused, invalid, multiple meanings.

kTypeGp8Lo 

8-bit low general purpose register (X86).

kTypeGp8Hi 

8-bit high general purpose register (X86).

kTypeGp16 

16-bit general purpose register (X86).

kTypeGp32 

32-bit general purpose register (X86|ARM).

kTypeGp64 

64-bit general purpose register (X86|ARM).

kTypeVec32 

32-bit view of a vector register (ARM).

kTypeVec64 

64-bit view of a vector register (ARM).

kTypeVec128 

128-bit view of a vector register (X86|ARM).

kTypeVec256 

256-bit view of a vector register (X86).

kTypeVec512 

512-bit view of a vector register (X86).

kTypeVec1024 

1024-bit view of a vector register (future).

kTypeOther0 

Other0 register, should match kOther0 group.

kTypeOther1 

Other1 register, should match kOther1 group.

kTypeIP 

Universal id of IP/PC register (if separate).

kTypeCustom 

Start of platform dependent register types (must be honored).

kTypeMax 

Maximum possible register type value.

BaseReg::RegGroup : uint32_tenum

Register group (architecture neutral), and some limits.

ConstantDescription
kGroupGp 

General purpose register group compatible with all backends.

kGroupVec 

Vector register group compatible with all backends.

kGroupOther0 

Group that is architecture dependent.

kGroupOther1 

Group that is architecture dependent.

kGroupVirt 

Count of register groups used by virtual registers.

kGroupCount 

Count of register groups used by physical registers.

BaseReg::Id : uint32_tenum

ConstantDescription
kIdBad 

None or any register (mostly internal).

Constructor & Destructor Documentation

BaseReg::BaseReg()constexprconstexprnoexcept[1/4]

Creates a dummy register operand.

BaseReg::BaseReg(const BaseReg& other)constexprconstexprnoexcept[2/4]

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

BaseReg::BaseReg(const BaseReg& other, uint32_t rId)constexprconstexprnoexcept[3/4]

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

BaseReg::BaseReg(uint32_t signature, uint32_t rId)constexprconstexprnoexcept[4/4]

Creates a register initialized to signature and rId.

Member Function Documentation

bool BaseReg::isSame(const BaseReg& other) constconstexprconstexprnoexcept

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 BaseReg::isValid() constconstexprconstexprnoexcept

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

bool BaseReg::isPhysReg() constconstexprconstexprnoexcept

Tests whether this is a physical register.

bool BaseReg::isVirtReg() constconstexprconstexprnoexcept

Tests whether this is a virtual register.

bool BaseReg::isType(uint32_t type) constconstexprconstexprnoexcept

Tests whether the register type matches type - same as isReg(type), provided for convenience.

bool BaseReg::isGroup(uint32_t group) constconstexprconstexprnoexcept

Tests whether the register group matches group.

bool BaseReg::isGp() constconstexprconstexprnoexcept[1/3]

Tests whether the register is a general purpose register (any size).

bool BaseReg::isVec() constconstexprconstexprnoexcept[1/3]

Tests whether the register is a vector register.

bool BaseReg::isReg(uint32_t rType) constconstexprconstexprnoexcept[1/5]

Same as isType(), provided for convenience.

bool BaseReg::isReg(uint32_t rType, uint32_t rId) constconstexprconstexprnoexcept[2/5]

Tests whether the register type matches type and register id matches rId.

uint32_t BaseReg::type() constconstexprconstexprnoexcept

Returns the type of the register.

uint32_t BaseReg::group() constconstexprconstexprnoexcept

Returns the register group.

BaseReg BaseReg::clone() constconstexprconstexprnoexcept

Clones the register operand.

template<typename RegT>
RegT BaseReg::cloneAs() constconstexprconstexprnoexcept[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 BaseReg::cloneAs(const RegT& other) constconstexprconstexprnoexcept[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 BaseReg::setId(uint32_t rId)noexcept

Sets the register id to rId.

template<typename RegT>
void BaseReg::setSignatureT()noexcept

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

void BaseReg::setSignatureAndId(uint32_t signature, uint32_t rId)noexcept

Sets the register signature and rId.

bool BaseReg::isGp(const Operand_& op)staticnoexcept[2/3]

Tests whether the op operand is a general purpose register.

bool BaseReg::isVec(const Operand_& op)staticnoexcept[2/3]

Tests whether the op operand is a vector register.

bool BaseReg::isGp(const Operand_& op, uint32_t rId)staticnoexcept[3/3]

Tests whether the op is a general purpose register of the given rId.

bool BaseReg::isVec(const Operand_& op, uint32_t rId)staticnoexcept[3/3]

Tests whether the op is a vector register of the given rId.

bool Operand_::isRegconstexprconstexprnoexcept[3/5]

Tests whether the operand is a register (kOpReg).

bool Operand_::isRegconstexprconstexprnoexcept[4/5]

ASMJIT_NO_DEPRECATED.

Tests whether the operand is a register matching rType.

bool Operand_::isRegconstexprconstexprnoexcept[5/5]

Tests whether the operand is register and of rType and rId.