AsmJit
Low-Latency Machine Code Generation
Base class representing an operand in AsmJit (non-default constructed version).
Contains no initialization code and can be used safely to define an array of operands that won't be initialized. This is a Operand base structure designed to be statically initialized, static const, or to be used by user code to define an array of operands without having them default initialized at construction time.
Tests whether the given id
is a valid virtual register id.
Since AsmJit supports both physical and virtual registers it must be able to distinguish between these two. The idea is that physical registers are always limited in size, so virtual identifiers start from kVirtIdMin
and end at kVirtIdMax
.
Converts a real-id into a packed-id that can be stored in Operand.
Converts a packed-id back to real-id.
Initializes the operand from other
operand (used by operator overloads).
Resets the Operand
to none.
None operand is defined the following way:
0
.0
.In other words, reset operands have all members set to zero. Reset operand must match the Operand state right after its construction. Alternatively, if you have an array of operands, you can simply use memset()
.
Tests whether this operand is the same as other
.
Tests whether this operand is not the same as other
.
Casts this operand to T
type.
Casts this operand to T
type (const).
Tests whether the operand is 100% equal to other
operand.
Tests whether the operand's signature matches the signature of the other
operand.
Tests whether the operand's signature matches the given signature sign
.
Returns operand signature as unsigned 32-bit integer.
Signature is first 4 bytes of the operand data. It's used mostly for operand checking as it's much faster to check packed 4 bytes at once than having to check these bytes individually.
Sets the operand signature, see signature()
.
setSignature()
can lead to hard-to-debug errors. This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the type of the operand, see OpType
.
Tests whether the operand is none (OperandType::kNone
).
Tests whether the operand is a register (OperandType::kReg
).
Tests whether the operand is a register-list.
Tests whether the operand is a memory location (OperandType::kMem
).
Tests whether the operand is an immediate (OperandType::kImm
).
Tests whether the operand is a label (OperandType::kLabel
).
Tests whether the operand is a physical register.
Tests whether the operand is a virtual register.
Returns the operand id.
The value returned should be interpreted accordingly to the operand type:
0
.0
.newLabel()
or Globals::kInvalidId
if the label is invalid or not initialized. Tests whether the operand is a register matching the given register type
.
Tests whether the operand is a register of the provided register group regGroup
.
Tests whether the operand is register and of register type regType
and regId
.
Tests whether the operand is register and of register group regGroup
and regId
.
Tests whether the register is a general purpose register (any size).
Tests whether the register is a 32-bit general purpose register.
Tests whether the register is a 64-bit general purpose register.
Tests whether the register is a vector register of any size.
Tests whether the register is an 8-bit vector register or view (AArch64).
Tests whether the register is a 16-bit vector register or view (AArch64).
Tests whether the register is a 32-bit vector register or view (AArch32, AArch64).
Tests whether the register is a 64-bit vector register or view (AArch32, AArch64).
Tests whether the register is a 128-bit vector register or view (AArch32, AArch64, X86, X86_64).
Tests whether the register is a 256-bit vector register or view (X86, X86_64).
Tests whether the register is a 512-bit vector register or view (X86, X86_64).
Tests whether the register is a mask register of any size.
Tests whether the operand is a register matching the given register type
.
Tests whether the operand is a register or memory.
Tests whether the operand is a register, register-list, or memory.
Returns a size of a register or an X86 memory operand.
Provides operand type and additional payload.
Either base id as used by memory operand or any id as used by others.
Data specific to the operand type.
The reason we don't use union is that we have constexpr
constructors that construct operands and other constexpr
functions that return whether another Operand or something else. These cannot generally work with unions so we also cannot use union
if we want to be standard compliant.