asmjit::ArchTraits Struct Reference

Architecture traits used by Function API and Compiler's register allocator.

Public Members

Members

Member Functions

Accessors

Static Functions

Statics

Member Function Documentation

uint32_t ArchTraits::spRegId() constnoexcept◆ 

Returns stack pointer register id.

uint32_t ArchTraits::fpRegId() constnoexcept◆ 

Returns stack frame register id.

uint32_t ArchTraits::linkRegId() constnoexcept◆ 

Returns link register id, if the architecture provides it.

uint32_t ArchTraits::ipRegId() constnoexcept◆ 

Returns instruction pointer register id, if the architecture provides it.

uint32_t ArchTraits::hwStackAlignment() constnoexcept◆ 

Returns a hardware stack alignment requirement.

Note
This is a hardware constraint. Architectures that don't constrain it would return the lowest alignment (1), however, some architectures may constrain the alignment, for example AArch64 requires 16-byte alignment.

bool ArchTraits::hasLinkReg() constnoexcept◆ 

Tests whether the architecture provides link register, which is used across function calls.

If the link register is not provided then a function call pushes the return address on stack (X86/X64).

uint32_t ArchTraits::minStackOffset() constnoexcept◆ 

Returns minimum addressable offset on stack guaranteed for all instructions.

uint32_t ArchTraits::maxStackOffset() constnoexcept◆ 

Returns maximum addressable offset on stack depending on specific instruction.

InstHints ArchTraits::instFeatureHints(RegGroup group) constnoexcept◆ 

Returns ISA flags of the given register group.

bool ArchTraits::hasInstHint(RegGroup group, InstHints feature) constnoexcept◆ 

Tests whether the given register group has the given flag set.

bool ArchTraits::hasInstRegSwap(RegGroup group) constnoexcept◆ 

Tests whether the ISA provides register swap instruction for the given register group.

bool ArchTraits::hasInstPushPop(RegGroup group) constnoexcept◆ 

Tests whether the ISA provides push/pop instructions for the given register group.

OperandSignature ArchTraits::regTypeToSignature(RegType type) constnoexcept◆ 

Returns an operand signature from the given register type of this architecture.

RegGroup ArchTraits::regTypeToGroup(RegType type) constnoexcept◆ 

Returns a register from the given register type of this architecture.

uint32_t ArchTraits::regTypeToSize(RegType type) constnoexcept◆ 

Returns a register size the given register type of this architecture.

TypeId ArchTraits::regTypeToTypeId(RegType type) constnoexcept◆ 

Returns a corresponding TypeId from the given register type of this architecture.

const ArchTypeNameId* ArchTraits::typeNameIdTable() constnoexcept◆ 

Returns a table of ISA word names that appear in formatted text.

Word names are ISA dependent.

The index of this table is log2 of the size:

  • [0] 8-bits
  • [1] 16-bits
  • [2] 32-bits
  • [3] 64-bits

ArchTypeNameId ArchTraits::typeNameIdByIndex(uint32_t index) constnoexcept◆ 

Returns an ISA word name identifier of the given index, see typeNameIdTable() for more details.

const ArchTraits& ArchTraits::byArch(Arch arch)staticnoexcept◆ 

Returns a const reference to ArchTraits for the given architecture arch.

Member Data Documentation

uint8_t ArchTraits::_spRegId◆ 

Stack pointer register id.

uint8_t ArchTraits::_fpRegId◆ 

Frame pointer register id.

uint8_t ArchTraits::_linkRegId◆ 

Link register id.

uint8_t ArchTraits::_ipRegId◆ 

Instruction pointer (or program counter) register id, if accessible.

uint8_t ArchTraits::_hwStackAlignment◆ 

Hardware stack alignment requirement.

uint32_t ArchTraits::_minStackOffset◆ 

Minimum addressable offset on stack guaranteed for all instructions.

uint32_t ArchTraits::_maxStackOffset◆ 

Maximum addressable offset on stack depending on specific instruction.

Support::Array<InstHints, Globals::kNumVirtGroups>ArchTraits::_instHints◆ 

Flags for each virtual register group.

Support::Array<OperandSignature, uint32_t(RegType::kMaxValue) + 1>ArchTraits::_regSignature◆ 

Maps register type into a signature, that provides group, size and can be used to construct register operands.

Support::Array<TypeId, uint32_t(RegType::kMaxValue) + 1>ArchTraits::_regTypeToTypeId◆ 

Maps a register to type-id, see TypeId.

Support::Array<RegType, 32>ArchTraits::_typeIdToRegType◆ 

Maps scalar TypeId values (from TypeId::_kIdBaseStart) to register types, see TypeId.

ArchTypeNameId ArchTraits::_typeNameIdTable[4]◆ 

Word name identifiers of 8-bit, 16-bit, 32-biit, and 64-bit quantities that appear in formatted text.