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

mercurial at gmplib.org mercurial at gmplib.org
Wed Apr 27 18:44:06 CEST 2011


details:   /var/hg/gmp/rev/01739be26934
changeset: 14134:01739be26934
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Apr 27 18:43:28 2011 +0200
description:
(LEA): Complete rewrite.

details:   /var/hg/gmp/rev/a7b0ebc4fe8b
changeset: 14135:a7b0ebc4fe8b
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Wed Apr 27 18:43:37 2011 +0200
description:
*** empty log message ***

diffstat:

 ChangeLog         |   5 +++++
 mpn/x86/darwin.m4 |  40 ++++++++++++++++++++++++++++++++--------
 2 files changed, 37 insertions(+), 8 deletions(-)

diffs (82 lines):

diff -r 409675ae8163 -r a7b0ebc4fe8b ChangeLog
--- a/ChangeLog	Tue Apr 26 18:54:58 2011 +0200
+++ b/ChangeLog	Wed Apr 27 18:43:37 2011 +0200
@@ -1,3 +1,8 @@
+2011-04-27  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/x86/darwin.m4 (LEA): Complete rewrite.
+	(m4append): New macro.
+
 2011-04-26  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/sparc32/sparc-defs.m4 (changecom): Don't redefine '!' as it
diff -r 409675ae8163 -r a7b0ebc4fe8b mpn/x86/darwin.m4
--- a/mpn/x86/darwin.m4	Tue Apr 26 18:54:58 2011 +0200
+++ b/mpn/x86/darwin.m4	Wed Apr 27 18:43:37 2011 +0200
@@ -1,5 +1,5 @@
 divert(-1)
-dnl  Copyright 2007 Free Software Foundation, Inc.
+dnl  Copyright 2007, 2011 Free Software Foundation, Inc.
 dnl
 dnl  This file is part of the GNU MP Library.
 dnl
@@ -18,28 +18,52 @@
 
 define(`DARWIN')
 
+
+dnl m4append is used below.  Consider moving it to mpn/asm-defs.m4.
+
+define(`m4append',
+`define(`$1',  defn(`$1')`$2')'
+)
+
+
 dnl  Usage LEA(symbol,reg)
 dnl
-dnl  FIXME: Only handles one symbol per assembly file because of the
-dnl  way EPILOGUE_cpu is handled.
+dnl  We maintain lists of stuff to append in load_eip and darwin_bd.  The
+dnl  `index' stuff is needed to suppress repeated definitions.  To avoid
+dnl  getting fooled by "var" and "var1", we add 'bol ' (the end of
+dnl  'indirect_symbol') at the beginning and and a newline at the end.  This
+dnl  might be a bit fragile.
 
 define(`LEA',
 m4_assert_numargs(2)
 `ifdef(`PIC',`
-define(`EPILOGUE_cpu',
-`
-L(movl_eip_`'substr($2,1)):
+ifelse(index(defn(`load_eip'), `$2'),-1,
+`m4append(`load_eip',
+`L(movl_eip_`'substr($2,1)):
 	movl	(%esp), $2
 	ret_internal
-	.section __IMPORT,__pointers,non_lazy_symbol_pointers
+')')
+ifelse(index(defn(`darwin_bd'), `bol $1
+'),-1,
+`m4append(`darwin_bd',
+`	.section __IMPORT,__pointers,non_lazy_symbol_pointers
 L($1`'$non_lazy_ptr):
 	.indirect_symbol $1
 	.long	 0
-')
+')')
 	call	L(movl_eip_`'substr($2,1))
 	movl	L($1`'$non_lazy_ptr)-.($2), $2
 ',`
 	movl	`$'$1, $2
 ')')
 
+
+dnl EPILOGUE_cpu
+
+define(`EPILOGUE_cpu',`load_eip`'darwin_bd')
+
+define(`load_eip', `')		dnl updated in LEA
+define(`darwin_bd', `')		dnl updated in LEA
+
+
 divert`'dnl


More information about the gmp-commit mailing list