forked from I2P_Developers/i2p.i2p
Recognize Skylake
Do the same checks for Broadwell and Skylake that we do for Haswell, and check ADX as well, which will be used in GMP 6.1. Javadocs
This commit is contained in:
@ -85,6 +85,11 @@ class CPUIDCPUInfo implements CPUInfo
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Intel Multi-Precision Add-Carry Instruction Extensions
|
||||
* Available in Broadwell.
|
||||
* Unused until GMP 6.1.
|
||||
*
|
||||
* @return true iff the CPU supports the ADX instruction set.
|
||||
* @since 0.9.25
|
||||
*/
|
||||
|
@ -98,6 +98,11 @@ public interface CPUInfo
|
||||
public boolean hasAVX512();
|
||||
|
||||
/**
|
||||
*
|
||||
* Intel Multi-Precision Add-Carry Instruction Extensions
|
||||
* Available in Broadwell.
|
||||
* Unused until GMP 6.1.
|
||||
*
|
||||
* @return true iff the CPU supports the ADX instruction set.
|
||||
* @since 0.9.25
|
||||
*/
|
||||
|
@ -128,6 +128,13 @@ public interface IntelCPUInfo extends CPUInfo {
|
||||
* All GMP coreibwl binaries are duplicates of binaries for older technologies,
|
||||
* so we do not distribute any. However, this is called from NativeBigInteger.
|
||||
*
|
||||
* Broadwell is supported in GMP 6.1 and requires the ADX instructions.
|
||||
*
|
||||
* Requires support for all 7 of these Corei features: FMA3 MOVBE ABM AVX2 BMI1 BMI2 ADX
|
||||
* Pentium/Celeron Broadwell processors that do not support these instruction sets are not compatible.
|
||||
* Those processors will be Sandy-compatible if they have AVX 1 support,
|
||||
* and Corei-compatible if they do not.
|
||||
*
|
||||
* @return true if the CPU implements at least a Broadwell level instruction/feature set.
|
||||
* @since 0.9.25
|
||||
*/
|
||||
|
@ -342,13 +342,31 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
||||
// case 0x3c: See below
|
||||
|
||||
// Broadwell 14 nm
|
||||
case 0x3d:
|
||||
isSandyCompatible = true;
|
||||
isIvyCompatible = true;
|
||||
isHaswellCompatible = true;
|
||||
isBroadwellCompatible = true;
|
||||
modelString = "Broadwell";
|
||||
// See Haswell notes below
|
||||
case 0x3d: {
|
||||
CPUIDCPUInfo c = new CPUIDCPUInfo();
|
||||
if (c.hasAVX2() && c.hasBMI1() && c.hasBMI2() &&
|
||||
c.hasFMA3() && c.hasMOVBE() && c.hasABM() &&
|
||||
c.hasADX()) {
|
||||
isSandyCompatible = true;
|
||||
isIvyCompatible = true;
|
||||
isHaswellCompatible = true;
|
||||
isBroadwellCompatible = true;
|
||||
modelString = "Broadwell Core i3/i5/i7";
|
||||
} else {
|
||||
// This processor is "corei" compatible, as we define it,
|
||||
// i.e. SSE4.2 but not necessarily AVX.
|
||||
if (c.hasAVX()) {
|
||||
isSandyCompatible = true;
|
||||
isIvyCompatible = true;
|
||||
modelString = "Broadwell Celeron/Pentium w/ AVX";
|
||||
} else {
|
||||
modelString = "Broadwell Celeron/Pentium";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Ivy Bridge 22 nm
|
||||
case 0x3e:
|
||||
isSandyCompatible = true;
|
||||
@ -376,6 +394,7 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
||||
case 0x3f:
|
||||
case 0x45:
|
||||
case 0x46:
|
||||
{
|
||||
CPUIDCPUInfo c = new CPUIDCPUInfo();
|
||||
if (c.hasAVX2() && c.hasBMI1() && c.hasBMI2() &&
|
||||
c.hasFMA3() && c.hasMOVBE() && c.hasABM()) {
|
||||
@ -395,6 +414,7 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Quark 32nm
|
||||
case 0x4a:
|
||||
@ -409,10 +429,43 @@ class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
||||
modelString = "Atom";
|
||||
break;
|
||||
|
||||
// following are for extended model == 5
|
||||
// most flags are set above
|
||||
// isCoreiCompatible = true is the default
|
||||
|
||||
// Skylake 14 nm
|
||||
// See reference link errata #SKD052 re: BMI
|
||||
// ref: http://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/desktop-6th-gen-core-family-spec-update.pdf
|
||||
// See Haswell notes above
|
||||
case 0x5e: {
|
||||
CPUIDCPUInfo c = new CPUIDCPUInfo();
|
||||
if (c.hasAVX2() && c.hasBMI1() && c.hasBMI2() &&
|
||||
c.hasFMA3() && c.hasMOVBE() && c.hasABM() &&
|
||||
c.hasADX()) {
|
||||
isSandyCompatible = true;
|
||||
isIvyCompatible = true;
|
||||
isHaswellCompatible = true;
|
||||
isBroadwellCompatible = true;
|
||||
modelString = "Skylake Core i3/i5/i7";
|
||||
} else {
|
||||
// This processor is "corei" compatible, as we define it,
|
||||
// i.e. SSE4.2 but not necessarily AVX.
|
||||
if (c.hasAVX()) {
|
||||
isSandyCompatible = true;
|
||||
isIvyCompatible = true;
|
||||
modelString = "Skylake Celeron/Pentium w/ AVX";
|
||||
} else {
|
||||
modelString = "Skylake Celeron/Pentium";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// others
|
||||
default:
|
||||
modelString = "Intel model " + model;
|
||||
break;
|
||||
|
||||
} // switch model
|
||||
} // case 6
|
||||
break;
|
||||
|
Reference in New Issue
Block a user