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

Types

Member Functions

Construction & Destruction
Accessors
Utilities

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() constconstexprnoexcept

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

bool RegOnly::isReg() constconstexprnoexcept

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

bool RegOnly::isPhysReg() constconstexprnoexcept

Tests whether this is a physical register.

bool RegOnly::isVirtReg() constconstexprnoexcept

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

OperandSignature RegOnly::signature() constconstexprnoexcept

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

uint32_t RegOnly::id() constconstexprnoexcept

Returns the register id.

Note
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() constconstexprnoexcept

Returns the register type.

RegGroup RegOnly::group() constconstexprnoexcept

Returns the register group.

template<typename RegT>
RegT RegOnly::toReg() constconstexprnoexcept

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.