
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.
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.
Tests whether the operand's signature matches the signature of the other
operand.
Tests whether the operand's signature matches the given signature sign
.
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's type matches the given type
.
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 register or memory.
Tests whether the operand is a register, register-list, or memory.
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 physical register.
Tests whether the operand is a virtual register.
Tests whether the operand is a register matching the given register type
.
Tests whether the operand is register and of register type regType
and regId
.
Tests whether the operand is a register of the provided register group regGroup
.
Tests whether the operand is register and of register group regGroup
and regId
.
Tests whether the operand is a general purpose register of any type.
Tests whether the operand is a general purpose register of any type.
Tests whether the operand is a general purpose register of any type having the given id regId
.
Tests whether the register is an 8-bit low or high general purpose register (X86|X86_64).
Tests whether the register is an 8-bit low or high general purpose register having the given id regId
(X86|X86_64).
Tests whether the register is an 8-bit low general purpose register (X86|X86_64).
Tests whether the register is an 8-bit low general purpose register having the given id regId
(X86|X86_64).
Tests whether the register is an 8-bit high general purpose register (X86|X86_64 only - AH, BH, CH, DH).
Tests whether the register is an 8-bit high general purpose register having the given id regId
(X86|X86_64).
Tests whether the register is a 16-bit general purpose register (X86|X86_64).
Tests whether the register is a 16-bit general purpose register having the given id regId
(X86|X86_64).
Tests whether the register is a 32-bit general purpose register.
Tests whether the register is a 32-bit general purpose register having the given id regId
.
Tests whether the register is a 64-bit general purpose register.
Tests whether the register is a 64-bit general purpose register having the given id regId
.
Tests whether the register is a vector register of any size.
Tests whether the register is a vector register of any size having the given id regId
.
Tests whether the register is an 8-bit vector register or view (AArch64).
Tests whether the register is an 8-bit vector register or view having the given id regId
(AArch64).
Tests whether the register is a 16-bit vector register or view (AArch64).
Tests whether the register is a 16-bit vector register or view having the given id regId
(AArch64).
Tests whether the register is a 32-bit vector register or view (AArch32, AArch64).
Tests whether the register is a 32-bit vector register or view having the given id regId
(AArch32/AArch64).
Tests whether the register is a 64-bit vector register or view (AArch32/AArch64).
Tests whether the register is a 64-bit vector register or view having the given id regId
(AArch32/AArch64).
Tests whether the register is a 128-bit vector register or view (X86|X86_64/AArch32/AArch64).
Tests whether the register is a 128-bit vector register or view having the given id regId
(X86|X86_64/AArch32/AArch64).
Tests whether the register is a 256-bit vector register or view (X86|X86_64).
Tests whether the register is a 256-bit vector register or view having the given id regId
(X86|X86_64).
Tests whether the register is a 512-bit vector register or view (X86|X86_64).
Tests whether the register is a 512-bit vector register or view having the given id regId
(X86|X86_64).
Tests whether the register is a mask register of any size.
Tests whether the register is a mask register of any size having the given id regId
(X86|X86_64/AArch64).
Tests whether the register is a mask register (K
register on X86|X86_64) - alias of isMaskReg().
Tests whether the register is a mask register (K
register on X86|X86_64) of any size having the given id regId
(X86|X86_64/AArch64).
Tests whether the register is a tile register.
Tests whether the register is a tile register of the given id regId
.
Tests whether the register is a tile register (TMM
register on X86_64) - alias of isTileReg().
Tests whether the register is a tile register (TMM
register on X86_64) of the given id regId
- alias of isTileReg().
Tests whether the register is a segment register (X86|X86_64).
Tests whether the register is a segment register having the given id regId
(X86|X86_64).
Tests whether the register is a control register (X86|X86_64).
Tests whether the register is a control register having the given id regId
(X86|X86_64).
Tests whether the register is a debug register (X86|X86_64).
Tests whether the register is a debug register of the given id regId
(X86|X86_64).
Tests whether the register is an MMX register (X86|X64).
Tests whether the register is an MMX register of the given id regId
(X86|X64).
Tests whether the register is an FPU register (ST
register on X86|X86_64) (X86|X64).
Tests whether the register is an FPU register (ST
register on X86|X86_64) of the given id regId
(X86|X64).
Tests whether the register is a BND register (X86|X64).
Tests whether the register is a BND register of the given id regId
(X86|X64).
Tests whether the operand is a register matching the given register type
.
Returns a size of a register or an X86 memory operand.
Memory index offset in a _data[2]
array.
Low 32-bit offset value a _data[2]
array.
Low 32-bit immediate value in a _data[2]
array.
High 32-bit immediate value in a _data[2]
array.
Minimum valid packed-id.
Maximum valid packed-id, excludes Globals::kInvalidId.
Count of valid packed-ids.
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.