asmjit::RegOnly Struct Reference

RegOnly is 8-byte version of BaseReg that allows to store either register or nothing.

It's designed to decrease the space consumed by an extra "operand" in BaseEmitter and InstNode.

Public Members

Public Types


Member Functions

Construction & Destruction

Member Function Documentation

void RegOnly::init(const OperandSignature& signature, uint32_t id)noexcept◆ 

Initializes the RegOnly instance to hold register signature and id.

void RegOnly::reset()noexcept◆ 

Resets the RegOnly members to zeros (none).

bool RegOnly::isNone() constconstexprconstexprnoexcept◆ 

Tests whether this ExtraReg is none (same as calling Operand_::isNone()).

bool RegOnly::isReg() constconstexprconstexprnoexcept◆ 

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

bool RegOnly::isPhysReg() constconstexprconstexprnoexcept◆ 

Tests whether this is a physical register.

bool RegOnly::isVirtReg() constconstexprconstexprnoexcept◆ 

Tests whether this is a virtual register (used by BaseCompiler).

OperandSignature RegOnly::signature() constconstexprconstexprnoexcept◆ 

Returns the register signature or 0 if no register is assigned.

uint32_t RegOnly::id() constconstexprconstexprnoexcept◆ 

Returns the register id.

Always check whether the register is assigned before using the returned identifier as non-assigned RegOnly instance would return zero id, which is still a valid register id.

void RegOnly::setId(uint32_t id)noexcept◆ 

Sets the register id.

RegType RegOnly::type() constconstexprconstexprnoexcept◆ 

Returns the register type.

RegGroup RegOnly::group() constconstexprconstexprnoexcept◆ 

Returns the register group.

template<typename RegT>
RegT RegOnly::toReg() constconstexprconstexprnoexcept◆ 

Converts this ExtraReg to a real RegT operand.

Member Data Documentation

Signature RegOnly::_signature◆ 

Operand signature - only OperandType::kNone and OperandType::kReg are supported.

uint32_t RegOnly::_id◆ 

Physical or virtual register id.