asmjit::TypeUtils Namespace Reference

Type identifier utilities.

Classes

Functions

Variables

Function Documentation

TypeId TypeUtils::scalarOf(TypeId typeId)staticnoexcept◆ 

Returns the scalar type of typeId.

uint32_t TypeUtils::sizeOf(TypeId typeId)staticnoexcept◆ 

Returns the size [in bytes] of typeId.

bool TypeUtils::isBetween(TypeId typeId, TypeId a, TypeId b)constexprstaticconstexprnoexcept◆ 

Tests whether a given type typeId is between a and b.

bool TypeUtils::isVoid(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type typeId is TypeId::kVoid.

bool TypeUtils::isValid(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type typeId is a valid non-void type.

bool TypeUtils::isScalar(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type typeId is scalar (has no vector part).

bool TypeUtils::isAbstract(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type typeId is abstract, which means that its size depends on register size.

bool TypeUtils::isInt(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar integer (signed or unsigned) of any size.

bool TypeUtils::isInt8(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 8-bit integer (signed).

bool TypeUtils::isUInt8(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 8-bit integer (unsigned).

bool TypeUtils::isInt16(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 16-bit integer (signed).

bool TypeUtils::isUInt16(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 16-bit integer (unsigned).

bool TypeUtils::isInt32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 32-bit integer (signed).

bool TypeUtils::isUInt32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 32-bit integer (unsigned).

bool TypeUtils::isInt64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 64-bit integer (signed).

bool TypeUtils::isUInt64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 64-bit integer (unsigned).

bool TypeUtils::isGp8(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an 8-bit general purpose register representing either signed or unsigned 8-bit integer.

bool TypeUtils::isGp16(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 16-bit general purpose register representing either signed or unsigned 16-bit integer.

bool TypeUtils::isGp32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 32-bit general purpose register representing either signed or unsigned 32-bit integer.

bool TypeUtils::isGp64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 64-bit general purpose register representing either signed or unsigned 64-bit integer.

bool TypeUtils::isFloat(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar floating point of any size.

bool TypeUtils::isFloat32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 32-bit float.

bool TypeUtils::isFloat64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 64-bit float.

bool TypeUtils::isFloat80(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a scalar 80-bit float.

bool TypeUtils::isMask(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a mask register of any size.

bool TypeUtils::isMask8(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an 8-bit mask register.

bool TypeUtils::isMask16(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an 16-bit mask register.

bool TypeUtils::isMask32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an 32-bit mask register.

bool TypeUtils::isMask64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an 64-bit mask register.

bool TypeUtils::isMmx(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an MMX register.

Note
MMX functionality is in general deprecated on X86 architecture. AsmJit provides it just for completeness.

bool TypeUtils::isMmx32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an MMX register, which only uses the low 32 bits of data (only specific cases).

Note
MMX functionality is in general deprecated on X86 architecture. AsmJit provides it just for completeness.

bool TypeUtils::isMmx64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is an MMX register, which uses 64 bits of data (default).

Note
MMX functionality is in general deprecated on X86 architecture. AsmJit provides it just for completeness.

bool TypeUtils::isVec(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a vector register of any size.

bool TypeUtils::isVec32(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 32-bit or 32-bit view of a vector register.

bool TypeUtils::isVec64(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 64-bit or 64-bit view of a vector register.

bool TypeUtils::isVec128(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 128-bit or 128-bit view of a vector register.

bool TypeUtils::isVec256(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 256-bit or 256-bit view of a vector register.

bool TypeUtils::isVec512(TypeId typeId)constexprstaticconstexprnoexcept◆ 

Tests whether a given type is a 512-bit or 512-bit view of a vector register.

template<typename T>
TypeId TypeUtils::typeIdOfT()constexprstaticconstexprnoexcept◆ 

Returns a corresponding TypeId of T type.

uint32_t TypeUtils::deabstractDeltaOfSize(uint32_t registerSize)constexprstaticconstexprnoexcept◆ 

Returns offset needed to convert a kIntPtr and kUIntPtr TypeId into a type that matches registerSize (general-purpose register size).

If you find such TypeId it's then only about adding the offset to it.

For example:

uint32_t registerSize = /* 4 or 8 *&zwj;/;
uint32_t deabstractDelta = TypeUtils::deabstractDeltaOfSize(registerSize);
TypeId typeId = 'some type-id';
// Normalize some typeId into a non-abstract typeId.
if (TypeUtils::isAbstract(typeId)) typeId += deabstractDelta;
// The same, but by using TypeUtils::deabstract() function.
typeId = TypeUtils::deabstract(typeId, deabstractDelta);

TypeId TypeUtils::deabstract(TypeId typeId, uint32_t deabstractDelta)constexprstaticconstexprnoexcept◆ 

Deabstracts a given typeId into a native type by using deabstractDelta, which was previously calculated by calling deabstractDeltaOfSize() with a target native register size.