[PATCH 1/2 v2] Add the recognization for Zhaoxin processors
DylanFan-oc
DylanFan-oc at zhaoxin.com
Wed Jun 23 12:58:54 UTC 2021
Hi,
This patch adds the detection for Zhaoxin CPU Vendor ID("CentaurHauls" and " Shanghai ")
and adds the stepping information to distinguish between zxc and nano.
acinclude.m4 | 2 +-
config.guess | 20 +++++++++++++++++---
config.sub | 2 +-
configure.ac | 18 ++++++++++++++++++
4 files changed, 37 insertions(+), 5 deletions(-)
diff -r 1694ca7a775e -r d0f2f692cb1d acinclude.m4
--- a/acinclude.m4 Sun Jun 20 15:21:23 2021 +0200
+++ b/acinclude.m4 Wed Jun 23 15:08:30 2021 +0800
@@ -63,7 +63,7 @@
[[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-*]])
define(X86_64_PATTERN,
-[[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar*-*-* | bulldozer*-*-* | piledriver*-*-* | steamroller*-*-* | excavator*-*-* | zen*-*-* | pentium4-*-* | atom-*-* | silvermont-*-* | goldmont-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-* | nehalem*-*-* | westmere*-*-* | sandybridge*-*-* | ivybridge*-*-* | haswell*-*-* | broadwell*-*-* | skylake*-*-* | kabylake*-*-* | icelake*-*-* | tigerlake*-*-* | rocketlake*-*-*]])
+[[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar*-*-* | bulldozer*-*-* | piledriver*-*-* | steamroller*-*-* | excavator*-*-* | zen*-*-* | pentium4-*-* | atom-*-* | silvermont-*-* | goldmont-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-* | nehalem*-*-* | westmere*-*-* | sandybridge*-*-* | ivybridge*-*-* | haswell*-*-* | broadwell*-*-* | skylake*-*-* | kabylake*-*-* | icelake*-*-* | tigerlake*-*-* | rocketlake*-*-* | zxc-*-* | kx5000-*-* | kx6000-*-*]])
dnl GMP_FAT_SUFFIX(DSTVAR, DIRECTORY)
dnl ---------------------------------
diff -r 1694ca7a775e -r d0f2f692cb1d config.guess
--- a/config.guess Sun Jun 20 15:21:23 2021 +0200
+++ b/config.guess Wed Jun 23 15:08:30 2021 +0800
@@ -847,7 +847,7 @@
char vendor_string[13];
char feature_string[12];
long fms;
- int family, model;
+ int family, model, stepping;
const char *modelstr, *suffix;
int cpu_64bit = 0, cpu_avx = 0;
int cpuid_64bit, cpuid_avx, cpuid_osxsave;
@@ -859,6 +859,7 @@
family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
+ stepping = (fms & 0xf);
cpuid_avx = (feature_string[11] >> 4) & 1;
cpuid_osxsave = (feature_string[11] >> 3) & 1;
@@ -1023,14 +1024,27 @@
{
/* Should recognize Cyrix' processors too. */
}
- else if (strcmp (vendor_string, "CentaurHauls") == 0)
+ else if (strcmp (vendor_string, "CentaurHauls") == 0 ||
+ strcmp (vendor_string, " Shanghai ") == 0)
{
switch (family)
{
case 6:
if (model < 9) modelstr = "viac3";
else if (model < 15) modelstr = "viac32";
- else cpu_64bit = 1, modelstr = "nano";
+ else if (model == 15)
+ {
+ if (stepping < 0xE)
+ cpu_64bit = 1, modelstr = "nano";
+ else cpu_64bit = 1, modelstr = "zxc";
+ }
+ else cpu_64bit=1, modelstr = "zxc";
+ break;
+ case 7:
+ if(model < 0x3B)
+ cpu_64bit = 1, cpu_avx = 1, modelstr = "kx5000";
+ else
+ cpu_64bit = 1, cpu_avx = 1, modelstr = "kx6000";
break;
}
}
diff -r 1694ca7a775e -r d0f2f692cb1d config.sub
--- a/config.sub Sun Jun 20 15:21:23 2021 +0200
+++ b/config.sub Wed Jun 23 15:08:30 2021 +0800
@@ -102,7 +102,7 @@
test_cpu=ia64 ;;
pentium | pentiummmx | pentiumpro | pentium[234m] | k[567] | k6[23] | geode | athlon | viac3*)
test_cpu=i386 ;;
-athlon64 | atom | silvermont | goldmont | core2 | corei* | opteron | k[89] | k10 | bobcat | jaguar* | bulldozer* | piledriver* | steamroller* | excavator* | zen* | nano | nehalem | westmere | sandybridge* | ivybridge* | haswell* | broadwell* | skylake* | kabylake* | icelake* | rocketlake* | tigerlake* | knightslanding)
+athlon64 | atom | silvermont | goldmont | core2 | corei* | opteron | k[89] | k10 | bobcat | jaguar* | bulldozer* | piledriver* | steamroller* | excavator* | zen* | nano | nehalem | westmere | sandybridge* | ivybridge* | haswell* | broadwell* | skylake* | kabylake* | icelake* | rocketlake* | tigerlake* | knightslanding | zxc | kx5000 | kx6000)
test_cpu=x86_64 ;;
power[2-9] | power2sc)
test_cpu=power ;;
diff -r 1694ca7a775e -r d0f2f692cb1d configure.ac
--- a/configure.ac Sun Jun 20 15:21:23 2021 +0200
+++ b/configure.ac Wed Jun 23 15:08:30 2021 +0800
@@ -2000,6 +2000,24 @@
path="x86/nano x86/mmx x86"
path_64="x86_64/nano x86_64"
;;
+ zxc)
+ gcc_cflags_cpu="-mtune=k8"
+ gcc_cflags_arch="-march=k8"
+ path="x86/mmx x86"
+ path_64="x86_64/zxc x86_64/nano x86_64"
+ ;;
+ kx5000)
+ gcc_cflags_cpu="-mtune=k8"
+ gcc_cflags_arch="-march=k8"
+ path="x86/mmx x86"
+ path_64="x86_64/kx5000 x86_64/zxc x86_64/nano x86_64"
+ ;;
+ kx6000)
+ gcc_cflags_cpu="-mtune=k8"
+ gcc_cflags_arch="-march=k8"
+ path="x86/mmx x86"
+ path_64="x86_64/kx6000 x86_64/zxc x86_64/nano x86_64"
+ ;;
*)
gcc_cflags_cpu="-mtune=i486 -mcpu=i486 -m486"
gcc_cflags_arch="-march=i486"
Thanks,
Dylan
More information about the gmp-devel
mailing list