[Gmp-commit] /var/hg/gmp: 5 new changesets

mercurial at gmplib.org mercurial at gmplib.org
Mon Jul 4 00:16:27 CEST 2011


details:   /var/hg/gmp/rev/671ad7c330e3
changeset: 14205:671ad7c330e3
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sat Jul 02 23:53:29 2011 +0200
description:
Rewrite x86-64 cpu recognition asm code to work under Windoze.

details:   /var/hg/gmp/rev/5283a5c6ea40
changeset: 14206:5283a5c6ea40
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Jul 03 14:24:02 2011 +0200
description:
Remove mention of libmp.

details:   /var/hg/gmp/rev/7090305aca8e
changeset: 14207:7090305aca8e
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Jul 03 14:24:24 2011 +0200
description:
Fix a spelling error.

details:   /var/hg/gmp/rev/2da287d3b4cc
changeset: 14208:2da287d3b4cc
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Jul 03 14:30:19 2011 +0200
description:
Mention aix64 name change.

details:   /var/hg/gmp/rev/2bfa74c136e1
changeset: 14209:2bfa74c136e1
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Jul 04 00:15:44 2011 +0200
description:
(x86_64 *-*-mingw*): Handle also cygwin here; clear out extra_functions_64.

diffstat:

 NEWS         |   2 ++
 config.guess |  38 +++++++++++++++++++++++---------------
 configure.in |  10 ++++------
 gmp-h.in     |   3 ---
 gmp-impl.h   |   2 +-
 5 files changed, 30 insertions(+), 25 deletions(-)

diffs (168 lines):

diff -r 28a97f01334d -r 2bfa74c136e1 NEWS
--- a/NEWS	Thu Jun 16 12:22:15 2011 +0200
+++ b/NEWS	Mon Jul 04 00:15:44 2011 +0200
@@ -15,6 +15,8 @@
   * In C++, the conversions mpq_class->mpz_class, mpf_class->mpz_class and
     mpf_class->mpq_class are now explicit.
 
+  * The ABIs under AIX are no longer called aix32 and aix64, but mode64 and 32.
+    This is more consistent with other powerpc systems.
 
 Changes between GMP version 5.0.0 and 5.0.1
 
diff -r 28a97f01334d -r 2bfa74c136e1 config.guess
--- a/config.guess	Thu Jun 16 12:22:15 2011 +0200
+++ b/config.guess	Mon Jul 04 00:15:44 2011 +0200
@@ -3,7 +3,7 @@
 # GMP config.guess wrapper.
 
 
-# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008 Free Software
+# Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008, 2011 Free Software
 # Foundation, Inc.
 #
 # This file is part of the GNU MP Library.
@@ -679,6 +679,12 @@
   fi
   ;;
 
+
+# Recognise x86 processors using a tricky cpuid with 4 arguments, repeating
+# arguments; for x86-64 we effectively pass the 1st in rdx and the 2nd in rcx.
+# This allows the same asm to work for both standard and Windoze calling
+# conventions.
+
 i?86-*-* | amd64-*-* | x86_64-*-*)
   cat <<EOF >${dummy}0.s
 	.globl cpuid
@@ -687,10 +693,10 @@
 _cpuid:
 	pushl %esi
 	pushl %ebx
-	movl 16(%esp),%eax
+	movl 24(%esp),%eax
 	.byte 0x0f
 	.byte 0xa2
-	movl 12(%esp),%esi
+	movl 20(%esp),%esi
 	movl %ebx,(%esi)
 	movl %edx,4(%esi)
 	movl %ecx,8(%esi)
@@ -703,23 +709,25 @@
 	.globl _cpuid
 cpuid:
 _cpuid:
-	push %rbx
-	mov %esi,%eax
-	.byte 0x0f
-	.byte 0xa2
-	mov %ebx,(%rdi)
-	mov %edx,4(%rdi)
-	mov %ecx,8(%rdi)
-	pop %rbx
+	push	%rbx
+	mov	%rdx, %r8
+	mov	%ecx, %eax
+	.byte	0x0f
+	.byte	0xa2
+	mov	%ebx, (%r8)
+	mov	%edx, 4(%r8)
+	mov	%ecx, 8(%r8)
+	pop	%rbx
 	ret
 EOF
   cat <<EOF >${dummy}2.c
 #include <string.h>
 #include <stdio.h>
