asmjit::VirtReg Class Reference

Virtual register data, managed by BaseCompiler.

Public Members

Member Functions

Construction & Destruction
Accessors

Member Function Documentation

uint32_t VirtReg::id() constnoexcept

Returns the virtual register id.

const char* VirtReg::name() constnoexcept

Returns the virtual register name.

uint32_t VirtReg::nameSize() constnoexcept

Returns the size of the virtual register name.

const RegInfo& VirtReg::info() constnoexcept

Returns a register information that wraps the register signature.

uint32_t VirtReg::type() constnoexcept

Returns a virtual register type (maps to the physical register type as well).

uint32_t VirtReg::group() constnoexcept

Returns a virtual register group (maps to the physical register group as well).

uint32_t VirtReg::regSize() constnoexcept

Returns a real size of the register this virtual register maps to.

For example if this is a 128-bit SIMD register used for a scalar single precision floating point value then its virtSize would be 4, however, the regSize would still say 16 (128-bits), because it's the smallest size of that register type.

uint32_t VirtReg::signature() constnoexcept

Returns a register signature of this virtual register.

uint32_t VirtReg::virtSize() constnoexcept

Returns the virtual register size.

The virtual register size describes how many bytes the virtual register needs to store its content. It can be smaller than the physical register size, see regSize().

uint32_t VirtReg::alignment() constnoexcept

Returns the virtual register alignment.

uint32_t VirtReg::typeId() constnoexcept

Returns the virtual register type id, see Type::Id.

uint32_t VirtReg::weight() constnoexcept

Returns the virtual register weight - the register allocator can use it as explicit hint for alloc/spill decisions.

void VirtReg::setWeight(uint32_t weight)noexcept

Sets the virtual register weight (0 to 255) - the register allocator can use it as explicit hint for alloc/spill decisions and initial bin-packing.

bool VirtReg::isFixed() constnoexcept

Returns whether the virtual register is always allocated to a fixed physical register (and never reallocated).

Note
This is only used for special purposes and it's mostly internal.

bool VirtReg::isStack() constnoexcept

Returns whether the virtual register is indeed a stack that only uses the virtual register id for making it accessible.

Note
It's an error if a stack is accessed as a register.

Member Data Documentation

uint32_t VirtReg::_id

Virtual register id.

RegInfo VirtReg::_info

Virtual register info (signature).

uint32_t VirtReg::_virtSize

Virtual register size (can be smaller than regInfo._size).

uint8_t VirtReg::_alignment

Virtual register alignment (for spilling).

uint8_t VirtReg::_typeId

Type-id.

uint8_t VirtReg::_weight

Virtual register weight for alloc/spill decisions.

uint8_t VirtReg::_isFixed

True if this is a fixed register, never reallocated.

uint8_t VirtReg::_isStack

True if the virtual register is only used as a stack (never accessed as register).

ZoneString<16>VirtReg::_name

Virtual register name (user provided or automatically generated).

RAWorkReg* VirtReg::_workReg

Reference to RAWorkReg, used during register allocation.