ROOT
6.07/01
Reference Guide
|
This class is available for x86 / AMD64 systems to read and interpret information about the CPU's capabilities.
Before any of the getter functions may be called, the init() function must have been called. It will be called automatically, but for any function executing before main, you better call CpuId::init()
first.
Vc users will most likely not need this class directly, but rely on the isImplementationSupported, bestImplementationSupported, extraInstructionsSupported, and currentImplementationSupported functions.
Public Types | |
enum | ProcessorType { OriginalOemProcessor = 0, IntelOverDriveProcessor = 1, DualProcessor = 2, IntelReserved = 3 } |
Static Public Member Functions | |
static void | init () |
Reads the CPU capabilities and stores them for faster subsequent access. More... | |
static ushort | cacheLineSize () |
Return the cache line size in bits. More... | |
static ProcessorType | processorType () |
Return the ProcessorType. More... | |
static uint | processorFamily () |
Return the family number of the processor (vendor dependent). More... | |
static uint | processorModel () |
Return the model number of the processor (vendor dependent). More... | |
static uint | logicalProcessors () |
Return the number of logical processors. More... | |
static bool | isAmd () |
Return whether the CPU vendor is AMD. More... | |
static bool | isIntel () |
Return whether the CPU vendor is Intel. More... | |
static bool | hasSse3 () |
Return whether the CPU supports SSE3. More... | |
static bool | hasPclmulqdq () |
Return whether the CPU supports the PCLMULQDQ instruction. More... | |
static bool | hasMonitor () |
Return whether the CPU supports the MONITOR/MWAIT instructions. More... | |
static bool | hasVmx () |
Return whether the CPU supports the Virtual Machine Extensions. More... | |
static bool | hasSmx () |
Return whether the CPU supports the Safer Mode Extensions. More... | |
static bool | hasEist () |
Return whether the CPU supports the Enhanced Intel SpeedStep technology. More... | |
static bool | hasTm2 () |
Return whether the CPU supports Thermal Monitor 2. More... | |
static bool | hasSsse3 () |
Return whether the CPU supports SSSE3. More... | |
static bool | hasFma () |
Return whether the CPU supports FMA extensions using YMM state. More... | |
static bool | hasCmpXchg16b () |
Return whether the CPU supports CMPXCHG16B. More... | |
static bool | hasPdcm () |
Return whether the CPU supports the Perfmon and Debug Capability. More... | |
static bool | hasDca () |
Return whether the CPU supports Direct Cache Access: prefetch data from a memory mapped device. More... | |
static bool | hasSse41 () |
Return whether the CPU supports SSE 4.1. More... | |
static bool | hasSse42 () |
Return whether the CPU supports SSE 4.2. More... | |
static bool | hasMovbe () |
Return whether the CPU supports the MOVBE instruction. More... | |
static bool | hasPopcnt () |
Return whether the CPU supports the POPCNT instruction. More... | |
static bool | hasAes () |
Return whether the CPU supports the AESNI instructions. More... | |
static bool | hasOsxsave () |
Return whether the CPU and OS support the XSETBV/XGETBV instructions. More... | |
static bool | hasAvx () |
Return whether the CPU supports AVX. More... | |
static bool | hasF16c () |
Return whether the CPU supports 16-bit floating-point conversion instructions. More... | |
static bool | hasRdrand () |
Return whether the CPU supports the RDRAND instruction. More... | |
static bool | hasFpu () |
Return whether the CPU contains an x87 FPU. More... | |
static bool | hasVme () |
static bool | hasDe () |
Return whether the CPU contains Debugging Extensions. More... | |
static bool | hasPse () |
Return whether the CPU contains Page Size Extensions. More... | |
static bool | hasTsc () |
Return whether the CPU supports the RDTSC instruction. More... | |
static bool | hasMsr () |
Return whether the CPU supports the Model Specific Registers instructions. More... | |
static bool | hasPae () |
Return whether the CPU supports the Physical Address Extension. More... | |
static bool | hasCx8 () |
Return whether the CPU supports the CMPXCHG8B instruction. More... | |
static bool | hasMtrr () |
Return whether the CPU supports Memory Type Range Registers. More... | |
static bool | hasCmov () |
Return whether the CPU supports CMOV instructions. More... | |
static bool | hasClfsh () |
Return whether the CPU supports the CLFLUSH instruction. More... | |
static bool | hasAcpi () |
Return whether the CPU supports ACPI. More... | |
static bool | hasMmx () |
Return whether the CPU supports MMX. More... | |
static bool | hasSse () |
Return whether the CPU supports SSE. More... | |
static bool | hasSse2 () |
Return whether the CPU supports SSE2. More... | |
static bool | hasHtt () |
static bool | hasSse4a () |
Return whether the CPU supports SSE4a. More... | |
static bool | hasMisAlignSse () |
Return whether the CPU supports misaligned SSE instructions. More... | |
static bool | hasAmdPrefetch () |
Return whether the CPU supports the AMD prefetchw instruction. More... | |
static bool | hasXop () |
Return whether the CPU supports the XOP instructions. More... | |
static bool | hasFma4 () |
Return whether the CPU supports the FMA4 instructions. More... | |
static bool | hasRdtscp () |
Return whether the CPU supports the RDTSCP instruction. More... | |
static bool | has3DNow () |
static bool | has3DNowExt () |
static uint | L1Instruction () |
Return the size of the L1 instruction cache. More... | |
static uint | L1Data () |
Return the size of the L1 data cache. More... | |
static uint | L2Data () |
Return the size of the L2 cache. More... | |
static uint | L3Data () |
Return the size of the L3 cache. More... | |
static ushort | L1InstructionLineSize () |
static ushort | L1DataLineSize () |
static ushort | L2DataLineSize () |
static ushort | L3DataLineSize () |
static uint | L1Associativity () |
static uint | L2Associativity () |
static uint | L3Associativity () |
static ushort | prefetch () |
Private Types | |
typedef unsigned char | uchar |
typedef unsigned short | ushort |
typedef unsigned int | uint |
Static Private Member Functions | |
static void | interpret (uchar byte, bool *checkLeaf4) |
Static Private Attributes | |
static uint | s_ecx0 = 0 |
static uint | s_logicalProcessors = 0 |
static uint | s_processorFeaturesC = 0 |
static uint | s_processorFeaturesD = 0 |
static uint | s_processorFeatures8C = 0 |
static uint | s_processorFeatures8D = 0 |
static uint | s_L1Instruction = 0 |
static uint | s_L1Data = 0 |
static uint | s_L2Data = 0 |
static uint | s_L3Data = 0 |
static ushort | s_L1InstructionLineSize = 0 |
static ushort | s_L1DataLineSize = 0 |
static ushort | s_L2DataLineSize = 0 |
static ushort | s_L3DataLineSize = 0 |
static uint | s_L1Associativity = 0 |
static uint | s_L2Associativity = 0 |
static uint | s_L3Associativity = 0 |
static ushort | s_prefetch = 32 |
static uchar | s_brandIndex = 0 |
static uchar | s_cacheLineSize = 0 |
static uchar | s_processorModel = 0 |
static uchar | s_processorFamily = 0 |
static ProcessorType | s_processorType = CpuId::IntelReserved |
static bool | s_noL2orL3 = false |
#include <Vc/cpuid.h>
|
private |
|
private |
|
private |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return whether the CPU supports AVX.
Definition at line 117 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return whether the CPU supports 16-bit floating-point conversion instructions.
Definition at line 119 of file cpuid.h.
Referenced by ROOT::Vc::extraInstructionsSupported().
|
inlinestatic |
Return whether the CPU supports FMA extensions using YMM state.
Definition at line 95 of file cpuid.h.
Referenced by ROOT::Vc::extraInstructionsSupported().
|
inlinestatic |
Return whether the CPU supports the FMA4 instructions.
Definition at line 161 of file cpuid.h.
Referenced by ROOT::Vc::extraInstructionsSupported().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return whether the CPU and OS support the XSETBV/XGETBV instructions.
Definition at line 115 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return whether the CPU supports the POPCNT instruction.
Definition at line 109 of file cpuid.h.
Referenced by ROOT::Vc::extraInstructionsSupported().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return whether the CPU supports SSE2.
Definition at line 150 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
Return whether the CPU supports SSE3.
Definition at line 79 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
Return whether the CPU supports SSE 4.1.
Definition at line 103 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
Return whether the CPU supports SSE 4.2.
Definition at line 105 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
Return whether the CPU supports SSE4a.
Definition at line 153 of file cpuid.h.
Referenced by ROOT::Vc::extraInstructionsSupported().
|
inlinestatic |
Return whether the CPU supports SSSE3.
Definition at line 93 of file cpuid.h.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
Return whether the CPU supports the XOP instructions.
Definition at line 159 of file cpuid.h.
Referenced by ROOT::Vc::extraInstructionsSupported().
|
static |
Reads the CPU capabilities and stores them for faster subsequent access.
Will be executed automatically before main, but not necessarily before other functions executing before main.
Definition at line 120 of file cpuid.cpp.
Referenced by ROOT::Vc::bestImplementationSupported(), and ROOT::Vc::isImplementationSupported().
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
staticprivate |
|
staticprivate |
Definition at line 205 of file cpuid.h.
Referenced by cacheLineSize(), and init().
|
staticprivate |
|
staticprivate |
Definition at line 200 of file cpuid.h.
Referenced by init(), interpret(), and L1Associativity().
|
staticprivate |
Definition at line 193 of file cpuid.h.
Referenced by init(), interpret(), and L1Data().
|
staticprivate |
Definition at line 197 of file cpuid.h.
Referenced by init(), interpret(), and L1DataLineSize().
|
staticprivate |
Definition at line 192 of file cpuid.h.
Referenced by init(), interpret(), and L1Instruction().
|
staticprivate |
Definition at line 196 of file cpuid.h.
Referenced by init(), interpret(), and L1InstructionLineSize().
|
staticprivate |
Definition at line 201 of file cpuid.h.
Referenced by init(), interpret(), and L2Associativity().
|
staticprivate |
Definition at line 194 of file cpuid.h.
Referenced by init(), interpret(), and L2Data().
|
staticprivate |
Definition at line 198 of file cpuid.h.
Referenced by init(), interpret(), and L2DataLineSize().
|
staticprivate |
Definition at line 202 of file cpuid.h.
Referenced by init(), interpret(), and L3Associativity().
|
staticprivate |
Definition at line 195 of file cpuid.h.
Referenced by init(), interpret(), and L3Data().
|
staticprivate |
Definition at line 199 of file cpuid.h.
Referenced by init(), interpret(), and L3DataLineSize().
|
staticprivate |
Definition at line 187 of file cpuid.h.
Referenced by init(), and logicalProcessors().
|
staticprivate |
Definition at line 209 of file cpuid.h.
Referenced by interpret().
|
staticprivate |
Definition at line 203 of file cpuid.h.
Referenced by init(), interpret(), and prefetch().
|
staticprivate |
Definition at line 207 of file cpuid.h.
Referenced by init(), interpret(), and processorFamily().
|
staticprivate |
Definition at line 190 of file cpuid.h.
Referenced by hasAmdPrefetch(), hasFma4(), hasMisAlignSse(), hasSse4a(), hasXop(), and init().
|
staticprivate |
Definition at line 191 of file cpuid.h.
Referenced by has3DNow(), has3DNowExt(), hasRdtscp(), and init().
|
staticprivate |
Definition at line 188 of file cpuid.h.
Referenced by hasAes(), hasAvx(), hasCmpXchg16b(), hasDca(), hasEist(), hasF16c(), hasFma(), hasMonitor(), hasMovbe(), hasOsxsave(), hasPclmulqdq(), hasPdcm(), hasPopcnt(), hasRdrand(), hasSmx(), hasSse3(), hasSse41(), hasSse42(), hasSsse3(), hasTm2(), hasVmx(), and init().
|
staticprivate |
|
staticprivate |
Definition at line 206 of file cpuid.h.
Referenced by init(), interpret(), and processorModel().
|
staticprivate |
Definition at line 208 of file cpuid.h.
Referenced by init(), and processorType().