asmjit::RegOnly Struct Reference

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

This class was designed to decrease the space consumed by each extra "operand" in BaseEmitter and InstNode classes.

Public Members

Member Functions

Construction & Destruction
Accessors
Utilities

Member Function Documentation

void RegOnly::init(uint32_t 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).

uint32_t RegOnly::signature() constconstexprconstexprnoexcept

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

uint32_t RegOnly::id() constconstexprconstexprnoexcept

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.

uint32_t RegOnly::type() constconstexprconstexprnoexcept

Returns the type of the register.

uint32_t 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

uint32_t RegOnly::_signature

Type of the operand, either kOpNone or kOpReg.

uint32_t RegOnly::_id

Physical or virtual register id.