Author: nextgens
Date: 2006-01-31 12:57:38 +0000 (Tue, 31 Jan 2006)
New Revision: 7969
Modified:
trunk/freenet/src/freenet/support/CPUInformation/CPUID.java
trunk/freenet/src/net/i2p/util/NativeBigInteger.java
Log:
patch for x86_64 : crashing the jvm here, but almost working ^-^ : Issue 000064
Modified: trunk/freenet/src/freenet/support/CPUInformation/CPUID.java
===================================================================
--- trunk/freenet/src/freenet/support/CPUInformation/CPUID.java 2006-01-31
12:34:41 UTC (rev 7968)
+++ trunk/freenet/src/freenet/support/CPUInformation/CPUID.java 2006-01-31
12:57:38 UTC (rev 7969)
@@ -33,7 +33,7 @@
* it easier for other systems to reuse this class
*/
private static final boolean _doLog = true;
- private static final boolean isX86 =
System.getProperty("os.arch").toLowerCase().matches("i?[x0-9]86(_64)?");
+ private static final boolean isX86 =
System.getProperty("os.arch").toLowerCase().matches("(i?[x0-9]86|amd64)");
static
{
@@ -238,6 +238,8 @@
return "Athlon 64";
case 5:
return "Athlon 64 FX
Opteron";
+ case 12:
+ return "AMD Athlon(tm)
64 Processor 3000+";
}
}
}
@@ -387,6 +389,8 @@
if(c instanceof AMDCPUInfo){
System.out.println(" **AMD-info**");
System.out.println(" Is Athlon-compatible:
"+((AMDCPUInfo)c).IsAthlonCompatible());
+ System.out.println(" Is Athlon64-compatible:
"+((AMDCPUInfo)c).IsAthlon64Compatible());
+
}
}
Modified: trunk/freenet/src/net/i2p/util/NativeBigInteger.java
===================================================================
--- trunk/freenet/src/net/i2p/util/NativeBigInteger.java 2006-01-31
12:34:41 UTC (rev 7968)
+++ trunk/freenet/src/net/i2p/util/NativeBigInteger.java 2006-01-31
12:57:38 UTC (rev 7969)
@@ -107,6 +107,7 @@
private final static String JBIGI_OPTIMIZATION_K6_2 = "k62";
private final static String JBIGI_OPTIMIZATION_K6_3 = "k63";
private final static String JBIGI_OPTIMIZATION_ATHLON = "athlon";
+ private final static String JBIGI_OPTIMISATION_X86_64 = "x86_64";
private final static String JBIGI_OPTIMIZATION_PENTIUM = "pentium";
private final static String JBIGI_OPTIMIZATION_PENTIUMMMX = "pentiummmx";
private final static String JBIGI_OPTIMIZATION_PENTIUM2 = "pentium2";
@@ -130,6 +131,8 @@
CPUInfo c = CPUID.getInfo();
if (c instanceof AMDCPUInfo) {
AMDCPUInfo amdcpu = (AMDCPUInfo) c;
+ if (amdcpu.IsAthlon64Compatible())
+ return JBIGI_OPTIMISATION_X86_64;
if (amdcpu.IsAthlonCompatible())
return JBIGI_OPTIMIZATION_ATHLON;
if (amdcpu.IsK6_3_Compatible())