asmjit::Environment Class Reference

Represents an environment, which is usually related to a Target.

Environment has usually an 'arch-subarch-vendor-os-abi' format, which is sometimes called "Triple" (historically it used to be 3 only parts) or "Tuple", which is a convention used by Debian Linux.

AsmJit doesn't support all possible combinations or architectures and ABIs, however, it models the environment similarly to other compilers for future extensibility.

Public Members

Members

Member Functions

Overloaded Operators
Accessors

Static Functions

Static Utilities

Construction & Destruction

Constructor & Destructor Documentation

Environment::Environment()constexprconstexprdefaultnoexcept[1/3]◆ 

Creates a default initialized environment (all values either unknown or set to safe defaults).

Environment::Environment(const Environment& other)constexprconstexprdefaultnoexcept[2/3]◆ 

Creates a copy of other instance.

Environment::Environment(Arch arch, SubArch subArch = SubArch::kUnknown, Vendor vendor = Vendor::kUnknown, Platform platform = Platform::kUnknown, PlatformABI platformABI = PlatformABI::kUnknown, ObjectFormat objectFormat = ObjectFormat::kUnknown, FloatABI floatABI = FloatABI::kHardFloat)constexprexplicitconstexprnoexcept[3/3]◆ 

Creates Environment initialized to arch, subArch, vendor, platform, platformABI, objectFormat, and floatABI.

Member Function Documentation

Environment Environment::host()staticnoexcept◆ 

Returns the host environment constructed from preprocessor macros defined by the compiler.

The returned environment should precisely match the target host architecture, sub-architecture, platform, and ABI.

bool Environment::empty() constnoexcept◆ 

Tests whether the environment is not set up.

Returns true if all members are zero, and thus unknown.

bool Environment::isInitialized() constnoexcept◆ 

Tests whether the environment is initialized, which means it must have a valid architecture.

void Environment::reset()noexcept◆ 

Resets all members of the environment to zero / unknown.

bool Environment::equals(const Environment& other) constnoexcept◆ 

Tests whether this environment is equal to other.

Arch Environment::arch() constnoexcept◆ 

Returns the architecture.

SubArch Environment::subArch() constnoexcept◆ 

Returns the sub-architecture.

Vendor Environment::vendor() constnoexcept◆ 

Returns vendor.

Platform Environment::platform() constnoexcept◆ 

Returns target's platform or operating system.

PlatformABI Environment::platformABI() constnoexcept◆ 

Returns target's ABI.

ObjectFormat Environment::objectFormat() constnoexcept◆ 

Returns target's object format.

FloatABI Environment::floatABI() constnoexcept◆ 

Returns floating point ABI.

void Environment::init(Arch arch, SubArch subArch = SubArch::kUnknown, Vendor vendor = Vendor::kUnknown, Platform platform = Platform::kUnknown, PlatformABI platformABI = PlatformABI::kUnknown, ObjectFormat objectFormat = ObjectFormat::kUnknown, FloatABI floatABI = FloatABI::kHardFloat)noexcept◆ 

Initializes Environment to arch, subArch, vendor, platform, platformABI, objectFormat, and floatABI.

bool Environment::isArchX86() constnoexcept◆ 

Tests whether this environment describes a 32-bit X86.

bool Environment::isArchX64() constnoexcept◆ 

Tests whether this environment describes a 64-bit X86.

bool Environment::isArchARM() constnoexcept[1/2]◆ 

Tests whether this environment describes a 32-bit ARM.

bool Environment::isArchThumb() constnoexcept[1/2]◆ 

Tests whether this environment describes a 32-bit ARM in THUMB mode.

bool Environment::isArchAArch64() constnoexcept[1/2]◆ 

Tests whether this environment describes a 64-bit X86.

bool Environment::isArchMIPS32() constnoexcept[1/2]◆ 

Tests whether this environment describes a 32-bit MIPS.

bool Environment::isArchMIPS64() constnoexcept[1/2]◆ 

Tests whether this environment describes a 64-bit MIPS.

bool Environment::isArchRISCV32() constnoexcept◆ 

Tests whether this environment describes a 32-bit RISC-V.

bool Environment::isArchRISCV64() constnoexcept◆ 

Tests whether this environment describes a 64-bit RISC-V.

bool Environment::is32Bit() constnoexcept[1/2]◆ 

Tests whether the architecture is 32-bit.

bool Environment::is64Bit() constnoexcept[1/2]◆ 

Tests whether the architecture is 64-bit.

bool Environment::isLittleEndian() constnoexcept[1/2]◆ 

Tests whether the architecture is little endian.

bool Environment::isBigEndian() constnoexcept[1/2]◆ 

Tests whether the architecture is big endian.

bool Environment::isFamilyX86() constnoexcept[1/2]◆ 

Tests whether this architecture is of X86 family.

