forked from I2P_Developers/i2p.i2p
Added more fine grained compatability for cpus in CPUID. Not implemented in NativeBigInteger yet.
This commit is contained in:
@ -198,32 +198,44 @@ public class CPUID {
|
|||||||
|
|
||||||
protected abstract static class CPUIDCPUInfo
|
protected abstract static class CPUIDCPUInfo
|
||||||
{
|
{
|
||||||
|
protected boolean isX64 = false;
|
||||||
|
|
||||||
public String getVendor()
|
public String getVendor()
|
||||||
{
|
{
|
||||||
return getCPUVendorID();
|
return getCPUVendorID();
|
||||||
}
|
}
|
||||||
public boolean hasMMX(){
|
public boolean hasMMX()
|
||||||
|
{
|
||||||
return (getEDXCPUFlags() & 0x800000) >0; //EDX Bit 23
|
return (getEDXCPUFlags() & 0x800000) >0; //EDX Bit 23
|
||||||
}
|
}
|
||||||
public boolean hasSSE(){
|
public boolean hasSSE(){
|
||||||
return (getEDXCPUFlags() & 0x2000000) >0; //EDX Bit 25
|
return (getEDXCPUFlags() & 0x2000000) >0; //EDX Bit 25
|
||||||
}
|
}
|
||||||
public boolean hasSSE2(){
|
public boolean hasSSE2()
|
||||||
|
{
|
||||||
return (getEDXCPUFlags() & 0x4000000) >0; //EDX Bit 26
|
return (getEDXCPUFlags() & 0x4000000) >0; //EDX Bit 26
|
||||||
}
|
}
|
||||||
public boolean hasSSE3(){
|
public boolean hasSSE3()
|
||||||
|
{
|
||||||
return (getEDXCPUFlags() & 0x1) >0; //ECX Bit 0
|
return (getEDXCPUFlags() & 0x1) >0; //ECX Bit 0
|
||||||
}
|
}
|
||||||
public boolean hasSSE41(){
|
public boolean hasSSE41()
|
||||||
|
{
|
||||||
return (getEDXCPUFlags() & 0x80000) >0; //ECX Bit 19
|
return (getEDXCPUFlags() & 0x80000) >0; //ECX Bit 19
|
||||||
}
|
}
|
||||||
public boolean hasSSE42(){
|
public boolean hasSSE42()
|
||||||
|
{
|
||||||
return (getEDXCPUFlags() & 0x100000) >0; //ECX Bit 20
|
return (getEDXCPUFlags() & 0x100000) >0; //ECX Bit 20
|
||||||
}
|
}
|
||||||
public boolean hasSSE4A(){
|
public boolean hasSSE4A()
|
||||||
|
{
|
||||||
return (getExtendedECXCPUFlags() & 0x40) >0; //Extended ECX Bit 6
|
return (getExtendedECXCPUFlags() & 0x40) >0; //Extended ECX Bit 6
|
||||||
}
|
}
|
||||||
public boolean IsC3Compatible() { return false; }
|
public boolean IsC3Compatible() { return false; }
|
||||||
|
public boolean hasX64()
|
||||||
|
{
|
||||||
|
return isX64;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static class VIAC3Impl extends CPUIDCPUInfo implements CPUInfo {
|
protected static class VIAC3Impl extends CPUIDCPUInfo implements CPUInfo {
|
||||||
@ -234,42 +246,25 @@ public class CPUID {
|
|||||||
|
|
||||||
protected static class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo
|
protected static class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo
|
||||||
{
|
{
|
||||||
//AMD-family = getCPUFamily()+getCPUExtendedFamily()
|
protected static boolean isK6Compatible = false;
|
||||||
//AMD-model = getCPUModel()+getCPUExtendedModel()
|
protected static boolean isK6_2_Compatible = false;
|
||||||
public boolean IsK6Compatible(){
|
protected static boolean isK6_3_Compatible = false;
|
||||||
return (getCPUFamily() + getCPUExtendedFamily()) >= 5 && (getCPUModel() + getCPUExtendedModel()) >= 6;
|
protected static boolean isAthlonCompatible = false;
|
||||||
}
|
protected static boolean isAthlon64Compatible = false;
|
||||||
|
protected static boolean isBobcatCompatible = false;
|
||||||
|
|
||||||
public boolean IsK6_2_Compatible(){
|
//AMD-family = getCPUFamily()+getCPUExtendedFamily()
|
||||||
return (getCPUFamily() + getCPUExtendedFamily()) >= 5 && (getCPUModel() + getCPUExtendedModel()) >= 8;
|
//AMD-model = getCPUModel()+getCPUExtendedModel()
|
||||||
}
|
public boolean IsK6Compatible(){ return isK6Compatible; }
|
||||||
|
public boolean IsK6_2_Compatible(){ return isK6_2_Compatible; }
|
||||||
|
public boolean IsK6_3_Compatible(){ return isK6_3_Compatible; }
|
||||||
|
public boolean IsAthlonCompatible(){ return isAthlonCompatible; }
|
||||||
|
public boolean IsAthlon64Compatible(){ return isAthlon64Compatible; }
|
||||||
|
public boolean IsBobcatCompatible(){ return isBobcatCompatible; }
|
||||||
|
|
||||||
public boolean IsK6_3_Compatible(){
|
public String getCPUModelString() throws UnknownCPUException
|
||||||
return (getCPUFamily() + getCPUExtendedFamily()) >= 5 && (getCPUModel() + getCPUExtendedModel()) >= 9;
|
{
|
||||||
}
|
//i486 class (Am486, 5x86)
|
||||||
|
|
||||||
public boolean IsAthlonCompatible(){
|
|
||||||
return (getCPUFamily() + getCPUExtendedFamily()) >= 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean IsAthlon64Compatible(){
|
|
||||||
//AMD64 class
|
|
||||||
if ((getCPUFamily() + getCPUExtendedFamily()) == 15){
|
|
||||||
return true;
|
|
||||||
//Stars (Phenom II/Athlon II/Third-Generation Opteron/Opteron 4100 & 6100/Sempron 1xx)
|
|
||||||
} else if ((getCPUFamily() + getCPUExtendedFamily()) == 16){
|
|
||||||
return true;
|
|
||||||
//K8 mobile+HT3 (Turion X2/Athlon X2/Sempron)
|
|
||||||
} else if ((getCPUFamily() + getCPUExtendedFamily()) == 17){
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getCPUModelString() throws UnknownCPUException {
|
|
||||||
|
|
||||||
//i486 class (Am486, 5x86)
|
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 4){
|
if(getCPUFamily() + getCPUExtendedFamily() == 4){
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 3:
|
case 3:
|
||||||
@ -286,8 +281,9 @@ public class CPUID {
|
|||||||
return "Am5x86-WB";
|
return "Am5x86-WB";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//i586 class (K5/K6/K6-2/K6-III)
|
//i586 class (K5/K6/K6-2/K6-III)
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 5){
|
if(getCPUFamily() + getCPUExtendedFamily() == 5){
|
||||||
|
isK6Compatible = true;
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 0:
|
case 0:
|
||||||
return "K5/SSA5";
|
return "K5/SSA5";
|
||||||
@ -302,15 +298,23 @@ public class CPUID {
|
|||||||
case 7:
|
case 7:
|
||||||
return "K6";
|
return "K6";
|
||||||
case 8:
|
case 8:
|
||||||
|
isK6_2_Compatible = true;
|
||||||
return "K6-2";
|
return "K6-2";
|
||||||
case 9:
|
case 9:
|
||||||
|
isK6_2_Compatible = true;
|
||||||
|
isK6_3_Compatible = true;
|
||||||
return "K6-3";
|
return "K6-3";
|
||||||
case 13:
|
case 13:
|
||||||
|
isK6_2_Compatible = true;
|
||||||
return "K6-2+ or K6-III+";
|
return "K6-2+ or K6-III+";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//i686 class (Athlon/Athlon XP/Duron/K7 Sempron)
|
//i686 class (Athlon/Athlon XP/Duron/K7 Sempron)
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 6){
|
if(getCPUFamily() + getCPUExtendedFamily() == 6){
|
||||||
|
isK6Compatible = true;
|
||||||
|
isK6_2_Compatible = true;
|
||||||
|
isK6_3_Compatible = true;
|
||||||
|
isAthlonCompatible = true;
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 0:
|
case 0:
|
||||||
return "Athlon (250 nm)";
|
return "Athlon (250 nm)";
|
||||||
@ -330,95 +334,107 @@ public class CPUID {
|
|||||||
return "Athlon (Thoroughbred)";
|
return "Athlon (Thoroughbred)";
|
||||||
case 10:
|
case 10:
|
||||||
return "Athlon (Barton)";
|
return "Athlon (Barton)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//AMD64 class (A64/Opteron/A64 X2/K8 Sempron/Turion/Second-Generation Opteron/Athlon Neo)
|
//AMD64 class (A64/Opteron/A64 X2/K8 Sempron/Turion/Second-Generation Opteron/Athlon Neo)
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 15){
|
if(getCPUFamily() + getCPUExtendedFamily() == 15){
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
isK6Compatible = true;
|
||||||
case 4:
|
isK6_2_Compatible = true;
|
||||||
return "Athlon 64/Mobile XP-M";
|
isK6_3_Compatible = true;
|
||||||
case 5:
|
isAthlonCompatible = true;
|
||||||
return "Athlon 64 FX Opteron";
|
isAthlon64Compatible = true;
|
||||||
case 7:
|
isX64 = true;
|
||||||
return "Athlon 64 FX (Sledgehammer S939, 130 nm)";
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 8:
|
case 4:
|
||||||
return "Mobile A64/Sempron/XP-M";
|
return "Athlon 64/Mobile XP-M";
|
||||||
case 11:
|
case 5:
|
||||||
return "Athlon 64 (Clawhammer S939, 130 nm)";
|
return "Athlon 64 FX Opteron";
|
||||||
case 12:
|
case 7:
|
||||||
return "Athlon 64/Sempron (Newcastle S754, 130 nm)";
|
return "Athlon 64 FX (Sledgehammer S939, 130 nm)";
|
||||||
case 14:
|
case 8:
|
||||||
return "Athlon 64/Sempron (Newcastle S754, 130 nm)";
|
return "Mobile A64/Sempron/XP-M";
|
||||||
case 15:
|
case 11:
|
||||||
return "Athlon 64/Sempron (Clawhammer S939, 130 nm)";
|
return "Athlon 64 (Clawhammer S939, 130 nm)";
|
||||||
case 18:
|
case 12:
|
||||||
return "Sempron (Palermo, 90 nm)";
|
return "Athlon 64/Sempron (Newcastle S754, 130 nm)";
|
||||||
case 20:
|
case 14:
|
||||||
return "Athlon 64 (Winchester S754, 90 nm)";
|
return "Athlon 64/Sempron (Newcastle S754, 130 nm)";
|
||||||
case 23:
|
case 15:
|
||||||
return "Athlon 64 (Winchester S939, 90 nm)";
|
return "Athlon 64/Sempron (Clawhammer S939, 130 nm)";
|
||||||
case 24:
|
case 18:
|
||||||
return "Mobile A64/Sempron/XP-M (Winchester S754, 90 nm)";
|
return "Sempron (Palermo, 90 nm)";
|
||||||
case 26:
|
case 20:
|
||||||
return "Athlon 64 (Winchester S939, 90 nm)";
|
return "Athlon 64 (Winchester S754, 90 nm)";
|
||||||
case 27:
|
case 23:
|
||||||
return "Athlon 64/Sempron (Winchester/Palermo 90 nm)";
|
return "Athlon 64 (Winchester S939, 90 nm)";
|
||||||
case 28:
|
case 24:
|
||||||
return "Sempron (Palermo, 90 nm)";
|
return "Mobile A64/Sempron/XP-M (Winchester S754, 90 nm)";
|
||||||
case 31:
|
case 26:
|
||||||
return "Athlon 64/Sempron (Winchester/Palermo, 90 nm)";
|
return "Athlon 64 (Winchester S939, 90 nm)";
|
||||||
case 33:
|
case 27:
|
||||||
return "Dual-Core Opteron (Italy-Egypt S940, 90 nm)";
|
return "Athlon 64/Sempron (Winchester/Palermo 90 nm)";
|
||||||
case 35:
|
case 28:
|
||||||
return "Athlon 64 X2/A64 FX/Opteron (Toledo/Denmark S939, 90 nm)";
|
return "Sempron (Palermo, 90 nm)";
|
||||||
case 36:
|
case 31:
|
||||||
return "Mobile A64/Turion (Lancaster/Richmond/Newark, 90 nm)";
|
return "Athlon 64/Sempron (Winchester/Palermo, 90 nm)";
|
||||||
case 37:
|
case 33:
|
||||||
return "Opteron (Troy/Athens S940, 90 nm)";
|
return "Dual-Core Opteron (Italy-Egypt S940, 90 nm)";
|
||||||
case 39:
|
case 35:
|
||||||
return "Athlon 64 (San Diego, 90 nm)";
|
return "Athlon 64 X2/A64 FX/Opteron (Toledo/Denmark S939, 90 nm)";
|
||||||
case 43:
|
case 36:
|
||||||
return "Athlon 64 X2 (Manchester, 90 nm)";
|
return "Mobile A64/Turion (Lancaster/Richmond/Newark, 90 nm)";
|
||||||
case 44:
|
case 37:
|
||||||
return "Sempron/mobile Sempron (Palermo/Albany/Roma S754, 90 nm)";
|
return "Opteron (Troy/Athens S940, 90 nm)";
|
||||||
case 47:
|
case 39:
|
||||||
return "Athlon 64/Sempron (Venice/Palermo S939, 90 nm)";
|
return "Athlon 64 (San Diego, 90 nm)";
|
||||||
case 65:
|
case 43:
|
||||||
return "Second-Generaton Opteron (Santa Rosa S1207, 90 nm)";
|
return "Athlon 64 X2 (Manchester, 90 nm)";
|
||||||
case 67:
|
case 44:
|
||||||
return "Athlon 64 X2/2nd-gen Opteron (Windsor/Santa Rosa, 90 nm)";
|
return "Sempron/mobile Sempron (Palermo/Albany/Roma S754, 90 nm)";
|
||||||
case 72:
|
case 47:
|
||||||
return "Athlon 64 X2/Turion 64 X2 (Windsor/Taylor/Trinidad, 90 nm)";
|
return "Athlon 64/Sempron (Venice/Palermo S939, 90 nm)";
|
||||||
case 75:
|
case 65:
|
||||||
return "Athlon 64 X2 (Windsor, 90 nm)";
|
return "Second-Generaton Opteron (Santa Rosa S1207, 90 nm)";
|
||||||
case 76:
|
case 67:
|
||||||
return "Mobile A64/mobile Sempron/Turion (Keene/Trinidad/Taylor, 90 nm)";
|
return "Athlon 64 X2/2nd-gen Opteron (Windsor/Santa Rosa, 90 nm)";
|
||||||
case 79:
|
case 72:
|
||||||
return "Athlon 64/Sempron (Orleans/Manila AM2, 90 nm)";
|
return "Athlon 64 X2/Turion 64 X2 (Windsor/Taylor/Trinidad, 90 nm)";
|
||||||
case 93:
|
case 75:
|
||||||
return "Opteron Gen 2 (Santa Rosa, 90 nm)";
|
return "Athlon 64 X2 (Windsor, 90 nm)";
|
||||||
case 95:
|
case 76:
|
||||||
return "A64/Sempron/mobile Sempron (Orleans/Manila/Keene, 90 nm)";
|
return "Mobile A64/mobile Sempron/Turion (Keene/Trinidad/Taylor, 90 nm)";
|
||||||
case 104:
|
case 79:
|
||||||
return "Turion 64 X2 (Tyler S1, 65 nm)";
|
return "Athlon 64/Sempron (Orleans/Manila AM2, 90 nm)";
|
||||||
case 107:
|
case 93:
|
||||||
return "Athlon 64 X2/Sempron X2/Athlon Neo X2 (Brisbane/Huron, 65 nm)";
|
return "Opteron Gen 2 (Santa Rosa, 90 nm)";
|
||||||
case 108:
|
case 95:
|
||||||
return "A64/Athlon Neo/Sempron/Mobile Sempron (Lima/Huron/Sparta/Sherman, 65 nm)";
|
return "A64/Sempron/mobile Sempron (Orleans/Manila/Keene, 90 nm)";
|
||||||
case 111:
|
case 104:
|
||||||
return "Neo/Sempron/mobile Sempron (Huron/Sparta/Sherman, 65 nm)";
|
return "Turion 64 X2 (Tyler S1, 65 nm)";
|
||||||
case 124:
|
case 107:
|
||||||
return "Athlon/Sempron/mobile Sempron (Lima/Sparta/Sherman, 65 nm)";
|
return "Athlon 64 X2/Sempron X2/Athlon Neo X2 (Brisbane/Huron, 65 nm)";
|
||||||
case 127:
|
case 108:
|
||||||
return "A64/Athlon Neo/Sempron/mobile Sempron (Lima/Huron/Sparta/Sherman, 65 nm)";
|
return "A64/Athlon Neo/Sempron/Mobile Sempron (Lima/Huron/Sparta/Sherman, 65 nm)";
|
||||||
case 193:
|
case 111:
|
||||||
return "Athlon 64 FX (Windsor S1207 90 nm)";
|
return "Neo/Sempron/mobile Sempron (Huron/Sparta/Sherman, 65 nm)";
|
||||||
default: // is this safe?
|
case 124:
|
||||||
return "Athlon 64 (unknown)";
|
return "Athlon/Sempron/mobile Sempron (Lima/Sparta/Sherman, 65 nm)";
|
||||||
}
|
case 127:
|
||||||
|
return "A64/Athlon Neo/Sempron/mobile Sempron (Lima/Huron/Sparta/Sherman, 65 nm)";
|
||||||
|
case 193:
|
||||||
|
return "Athlon 64 FX (Windsor S1207 90 nm)";
|
||||||
|
default: // is this safe?
|
||||||
|
return "Athlon 64 (unknown)";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//Stars (Phenom II/Athlon II/Third-Generation Opteron/Opteron 4100 & 6100/Sempron 1xx)
|
//Stars (Phenom II/Athlon II/Third-Generation Opteron/Opteron 4100 & 6100/Sempron 1xx)
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 16){
|
if(getCPUFamily() + getCPUExtendedFamily() == 16){
|
||||||
|
isK6Compatible = true;
|
||||||
|
isK6_2_Compatible = true;
|
||||||
|
isK6_3_Compatible = true;
|
||||||
|
isAthlonCompatible = true;
|
||||||
|
isAthlon64Compatible = true;
|
||||||
|
isX64 = true;
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 2:
|
case 2:
|
||||||
return "Phenom / Athlon / Opteron Gen 3 (Barcelona/Agena/Toliman/Kuma, 65 nm)";
|
return "Phenom / Athlon / Opteron Gen 3 (Barcelona/Agena/Toliman/Kuma, 65 nm)";
|
||||||
@ -436,21 +452,34 @@ public class CPUID {
|
|||||||
return "Phenom II X4/X6 (Zosma/Thuban AM3, 45 nm)";
|
return "Phenom II X4/X6 (Zosma/Thuban AM3, 45 nm)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//K8 mobile+HT3 (Turion X2/Athlon X2/Sempron)
|
//K8 mobile+HT3 (Turion X2/Athlon X2/Sempron)
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 17){
|
if(getCPUFamily() + getCPUExtendedFamily() == 17){
|
||||||
|
isK6Compatible = true;
|
||||||
|
isK6_2_Compatible = true;
|
||||||
|
isK6_3_Compatible = true;
|
||||||
|
isAthlonCompatible = true;
|
||||||
|
isAthlon64Compatible = true;
|
||||||
|
isX64 = true;
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 3:
|
case 3:
|
||||||
return "AMD Turion X2/Athlon X2/Sempron (Lion/Sable, 65 nm)";
|
return "AMD Turion X2/Athlon X2/Sempron (Lion/Sable, 65 nm)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//Bobcat
|
//Bobcat
|
||||||
if(getCPUFamily() + getCPUExtendedFamily() == 20){
|
if(getCPUFamily() + getCPUExtendedFamily() == 20){
|
||||||
|
isK6Compatible = true;
|
||||||
|
isK6_2_Compatible = true;
|
||||||
|
isK6_3_Compatible = true;
|
||||||
|
isAthlonCompatible = true;
|
||||||
|
isAthlon64Compatible = true;
|
||||||
|
isBobcatCompatible = true;
|
||||||
|
isX64 = true;
|
||||||
switch(getCPUModel() + getCPUExtendedModel()){
|
switch(getCPUModel() + getCPUExtendedModel()){
|
||||||
case 1:
|
case 1:
|
||||||
return "Bobcat APU";
|
return "Bobcat APU";
|
||||||
// Case 3 is uncertain but most likely a Bobcat APU
|
// Case 3 is uncertain but most likely a Bobcat APU
|
||||||
case 3:
|
case 3:
|
||||||
return "Bobcat APU";
|
return "Bobcat APU";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new UnknownCPUException("Unknown AMD CPU; Family="+(getCPUFamily() + getCPUExtendedFamily())+", Model="+(getCPUModel() + getCPUExtendedModel()));
|
throw new UnknownCPUException("Unknown AMD CPU; Family="+(getCPUFamily() + getCPUExtendedFamily())+", Model="+(getCPUModel() + getCPUExtendedModel()));
|
||||||
@ -459,167 +488,179 @@ public class CPUID {
|
|||||||
|
|
||||||
protected static class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
protected static class IntelInfoImpl extends CPUIDCPUInfo implements IntelCPUInfo
|
||||||
{
|
{
|
||||||
public boolean IsPentiumCompatible()
|
protected static boolean isPentiumCompatible = false;
|
||||||
{
|
protected static boolean isPentiumMMXCompatible = false;
|
||||||
return getCPUFamily() >= 5;
|
protected static boolean isPentium2Compatible = false;
|
||||||
}
|
protected static boolean isPentium3Compatible = false;
|
||||||
public boolean IsPentiumMMXCompatible()
|
protected static boolean isPentium4Compatible = false;
|
||||||
{
|
protected static boolean isAtomCompatible = false;
|
||||||
return IsPentium2Compatible() || (getCPUFamily() == 5 && (getCPUModel() ==4 || getCPUModel() == 8));
|
protected static boolean isCore2Compatible = false;
|
||||||
}
|
protected static boolean isCoreiCompatible = false;
|
||||||
public boolean IsPentium2Compatible()
|
|
||||||
{
|
|
||||||
return getCPUFamily() > 6 || (getCPUFamily() == 6 && getCPUModel() >=3);
|
|
||||||
}
|
|
||||||
public boolean IsPentium3Compatible()
|
|
||||||
{
|
|
||||||
return getCPUFamily() > 6 || (getCPUFamily() == 6 && getCPUModel() >=7);
|
|
||||||
}
|
|
||||||
public boolean IsPentium4Compatible()
|
|
||||||
{
|
|
||||||
// P4
|
|
||||||
if (getCPUFamily() >= 15){
|
|
||||||
return true;
|
|
||||||
// Core i3/i5/i7
|
|
||||||
// Remove when implemented isCoreiCompatible in BigInteger
|
|
||||||
} else if (getCPUExtendedModel() == 2 && (getCPUFamily() == 6)){
|
|
||||||
// Xeon MP (45nm) or Core i7
|
|
||||||
// Remove when implemented isCoreiCompatible in BigInteger
|
|
||||||
} else if (getCPUExtendedModel() == 1 && (getCPUFamily() == 6 && (getCPUModel() == 10 || getCPUModel() == 13 || getCPUModel() == 14))){
|
|
||||||
return true;
|
|
||||||
// Core 2 Duo
|
|
||||||
// Remove when implemented isCore7Compatible in BigInteger
|
|
||||||
} else if (getCPUExtendedModel() == 0 && getCPUFamily() == 6 && getCPUModel() == 15){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public boolean IsAtomCompatible()
|
|
||||||
{
|
|
||||||
if (getCPUExtendedModel() == 0 && getCPUFamily() == 6 && getCPUModel() == 12){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
|
|
||||||
}
|
public boolean IsPentiumCompatible(){ return isPentiumCompatible; }
|
||||||
public boolean IsCore2Compatible()
|
public boolean IsPentiumMMXCompatible(){ return isPentiumMMXCompatible; }
|
||||||
{
|
public boolean IsPentium2Compatible(){ return isPentium2Compatible; }
|
||||||
if (getCPUExtendedModel() == 0 && getCPUFamily() == 6 && getCPUModel() == 15){
|
public boolean IsPentium3Compatible(){ return isPentium3Compatible; }
|
||||||
return true;
|
public boolean IsPentium4Compatible(){ return isPentium4Compatible; }
|
||||||
}
|
public boolean IsAtomCompatible(){ return isAtomCompatible; }
|
||||||
return false;
|
public boolean IsCore2Compatible(){ return isCore2Compatible; }
|
||||||
}
|
public boolean IsCoreiCompatible(){ return isCoreiCompatible; }
|
||||||
public boolean IsCoreiCompatible()
|
|
||||||
{
|
public String getCPUModelString() throws UnknownCPUException
|
||||||
// Core i3/i5/i7
|
{
|
||||||
if (getCPUExtendedModel() == 2 && (getCPUFamily() == 6)){
|
|
||||||
// Xeon MP (45nm) or Core i7
|
|
||||||
} else if (getCPUExtendedModel() == 1 && (getCPUFamily() == 6 && (getCPUModel() == 10 || getCPUModel() == 13 || getCPUModel() == 14))){
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
public String getCPUModelString() throws UnknownCPUException {
|
|
||||||
if (getCPUExtendedModel() == 0){
|
|
||||||
if(getCPUFamily() == 4){
|
|
||||||
switch(getCPUModel()){
|
|
||||||
case 0:
|
|
||||||
return "486 DX-25/33";
|
|
||||||
case 1:
|
|
||||||
return "486 DX-50";
|
|
||||||
case 2:
|
|
||||||
return "486 SX";
|
|
||||||
case 3:
|
|
||||||
return "486 DX/2";
|
|
||||||
case 4:
|
|
||||||
return "486 SL";
|
|
||||||
case 5:
|
|
||||||
return "486 SX/2";
|
|
||||||
case 7:
|
|
||||||
return "486 DX/2-WB";
|
|
||||||
case 8:
|
|
||||||
return "486 DX/4";
|
|
||||||
case 9:
|
|
||||||
return "486 DX/4-WB";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (getCPUExtendedModel() == 0){
|
if (getCPUExtendedModel() == 0){
|
||||||
if(getCPUFamily() == 5){
|
if(getCPUFamily() == 4){
|
||||||
switch(getCPUModel()){
|
switch(getCPUModel()){
|
||||||
case 0:
|
case 0:
|
||||||
return "Pentium 60/66 A-step";
|
return "486 DX-25/33";
|
||||||
case 1:
|
case 1:
|
||||||
return "Pentium 60/66";
|
return "486 DX-50";
|
||||||
case 2:
|
case 2:
|
||||||
return "Pentium 75 - 200";
|
return "486 SX";
|
||||||
case 3:
|
case 3:
|
||||||
return "OverDrive PODP5V83";
|
return "486 DX/2";
|
||||||
case 4:
|
case 4:
|
||||||
return "Pentium MMX";
|
return "486 SL";
|
||||||
case 7:
|
case 5:
|
||||||
return "Mobile Pentium 75 - 200";
|
return "486 SX/2";
|
||||||
case 8:
|
case 7:
|
||||||
return "Mobile Pentium MMX";
|
return "486 DX/2-WB";
|
||||||
}
|
case 8:
|
||||||
}
|
return "486 DX/4";
|
||||||
|
case 9:
|
||||||
|
return "486 DX/4-WB";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (getCPUExtendedModel() == 0){
|
||||||
|
if(getCPUFamily() == 5){
|
||||||
|
isPentiumCompatible = true;
|
||||||
|
switch(getCPUModel()){
|
||||||
|
case 0:
|
||||||
|
return "Pentium 60/66 A-step";
|
||||||
|
case 1:
|
||||||
|
return "Pentium 60/66";
|
||||||
|
case 2:
|
||||||
|
return "Pentium 75 - 200";
|
||||||
|
case 3:
|
||||||
|
return "OverDrive PODP5V83";
|
||||||
|
case 4:
|
||||||
|
isPentiumMMXCompatible = true;
|
||||||
|
return "Pentium MMX";
|
||||||
|
case 7:
|
||||||
|
return "Mobile Pentium 75 - 200";
|
||||||
|
case 8:
|
||||||
|
isPentiumMMXCompatible = true;
|
||||||
|
return "Mobile Pentium MMX";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if(getCPUFamily() == 6){
|
if(getCPUFamily() == 6){
|
||||||
if (getCPUExtendedModel() == 0){
|
if (getCPUExtendedModel() == 0){
|
||||||
switch(getCPUModel()){
|
isPentiumCompatible = true;
|
||||||
case 0:
|
isPentiumMMXCompatible = true;
|
||||||
return "Pentium Pro A-step";
|
switch(getCPUModel()){
|
||||||
case 1:
|
case 0:
|
||||||
return "Pentium Pro";
|
return "Pentium Pro A-step";
|
||||||
case 3:
|
case 1:
|
||||||
return "Pentium II (Klamath)";
|
return "Pentium Pro";
|
||||||
case 5:
|
case 3:
|
||||||
return "Pentium II (Deschutes), Celeron (Covington), Mobile Pentium II (Dixon)";
|
isPentium2Compatible = true;
|
||||||
case 6:
|
return "Pentium II (Klamath)";
|
||||||
return "Mobile Pentium II, Celeron (Mendocino)";
|
case 5:
|
||||||
case 7:
|
isPentium2Compatible = true;
|
||||||
return "Pentium III (Katmai)";
|
return "Pentium II (Deschutes), Celeron (Covington), Mobile Pentium II (Dixon)";
|
||||||
case 8:
|
case 6:
|
||||||
return "Pentium III (Coppermine), Celeron w/SSE";
|
isPentium2Compatible = true;
|
||||||
case 9:
|
return "Mobile Pentium II, Celeron (Mendocino)";
|
||||||
return "Mobile Pentium III (Banias)";
|
case 7:
|
||||||
case 10:
|
isPentium2Compatible = true;
|
||||||
return "Pentium III Xeon (Cascades)";
|
isPentium3Compatible = true;
|
||||||
case 11:
|
return "Pentium III (Katmai)";
|
||||||
return "Pentium III (130 nm)";
|
case 8:
|
||||||
case 13:
|
isPentium2Compatible = true;
|
||||||
return "Mobile Pentium III (Dothan)";
|
isPentium3Compatible = true;
|
||||||
case 14:
|
return "Pentium III (Coppermine), Celeron w/SSE";
|
||||||
return "Mobile Core (Yonah)";
|
case 9:
|
||||||
case 15:
|
isPentium2Compatible = true;
|
||||||
return "Core 2 (Conroe)";
|
isPentium3Compatible = true;
|
||||||
}
|
isX64 = true;
|
||||||
} else if (getCPUExtendedModel() == 1){
|
return "Pentium M (Banias)";
|
||||||
switch(getCPUModel()){
|
case 10:
|
||||||
case 10:
|
isPentium2Compatible = true;
|
||||||
return "Core i7 (45nm)";
|
isPentium3Compatible = true;
|
||||||
case 12:
|
return "Pentium III Xeon (Cascades)";
|
||||||
return "Atom";
|
case 11:
|
||||||
case 13:
|
isPentium2Compatible = true;
|
||||||
return "Xeon MP (45nm)";
|
isPentium3Compatible = true;
|
||||||
case 14:
|
return "Pentium III (130 nm)";
|
||||||
return "Core i5/i7 (45nm)";
|
case 13:
|
||||||
}
|
isPentium2Compatible = true;
|
||||||
} else if (getCPUExtendedModel() == 2){
|
isPentium3Compatible = true;
|
||||||
switch(getCPUModel()){
|
isX64 = true;
|
||||||
case 5:
|
return "Core (Yonah)";
|
||||||
return "Core i3 or i5/i7 mobile (32nm)";
|
case 14:
|
||||||
case 10:
|
isPentium2Compatible = true;
|
||||||
return "Core i7/i5 (32nm)";
|
isPentium3Compatible = true;
|
||||||
case 12:
|
isCore2Compatible = true;
|
||||||
return "Core i7 (32nm)";
|
isX64 = true;
|
||||||
case 14:
|
return "Core 2 (Conroe)";
|
||||||
return "Xeon MP (45nm)";
|
case 15:
|
||||||
case 15:
|
isPentium2Compatible = true;
|
||||||
return "Xeon MP (32nm)";
|
isPentium3Compatible = true;
|
||||||
}
|
isCore2Compatible = true;
|
||||||
}
|
isX64 = true;
|
||||||
}
|
return "Core 2 (Conroe)";
|
||||||
|
}
|
||||||
|
} else if (getCPUExtendedModel() == 1){
|
||||||
|
isPentiumCompatible = true;
|
||||||
|
isPentiumMMXCompatible = true;
|
||||||
|
isPentium2Compatible = true;
|
||||||
|
isPentium3Compatible = true;
|
||||||
|
isPentium4Compatible = true;
|
||||||
|
isCore2Compatible = true;
|
||||||
|
isX64 = true;
|
||||||
|
switch(getCPUModel()){
|
||||||
|
case 6:
|
||||||
|
return "Celeron";
|
||||||
|
case 10:
|
||||||
|
isCoreiCompatible = true;
|
||||||
|
return "Core i7 (45nm)";
|
||||||
|
case 12:
|
||||||
|
isAtomCompatible = true;
|
||||||
|
isCore2Compatible = false;
|
||||||
|
isPentium4Compatible = false;
|
||||||
|
isX64 = true;
|
||||||
|
return "Atom";
|
||||||
|
case 13:
|
||||||
|
isCoreiCompatible = true;
|
||||||
|
return "Xeon MP (45nm)";
|
||||||
|
case 14:
|
||||||
|
isCoreiCompatible = true;
|
||||||
|
return "Core i5/i7 (45nm)";
|
||||||
|
}
|
||||||
|
} else if (getCPUExtendedModel() == 2){
|
||||||
|
isPentiumCompatible = true;
|
||||||
|
isPentiumMMXCompatible = true;
|
||||||
|
isPentium2Compatible = true;
|
||||||
|
isPentium3Compatible = true;
|
||||||
|
isCore2Compatible = true;
|
||||||
|
isCoreiCompatible = true;
|
||||||
|
isX64 = true;
|
||||||
|
switch(getCPUModel()){
|
||||||
|
case 5:
|
||||||
|
return "Core i3 or i5/i7 mobile (32nm)";
|
||||||
|
case 10:
|
||||||
|
return "Core i7/i5 (32nm)";
|
||||||
|
case 12:
|
||||||
|
return "Core i7 (32nm)";
|
||||||
|
case 14:
|
||||||
|
return "Xeon MP (45nm)";
|
||||||
|
case 15:
|
||||||
|
return "Xeon MP (32nm)";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
if(getCPUFamily() == 7){
|
if(getCPUFamily() == 7){
|
||||||
switch(getCPUModel()){
|
switch(getCPUModel()){
|
||||||
//Itanium.. TODO
|
//Itanium.. TODO
|
||||||
@ -627,6 +668,11 @@ public class CPUID {
|
|||||||
}
|
}
|
||||||
if(getCPUFamily() == 15){
|
if(getCPUFamily() == 15){
|
||||||
if(getCPUExtendedFamily() == 0){
|
if(getCPUExtendedFamily() == 0){
|
||||||
|
isPentiumCompatible = true;
|
||||||
|
isPentiumMMXCompatible = true;
|
||||||
|
isPentium2Compatible = true;
|
||||||
|
isPentium3Compatible = true;
|
||||||
|
isPentium4Compatible = true;
|
||||||
switch(getCPUModel()){
|
switch(getCPUModel()){
|
||||||
case 0:
|
case 0:
|
||||||
return "Pentium IV (180 nm)";
|
return "Pentium IV (180 nm)";
|
||||||
@ -637,8 +683,10 @@ public class CPUID {
|
|||||||
case 3:
|
case 3:
|
||||||
return "Pentium IV (90 nm)";
|
return "Pentium IV (90 nm)";
|
||||||
case 4:
|
case 4:
|
||||||
|
isX64 = true;
|
||||||
return "Pentium IV (90 nm)";
|
return "Pentium IV (90 nm)";
|
||||||
case 6:
|
case 6:
|
||||||
|
isX64 = true;
|
||||||
return "Pentium IV (65 nm)";
|
return "Pentium IV (65 nm)";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user