asmjit::CpuInfo Class Reference

CPU information.

Public Members


Member Functions

Overloaded Operators

Construction & Destruction

Member Function Documentation

const CpuInfo& CpuInfo::host()staticnoexcept

Returns the host CPU information.

void CpuInfo::initArch(Arch arch, SubArch subArch = SubArch::kUnknown)noexcept

Initializes CpuInfo architecture and sub-architecture members to arch and subArch, respectively.

Arch CpuInfo::arch() constnoexcept

Returns the CPU architecture this information relates to.

SubArch CpuInfo::subArch() constnoexcept

Returns the CPU sub-architecture this information relates to.

bool CpuInfo::wasDetected() constnoexcept

Returns whether the CPU was detected successfully.

If the returned value is false it means that AsmJit either failed to detect the CPU or it doesn't have implementation targeting the host architecture and operating system.

uint32_t CpuInfo::familyId() constnoexcept

Returns the CPU family ID.

Family identifier matches the FamilyId read by using CPUID on X86 architecture.

uint32_t CpuInfo::modelId() constnoexcept

Returns the CPU model ID.

Family identifier matches the ModelId read by using CPUID on X86 architecture.

uint32_t CpuInfo::brandId() constnoexcept

Returns the CPU brand id.

Family identifier matches the BrandId read by using CPUID on X86 architecture.

uint32_t CpuInfo::stepping() constnoexcept

Returns the CPU stepping.

Family identifier matches the Stepping information read by using CPUID on X86 architecture.

uint32_t CpuInfo::processorType() constnoexcept

Returns the processor type.

Family identifier matches the ProcessorType read by using CPUID on X86 architecture.

uint32_t CpuInfo::maxLogicalProcessors() constnoexcept

Returns the maximum number of logical processors.

uint32_t CpuInfo::cacheLineSize() constnoexcept

Returns the size of a cache line flush.

uint32_t CpuInfo::hwThreadCount() constnoexcept

Returns number of hardware threads available.

const char* CpuInfo::vendor() constnoexcept

Returns a CPU vendor string.

bool CpuInfo::isVendor(const char* s) constnoexcept

Tests whether the CPU vendor string is equal to s.

const char* CpuInfo::brand() constnoexcept

Returns a CPU brand string.

CpuFeatures& CpuInfo::features()noexcept[1/2]

Returns CPU features.

const CpuFeatures& CpuInfo::features() constnoexcept[2/2]

Returns CPU features (const).

template<typename FeatureId>
bool CpuInfo::hasFeature(const FeatureId& featureId) constnoexcept

Tests whether the CPU has the given feature.

template<typename... Args>
void CpuInfo::addFeature(Args&&... args)noexcept

Adds the given CPU featureId to the list of features.

template<typename... Args>
void CpuInfo::removeFeature(Args&&... args)noexcept

Removes the given CPU featureId from the list of features.

Member Data Documentation

Arch CpuInfo::_arch


SubArch CpuInfo::_subArch


bool CpuInfo::_wasDetected

True if the CPU was detected, false if the detection failed or it's not available.

uint8_t CpuInfo::_reserved

Reserved for future use.

uint32_t CpuInfo::_familyId

CPU family ID.

uint32_t CpuInfo::_modelId

CPU model ID.

uint32_t CpuInfo::_brandId

CPU brand ID.

uint32_t CpuInfo::_stepping

CPU stepping.

uint32_t CpuInfo::_processorType

Processor type.

uint32_t CpuInfo::_maxLogicalProcessors

Maximum number of addressable IDs for logical processors.

uint32_t CpuInfo::_cacheLineSize

Cache line size (in bytes).

uint32_t CpuInfo::_hwThreadCount

Number of hardware threads.


CPU vendor string.


CPU brand string.

CpuFeatures CpuInfo::_features

CPU features.