[Gmp-commit] /var/hg/gmp: 2 new changesets
mercurial at gmplib.org
mercurial at gmplib.org
Thu Apr 3 14:32:56 UTC 2014
details: /var/hg/gmp/rev/e42ba6cf3945
changeset: 16367:e42ba6cf3945
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Apr 03 16:32:16 2014 +0200
description:
Handle the situation where a CPU knows about AVX but the kernel does not.
details: /var/hg/gmp/rev/267de6866b9a
changeset: 16368:267de6866b9a
user: Torbjorn Granlund <tege at gmplib.org>
date: Thu Apr 03 16:32:29 2014 +0200
description:
ChangeLog
diffstat:
ChangeLog | 15 +++++++++++++++
config.guess | 10 +++++++---
configure.ac | 25 +++++++++++++++----------
3 files changed, 37 insertions(+), 13 deletions(-)
diffs (156 lines):
diff -r 1fab0adc5ff7 -r 267de6866b9a ChangeLog
--- a/ChangeLog Wed Apr 02 22:28:24 2014 +0200
+++ b/ChangeLog Thu Apr 03 16:32:29 2014 +0200
@@ -1,3 +1,18 @@
+2014-04-03 Torbjorn Granlund <tege at gmplib.org>
+
+ * config.guess: Append "noavx" for CPUs which have AVX but where the
+ kernel does not support it.
+ * configure.ac: Accept "noavx" cpu name suffixes. Conditionally pass
+ -mno-avx.
+
+2014-04-02 Torbjorn Granlund <tege at gmplib.org>
+
+ * mpn/x86_64/k8/redc_1.asm: Workaround for Darwin assembler quirk.
+
+2014-03-28 Torbjorn Granlund <tege at gmplib.org>
+
+ * mpn/generic/mod_1_1.c: Conditionalise ARM asm on !__thumb__.
+
2014-03-31 Marc Glisse <marc.glisse at inria.fr>
* mpn/arm/dive_1.asm, mpn/arm/invert_limb.asm: Use RODATA.
diff -r 1fab0adc5ff7 -r 267de6866b9a config.guess
--- a/config.guess Wed Apr 02 22:28:24 2014 +0200
+++ b/config.guess Thu Apr 03 16:32:29 2014 +0200
@@ -755,9 +755,9 @@
char dummy_string[12];
long fms;
int family, model, stepping;
- const char *modelstr;
+ const char *modelstr, *suffix;
int cpu_64bit = 0;
- int cpuid_64bit;
+ int cpuid_64bit, cpuid_avx, cpuid_osxsave;
CPUID (vendor_string, 0);
vendor_string[12] = 0;
@@ -768,6 +768,10 @@
model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
stepping = fms & 0xf;
+ cpuid_avx = (dummy_string[11] >> 4) & 1;
+ cpuid_osxsave = (dummy_string[11] >> 3) & 1;
+ suffix = cpuid_avx > cpuid_osxsave ? "noavx" : "";
+
modelstr = "$guess_cpu";
/**************************************************/
@@ -905,7 +909,7 @@
if (cpuid_64bit && ! cpu_64bit)
modelstr = "x86_64";
- printf ("%s", modelstr);
+ printf ("%s%s", modelstr, suffix);
return 0;
}
EOF
diff -r 1fab0adc5ff7 -r 267de6866b9a configure.ac
--- a/configure.ac Wed Apr 02 22:28:24 2014 +0200
+++ b/configure.ac Thu Apr 03 16:32:29 2014 +0200
@@ -1545,6 +1545,7 @@
icc_cflags_optlist="opt"
icc_cflags_opt="-O3 -O2 -O1"
any_32_testlist="sizeof-long-4"
+ gcc_cflags_optlist="cpu arch noavx"
CALLING_CONVENTIONS_OBJS='x86call.lo x86check$U.lo'
# Availability of rdtsc is checked at run-time.
@@ -1584,7 +1585,6 @@
# like k8 for x86_64, then it can be the -mtune at the start, no need to
# duplicate anything.
#
- gcc_cflags_optlist="cpu arch"
case $host_cpu in
i386*)
gcc_cflags_cpu="-mtune=i386 -mcpu=i386 -m386"
@@ -1696,31 +1696,31 @@
path="x86/bobcat x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bobcat x86_64/k10 x86_64/k8 x86_64"
;;
- jaguar)
+ jaguar | jaguarnoavx)
gcc_cflags_cpu="-mtune=btver2 -mtune=btver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=btver2 -march=btver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/jaguar x86/bobcat x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/jaguar x86_64/bobcat x86_64/k10 x86_64/k8 x86_64"
;;
- bulldozer | bd1)
+ bulldozer | bd1 | bulldozernoavx | bd1noavx)
gcc_cflags_cpu="-mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
- piledriver | bd2)
+ piledriver | bd2 | piledrivernoavx | bd2noavx)
gcc_cflags_cpu="-mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
- steamroller | bd3)
+ steamroller | bd3 | steamrollernoavx | bd3noavx)
gcc_cflags_cpu="-mtune=bdver3 -mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver3 -march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd3 x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd3 x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
;;
- excavator | bd4)
+ excavator | bd4 | excavatornoavx | bd4noavx)
gcc_cflags_cpu="-mtune=bdver4 -mtune=bdver3 -mtune=bdver2 -mtune=bdver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=bdver4 -march=bdver3 -march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd4 x86/bd3 x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
@@ -1731,26 +1731,26 @@
gcc_cflags_arch="-march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/core2 x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/core2 x86_64"
- ;;
+ ;;
corei | coreinhm | coreiwsm)
gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreinhm x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreinhm x86_64/core2 x86_64"
;;
- coreisbr)
+ coreisbr | coreisbrnoavx)
gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
;;
- coreihwl)
+ coreihwl | coreihwlnoavx)
gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
;;
- coreibwl)
+ coreibwl | coreibwlnoavx)
gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
@@ -1777,6 +1777,11 @@
;;
esac
+ case $host_cpu in
+ *noavx)
+ gcc_cflags_noavx="-mno-avx";;
+ esac
+
case $host in
X86_64_PATTERN)
cclist_64="gcc cc"
More information about the gmp-commit
mailing list