Core

Core API.

API that provides classes and functions not specific to any architecture.

Namespaces

Classes

Typedefs

Enumerations

Functions

Typedef Documentation

typedef uint32_t Error

AsmJit error type (uint32_t).

Enumeration Type Documentation

AlignMode : uint32_tenum

Align mode.

ConstantDescription
kAlignCode 

Align executable code.

kAlignData 

Align non-executable code.

kAlignZero 

Align by a sequence of zeros.

kAlignCount 

Count of alignment modes.

ErrorCode : uint32_tenum

AsmJit error codes.

ConstantDescription
kErrorOk 

No error (success).

kErrorOutOfMemory 

Out of memory.

kErrorInvalidArgument 

Invalid argument.

kErrorInvalidState 

Invalid state.

If this error is returned it means that either you are doing something wrong or AsmJit caught itself by doing something wrong. This error should never be ignored.

kErrorInvalidArch 

Invalid or incompatible architecture.

kErrorNotInitialized 

The object is not initialized.

kErrorAlreadyInitialized 

The object is already initialized.

kErrorFeatureNotEnabled 

Built-in feature was disabled at compile time and it's not available.

kErrorTooManyHandles 

Too many handles (Windows) or file descriptors (Unix/Posix).

kErrorTooLarge 

Code generated is larger than allowed.

kErrorNoCodeGenerated 

No code generated.

Returned by runtime if the CodeHolder contains no code.

kErrorInvalidDirective 

Invalid directive.

kErrorInvalidLabel 

Attempt to use uninitialized label.

kErrorTooManyLabels 

Label index overflow - a single Assembler instance can hold almost 2^32 (4 billion) labels. If there is an attempt to create more labels then this error is returned.

kErrorLabelAlreadyBound 

Label is already bound.

kErrorLabelAlreadyDefined 

Label is already defined (named labels).

kErrorLabelNameTooLong 

Label name is too long.

kErrorInvalidLabelName 

Label must always be local if it's anonymous (without a name).

kErrorInvalidParentLabel 

Parent id passed to CodeHolder::newNamedLabelId() was invalid.

kErrorNonLocalLabelCantHaveParent 

Parent id specified for a non-local (global) label.

kErrorInvalidSection 

Invalid section.

kErrorTooManySections 

Too many sections (section index overflow).

kErrorInvalidSectionName 

Invalid section name (most probably too long).

kErrorTooManyRelocations 

Relocation index overflow (too many relocations).

kErrorInvalidRelocEntry 

Invalid relocation entry.

kErrorRelocOffsetOutOfRange 

Reloc entry contains address that is out of range (unencodable).

kErrorInvalidAssignment 

Invalid assignment to a register, function argument, or function return value.

kErrorInvalidInstruction 

Invalid instruction.

kErrorInvalidRegType 

Invalid register type.

kErrorInvalidRegGroup 

Invalid register group.

kErrorInvalidPhysId 

Invalid register's physical id.

kErrorInvalidVirtId 

Invalid register's virtual id.

kErrorInvalidPrefixCombination 

Invalid prefix combination.

kErrorInvalidLockPrefix 

Invalid LOCK prefix.

kErrorInvalidXAcquirePrefix 

Invalid XACQUIRE prefix.

kErrorInvalidXReleasePrefix 

Invalid XRELEASE prefix.

kErrorInvalidRepPrefix 

Invalid REP prefix.

kErrorInvalidRexPrefix 

Invalid REX prefix.

kErrorInvalidExtraReg 

Invalid {...} register.

kErrorInvalidKMaskUse 

Invalid {k} use (not supported by the instruction).

kErrorInvalidKZeroUse 

Invalid {k}{z} use (not supported by the instruction).

kErrorInvalidBroadcast 

Invalid broadcast - Currently only related to invalid use of AVX-512 {1tox}.

kErrorInvalidEROrSAE 

Invalid 'embedded-rounding' {er} or 'suppress-all-exceptions' {sae} (AVX-512).

kErrorInvalidAddress 

Invalid address used (not encodable).

kErrorInvalidAddressIndex 

Invalid index register used in memory address (not encodable).

kErrorInvalidAddressScale 

Invalid address scale (not encodable).

kErrorInvalidAddress64Bit 

Invalid use of 64-bit address.

kErrorInvalidAddress64BitZeroExtension 

Invalid use of 64-bit address that require 32-bit zero-extension (X64).

kErrorInvalidDisplacement 

Invalid displacement (not encodable).

kErrorInvalidSegment 

Invalid segment (X86).

kErrorInvalidImmediate 

Invalid immediate (out of bounds on X86 and invalid pattern on ARM).

kErrorInvalidOperandSize 

Invalid operand size.

kErrorAmbiguousOperandSize 

Ambiguous operand size (memory has zero size while it's required to determine the operation type.

kErrorOperandSizeMismatch 

Mismatching operand size (size of multiple operands doesn't match the operation size).

kErrorInvalidOption 

Invalid option.

kErrorOptionAlreadyDefined 

Option already defined.

kErrorInvalidTypeId 

Invalid TypeId.

kErrorInvalidUseOfGpbHi 

Invalid use of a 8-bit GPB-HIGH register.

kErrorInvalidUseOfGpq 

Invalid use of a 64-bit GPQ register in 32-bit mode.

kErrorInvalidUseOfF80 

Invalid use of an 80-bit float (Type::kIdF80).

kErrorNotConsecutiveRegs 

Some registers in the instruction muse be consecutive (some ARM and AVX512 neural-net instructions).

kErrorNoMorePhysRegs 

AsmJit requires a physical register, but no one is available.

kErrorOverlappedRegs 

A variable has been assigned more than once to a function argument (BaseCompiler).

kErrorOverlappingStackRegWithRegArg 

Invalid register to hold stack arguments offset.

kErrorExpressionLabelNotBound 

Unbound label cannot be evaluated by expression.

kErrorExpressionOverflow 

Arithmetic overflow during expression evaluation.

kErrorCount 

Count of AsmJit error codes.

Function Documentation

template<typename T>
Imm imm(T val)constexprstaticnoexcept

Creates a new immediate operand.

Using imm(x) is much nicer than using Imm(x) as this is a template which can accept any integer including pointers and function pointers.