diff --git a/core/java/src/freenet/support/CPUInformation/AMDCPUInfo.java b/core/java/src/freenet/support/CPUInformation/AMDCPUInfo.java index 547e8a2fd5..5cb6772739 100644 --- a/core/java/src/freenet/support/CPUInformation/AMDCPUInfo.java +++ b/core/java/src/freenet/support/CPUInformation/AMDCPUInfo.java @@ -39,6 +39,10 @@ public interface AMDCPUInfo extends CPUInfo { * @return true if the CPU present in the machine is at least an 'k8' CPU (Atlhon 64, Opteron etc. and better) */ public boolean IsAthlon64Compatible(); + /** + * @return true if the CPU present in the machine is at least an 'k10' CPU + */ + public boolean IsK10Compatible(); /** * @return true if the CPU present in the machine is at least an 'bobcat' CPU */ diff --git a/core/java/src/freenet/support/CPUInformation/AMDInfoImpl.java b/core/java/src/freenet/support/CPUInformation/AMDInfoImpl.java index 71f77db16a..11e3777b10 100644 --- a/core/java/src/freenet/support/CPUInformation/AMDInfoImpl.java +++ b/core/java/src/freenet/support/CPUInformation/AMDInfoImpl.java @@ -15,6 +15,7 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo private static boolean isGeodeCompatible; private static boolean isAthlonCompatible; private static boolean isAthlon64Compatible; + private static boolean isK10Compatible; private static boolean isBobcatCompatible; private static boolean isJaguarCompatible; private static boolean isBulldozerCompatible; @@ -35,6 +36,8 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo public boolean IsAthlon64Compatible(){ return isAthlon64Compatible; } + public boolean IsK10Compatible(){ return isK10Compatible; } + public boolean IsBobcatCompatible(){ return isBobcatCompatible; } public boolean IsJaguarCompatible(){ return isJaguarCompatible; } @@ -324,6 +327,7 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo isK6_3_Compatible = true; isAthlonCompatible = true; isAthlon64Compatible = true; + isK10Compatible = true; switch (model) { case 2: modelString = "Phenom / Athlon / Opteron Gen 3 (Barcelona/Agena/Toliman/Kuma, 65 nm)"; diff --git a/core/java/src/net/i2p/util/NativeBigInteger.java b/core/java/src/net/i2p/util/NativeBigInteger.java index 5c1f15e6a9..21524f5e56 100644 --- a/core/java/src/net/i2p/util/NativeBigInteger.java +++ b/core/java/src/net/i2p/util/NativeBigInteger.java @@ -164,6 +164,7 @@ public class NativeBigInteger extends BigInteger { private final static String JBIGI_OPTIMIZATION_COREI_SBR = "coreisbr"; private final static String JBIGI_OPTIMIZATION_COREI_HWL = "coreihwl"; private final static String JBIGI_OPTIMIZATION_COREI_BWL = "coreibwl"; + private final static String JBIGI_OPTIMIZATION_K10 = "k10"; private final static String JBIGI_OPTIMIZATION_BULLDOZER = "bulldozer"; private final static String JBIGI_OPTIMIZATION_PILEDRIVER = "piledriver"; private final static String JBIGI_OPTIMIZATION_STEAMROLLER = "steamroller"; @@ -213,8 +214,8 @@ public class NativeBigInteger extends BigInteger { JBIGI_OPTIMIZATION_ARM_ARMV6, JBIGI_OPTIMIZATION_ARM_ARMV5}; private final static String[] JBIGI_COMPAT_LIST_VIA = {JBIGI_OPTIMIZATION_NANO, JBIGI_OPTIMIZATION_VIAC32, JBIGI_OPTIMIZATION_VIAC3, JBIGI_OPTIMIZATION_PENTIUM, JBIGI_OPTIMIZATION_X86}; - private final static String[] JBIGI_COMPAT_LIST_AMD_ATHLON = {JBIGI_OPTIMIZATION_ATHLON64, JBIGI_OPTIMIZATION_ATHLON, JBIGI_OPTIMIZATION_K6_3, - JBIGI_OPTIMIZATION_K6_2, JBIGI_OPTIMIZATION_K6, JBIGI_OPTIMIZATION_X86}; + private final static String[] JBIGI_COMPAT_LIST_AMD_ATHLON = {JBIGI_OPTIMIZATION_K10, JBIGI_OPTIMIZATION_ATHLON64, JBIGI_OPTIMIZATION_ATHLON, + JBIGI_OPTIMIZATION_K6_3, JBIGI_OPTIMIZATION_K6_2, JBIGI_OPTIMIZATION_K6, JBIGI_OPTIMIZATION_X86}; private final static String[] JBIGI_COMPAT_LIST_AMD_GEODE = {JBIGI_OPTIMIZATION_GEODE, JBIGI_OPTIMIZATION_K6_3, JBIGI_OPTIMIZATION_K6_2, JBIGI_OPTIMIZATION_K6, JBIGI_OPTIMIZATION_X86}; private final static String[] JBIGI_COMPAT_LIST_AMD_APU = {JBIGI_OPTIMIZATION_JAGUAR, JBIGI_OPTIMIZATION_BOBCAT, JBIGI_OPTIMIZATION_ATHLON64}; @@ -254,6 +255,7 @@ public class NativeBigInteger extends BigInteger { put(JBIGI_OPTIMIZATION_K6_3, JBIGI_COMPAT_LIST_AMD_ATHLON); put(JBIGI_OPTIMIZATION_ATHLON, JBIGI_COMPAT_LIST_AMD_ATHLON); put(JBIGI_OPTIMIZATION_ATHLON64, JBIGI_COMPAT_LIST_AMD_ATHLON); + put(JBIGI_OPTIMIZATION_K10, JBIGI_COMPAT_LIST_AMD_ATHLON); put(JBIGI_OPTIMIZATION_GEODE, JBIGI_COMPAT_LIST_AMD_GEODE); @@ -359,6 +361,8 @@ public class NativeBigInteger extends BigInteger { return JBIGI_OPTIMIZATION_JAGUAR; if (amdcpu.IsBobcatCompatible()) return JBIGI_OPTIMIZATION_BOBCAT; + if (amdcpu.IsK10Compatible()) + return JBIGI_OPTIMIZATION_K10; if (amdcpu.IsAthlon64Compatible()) return JBIGI_OPTIMIZATION_ATHLON64; if (amdcpu.IsAthlonCompatible())