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

mercurial at gmplib.org mercurial at gmplib.org
Sun Mar 24 20:49:08 CET 2013


details:   /var/hg/gmp/rev/f87a1edc7f9f
changeset: 15633:f87a1edc7f9f
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Mar 24 19:55:09 2013 +0100
description:
(refmpn_addlsh_nc, refmpn_sublsh_nc): Remove silly assert of mp_limb being non-negative.

details:   /var/hg/gmp/rev/c782a0dbb21b
changeset: 15634:c782a0dbb21b
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Mar 24 19:57:46 2013 +0100
description:
(GMP_MULFUNC_CHOICES): Support add+sub+rsb lsh files.

details:   /var/hg/gmp/rev/9bfefa65006a
changeset: 15635:9bfefa65006a
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Mar 24 20:48:29 2013 +0100
description:
New ARM A15 addlsh1_n, sublsh1_n, rsblsh1_n, addlsh2_n, sublsh2_n, rsblsh2_n, rsh1add_n, rsh1sub_n.

details:   /var/hg/gmp/rev/0856beb907f3
changeset: 15636:0856beb907f3
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Sun Mar 24 20:48:46 2013 +0100
description:
ChangeLog

diffstat:

 ChangeLog                                 |   12 ++
 configure.ac                              |   18 +-
 mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm |   32 +++++
 mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm |   32 +++++
 mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm |  133 ++++++++++++++++++++++++
 mpn/arm/v7a/cora15/neon/rsh1aors_n.asm    |  166 ++++++++++++++++++++++++++++++
 tests/refmpn.c                            |   10 +-
 7 files changed, 389 insertions(+), 14 deletions(-)

diffs (truncated from 474 to 300 lines):

diff -r 4b32bd60c390 -r 0856beb907f3 ChangeLog
--- a/ChangeLog	Thu Mar 21 23:10:04 2013 +0100
+++ b/ChangeLog	Sun Mar 24 20:48:46 2013 +0100
@@ -1,3 +1,15 @@
+2013-03-24  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm: New file.
+	* mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm: New file.
+	* mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm: New file.
+	* mpn/arm/v7a/cora15/neon/rsh1aors_n.asm: New file.
+
+	* configure.ac (GMP_MULFUNC_CHOICES): Support add+sub+rsb lsh files.
+
+	* tests/refmpn.c (refmpn_addlsh_nc, refmpn_sublsh_nc): Remove silly
+	assert of mp_limb being non-negative.
+
 2013-03-21  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/arm/neon/lshiftc.asm: New file.
diff -r 4b32bd60c390 -r 0856beb907f3 configure.ac
--- a/configure.ac	Thu Mar 21 23:10:04 2013 +0100
+++ b/configure.ac	Sun Mar 24 20:48:46 2013 +0100
@@ -2811,23 +2811,23 @@
                      tmp_mulfunc="logops_n"  ;;
   lshift|rshift)     tmp_mulfunc="lorrshift";;
   addlsh1_n)
-		     tmp_mulfunc="aorslsh1_n aorrlsh1_n";;
+		     tmp_mulfunc="aorslsh1_n aorrlsh1_n aorsorrlsh1_n";;
   sublsh1_n)
-		     tmp_mulfunc="aorslsh1_n sorrlsh1_n";;
+		     tmp_mulfunc="aorslsh1_n sorrlsh1_n aorsorrlsh1_n";;
   rsblsh1_n)
-		     tmp_mulfunc="aorrlsh1_n sorrlsh1_n";;
+		     tmp_mulfunc="aorrlsh1_n sorrlsh1_n aorsorrlsh1_n";;
   addlsh2_n)
-		     tmp_mulfunc="aorslsh2_n aorrlsh2_n";;
+		     tmp_mulfunc="aorslsh2_n aorrlsh2_n aorsorrlsh2_n";;
   sublsh2_n)
-		     tmp_mulfunc="aorslsh2_n sorrlsh2_n";;
+		     tmp_mulfunc="aorslsh2_n sorrlsh2_n aorsorrlsh2_n";;
   rsblsh2_n)
-		     tmp_mulfunc="aorrlsh2_n sorrlsh2_n";;
+		     tmp_mulfunc="aorrlsh2_n sorrlsh2_n aorsorrlsh2_n";;
   addlsh_n)
-		     tmp_mulfunc="aorslsh_n aorrlsh_n";;
+		     tmp_mulfunc="aorslsh_n aorrlsh_n aorsorrlsh_n";;
   sublsh_n)
-		     tmp_mulfunc="aorslsh_n sorrlsh_n";;
+		     tmp_mulfunc="aorslsh_n sorrlsh_n aorsorrlsh_n";;
   rsblsh_n)
