java.lang.Object
freenet.support.CPUInformation.CPUIDCPUInfo
freenet.support.CPUInformation.IntelInfoImpl
- All Implemented Interfaces:
CPUInfo, IntelCPUInfo
Identifies Intel CPUs via
CPUID and exposes instruction set support flags.Identification Strategy
Two identification paths are used, in order of priority:
- Brand string (CPUID leaf
0x80000002–0x80000004): Returns the exact marketing name (e.g. "Intel(R) Core(TM) i9-14900K") and is always accurate when the CPU supports extended CPUID leaves. - Model number fallback: For very old CPUs without brand string support, the processor identifier is computed from CPUID family/model/extended-model/extended-family values and matched against a table of known Intel microarchitectures.
Instruction Set Flags
Regardless of the identification path, the switch(family) block always runs to set the instruction set compatibility flags (isSandyCompatible, isHaswellCompatible, etc.), which are queried by callers to determine feature availability (AVX, AVX2, AVX-512, BMI, FMA, etc.).
Intel Family 6 Model Numbers
Intel uses family 6 for all modern Core processors. The model number (base model + extended model) distinguishes microarchitectures:
0x0e-0x0f Core (Merom/Conroe) 0x1a-0x1f Nehalem 0x25-0x2f Westmere 0x25-0x2f Sandy Bridge 0x3a-0x3f Ivy Bridge 0x3c-0x3f Haswell 0x45-0x47 Haswell (ULT) 0x3d-0x4f Broadwell 0x4e-0x5e Skylake 0x55 Skylake-X / Cascade Lake / Cooper Lake 0x5c-0x5f Goldmont (Atom) 0x66-0x67 Cannon Lake 0x7a Gemini Lake 0x7c Lakefield 0x7d-0x7e Ice Lake client 0x6a-0x6c Ice Lake server 0x82-0x9e Kaby Lake / Coffee Lake 0xa5-0xa6 Comet Lake 0x8c-0x8d Tiger Lake 0xa7 Rocket Lake 0x97-0x9a Alder Lake 0xb7-0xbf Raptor Lake 0xaa-0xac Meteor Lake 0xb5-0xc6 Arrow Lake 0xbd Lunar Lake 0xcc Panther Lake 0xd5 Wildcat Lake 0x8f Sapphire Rapids 0xcf Emerald Rapids 0xad-0xae Granite Rapids 0xaf Sierra Forest 0xdd Clearwater Forest 0xb6 Grand Ridge 0xbe Gracemont (E-core only)
- See Also:
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanTrue for an Atom class CPU or better.private static booleanTrue for a Broadwell class CPU or better.private static booleanTrue for a Core 2 class CPU or better.private static booleanTrue for a Core i class CPU or better.private static booleanTrue for a Haswell class CPU or better.private static booleanTrue for an Ivy Bridge class CPU or better.private static booleanTrue for a Pentium II class CPU or better.private static booleanTrue for a Pentium III class CPU or better.private static booleanTrue for a Pentium 4 class CPU or better.private static booleanTrue for a Pentium class CPU or better.private static booleanTrue for a Pentium M class CPU or better.private static booleanTrue for a Pentium MMX class CPU or better.private static booleanTrue for a Sandy Bridge class CPU or better.private static booleanTrue for a Skylake class CPU or better.private static final StringIdentified processor name fromidentifyCPU(), ornullif unrecognized.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionReturns the identified processor name, or throws if unrecognized.private static StringIdentifies the Intel CPU and sets instruction set compatibility flags.booleantrueif the CPU is an Intel Atom (Silvermont/Goldmont/etc.).booleantrueif the CPU supports Broadwell (ADX, AVX-512PF/ER) instructions.booleantrueif the CPU supports Core 2 (SSSE3) instructions.booleantrueif the CPU supports Core i-series (SSE4.2) instructions.booleantrueif the CPU supports Haswell (AVX2, BMI1/2, FMA) instructions.booleantrueif the CPU supports Ivy Bridge (AVX, PCMPGTQ) instructions.booleantrueif the CPU supports Pentium II (P6) instructions.booleantrueif the CPU supports Pentium III instructions (SSE).booleantrueif the CPU supports Pentium 4 instructions (SSE2).booleantrueif the CPU supports Pentium (P5) instructions.booleantrueif the CPU supports Pentium M (Dothan/Core) instructions.booleantrueif the CPU supports Pentium MMX instructions.booleantrueif the CPU supports Sandy Bridge (AVX) instructions.booleantrueif the CPU supports Skylake (AVX-512F/DQ/BW/VL) instructions.Methods inherited from class CPUIDCPUInfo
getVendor, hasABM, hasADX, hasAES, hasAVX, hasAVX2, hasAVX512, hasBMI1, hasBMI2, hasFMA3, hasMMX, hasMOVBE, hasSSE, hasSSE2, hasSSE3, hasSSE41, hasSSE42, hasSSE4A, hasTBM, hasX64Modifier and TypeMethodDescriptionGets the CPU vendor.booleanhasABM()Also known as LZCNTbooleanhasADX()Intel Multi-Precision Add-Carry Instruction Extensions Available in Broadwell.booleanhasAES()Whether the CPU supports AES.booleanhasAVX()Whether the CPU supports AVX.booleanhasAVX2()Whether the CPU supports AVX2.booleanDoes the CPU supports the AVX-512 Foundation instruction set? Quote wikipedia: AVX-512 consists of multiple extensions not all meant to be supported by all processors implementing them.booleanhasBMI1()Whether the CPU supports BMI1.booleanhasBMI2()Whether the CPU supports BMI2.booleanhasFMA3()Whether the CPU supports FMA3.booleanhasMMX()Checks if CPU supports the MMX instruction set.booleanhasMOVBE()Whether the CPU supports MOVBE.booleanhasSSE()Checks if CPU supports the SSE instruction set.booleanhasSSE2()Checks if CPU supports the SSE2 instruction set.booleanhasSSE3()Checks if CPU supports the SSE3 instruction set.booleanhasSSE41()Checks if CPU supports the SSE4.1 instruction set.booleanhasSSE42()Checks if CPU supports the SSE4.2 instruction set.booleanhasSSE4A()AMD K10 only.booleanhasTBM()Trailing Bit Manipulation (AMD feature)booleanhasX64()Whether the CPU supports 64-bit mode.
Field Details
isPentiumCompatible
private static boolean isPentiumCompatibleTrue for a Pentium class CPU or better.isPentiumMMXCompatible
private static boolean isPentiumMMXCompatibleTrue for a Pentium MMX class CPU or better.isPentium2Compatible
private static boolean isPentium2CompatibleTrue for a Pentium II class CPU or better.isPentium3Compatible
private static boolean isPentium3CompatibleTrue for a Pentium III class CPU or better.isPentium4Compatible
private static boolean isPentium4CompatibleTrue for a Pentium 4 class CPU or better.isPentiumMCompatible
private static boolean isPentiumMCompatibleTrue for a Pentium M class CPU or better.isAtomCompatible
private static boolean isAtomCompatibleTrue for an Atom class CPU or better.isCore2Compatible
private static boolean isCore2CompatibleTrue for a Core 2 class CPU or better.isCoreiCompatible
private static boolean isCoreiCompatibleTrue for a Core i class CPU or better.isSandyCompatible
private static boolean isSandyCompatibleTrue for a Sandy Bridge class CPU or better.isIvyCompatible
private static boolean isIvyCompatibleTrue for an Ivy Bridge class CPU or better.isHaswellCompatible
private static boolean isHaswellCompatibleTrue for a Haswell class CPU or better.isBroadwellCompatible
private static boolean isBroadwellCompatibleTrue for a Broadwell class CPU or better.isSkylakeCompatible
private static boolean isSkylakeCompatibleTrue for a Skylake class CPU or better.smodel
Identified processor name fromidentifyCPU(), ornullif unrecognized.
Constructor Details
IntelInfoImpl
IntelInfoImpl()Constructor. The family and model detection below reads the static CPUID results, so an instance carries no state beyond the base class.
Method Details
IsPentiumCompatible
public boolean IsPentiumCompatible()trueif the CPU supports Pentium (P5) instructions.- Specified by:
IsPentiumCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU is at least a Pentium CPU
IsPentiumMMXCompatible
public boolean IsPentiumMMXCompatible()trueif the CPU supports Pentium MMX instructions.- Specified by:
IsPentiumMMXCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU is at least a Pentium MMX compatible CPU
IsPentium2Compatible
public boolean IsPentium2Compatible()trueif the CPU supports Pentium II (P6) instructions.- Specified by:
IsPentium2Compatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least the p6 instruction set
IsPentium3Compatible
public boolean IsPentium3Compatible()trueif the CPU supports Pentium III instructions (SSE).- Specified by:
IsPentium3Compatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Pentium III level
IsPentium4Compatible
public boolean IsPentium4Compatible()trueif the CPU supports Pentium 4 instructions (SSE2).- Specified by:
IsPentium4Compatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Pentium IV level
IsPentiumMCompatible
public boolean IsPentiumMCompatible()trueif the CPU supports Pentium M (Dothan/Core) instructions.- Specified by:
IsPentiumMCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Pentium M level
IsAtomCompatible
public boolean IsAtomCompatible()trueif the CPU is an Intel Atom (Silvermont/Goldmont/etc.).- Specified by:
IsAtomCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least an Atom level instruction/feature set
IsCore2Compatible
public boolean IsCore2Compatible()trueif the CPU supports Core 2 (SSSE3) instructions.- Specified by:
IsCore2Compatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Core2 level instruction/feature set
IsCoreiCompatible
public boolean IsCoreiCompatible()trueif the CPU supports Core i-series (SSE4.2) instructions.- Specified by:
IsCoreiCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Corei level instruction/feature set
IsSandyCompatible
public boolean IsSandyCompatible()trueif the CPU supports Sandy Bridge (AVX) instructions.- Specified by:
IsSandyCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a SandyBridge level instruction/feature set
IsIvyCompatible
public boolean IsIvyCompatible()trueif the CPU supports Ivy Bridge (AVX, PCMPGTQ) instructions.- Specified by:
IsIvyCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least an IvyBridge level instruction/feature set
IsHaswellCompatible
public boolean IsHaswellCompatible()trueif the CPU supports Haswell (AVX2, BMI1/2, FMA) instructions.- Specified by:
IsHaswellCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Haswell level instruction/feature set
IsBroadwellCompatible
public boolean IsBroadwellCompatible()trueif the CPU supports Broadwell (ADX, AVX-512PF/ER) instructions.- Specified by:
IsBroadwellCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Broadwell level instruction/feature set
IsSkylakeCompatible
public boolean IsSkylakeCompatible()trueif the CPU supports Skylake (AVX-512F/DQ/BW/VL) instructions.- Specified by:
IsSkylakeCompatiblein interfaceIntelCPUInfo- Returns:
- true if the CPU implements at least a Skylake level instruction/feature set
getCPUModelString
Returns the identified processor name, or throws if unrecognized.- Specified by:
getCPUModelStringin interfaceCPUInfo- Overrides:
getCPUModelStringin classCPUIDCPUInfo- Returns:
- the CPU model string (e.g. "Intel(R) Core(TM) i9-14900K" or "Skylake Core i3/i5/i7")
- Throws:
UnknownCPUException- if the CPU could not be identified
identifyCPU
Identifies the Intel CPU and sets instruction set compatibility flags.Strategy:
- Capture the CPUID brand string (leaf
0x80000002–0x80000004), which gives the exact marketing name when available. - Compute the processor family and model from CPUID leaf 1, handling Intel's extended model and extended family fields.
- Walk a
switch(family)block that matches known model numbers to microarchitecture codenames and sets the appropriate instruction set compatibility flags (isSandyCompatible,isHaswellCompatible, etc.). - Override the model-based name with the brand string if one was captured, providing a more accurate and user-friendly display string.
The brand string override at the end ensures that modern CPUs (family 6) always display the correct marketing name, while the model-based switch still runs to set the instruction set flags needed by callers.
- Returns:
- the identified processor name, or
nullif unrecognized
- Capture the CPUID brand string (leaf