[Gmp-commit] /var/hg/gmp: Support cpuid faking from configure, for better tes...

mercurial at gmplib.org mercurial at gmplib.org
Thu May 9 19:26:54 CEST 2013


details:   /var/hg/gmp/rev/d7e58b0ea0b4
changeset: 15804:d7e58b0ea0b4
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu May 09 19:26:50 2013 +0200
description:
Support cpuid faking from configure, for better testing.

diffstat:

 ChangeLog            |   4 ++++
 configure.ac         |  19 +++++++++++++++++++
 mpn/x86/fat/fat.c    |   3 ---
 mpn/x86_64/fat/fat.c |   3 ---
 4 files changed, 23 insertions(+), 6 deletions(-)

diffs (79 lines):

diff -r 6ab7e63e3067 -r d7e58b0ea0b4 ChangeLog
--- a/ChangeLog	Thu May 09 00:35:16 2013 +0200
+++ b/ChangeLog	Thu May 09 19:26:50 2013 +0200
@@ -1,5 +1,9 @@
 2013-05-09  Torbjorn Granlund  <tege at gmplib.org>
 
+	* configure.ac (--enable-fake-cpuid): New option.
+	* mpn/x86_64/fat/fat.c (WANT_FAKE_CPUID): Remove defaulting.
+	* mpn/x86/fat/fat.c (WANT_FAKE_CPUID): Likewise.
+
 	* mpn/x86_64/bd1/mul_1.asm: Fix typo.
 
 2013-05-07  Torbjorn Granlund  <tege at gmplib.org>
diff -r 6ab7e63e3067 -r d7e58b0ea0b4 configure.ac
--- a/configure.ac	Thu May 09 00:35:16 2013 +0200
+++ b/configure.ac	Thu May 09 19:26:50 2013 +0200
@@ -36,6 +36,7 @@
 m4_pattern_allow(GMP_NAIL_BITS)
 m4_pattern_allow(GMP_NUMB_BITS)
 m4_pattern_allow(GMP_NONSTD_ABI)
+m4_pattern_allow(GMP_CPU_TYPE)
 
 # If --target is not used then $target_alias is empty, but if say
 # "./configure athlon-pc-freebsd3.5" is used, then all three of
@@ -243,10 +244,28 @@
 [enable_minithres=no])
 
 
+AC_ARG_ENABLE(fake-cpuid,
+AC_HELP_STRING([--enable-fake-cpuid],[enable GMP_CPU_TYPE faking cpuid [[default=no]]]),
+[case $enableval in
+yes|no) ;;
+*) AC_MSG_ERROR([bad value $enableval for --enable-fake-cpuid, need yes or no]) ;;
+esac],
+[enable_fake_cpuid=no])
+
+if test "$enable_fake_cpuid" = "yes"; then
+  AC_DEFINE(WANT_FAKE_CPUID,1,
+  [Define to 1 to enable GMP_CPU_TYPE faking cpuid, per --enable-fake-cpuid])
+fi
+
+
 if test $enable_fat = yes && test $enable_assembly = no ; then
   AC_MSG_ERROR([when doing a fat build, disabling assembly will not work])
 fi
 
+if test $enable_fake_cpuid = yes && test $enable_fat = no ; then
+  AC_MSG_ERROR([--enable-fake-cpuid requires --enable-fat])
+fi
+
 
 tmp_host=`echo $host_cpu | sed 's/\./_/'`
 AC_DEFINE_UNQUOTED(HAVE_HOST_CPU_$tmp_host)
diff -r 6ab7e63e3067 -r d7e58b0ea0b4 mpn/x86/fat/fat.c
--- a/mpn/x86/fat/fat.c	Thu May 09 00:35:16 2013 +0200
+++ b/mpn/x86/fat/fat.c	Thu May 09 19:26:50 2013 +0200
@@ -31,9 +31,6 @@
 /* Change this to "#define TRACE(x) x" for some traces. */
 #define TRACE(x)
 
-/* Change this to 1 to take the cpuid from GMP_CPU_TYPE env var. */
-#define WANT_FAKE_CPUID  0
-
 
 /* fat_entry.asm */
 long __gmpn_cpuid (char [12], int);
diff -r 6ab7e63e3067 -r d7e58b0ea0b4 mpn/x86_64/fat/fat.c
--- a/mpn/x86_64/fat/fat.c	Thu May 09 00:35:16 2013 +0200
+++ b/mpn/x86_64/fat/fat.c	Thu May 09 19:26:50 2013 +0200
@@ -34,9 +34,6 @@
 /* Change this to "#define TRACE(x) x" for some traces. */
 #define TRACE(x)
 
-/* Change this to 1 to take the cpuid from GMP_CPU_TYPE env var. */
-#define WANT_FAKE_CPUID  0
-
 
 /* fat_entry.asm */
 long __gmpn_cpuid (char [12], int);


More information about the gmp-commit mailing list