bool Environment::isFamilyARM() constnoexcept[1/2]◆ 

Tests whether this architecture family is ARM, THUMB, or AArch64.

bool Environment::isFamilyAArch32() constnoexcept[1/2]◆ 

Tests whether this architecture family is AArch32 (ARM or THUMB).

bool Environment::isFamilyAArch64() constnoexcept[1/2]◆ 

Tests whether this architecture family is AArch64.

bool Environment::isFamilyMIPS() constnoexcept[1/2]◆ 

Tests whether this architecture family is MISP or MIPS64.

bool Environment::isFamilyRISCV() constnoexcept[1/2]◆ 

Tests whether this architecture family is RISC-V (both 32-bit and 64-bit).

bool Environment::isPlatformWindows() constnoexcept◆ 

Tests whether the environment platform is Windows.

bool Environment::isPlatformLinux() constnoexcept◆ 

Tests whether the environment platform is Linux.

bool Environment::isPlatformHurd() constnoexcept◆ 

Tests whether the environment platform is Hurd.

bool Environment::isPlatformHaiku() constnoexcept◆ 

Tests whether the environment platform is Haiku.

bool Environment::isPlatformBSD() constnoexcept◆ 

Tests whether the environment platform is any BSD.

bool Environment::isPlatformApple() constnoexcept◆ 

Tests whether the environment platform is any Apple platform (OSX, iOS, TVOS, WatchOS).

bool Environment::isMSVC() constnoexcept◆ 

Tests whether the ABI is MSVC.

bool Environment::isGNU() constnoexcept◆ 

Tests whether the ABI is GNU.

bool Environment::isDarwin() constnoexcept◆ 

Tests whether the ABI is GNU.

uint32_t Environment::stackAlignment() constnoexcept◆ 

Returns a calculated stack alignment for this environment.

uint32_t Environment::registerSize() constnoexcept◆ 

Returns a native register size of this architecture.

void Environment::setArch(Arch arch)noexcept◆ 

Sets the architecture to arch.

void Environment::setSubArch(SubArch subArch)noexcept◆ 

Sets the sub-architecture to subArch.

void Environment::setVendor(Vendor vendor)noexcept◆ 

Sets the vendor to vendor.

void Environment::setPlatform(Platform platform)noexcept◆ 

Sets the platform to platform.

void Environment::setPlatformABI(PlatformABI platformABI)noexcept◆ 

Sets the ABI to platformABI.

void Environment::setObjectFormat(ObjectFormat objectFormat)noexcept◆ 

Sets the object format to objectFormat.

void Environment::setFloatABI(FloatABI floatABI)noexcept◆ 

Sets floating point ABI to floatABI.

bool Environment::is32Bit(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture arch is 32-bit.

bool Environment::is64Bit(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture arch is 64-bit.

bool Environment::isLittleEndian(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture arch is little endian.

bool Environment::isBigEndian(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture arch is big endian.

bool Environment::isArchThumb(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture is Thumb or Thumb_BE.

bool Environment::isArchARM(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture is ARM or ARM_BE.

bool Environment::isArchAArch64(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture is AArch64 or AArch64_BE.

bool Environment::isArchMIPS32(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture is MIPS32_LE or MIPS32_BE.

bool Environment::isArchMIPS64(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture is MIPS64_LE or MIPS64_BE.

bool Environment::isFamilyX86(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture family is X86 or X64.

bool Environment::isFamilyAArch32(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture family is AArch32 (ARM or THUMB).

bool Environment::isFamilyAArch64(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture family is AArch64.

bool Environment::isFamilyARM(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture family is ARM, THUMB, or AArch64.

bool Environment::isFamilyMIPS(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture family is MIPS or MIPS64.

bool Environment::isFamilyRISCV(Arch arch)staticnoexcept[2/2]◆ 

Tests whether the given architecture family is RISC-V (both 32-bit and 64-bit).

uint32_t Environment::registerSizeFromArch(Arch arch)staticnoexcept◆ 

Returns a native general purpose register size from the given architecture.

Member Data Documentation

Arch Environment::_arch = Arch::kUnknown◆ 

Architecture.

SubArch Environment::_subArch = SubArch::kUnknown◆ 

Sub-architecture type.

Vendor Environment::_vendor = Vendor::kUnknown◆ 

Vendor type.

Platform Environment::_platform = Platform::kUnknown◆ 

Platform.

PlatformABI Environment::_platformABI = PlatformABI::kUnknown◆ 

Platform ABI.

ObjectFormat Environment::_objectFormat = ObjectFormat::kUnknown◆ 

Object format.

FloatABI Environment::_floatABI = FloatABI::kHardFloat◆ 

Floating point ABI.

uint8_t Environment::_reserved = 0◆ 

Reserved for future use, must be zero.