Report a bug
If you spot a problem with this page, click here to create a Github issue.
Improve this page
Quickly fork, edit online, and submit a pull request for this page. Requires a signed-in GitHub account. This works well for small changes. If you'd like to make larger changes you may want to consider using a local clone.

cpuid.x86_any

Common information for all x86 and x86_64 vendors.

This module is compatible with betterC compilation mode.

NoteT.max value value is used to represent fully-associative Cache/TLB.

Referenceswikipedia:CPUID

Authors:
Ilya Yaroshenko
export nothrow @nogc void cpuid_x86_any_init();
Initialize basic x86 CPU information. It is safe to call this function multiple times.
union Leaf1Information;
Basic information about CPU.
CpuInfo info;
CPUID payload
pure nothrow @nogc @property @trusted uint stepping();
Stepping ID
pure nothrow @nogc @property @trusted uint model();
Model
pure nothrow @nogc @property @trusted uint family();
Family ID
pure nothrow @nogc @property @trusted uint type();
Processor Type, Specification: Intel
pure nothrow @nogc @property @trusted uint extendedModel();
Extended Model ID
pure nothrow @nogc @property @trusted uint extendedFamily();
Extended Family ID
ubyte brandIndex;
Brand Index
ubyte clflushLineSize;
clflush line size
ubyte maxLogicalProcessors;
maximal number of logical processors
ubyte initialAPIC;
initial APIC
pure nothrow @nogc @property @trusted bool sse3();
SSE3 Extensions
pure nothrow @nogc @property @trusted bool pclmulqdq();
Carryless Multiplication
pure nothrow @nogc @property @trusted bool dtes64();
64-bit DS Area
pure nothrow @nogc @property @trusted bool monitor();
MONITOR/MWAIT
pure nothrow @nogc @property @trusted bool ds_cpl();
(); /// CPL Qualified Debug Store
pure nothrow @nogc @property @trusted bool vmx();
Virtual Machine Extensions
pure nothrow @nogc @property @trusted bool smx();
Safer Mode Extensions
pure nothrow @nogc @property @trusted bool eist();
Enhanced Intel SpeedStep® Technology
pure nothrow @nogc @property @trusted bool therm_monitor2();
Thermal Monitor 2
pure nothrow @nogc @property @trusted bool ssse3();
SSSE3 Extensions
pure nothrow @nogc @property @trusted bool cnxt_id();
L1 Context ID
pure nothrow @nogc @property @trusted bool sdbg();
pure nothrow @nogc @property @trusted bool fma();
Fused Multiply Add
pure nothrow @nogc @property @trusted bool cmpxchg16b();
pure nothrow @nogc @property @trusted bool xtpr();
TPR Update Control
pure nothrow @nogc @property @trusted bool pdcm();
Perf/Debug Capability MSR xTPR Update Control
pure nothrow @nogc @property @trusted bool pcid();
Process-context Identifiers
pure nothrow @nogc @property @trusted bool dca();
Direct Cache Access
pure nothrow @nogc @property @trusted bool sse41();
SSE4.1
pure nothrow @nogc @property @trusted bool sse42();
SSE4.2
pure nothrow @nogc @property @trusted bool x2apic();
pure nothrow @nogc @property @trusted bool movbe();
pure nothrow @nogc @property @trusted bool popcnt();
pure nothrow @nogc @property @trusted bool tsc_deadline();
(
pure nothrow @nogc @property @trusted bool aes();
pure nothrow @nogc @property @trusted bool xsave();
pure nothrow @nogc @property @trusted bool osxsave();
pure nothrow @nogc @property @trusted bool avx();
pure nothrow @nogc @property @trusted bool f16c();
pure nothrow @nogc @property @trusted bool rdrand();
pure nothrow @nogc @property @trusted bool virtual();
pure nothrow @nogc @property @trusted bool fpu();
x87 FPU on Chip
pure nothrow @nogc @property @trusted bool vme();
Virtual-8086 Mode Enhancement
pure nothrow @nogc @property @trusted bool de();
Debugging Extensions
pure nothrow @nogc @property @trusted bool pse();
Page Size Extensions
pure nothrow @nogc @property @trusted bool tsc();
Time Stamp Counter
pure nothrow @nogc @property @trusted bool msr();
RDMSR and WRMSR Support
pure nothrow @nogc @property @trusted bool pae();
Physical Address Extensions
pure nothrow @nogc @property @trusted bool mce();
Machine Check Exception
pure nothrow @nogc @property @trusted bool cx8();
CMPXCHG8B Inst.
pure nothrow @nogc @property @trusted bool apic();
APIC on Chip
pure nothrow @nogc @property @trusted bool sep();
SYSENTER and SYSEXIT
pure nothrow @nogc @property @trusted bool mtrr();
Memory Type Range Registers
pure nothrow @nogc @property @trusted bool pge();
PTE Global Bit
pure nothrow @nogc @property @trusted bool mca();
Machine Check Architecture
pure nothrow @nogc @property @trusted bool cmov();
Conditional Move/Compare Instruction
pure nothrow @nogc @property @trusted bool pat();
Page Attribute Table
pure nothrow @nogc @property @trusted bool pse36();
Page Size Extension
pure nothrow @nogc @property @trusted bool psn();
Processor Serial Number
pure nothrow @nogc @property @trusted bool clfsh();
CLFLUSH instruction
pure nothrow @nogc @property @trusted bool ds();
Debug Store
pure nothrow @nogc @property @trusted bool acpi();
Thermal Monitor and Clock Ctrl
pure nothrow @nogc @property @trusted bool mmx();
MMX Technology
pure nothrow @nogc @property @trusted bool fxsr();
FXSAVE/FXRSTOR
pure nothrow @nogc @property @trusted bool sse();
SSE Extensions
pure nothrow @nogc @property @trusted bool sse2();
SSE2 Extensions
pure nothrow @nogc @property @trusted bool self_snoop();
Self Snoop
pure nothrow @nogc @property @trusted bool htt();
Multi-threading
pure nothrow @nogc @property @trusted bool therm_monitor();
Therm. Monitor
pure nothrow @nogc @property @trusted bool pbe();
Pend. Brk. EN.
union Leaf7Information;
Extended information about CPU.
CpuInfo info;
CPUID payload
uint max7SubLeafs;
Reports the maximum input value for supported leaf 7 sub-leaves
pure nothrow @nogc @property @trusted bool fsgsbase();
Supports RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE if 1.
pure nothrow @nogc @property @trusted bool ia32_tsc_adjust();
MSR is supported if 1.
pure nothrow @nogc @property @trusted bool sgx();
Supports Intel® Software Guard Extensions (Intel® SGX Extensions) if 1.
pure nothrow @nogc @property @trusted bool bmi1();
Bit Manipulation Instruction Set 1
pure nothrow @nogc @property @trusted bool hle();
Transactional Synchronization Extensions
pure nothrow @nogc @property @trusted bool avx2();
Advanced Vector Extensions 2
pure nothrow @nogc @property @trusted bool fdp_excptn_only();
x87 FPU Data Pointer updated only on x87 exceptions if 1.
pure nothrow @nogc @property @trusted bool smep();
Supports Supervisor-Mode Execution Prevention if 1.
pure nothrow @nogc @property @trusted bool bmi2();
Bit Manipulation Instruction Set 2
pure nothrow @nogc @property @trusted bool supports();
Enhanced REP MOVSB/STOSB if 1.
pure nothrow @nogc @property @trusted bool invpcid();
If 1, supports INVPCID instruction for system software that manages process-context identifiers.
pure nothrow @nogc @property @trusted bool rtm();
Transactional Synchronization Extensions
pure nothrow @nogc @property @trusted bool rdt_m();
Supports Intel® Resource Director Technology (Intel® RDT) Monitoring capability if 1.
pure nothrow @nogc @property @trusted bool deprecates();
FPU CS and FPU DS values if 1.
pure nothrow @nogc @property @trusted bool mpx();
Supports Intel® Memory Protection Extensions if 1.
pure nothrow @nogc @property @trusted bool rdt_a();
Supports Intel® Resource Director Technology (Intel® RDT) Allocation capability if 1.
pure nothrow @nogc @property @trusted bool avx512f();
AVX-512 Foundation
pure nothrow @nogc @property @trusted bool avx512dq();
AVX-512 Doubleword and Quadword Instructions
pure nothrow @nogc @property @trusted bool rdseed();
RDSEED instruction
pure nothrow @nogc @property @trusted bool adx();
Intel ADX (Multi-Precision Add-Carry Instruction Extensions)
pure nothrow @nogc @property @trusted bool smap();
Supports Supervisor-Mode Access Prevention (and the CLAC/STAC instructions) if 1.
pure nothrow @nogc @property @trusted bool avx512ifma();
AVX-512 Integer Fused Multiply-Add Instructions
pure nothrow @nogc @property @trusted bool pcommit();
PCOMMIT instruction
pure nothrow @nogc @property @trusted bool clflushopt();
CLFLUSHOPT instruction
pure nothrow @nogc @property @trusted bool clwb();
CLWB instruction
pure nothrow @nogc @property @trusted bool intel_pt();
Intel Processor Trace.
pure nothrow @nogc @property @trusted bool avx512pf();
AVX-512 Prefetch Instructions
pure nothrow @nogc @property @trusted bool avx512er();
AVX-512 Exponential and Reciprocal Instructions
pure nothrow @nogc @property @trusted bool avx512cd();
AVX-512 Conflict Detection Instructions
pure nothrow @nogc @property @trusted bool sha();
supports Intel® Secure Hash Algorithm Extens
pure nothrow @nogc @property @trusted bool avx512bw();
AVX-512 Byte and Word Instructions
pure nothrow @nogc @property @trusted bool avx512vl();
AVX-512 Vector Length Extensions
pure nothrow @nogc @property @trusted bool prefetchwt1();
PREFETCHWT1 instruction
pure nothrow @nogc @property @trusted bool avx512vbmi();
AVX-512 Vector Bit Manipulation Instructions
pure nothrow @nogc @property @trusted bool pku();
Memory Protection Keys for User-mode pages
pure nothrow @nogc @property @trusted bool ospke();
PKU enabled by OS
struct CpuInfo;
x86 CPU information
uint a;
EAX
uint b;
EBX
uint c;
ECX
uint d;
EDX
pure nothrow @nogc @trusted CpuInfo _cpuid()(uint eax, uint ecx = 0);
Parameters:
infoinformation received from CPUID instruction
uint eaxfunction id
uint ecxsub-function id
immutable(char)[12][] vendors()();
VendorIndex name
Examples:
assert(vendors[VendorIndex.intel] == "GenuineIntel");
VendorIndex vendorIndex()();
VendorIndex encoded value.
VendorIndex virtualVendorIndex()();
VendorIndex encoded value for virtual machine.
uint maxBasicLeaf()();
Maximum Input Value for Basic CPUID Information
uint maxExtendedLeaf()();
Maximum Input Value for Extended CPUID Information
uint max7SubLeafs()();
Reports the maximum input value for supported leaf 7 sub-leaves.
enum VendorIndex: int;
Encoded vendors
intel
Intel
amd
AMD
sis
SiS
umc
UMC
via
VIA
amd_old
early engineering samples of AMD K5 processor
centaur
Centaur (Including some VIA CPU)
cyrix
Cyrix
transmeta
Transmeta
nsc
National Semiconductor
nexgen
NexGen
rise
Rise
transmeta_old
Transmeta
vortex
Vortex
undefined
undefined
kvm
KVM
parallels
Parallels
microsoft
Microsoft Hyper-V or Windows Virtual PC
vmware
VMware
xen
Xen HVM
undefinedvm
undefined virtual machine
size_t brand()(ref char[48] brand);
Brand, e.g. Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz.
Returns:
brand length
Parameters:
char[48] brandfixed length string to initiate
string vendor()();
Vendor, e.g. GenuineIntel.
string virtualVendor()();
Virtual vendor, e.g. GenuineIntel or VMwareVMware.
ubyte brandIndex()();
Brand Index
ubyte clflushLineSize()();
CLFLUSH line size

NoteValue ∗ 8 = cache line size in bytes; used also by CLFLUSHOPT.

ubyte maxLogicalProcessors()();
Maximum number of addressable IDs for logical processors in this physical package.
ubyte initialAPIC()();
Initial APIC ID
uint stepping()();
Stepping ID
uint model()();
Model
uint family()();
Family ID
uint type()();
Processor Type, Specification: Intel
uint extendedModel()();
Extended Model ID
uint extendedFamily()();
Extended Family ID
bool sse3()();
SSE3 Extensions
bool pclmulqdq()();
Carryless Multiplication
bool dtes64()();
64-bit DS Area
bool monitor()();
MONITOR/MWAIT
bool ds_cpl()();
CPL Qualified Debug Store
bool vmx()();
Virtual Machine Extensions
bool smx()();
Safer Mode Extensions
bool eist()();
Enhanced Intel SpeedStep® Technology
bool therm_monitor2()();
Thermal Monitor 2
bool ssse3()();
SSSE3 Extensions
bool cnxt_id()();
L1 Context ID
bool sdbg()();
bool fma()();
Fused Multiply Add
bool cmpxchg16b()();
bool xtpr()();
TPR Update Control
bool pdcm()();
Perf/Debug Capability MSR xTPR Update Control
bool pcid()();
Process-context Identifiers
bool dca()();
Direct Cache Access
bool sse41()();
SSE4.1
bool sse42()();
SSE4.2
bool x2apic()();
bool movbe()();
bool popcnt()();
bool tsc_deadline()();
bool aes()();
bool xsave()();
bool osxsave()();
bool avx()();
bool f16c()();
bool rdrand()();
bool virtual()();
Virtual machine
bool fpu()();
x87 FPU on Chip
bool vme()();
Virtual-8086 Mode Enhancement
bool de()();
Debugging Extensions
bool pse()();
Page Size Extensions
bool tsc()();
Time Stamp Counter
bool msr()();
RDMSR and WRMSR Support
bool pae()();
Physical Address Extensions
bool mce()();
Machine Check Exception
bool cx8()();
CMPXCHG8B Inst.
bool apic()();
APIC on Chip
bool sep()();
SYSENTER and SYSEXIT
bool mtrr()();
Memory Type Range Registers
bool pge()();
PTE Global Bit
bool mca()();
Machine Check Architecture
bool cmov()();
Conditional Move/Compare Instruction
bool pat()();
Page Attribute Table
bool pse36()();
Page Size Extension
bool psn()();
Processor Serial Number
bool clfsh()();
CLFLUSH instruction
bool ds()();
Debug Store
bool acpi()();
Thermal Monitor and Clock Ctrl
bool mmx()();
MMX Technology
bool fxsr()();
FXSAVE/FXRSTOR
bool sse()();
SSE Extensions
bool sse2()();
SSE2 Extensions
bool self_snoop()();
Self Snoop
bool htt()();
Multi-threading
bool therm_monitor()();
Therm. Monitor
bool pbe()();
Pend. Brk. EN.
bool fsgsbase()();
Supports RDFSBASE/RDGSBASE/WRFSBASE/WRGSBASE if 1.
bool ia32_tsc_adjust()();
MSR is supported if 1.
bool sgx()();
Supports Intel® Software Guard Extensions (Intel® SGX Extensions) if 1.
bool bmi1()();
Bit Manipulation Instruction Set 1
bool hle()();
Transactional Synchronization Extensions
bool avx2()();
Advanced Vector Extensions 2
bool fdp_excptn_only()();
x87 FPU Data Pointer updated only on x87 exceptions if 1.
bool smep()();
Supports Supervisor-Mode Execution Prevention if 1.
bool bmi2()();
Bit Manipulation Instruction Set 2
bool supports()();
Enhanced REP MOVSB/STOSB if 1.
bool invpcid()();
If 1, supports INVPCID instruction for system software that manages process-context identifiers.
bool rtm()();
Transactional Synchronization Extensions
bool rdt_m()();
Supports Intel® Resource Director Technology (Intel® RDT) Monitoring capability if 1.
bool deprecates()();
FPU CS and FPU DS values if 1.
bool mpx()();
Supports Intel® Memory Protection Extensions if 1.
bool rdt_a()();
Supports Intel® Resource Director Technology (Intel® RDT) Allocation capability if 1.
bool avx512f()();
AVX-512 Foundation
bool avx512dq()();
AVX-512 Doubleword and Quadword Instructions
bool rdseed()();
RDSEED instruction
bool adx()();
Intel ADX (Multi-Precision Add-Carry Instruction Extensions)
bool smap()();
Supports Supervisor-Mode Access Prevention (and the CLAC/STAC instructions) if 1.
bool avx512ifma()();
AVX-512 Integer Fused Multiply-Add Instructions
bool pcommit()();
PCOMMIT instruction
bool clflushopt()();
CLFLUSHOPT instruction
bool clwb()();
CLWB instruction
bool intel_pt()();
Intel Processor Trace.
bool avx512pf()();
AVX-512 Prefetch Instructions
bool avx512er()();
AVX-512 Exponential and Reciprocal Instructions
bool avx512cd()();
AVX-512 Conflict Detection Instructions
bool sha()();
supports Intel® Secure Hash Algorithm Extens
bool avx512bw()();
AVX-512 Byte and Word Instructions
bool avx512vl()();
AVX-512 Vector Length Extensions
bool prefetchwt1()();
PREFETCHWT1 instruction
bool avx512vbmi()();
AVX-512 Vector Bit Manipulation Instructions
bool pku()();
Memory Protection Keys for User-mode pages
bool ospke()();
PKU enabled by OS