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::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.

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.