+#define CPUID(a,b) cpuid(b,a,a,b)
 #if __cplusplus
 extern "C"
 #endif
-unsigned int cpuid (char dummy_string[12], int);
+unsigned int cpuid (int, char *, char *, int);
 int
 main ()
 {
@@ -730,10 +738,10 @@
   const char *modelstr;
   int cpu_64bit = 0;
 
-  cpuid (vendor_string, 0);
+  CPUID (vendor_string, 0);
   vendor_string[12] = 0;
 
-  fms = cpuid (dummy_string, 1);
+  fms = CPUID (dummy_string, 1);
 
   family = ((fms >> 8) & 0xf) + ((fms >> 20) & 0xff);
   model = ((fms >> 4) & 0xf) + ((fms >> 12) & 0xf0);
@@ -842,7 +850,7 @@
   if (strcmp ("$guess_cpu", "x86_64") == 0 && ! cpu_64bit)
     modelstr = "$guess_cpu";
 
-  printf ("%s\n", modelstr);
+  printf ("%s", modelstr);
   return 0;
 }
 EOF
diff -r 28a97f01334d -r 2bfa74c136e1 configure.in
--- a/configure.in	Thu Jun 16 12:22:15 2011 +0200
+++ b/configure.in	Mon Jul 04 00:15:44 2011 +0200
@@ -123,7 +123,7 @@
 
 
 AC_ARG_ENABLE(assembly,
-AC_HELP_STRING([--enable-assembly],[enable the use of asembly loops [[default=yes]]]),
+AC_HELP_STRING([--enable-assembly],[enable the use of assembly loops [[default=yes]]]),
 [case $enableval in
 yes|no) ;;
 *) AC_MSG_ERROR([bad value $enableval for --enable-assembly, need yes or no]) ;;
@@ -1548,9 +1548,10 @@
 	    cclist_64="$cclist_64 cc"
 	    cc_64_cflags="-xO3 -m64"
 	    ;;
-	  *-*-mingw*)
+	  *-*-mingw* | *-*-cygwin)
 	    limb_64=longlong
 	    path_64=""	# Windows amd64 calling conventions are *different*
+	    extra_functions_64=""
 	    # Silence many pedantic warnings for w64.  FIXME.
 	    gcc_64_cflags="$gcc_64_cflags -std=gnu99"
 	    ;;
@@ -1572,10 +1573,7 @@
     ;;
 
 
-  # Special CPU "none" selects generic C.  -DNO_ASM is used to disable gcc
-  # asm blocks in longlong.h (since they're driven by cpp pre-defined
-  # symbols like __alpha rather than the configured $host_cpu).
-  #
+  # Special CPU "none" used to select generic C, now this is obsolete.
   none-*-*)
     AC_MSG_ERROR([the \"none\" host is obsolete, use --disable-assembly])
     ;;
diff -r 28a97f01334d -r 2bfa74c136e1 gmp-h.in
--- a/gmp-h.in	Thu Jun 16 12:22:15 2011 +0200
+++ b/gmp-h.in	Mon Jul 04 00:15:44 2011 +0200
@@ -123,9 +123,6 @@
    indicates when building libgmpxx, and in that case libgmpxx functions are
    exports, but libgmp functions which might get called are imports.
 
-   libmp.la uses __GMP_DECLSPEC, just as if it were libgmp.la.  libgmp and
-   libmp don't call each other, so there's no conflict or confusion.
-
    Libtool DLL_EXPORT define is not used.
 
    There's no attempt to support GMP built both static and DLL.  Doing so
diff -r 28a97f01334d -r 2bfa74c136e1 gmp-impl.h
--- a/gmp-impl.h	Thu Jun 16 12:22:15 2011 +0200
+++ b/gmp-impl.h	Mon Jul 04 00:15:44 2011 +0200
@@ -53,7 +53,7 @@
 
 /* For fat.h and other fat binary stuff.
    No need for __GMP_ATTRIBUTE_PURE or __GMP_NOTHROW, since functions
-   declared this way are only used to set function pointers in __gmp_cpuvec,
+   declared this way are only used to set function pointers in __gmpn_cpuvec,
    they're not called directly.  */
 #define DECL_add_n(name) \
   __GMP_DECLSPEC mp_limb_t name __GMP_PROTO ((mp_ptr, mp_srcptr, mp_srcptr, mp_size_t))


More information about the gmp-commit mailing list