JBigI: GMP 6.2.0 for linux 64 bit (ticket #1869)

Add support for zen and zen2
Enable more fallbacks for zen and zen2
Adds Zen and Zen2 binaries, stripped
Built with gcc 9.3.0
Other binaries will be added if testing shows improvement
Fix hangs in mbuild-all.sh build script
Add silvermont and goldmont to build script, untested, support TBD
GMP is GPLv2
More info: http://zzz.i2p/topics/2955
This commit is contained in:
zzz
2020-09-26 12:58:55 +00:00
parent ea4409897d
commit 2989d955d9
11 changed files with 78 additions and 20 deletions

View File

@@ -73,4 +73,16 @@ public interface AMDCPUInfo extends CPUInfo {
*/
public boolean IsExcavatorCompatible();
/**
* @return true if the CPU present in the machine is at least a Zen family CPU
* @since 0.9.48
*/
public boolean IsZenCompatible();
/**
* @return true if the CPU present in the machine is at least a Zen2 family CPU
* @since 0.9.48
*/
public boolean IsZen2Compatible();
}

View File

@@ -22,6 +22,8 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo
private static boolean isPiledriverCompatible;
private static boolean isSteamrollerCompatible;
private static boolean isExcavatorCompatible;
private static boolean isZenCompatible;
private static boolean isZen2Compatible;
public boolean IsK6Compatible(){ return isK6Compatible; }
@@ -50,6 +52,18 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo
public boolean IsExcavatorCompatible(){ return isExcavatorCompatible; }
/**
* @return true if the CPU present in the machine is at least a Zen family CPU
* @since 0.9.48
*/
public boolean IsZenCompatible() { return isZenCompatible; }
/**
* @return true if the CPU present in the machine is at least a Zen2 family CPU
* @since 0.9.48
*/
public boolean IsZen2Compatible() { return isZen2Compatible; }
public String getCPUModelString() throws UnknownCPUException
{
@@ -454,9 +468,10 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo
}
break;
//Ryzen 7 (model 1), Ryzen 5 TBD
// Zen / Zen+ / Zen2 / Zen3 / Ryzen 3/5/7/9/Threadripper / EPYC
// untested
case 23: {
case 23:
case 25: {
// Quote wikipedia:
// Zen is a clean sheet design that differs from the long-standing Bulldozer architecture.
// All models support: x87, MMX, SSE, SSE2, SSE3, SSSE3, SSE4.1, SSE4.2, AES, CLMUL,
@@ -466,18 +481,22 @@ class AMDInfoImpl extends CPUIDCPUInfo implements AMDCPUInfo
isK6_3_Compatible = true;
isAthlonCompatible = true;
isAthlon64Compatible = true;
// Pending testing of the bulldozer jbigi
//isPiledriverCompatible = true;
//isSteamrollerCompatible = true;
//isExcavatorCompatible = true;
//isBulldozerCompatible = true;
if (model == 1)
isPiledriverCompatible = true;
isSteamrollerCompatible = true;
isExcavatorCompatible = true;
isBulldozerCompatible = true;
isZenCompatible = true;
isZen2Compatible = family == 25;
if (isZen2Compatible)
modelString = "EPYC model " + model;
else if (model == 1)
modelString = "Ryzen 7";
else
modelString = "Ryzen model " + model;
}
break;
// Hygon Dhyana
// http://lkml.iu.edu/hypermail/linux/kernel/1806.1/00730.html
// untested
case 24: {

View File

@@ -420,6 +420,8 @@ public class CPUID {
System.out.println("Is Piledriver-compatible: " + cc.IsPiledriverCompatible());
System.out.println("Is Steamroller-compatible: " + cc.IsSteamrollerCompatible());
System.out.println("Is Excavator-compatible: " + cc.IsExcavatorCompatible());
System.out.println("Is Zen-compatible: " + cc.IsZenCompatible());
System.out.println("Is Zen2-compatible: " + cc.IsZen2Compatible());
}
}

View File

@@ -174,6 +174,10 @@ public class NativeBigInteger extends BigInteger {
private final static String JBIGI_OPTIMIZATION_JAGUAR = "jaguar";
/** @since 0.9.41 */
private final static String JBIGI_OPTIMIZATION_SKYLAKE = "skylake";
/** @since 0.9.48 */
private final static String JBIGI_OPTIMIZATION_ZEN = "zen";
/** @since 0.9.48 */
private final static String JBIGI_OPTIMIZATION_ZEN2 = "zen2";
/**
* Non-x86, no fallbacks to older libs or to "none"
@@ -227,7 +231,9 @@ public class NativeBigInteger extends BigInteger {
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};
private final static String[] JBIGI_COMPAT_LIST_AMD_BULLDOZER = {JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_OPTIMIZATION_PILEDRIVER,
/** the main AMD product line */
private final static String[] JBIGI_COMPAT_LIST_AMD_MAIN = {JBIGI_OPTIMIZATION_ZEN2, JBIGI_OPTIMIZATION_ZEN,
JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_OPTIMIZATION_PILEDRIVER,
JBIGI_OPTIMIZATION_BULLDOZER, JBIGI_OPTIMIZATION_ATHLON64, JBIGI_OPTIMIZATION_X86};
private final static String[] JBIGI_COMPAT_LIST_INTEL_ATOM = {JBIGI_OPTIMIZATION_ATOM, JBIGI_OPTIMIZATION_PENTIUM3, JBIGI_OPTIMIZATION_PENTIUM2,
JBIGI_OPTIMIZATION_PENTIUMMMX, JBIGI_OPTIMIZATION_PENTIUM, JBIGI_OPTIMIZATION_X86,
@@ -275,10 +281,12 @@ public class NativeBigInteger extends BigInteger {
put(JBIGI_OPTIMIZATION_BOBCAT, JBIGI_COMPAT_LIST_AMD_APU);
put(JBIGI_OPTIMIZATION_JAGUAR, JBIGI_COMPAT_LIST_AMD_APU);
put(JBIGI_OPTIMIZATION_BULLDOZER, JBIGI_COMPAT_LIST_AMD_BULLDOZER);
put(JBIGI_OPTIMIZATION_PILEDRIVER, JBIGI_COMPAT_LIST_AMD_BULLDOZER);
put(JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_COMPAT_LIST_AMD_BULLDOZER);
put(JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_COMPAT_LIST_AMD_BULLDOZER);
put(JBIGI_OPTIMIZATION_BULLDOZER, JBIGI_COMPAT_LIST_AMD_MAIN);
put(JBIGI_OPTIMIZATION_PILEDRIVER, JBIGI_COMPAT_LIST_AMD_MAIN);
put(JBIGI_OPTIMIZATION_STEAMROLLER, JBIGI_COMPAT_LIST_AMD_MAIN);
put(JBIGI_OPTIMIZATION_EXCAVATOR, JBIGI_COMPAT_LIST_AMD_MAIN);
put(JBIGI_OPTIMIZATION_ZEN, JBIGI_COMPAT_LIST_AMD_MAIN);
put(JBIGI_OPTIMIZATION_ZEN2, JBIGI_COMPAT_LIST_AMD_MAIN);
put(JBIGI_OPTIMIZATION_ATOM, JBIGI_COMPAT_LIST_INTEL_ATOM);
@@ -363,6 +371,10 @@ public class NativeBigInteger extends BigInteger {
return JBIGI_OPTIMIZATION_VIAC3;
} else if (c instanceof AMDCPUInfo) {
AMDCPUInfo amdcpu = (AMDCPUInfo) c;
if (amdcpu.IsZen2Compatible())
return JBIGI_OPTIMIZATION_ZEN2;
if (amdcpu.IsZenCompatible())
return JBIGI_OPTIMIZATION_ZEN;
if (amdcpu.IsExcavatorCompatible())
return JBIGI_OPTIMIZATION_EXCAVATOR;
if (amdcpu.IsSteamrollerCompatible())