-		     tmp_mulfunc="aorrlsh_n sorrlsh_n";;
+		     tmp_mulfunc="aorrlsh_n sorrlsh_n aorsorrlsh_n";;
   rsh1add_n|rsh1sub_n)
 		     tmp_mulfunc="rsh1aors_n";;
   sb_div_qr_sec|sb_div_r_sec)
diff -r 4b32bd60c390 -r 0856beb907f3 mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/arm/v7a/cora15/neon/aorsorrlsh1_n.asm	Sun Mar 24 20:48:46 2013 +0100
@@ -0,0 +1,32 @@
+dnl  ARM mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n
+
+dnl  Contributed to the GNU project by Torbjörn Granlund.
+
+dnl  Copyright 2013 Free Software Foundation, Inc.
+
+dnl  This file is part of the GNU MP Library.
+
+dnl  The GNU MP Library is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU Lesser General Public License as published
+dnl  by the Free Software Foundation; either version 3 of the License, or (at
+dnl  your option) any later version.
+
+dnl  The GNU MP Library is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl  License for more details.
+
+dnl  You should have received a copy of the GNU Lesser General Public License
+dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+define(LSH,		1)
+
+ifdef(`OPERATION_addlsh1_n',`define(`DO_add')')
+ifdef(`OPERATION_sublsh1_n',`define(`DO_sub')')
+ifdef(`OPERATION_rsblsh1_n',`define(`DO_rsb')')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n mpn_rsblsh1_n)
+
+include_mpn(`arm/v7a/cora15/neon/aorsorrlshC_n.asm')
diff -r 4b32bd60c390 -r 0856beb907f3 mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/arm/v7a/cora15/neon/aorsorrlsh2_n.asm	Sun Mar 24 20:48:46 2013 +0100
@@ -0,0 +1,32 @@
+dnl  ARM mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n
+
+dnl  Contributed to the GNU project by Torbjörn Granlund.
+
+dnl  Copyright 2013 Free Software Foundation, Inc.
+
+dnl  This file is part of the GNU MP Library.
+
+dnl  The GNU MP Library is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU Lesser General Public License as published
+dnl  by the Free Software Foundation; either version 3 of the License, or (at
+dnl  your option) any later version.
+
+dnl  The GNU MP Library is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl  License for more details.
+
+dnl  You should have received a copy of the GNU Lesser General Public License
+dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+define(LSH,		2)
+
+ifdef(`OPERATION_addlsh2_n',`define(`DO_add')')
+ifdef(`OPERATION_sublsh2_n',`define(`DO_sub')')
+ifdef(`OPERATION_rsblsh2_n',`define(`DO_rsb')')
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_sublsh2_n mpn_rsblsh2_n)
+
+include_mpn(`arm/v7a/cora15/neon/aorsorrlshC_n.asm')
diff -r 4b32bd60c390 -r 0856beb907f3 mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm	Sun Mar 24 20:48:46 2013 +0100
@@ -0,0 +1,133 @@
+dnl  ARM mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n
+
+dnl  Contributed to the GNU project by Torbjörn Granlund.
+
+dnl  Copyright 2013 Free Software Foundation, Inc.
+
+dnl  This file is part of the GNU MP Library.
+
+dnl  The GNU MP Library is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU Lesser General Public License as published
+dnl  by the Free Software Foundation; either version 3 of the License, or (at
+dnl  your option) any later version.
+
+dnl  The GNU MP Library is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl  License for more details.
+
+dnl  You should have received a copy of the GNU Lesser General Public License
+dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
+
+
+C	     cycles/limb
+C StrongARM	 -
+C XScale	 -
+C Cortex-A7	 ?
+C Cortex-A8	 ?
+C Cortex-A9	 5.25
+C Cortex-A15	 2.25
+
+C TODO
+C  * Consider using 4-way feed-in code.
+C  * This is ad-hoc scheduled, perhaps unnecessarily so for A15, and perhaps
+C    insufficiently for A7 and A8.
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`vp', `r2')
+define(`n',  `r3')
+
+ifdef(`DO_add', `
+  define(`ADCSBCS',	`adcs	$1, $2, $3')
+  define(`CLRCY',	`cmn	r13, #1')
+  define(`RETVAL',	`adc	r0, $1, #0')
+  define(`func',	mpn_addlsh`'LSH`'_n)')
+ifdef(`DO_sub', `
+  define(`ADCSBCS',	`sbcs	$1, $2, $3')
+  define(`CLRCY',	`cmp	r13, #0')
+  define(`RETVAL',	`sbc	$2, $2, $2
+			cmn	$2, #1
+			adc	 r0, $1, #0')
+  define(`func',	mpn_sublsh`'LSH`'_n)')
+ifdef(`DO_rsb', `
+  define(`ADCSBCS',	`sbcs	$1, $3, $2')
+  define(`CLRCY',	`cmp	r13, #0')
+  define(`RETVAL',	`sbc	r0, $1, #0')
+  define(`func',	mpn_rsblsh`'LSH`'_n)')
+
+
+ASM_START()
+PROLOGUE(func)
+	push	 {r4-r10}
+	vmov.i8	 d0, #0			C could feed carry through here
+	CLRCY
+	tst	n, #1
+	beq	L(bb0)
+
+L(bb1):	vld1.32	 {d3[0]}, [vp]!
+	vsli.u32 d0, d3, #LSH
+	ldr	 r12, [up], #4
+	vmov.32	 r5, d0[0]
+	vshr.u32 d0, d3, #32-LSH
+	ADCSBCS( r12, r12, r5)
+	str	 r12, [rp], #4
+	bics	 n, n, #1
+	beq	 L(rtn)
+
+L(bb0):	tst	n, #2
+	beq	L(b00)
+
+L(b10):	vld1.32	 {d3}, [vp]!
+	vsli.u64 d0, d3, #LSH
+	ldmia	 up!, {r10,r12}
+	vmov	 r4, r5, d0
+	vshr.u64 d0, d3, #64-LSH
+	ADCSBCS( r10, r10, r4)
+	ADCSBCS( r12, r12, r5)
+	stmia	 rp!, {r10,r12}
+	bics	 n, n, #2
+	beq	 L(rtn)
+
+L(b00):	vld1.32	 {d2}, [vp]!
+	vsli.u64 d0, d2, #LSH
+	vshr.u64 d1, d2, #64-LSH
+	vld1.32	 {d3}, [vp]!
+	vsli.u64 d1, d3, #LSH
+	vmov	 r6, r7, d0
+	vshr.u64 d0, d3, #64-LSH
+	sub	 n, n, #4
+	tst	 n, n
+	beq	 L(end)
+
+	ALIGN(16)
+L(top):	ldmia	 up!, {r8,r9,r10,r12}
+	vld1.32	 {d2}, [vp]!
+	vsli.u64 d0, d2, #LSH
+	vmov	 r4, r5, d1
+	vshr.u64 d1, d2, #64-LSH
+	ADCSBCS( r8, r8, r6)
+	ADCSBCS( r9, r9, r7)
+	vld1.32	 {d3}, [vp]!
+	vsli.u64 d1, d3, #LSH
+	vmov	 r6, r7, d0
+	vshr.u64 d0, d3, #64-LSH
+	ADCSBCS( r10, r10, r4)
+	ADCSBCS( r12, r12, r5)
+	stmia	 rp!, {r8,r9,r10,r12}
+	sub	 n, n, #4
+	tst	 n, n
+	bne	 L(top)
+
+L(end):	ldmia	 up!, {r8,r9,r10,r12}
+	vmov	 r4, r5, d1
+	ADCSBCS( r8, r8, r6)
+	ADCSBCS( r9, r9, r7)
+	ADCSBCS( r10, r10, r4)
+	ADCSBCS( r12, r12, r5)
+	stmia	 rp!, {r8,r9,r10,r12}
+L(rtn):	vmov.32	 r0, d0[0]
+	RETVAL(	 r0, r1)
+	pop	 {r4-r10}
+	bx	 r14
+EPILOGUE()
diff -r 4b32bd60c390 -r 0856beb907f3 mpn/arm/v7a/cora15/neon/rsh1aors_n.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/arm/v7a/cora15/neon/rsh1aors_n.asm	Sun Mar 24 20:48:46 2013 +0100
@@ -0,0 +1,166 @@
+dnl  ARM Neon mpn_rsh1add_n, mpn_rsh1sub_n.
+
+dnl  Contributed to the GNU project by Torbjörn Granlund.
+
+dnl  Copyright 2013 Free Software Foundation, Inc.
+
+dnl  This file is part of the GNU MP Library.
+
+dnl  The GNU MP Library is free software; you can redistribute it and/or modify
+dnl  it under the terms of the GNU Lesser General Public License as published
+dnl  by the Free Software Foundation; either version 3 of the License, or (at
+dnl  your option) any later version.
+
+dnl  The GNU MP Library is distributed in the hope that it will be useful, but
+dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
+dnl  License for more details.
+
+dnl  You should have received a copy of the GNU Lesser General Public License
+dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C	     cycles/limb
+C StrongARM	 -
+C XScale	 -
+C Cortex-A7	 ?
+C Cortex-A8	 ?
+C Cortex-A9	4-5
+C Cortex-A15	 2.5
+
+C TODO


More information about the gmp-commit mailing list