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

mercurial at gmplib.org mercurial at gmplib.org
Sun Nov 9 23:55:47 UTC 2014


details:   /var/hg/gmp/rev/a730c56c90c2
changeset: 16506:a730c56c90c2
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Mon Nov 10 00:51:36 2014 +0100
description:
(i386 speed_cyclecounter): Remove inline asm code, rely on external version.

details:   /var/hg/gmp/rev/b7561e428ff1
changeset: 16507:b7561e428ff1
user:      Torbjorn Granlund <torbjorng at google.com>
date:      Mon Nov 10 00:55:28 2014 +0100
description:
(LEA, LEAL): Make sure to put eip stub code in text segment.

diffstat:

 ChangeLog           |   9 +++++++++
 mpn/x86/darwin.m4   |   8 ++++++--
 mpn/x86/x86-defs.m4 |   8 ++++++--
 tune/speed.h        |  36 ------------------------------------
 4 files changed, 21 insertions(+), 40 deletions(-)

diffs (112 lines):

diff -r 40fb11795fcb -r b7561e428ff1 ChangeLog
--- a/ChangeLog	Thu Nov 06 22:29:45 2014 +0100
+++ b/ChangeLog	Mon Nov 10 00:55:28 2014 +0100
@@ -1,3 +1,12 @@
+2014-11-08  Torbjörn Granlund  <torbjorng at google.com>
+
+	* mpn/x86/x86-defs.m4 (LEA, LEAL): Make sure to put eip stub code in
+	text segment.
+	* mpn/x86/darwin.m4: Likewise.
+
+	* tune/speed.h (i386 speed_cyclecounter): Remove inline asm code, rely
+	on external version.
+
 2014-11-06  Torbjörn Granlund  <torbjorng at google.com>
 
 	* config.guess: Ignore appended letters such E in POWER8E.
diff -r 40fb11795fcb -r b7561e428ff1 mpn/x86/darwin.m4
--- a/mpn/x86/darwin.m4	Thu Nov 06 22:29:45 2014 +0100
+++ b/mpn/x86/darwin.m4	Mon Nov 10 00:55:28 2014 +0100
@@ -44,7 +44,9 @@
 `ifdef(`PIC',`
 ifelse(index(defn(`load_eip'), `$2'),-1,
 `m4append(`load_eip',
-`L(movl_eip_`'substr($2,1)):
+`	TEXT
+	ALIGN(16)
+L(movl_eip_`'substr($2,1)):
 	movl	(%esp), $2
 	ret_internal
 ')')
@@ -67,7 +69,9 @@
 `ifdef(`PIC',`
 ifelse(index(defn(`load_eip'), `$2'),-1,
 `m4append(`load_eip',
-`L(movl_eip_`'substr($2,1)):
+`	TEXT
+	ALIGN(16)
+L(movl_eip_`'substr($2,1)):
 	movl	(%esp), $2
 	ret_internal
 ')')
diff -r 40fb11795fcb -r b7561e428ff1 mpn/x86/x86-defs.m4
--- a/mpn/x86/x86-defs.m4	Thu Nov 06 22:29:45 2014 +0100
+++ b/mpn/x86/x86-defs.m4	Mon Nov 10 00:55:28 2014 +0100
@@ -959,7 +959,9 @@
 `ifdef(`PIC',`dnl
 ifelse(index(defn(`load_eip'), `$2'),-1,
 `m4append(`load_eip',
-`L(movl_eip_`'substr($2,1)):
+`	TEXT
+	ALIGN(16)
+L(movl_eip_`'substr($2,1)):
 	movl	(%esp), $2
 	ret_internal
 ')')dnl
@@ -975,7 +977,9 @@
 `ifdef(`PIC',`dnl
 ifelse(index(defn(`load_eip'), `$2'),-1,
 `m4append(`load_eip',
-`L(movl_eip_`'substr($2,1)):
+`	TEXT
+	ALIGN(16)
+L(movl_eip_`'substr($2,1)):
 	movl	(%esp), $2
 	ret_internal
 ')')dnl
diff -r 40fb11795fcb -r b7561e428ff1 tune/speed.h
--- a/tune/speed.h	Thu Nov 06 22:29:45 2014 +0100
+++ b/tune/speed.h	Mon Nov 10 00:55:28 2014 +0100
@@ -417,42 +417,6 @@
 
 void mftb_function (unsigned p[2]);
 
-/* In i386 gcc -fPIC, ebx is a fixed register and can't be declared a dummy
-   output or a clobber for the cpuid, hence an explicit save and restore.  A
-   clobber as such doesn't provoke an error unfortunately (gcc 3.0), so use
-   the dummy output style in non-PIC, so there's an error if somehow -fPIC
-   is used without a -DPIC to tell us about it.  */
-#if defined(__GNUC__) && ! defined (NO_ASM)	\
-  && (defined (__i386__) || defined (__i486__))
-#if defined (PIC) || defined (__APPLE_CC__)
-#define speed_cyclecounter(p)						\
-  do {									\
-    int	 __speed_cyclecounter__save_ebx;				\
-    int	 __speed_cyclecounter__dummy;					\
-    __asm__ __volatile__ ("movl %%ebx, %1\n"				\
-			  "cpuid\n"					\
-			  "movl %1, %%ebx\n"				\
-			  "rdtsc"					\
-			  : "=a"   ((p)[0]),				\
-			    "=&rm" (__speed_cyclecounter__save_ebx),	\
-			    "=c"   (__speed_cyclecounter__dummy),	\
-			    "=d"   ((p)[1]));				\
-  } while (0)
-#else
-#define speed_cyclecounter(p)						\
-  do {									\
-    int	 __speed_cyclecounter__dummy1;					\
-    int	 __speed_cyclecounter__dummy2;					\
-    __asm__ __volatile__ ("cpuid\n"					\
-			  "rdtsc"					\
-			  : "=a" ((p)[0]),				\
-			    "=b" (__speed_cyclecounter__dummy1),	\
-			    "=c" (__speed_cyclecounter__dummy2),	\
-			    "=d" ((p)[1]));				\
-  } while (0)
-#endif
-#endif
-
 double speed_cyclecounter_diff (const unsigned [2], const unsigned [2]);
 int gettimeofday_microseconds_p (void);
 int getrusage_microseconds_p (void);


More information about the gmp-commit mailing list