Page
Library
Module
Module type
Parameter
Class
Class type
Source
CpuidDetect CPU features.
v0.0.1 — homepage
Cpuid provides runtime detection of CPU features through the x86 CPUID instruction. Detection discovers the CPU vendor and a set of feature flags.
The flag names reflect the Linux convention, except in uppercase. Only the features reported by the CPU are included (i.e. there are no synthetic flags).
Cpuid currently relies on an x86-specific feature. The library runs on ARM processors, but calls return an error.
The only consulted CPUID-leaves are 0x00000001, 0x00000007:0 and 0x80000001. Hence, the reported features are a subset of what Linux would report.
type 'a result = ('a, error) Result.resulttype vendor = [ | `AMD| `Centaur| `Cyrix| `Intel| `Transmeta| `NSC| `NexGen| `Rise| `SiS| `UMC| `VIA| `Vortex| `KVM| `Hyper_V| `Parallels| `VMware| `Xen| `UNKNOWN ]The CPU manufacturer, the type of virtual environment, or `UNKNOWN.
type flag = [ | `FPUOnboard FPU
*)| `VMEVirtual Mode Extensions
*)| `DEDebugging Extensions
*)| `PSEPage Size Extensions
*)| `TSCTime Stamp Counter
*)| `MSRModel-Specific Registers
*)| `PAEPhysical Address Extensions
*)| `MCEMachine Check Exception
*)| `CX8CMPXCHG8 instruction
*)| `APICOnboard APIC
*)| `SEPSYSENTER/SYSEXIT
*)| `MTRRMemory Type Range Registers
*)| `PGEPage Global Enable
*)| `MCAMachine Check Architecture
*)| `CMOVCMOV instructions
*)| `PATPage Attribute Table
*)| `PSE3636-bit PSEs
*)| `PNProcessor serial number
*)| `CLFLUSHCLFLUSH instruction
*)| `DTSDebug Store
*)| `ACPIACPI via MSR
*)| `MMXMultimedia Extensions
*)| `FXSRFXSAVE/FXRSTOR, CR4.OSFXSR
*)| `SSESSE
*)| `SSE2SSE2
*)| `SSCPU self snoop
*)| `HTHyper-Threading
*)| `TMAutomatic clock control
*)| `IA64IA-64 processor
*)| `PBEPending Break Enable
*)| `SYSCALLSYSCALL/SYSRET
*)| `MPMP Capable.
*)| `NXExecute Disable
*)| `MMXEXTAMD MMX extensions
*)| `FXSR_OPTFXSAVE/FXRSTOR optimizations
*)| `PDPE1GBGB pages
*)| `RDTSCPRDTSCP
*)| `LMLong Mode (x86-64)
*)| `F_3DNOWEXTAMD 3DNow! extensions
*)| `F_3DNOW3DNow!
*)| `PNISSE-3
*)| `PCLMULQDQPCLMULQDQ instruction
*)| `DTES6464-bit Debug Store
*)| `MONITORMonitor/Mwait support
*)| `DS_CPLCPL Qual. Debug Store
*)| `VMXHardware virtualization
*)| `SMXSafer mode
*)| `ESTEnhanced SpeedStep
*)| `TM2Thermal Monitor 2
*)| `SSSE3Supplemental SSE-3
*)| `CIDContext ID
*)| `SDBGSilicon Debug
*)| `FMAFused multiply-add
*)| `CX16CMPXCHG16B
*)| `XTPRSend Task Priority Messages
*)| `PDCMPerformance Capabilities
*)| `PCIDProcess Context Identifiers
*)| `DCADirect Cache Access
*)| `SSE4_1SSE-4.1
*)| `SSE4_2SSE-4.2
*)| `X2APICx2APIC
*)| `MOVBEMOVBE instruction
*)| `POPCNTPOPCNT instruction
*)| `TSC_DEADLINE_TIMERTsc deadline timer
*)| `AESAES instructions
*)| `XSAVEXSAVE/XRSTOR/XSETBV/XGETBV
*)| `OSXSAVEXSAVE enabled in the OS
*)| `AVXAdvanced Vector Extensions
*)| `F16C16-bit fp conversions
*)| `RDRANDThe RDRAND instruction
*)| `HYPERVISORRunning on a hypervisor
*)| `LAHF_LMLAHF/SAHF in long mode
*)| `CMP_LEGACYIf yes HyperThreading not valid
*)| `SVMSecure virtual machine
*)| `EXTAPICExtended APIC space
*)| `CR8_LEGACYCR8 in 32-bit mode
*)| `ABMAdvanced bit manipulation
*)| `SSE4ASSE-4A
*)| `MISALIGNSSEMisaligned SSE mode
*)| `F_3DNOWPREFETCH3DNow prefetch instructions
*)| `OSVWOS Visible Workaround
*)| `IBSInstruction Based Sampling
*)| `XOPextended AVX instructions
*)| `SKINITSKINIT/STGI instructions
*)| `WDTWatchdog timer
*)| `LWPLight Weight Profiling
*)| `FMA44 operands MAC instructions
*)| `TCEtranslation cache extension
*)| `NODEID_MSRNodeId MSR
*)| `TBMtrailing bit manipulations
*)| `TOPOEXTtopology extensions CPUID leafs
*)| `PERFCTR_COREcore performance counter extensions
*)| `PERFCTR_NBNB performance counter extensions
*)| `BPEXTdata breakpoint extension
*)| `PTSCperformance time-stamp counter
*)| `PERFCTR_L2L2 performance counter extensions
*)| `MWAITXMWAIT extension ( MONITORX/MWAITX)
*)| `FSGSBASED/WR
FS/GSBASE instructions
| `TSC_ADJUSTTSC adjustment MSR 0x3b
*)| `BMI11st group bit manipulation extensions
*)| `HLEHardware Lock Elision
*)| `AVX2AVX2 instructions
*)| `SMEPSupervisor Mode Execution Protection
*)| `BMI22nd group bit manipulation extensions
*)| `ERMSEnhanced REP MOVSB/STOSB
*)| `INVPCIDInvalidate Processor Context ID
*)| `RTMRestricted Transactional Memory
*)| `CQMCache QoS Monitoring
*)| `MPXMemory Protection Extension
*)| `AVX512FAVX-512 Foundation
*)| `AVX512DQAVX-512 DQ (Double/Quad granular) Instructions
*)| `RDSEEDThe RDSEED instruction
*)| `ADXThe ADCX and ADOX instructions
*)| `SMAPSupervisor Mode Access Prevention
*)| `CLFLUSHOPTCLFLUSHOPT instruction
*)| `CLWBCLWB instruction
*)| `AVX512PFAVX-512 Prefetch
*)| `AVX512ERAVX-512 Exponential and Reciprocal
*)| `AVX512CDAVX-512 Conflict Detection
*)| `SHA_NISHA1/SHA256 Instruction Extensions
*)| `AVX512BWAVX-512 BW (Byte/Word granular) Instructions
*)| `AVX512VLAVX-512 VL (128/256 Vector Length) Extensions
*)| `PKUProtection Keys for Userspace
*)| `OSPKEOS Protection Keys Enable
*) ]CPU flags signify presence of individual features.
Consult the interface file for the meaning of individual flags.
val pp_error : Format.formatter -> error -> unitpp_error ppf e formats the error e to the formatter ppf.
val pp_vendor : Format.formatter -> vendor -> unitpp_vendor ppf v formats the vendor v to the formatter ppf.
val pp_flag : Format.formatter -> flag -> unitpp_flag ppf f formats the flag f to the formatter ppf.