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

mercurial at gmplib.org mercurial at gmplib.org
Mon Mar 18 23:40:02 CET 2013


details:   /var/hg/gmp/rev/fa64a6cd25fa
changeset: 15598:fa64a6cd25fa
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 20:29:02 2013 +0100
description:
(m4append): Move definition.

details:   /var/hg/gmp/rev/90e653d25f2e
changeset: 15599:90e653d25f2e
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 20:35:30 2013 +0100
description:
Modernise asm syntax.

details:   /var/hg/gmp/rev/7e9e577e76e1
changeset: 15600:7e9e577e76e1
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 22:49:37 2013 +0100
description:
Make code work for PIC.

details:   /var/hg/gmp/rev/11f1ad31c7ee
changeset: 15601:11f1ad31c7ee
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 23:36:36 2013 +0100
description:
(LEA): Rewrite to properly handle repeated use.

details:   /var/hg/gmp/rev/657cc9e8606d
changeset: 15602:657cc9e8606d
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 23:38:06 2013 +0100
description:
Provide arm32 calling convention check files.

details:   /var/hg/gmp/rev/f94de27751ed
changeset: 15603:f94de27751ed
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 23:39:05 2013 +0100
description:
(arm*-*-*): Define CALLING_CONVENTIONS_OBJS.

details:   /var/hg/gmp/rev/11ac185e1edd
changeset: 15604:11ac185e1edd
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Mon Mar 18 23:39:46 2013 +0100
description:
ChangeLog

diffstat:

 ChangeLog               |  22 ++++++++++-
 configure.ac            |   1 +
 mpn/arm/arm-defs.m4     |  18 ++++++---
 mpn/arm/v6/addmul_3.asm |  12 ++++++
 mpn/asm-defs.m4         |   7 +++
 mpn/x86/darwin.m4       |   7 ---
 tests/amd64call.asm     |  76 +++++++++++++++++++-------------------
 tests/arm32call.asm     |  83 ++++++++++++++++++++++++++++++++++++++++++
 tests/arm32check.c      |  95 +++++++++++++++++++++++++++++++++++++++++++++++++
 tests/x86call.asm       |  54 +++++++++++++-------------
 10 files changed, 295 insertions(+), 80 deletions(-)

diffs (truncated from 559 to 300 lines):

diff -r db4619c0f9a0 -r 11ac185e1edd ChangeLog
--- a/ChangeLog	Mon Mar 18 15:51:14 2013 +0100
+++ b/ChangeLog	Mon Mar 18 23:39:46 2013 +0100
@@ -1,3 +1,21 @@
+2013-03-18  Torbjorn Granlund  <tege at gmplib.org>
+
+	* configure.ac (arm*-*-*): Define CALLING_CONVENTIONS_OBJS.
+
+	* tests/arm32call.asm: New file.
+	* tests/arm32check.c: New file.
+
+	* mpn/arm/arm-defs.m4 (LEA): Rewrite to properly handle repeated use.
+	(EPILOGUE_cpu): Define.
+
+	* mpn/arm/v6/addmul_3.asm: Make code work for PIC.
+
+	* tests/x86call.asm: Modernise asm syntax.
+	* tests/amd64call.asm: Likewise.
+
+	* mpn/x86/darwin.m4 (m4append): Move definition from here...
+	* mpn/asm-defs.m4: ...to here.
+
 2013-03-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
 	* doc/gmp.texi (--enable-fat): No quote in concept index.
@@ -216,7 +234,7 @@
 
 2013-02-27 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
-        * mini-gmp/mini-gmp.c (mpz_div_q_2exp): Adjust only if needed.
+	* mini-gmp/mini-gmp.c (mpz_div_q_2exp): Adjust only if needed.
 	(mpn_common_scan): New service function to unify scan loops.
 	(mpz_scan0, mpz_scan1): Simplify by using mpn_common_scan.
 	(mpz_make_odd): Simplify, assume in-place operation on positive.
@@ -274,7 +292,7 @@
 
 2013-02-19 Marco Bodrato <bodrato at mail.dm.unipi.it>
 
-        * mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
+	* mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
 	(mpz_export): Reorder branches.
 	(mpz_mul_ui): Avoid temporary allocation (mpn_mul_1 can work in-place).
 
diff -r db4619c0f9a0 -r 11ac185e1edd configure.ac
--- a/configure.ac	Mon Mar 18 15:51:14 2013 +0100
+++ b/configure.ac	Mon Mar 18 23:39:46 2013 +0100
@@ -570,6 +570,7 @@
     gcc_cflags_maybe="-marm"
     gcc_testlist="gcc-arm-umodsi"
     GMP_INCLUDE_MPN(arm/arm-defs.m4)
+    CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
     case $host_cpu in
       armsa1 | armv4*)
 	;;
diff -r db4619c0f9a0 -r 11ac185e1edd mpn/arm/arm-defs.m4
--- a/mpn/arm/arm-defs.m4	Mon Mar 18 15:51:14 2013 +0100
+++ b/mpn/arm/arm-defs.m4	Mon Mar 18 23:39:46 2013 +0100
@@ -2,7 +2,7 @@
 
 dnl  m4 macros for ARM assembler.
 
