asmjit::BaseReg Class Reference
Inheritance diagram for asmjit::BaseReg:
asmjit::Operand asmjit::Operand_ asmjit::arm::Reg asmjit::x86::Reg asmjit::arm::Gp asmjit::arm::Vec asmjit::x86::Bnd asmjit::x86::CReg asmjit::x86::DReg asmjit::x86::Gp asmjit::x86::KReg asmjit::x86::Mm asmjit::x86::Rip asmjit::x86::SReg asmjit::x86::St asmjit::x86::Tmm asmjit::x86::Vec

Physical or virtual register operand.

Public Types

Constants
- 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

anonymous enum : uint32_t

ConstantDescription
kIdBad 

None or any register (mostly internal).

Constructor & Destructor Documentation

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

Creates a dummy register operand.

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

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

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

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

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

Creates a register initialized to the given signature and id.

Member Function Documentation

OperandSignature BaseReg::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 architecture-specific RegTraits, like x86::RegTraits.

bool BaseReg::hasBaseSignature(uint32_t signature) constconstexprnoexcept[1/3]

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

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

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

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

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

bool BaseReg::isSame(const BaseReg& 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 BaseReg::isValid() constconstexprnoexcept

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

bool BaseReg::isPhysReg() constconstexprnoexcept

Tests whether this is a physical register.

bool BaseReg::isVirtReg() constconstexprnoexcept

Tests whether this is a virtual register.

bool BaseReg::isType(RegType type) constconstexprnoexcept

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

bool BaseReg::isGroup(RegGroup group) constconstexprnoexcept

Tests whether the register group matches group.

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

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

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

Tests whether the register is a vector register.

bool BaseReg::isReg(RegType rType) constconstexprnoexcept[1/5]

Same as isType(), provided for convenience.

bool BaseReg::isReg(RegType rType, uint32_t id) constconstexprnoexcept[2/5]

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

RegType BaseReg::type() constconstexprnoexcept

Returns the register type.

RegGroup BaseReg::group() constconstexprnoexcept

Returns the register group.

uint32_t BaseReg::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 BaseReg::setPredicate(uint32_t predicate)noexcept

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 BaseReg::resetPredicate()noexcept

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

BaseReg BaseReg::clone() constconstexprnoexcept

Clones the register operand.

template<typename RegT>
RegT BaseReg::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 BaseReg::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 BaseReg::setId(uint32_t id)noexcept

Sets the register id to id.

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

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

void BaseReg::setSignatureAndId(const OperandSignature& signature, uint32_t id)noexcept

Sets the register signature and id.

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 id)staticnoexcept[3/3]

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

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

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

bool Operand_::isRegconstexprnoexcept[3/5]

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

bool Operand_::isRegconstexprnoexcept[4/5]

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

bool Operand_::isRegconstexprnoexcept[5/5]

Tests whether the operand is register and of register type and id.