-dnl  Copyright 2001, 2012 Free Software Foundation, Inc.
+dnl  Copyright 2001, 2012, 2013 Free Software Foundation, Inc.
 dnl
 dnl  This file is part of the GNU MP Library.
 dnl
@@ -48,6 +48,7 @@
 deflit(pc,r15)
 
 
+define(`lea_list', `')
 define(`lea_num',0)
 
 dnl  LEA(reg,gmp_symbol)
@@ -59,16 +60,21 @@
 define(`LEA',`dnl
 ldr	$1, L(ptr`'lea_num)
 ifdef(`PIC',dnl
-`
+`dnl
 L(bas`'lea_num):dnl
 	add	$1, $1, pc`'dnl
-	define(`EPILOGUE_cpu',
-		L(ptr`'lea_num):	.word	GSYM_PREFIX`'$2-L(bas`'lea_num)-8)dnl
+	m4append(`lea_list',`
+L(ptr'lea_num`):	.word	GSYM_PREFIX`'$2-L(bas'lea_num`)-8')
 	define(`lea_num', eval(lea_num+1))dnl
 ',`dnl
-	define(`EPILOGUE_cpu',
-		L(ptr`'lea_num):	.word	GSYM_PREFIX`'$2)')dnl
+	m4append(`lea_list',`
+L(ptr'lea_num`):	.word	GSYM_PREFIX`'$2')
+	define(`lea_num', eval(lea_num+1))dnl
+')dnl
 ')
 
+define(`EPILOGUE_cpu',
+`lea_list
+	SIZE(`$1',.-`$1')')
 
 divert
diff -r db4619c0f9a0 -r 11ac185e1edd mpn/arm/v6/addmul_3.asm
--- a/mpn/arm/v6/addmul_3.asm	Mon Mar 18 15:51:14 2013 +0100
+++ b/mpn/arm/v6/addmul_3.asm	Mon Mar 18 23:39:46 2013 +0100
@@ -58,9 +58,21 @@
 	mul	w0, w0, n		C n * 3^{-1} mod 2^32
 	and	w0, w0, #0xc0000001	C pseudo-CRT mod 3,2
 	sub	n, n, #3
+ifdef(`PIC',`
 	ldr	pc, [pc, w0, ror $28]
 	nop
 	.word	L(b0), L(b2), L(b4), 0, L(b3), L(b5), L(b1)
+',`
+	add	pc, pc, w0, ror $28
+	nop
+	b	L(b0)
+	b	L(b2)
+	b	L(b4)
+	.word	0
+	b	L(b3)
+	b	L(b5)
+	b	L(b1)
+')
 
 L(b5):	add	up, up, #-8
 	ldr	w1, [rp, #0]
diff -r db4619c0f9a0 -r 11ac185e1edd mpn/asm-defs.m4
--- a/mpn/asm-defs.m4	Mon Mar 18 15:51:14 2013 +0100
+++ b/mpn/asm-defs.m4	Mon Mar 18 23:39:46 2013 +0100
@@ -1740,4 +1740,11 @@
 `m4_hex_lowmask(GMP_NUMB_BITS)')
 
 
+dnl  Usage: m4append(`variable',`value-to-append')
+
+define(`m4append',
+`define(`$1',  defn(`$1')`$2')
+'
+)
+
 divert`'dnl
diff -r db4619c0f9a0 -r 11ac185e1edd mpn/x86/darwin.m4
--- a/mpn/x86/darwin.m4	Mon Mar 18 15:51:14 2013 +0100
+++ b/mpn/x86/darwin.m4	Mon Mar 18 23:39:46 2013 +0100
@@ -19,13 +19,6 @@
 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  We maintain lists of stuff to append in load_eip and darwin_bd.  The
diff -r db4619c0f9a0 -r 11ac185e1edd tests/amd64call.asm
--- a/tests/amd64call.asm	Mon Mar 18 15:51:14 2013 +0100
+++ b/tests/amd64call.asm	Mon Mar 18 23:39:46 2013 +0100
@@ -30,7 +30,7 @@
 C Execute an fldcw, setting the x87 control word to cw.
 
 PROLOGUE(x86_fldcw)
-	movq	%rdi, -8(%rsp)
+	mov	%rdi, -8(%rsp)
 	fldcw	-8(%rsp)
 	ret
 EPILOGUE()
@@ -43,7 +43,7 @@
 PROLOGUE(x86_fstcw)
 	movq	$0, -8(%rsp)
 	fstcw	-8(%rsp)
-	movq	-8(%rsp), %rax
+	mov	-8(%rsp), %rax
 	ret
 EPILOGUE()
 
@@ -101,52 +101,52 @@
 	TEXT
 	ALIGN(32)
 PROLOGUE(calling_conventions)
-	movq	G(calling_conventions_values)@GOTPCREL(%rip), %rax
-	popq	RETADDR(%rax)
+	mov	G(calling_conventions_values)@GOTPCREL(%rip), %rax
+	pop	RETADDR(%rax)
 
-	movq	%rbx, SAVE_RBX(%rax)
-	movq	%rbp, SAVE_RBP(%rax)
-	movq	%r12, SAVE_R12(%rax)
-	movq	%r13, SAVE_R13(%rax)
-	movq	%r14, SAVE_R14(%rax)
-	movq	%r15, SAVE_R15(%rax)
+	mov	%rbx, SAVE_RBX(%rax)
+	mov	%rbp, SAVE_RBP(%rax)
+	mov	%r12, SAVE_R12(%rax)
+	mov	%r13, SAVE_R13(%rax)
+	mov	%r14, SAVE_R14(%rax)
+	mov	%r15, SAVE_R15(%rax)
 
 	C Values we expect to see unchanged, as per amd64check.c
-	movq	WANT_RBX(%rax), %rbx
-	movq	WANT_RBP(%rax), %rbp
-	movq	WANT_R12(%rax), %r12
-	movq	WANT_R13(%rax), %r13
-	movq	WANT_R14(%rax), %r14
-	movq	WANT_R15(%rax), %r15
+	mov	WANT_RBX(%rax), %rbx
+	mov	WANT_RBP(%rax), %rbp
+	mov	WANT_R12(%rax), %r12
+	mov	WANT_R13(%rax), %r13
+	mov	WANT_R14(%rax), %r14
+	mov	WANT_R15(%rax), %r15
 
 	C Try to provoke a problem by starting with junk in the caller-saves
 	C registers, especially %rax which will be the return value.
-C	movq	JUNK_RAX(%rax), %rax		C overwritten below anyway
-	movq	JUNK_R10(%rax), %r10
-	movq	JUNK_R11(%rax), %r11
+C	mov	JUNK_RAX(%rax), %rax		C overwritten below anyway
+	mov	JUNK_R10(%rax), %r10
+	mov	JUNK_R11(%rax), %r11
 
-	movq	G(calling_conventions_function)@GOTPCREL(%rip), %rax
+	mov	G(calling_conventions_function)@GOTPCREL(%rip), %rax
 	call	*(%rax)
 
-	movq	G(calling_conventions_values)@GOTPCREL(%rip), %rcx
+	mov	G(calling_conventions_values)@GOTPCREL(%rip), %rcx
 
-	movq	%rbx, RBX(%rcx)
-	movq	%rbp, RBP(%rcx)
-	movq	%r12, R12(%rcx)
-	movq	%r13, R13(%rcx)
-	movq	%r14, R14(%rcx)
-	movq	%r15, R15(%rcx)
+	mov	%rbx, RBX(%rcx)
+	mov	%rbp, RBP(%rcx)
+	mov	%r12, R12(%rcx)
+	mov	%r13, R13(%rcx)
+	mov	%r14, R14(%rcx)
+	mov	%r15, R15(%rcx)
 
-	pushfq
-	popq	%rbx
-	movq	%rbx, RFLAGS(%rcx)
+	pushf
+	pop	%rbx
+	mov	%rbx, RFLAGS(%rcx)
 
-	movq	SAVE_RBX(%rcx), %rbx
-	movq	SAVE_RBP(%rcx), %rbp
-	movq	SAVE_R12(%rcx), %r12
-	movq	SAVE_R13(%rcx), %r13
-	movq	SAVE_R14(%rcx), %r14
-	movq	SAVE_R15(%rcx), %r15
+	mov	SAVE_RBX(%rcx), %rbx
+	mov	SAVE_RBP(%rcx), %rbp
+	mov	SAVE_R12(%rcx), %r12
+	mov	SAVE_R13(%rcx), %r13
+	mov	SAVE_R14(%rcx), %r14
+	mov	SAVE_R15(%rcx), %r15
 
 	C Overwrite parameter registers
 C	mov	JUNK_R9(%rcx), %r9
@@ -156,9 +156,9 @@
 C	mov	JUNK_RSI(%rcx), %rsi
 C	mov	JUNK_RDI(%rcx), %rdi
 
-	pushq	RETADDR(%rcx)
+	push	RETADDR(%rcx)
 
-	movq	G(calling_conventions_fenv)@GOTPCREL(%rip), %rcx
+	mov	G(calling_conventions_fenv)@GOTPCREL(%rip), %rcx
 	fstenv	(%rcx)
 	finit
 
diff -r db4619c0f9a0 -r 11ac185e1edd tests/arm32call.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/arm32call.asm	Mon Mar 18 23:39:46 2013 +0100
@@ -0,0 +1,83 @@
+dnl  ARM32 calling conventions checking.
+
+dnl  Copyright 2000, 2003, 2004, 2006, 2007, 2010, 2013 Free Software
+dnl  Foundation, Inc.
+
+dnl  This file is part of the GNU MP Library test suite.
+
+dnl  The GNU MP Library test suite is free software; you can redistribute it
+dnl  and/or modify it under the terms of the GNU General Public License as
+dnl  published by the Free Software Foundation; either version 3 of the
+dnl  License, or (at your option) any later version.
+
+dnl  The GNU MP Library test suite is distributed in the hope that it will be
+dnl  useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
+dnl  Public License for more details.
+
+dnl  You should have received a copy of the GNU General Public License along


More information about the gmp-commit mailing list