[Gmp-commit] /var/hg/gmp: Renaming of mpn_addcnd_n and mpn_subcnd_n to mpn_cn...

mercurial at gmplib.org mercurial at gmplib.org
Wed Mar 13 14:54:49 CET 2013


details:   /var/hg/gmp/rev/2c97edbdd90d
changeset: 15569:2c97edbdd90d
user:      Niels M?ller <nisse at lysator.liu.se>
date:      Wed Mar 13 14:47:27 2013 +0100
description:
Renaming of mpn_addcnd_n and mpn_subcnd_n to mpn_cnd_*.

diffstat:

 ChangeLog                           |   29 +++++
 configure.ac                        |    8 +-
 gmp-impl.h                          |    8 +-
 mpn/arm/aorscnd_n.asm               |  122 -----------------------
 mpn/arm/cnd_aors_n.asm              |  122 +++++++++++++++++++++++
 mpn/asm-defs.m4                     |    4 +-
 mpn/generic/addcnd_n.c              |   62 ------------
 mpn/generic/cnd_add_n.c             |   62 ++++++++++++
 mpn/generic/cnd_sub_n.c             |   62 ++++++++++++
 mpn/generic/powm_sec.c              |    6 +-
 mpn/generic/sbpi1_div_sec.c         |    6 +-
 mpn/generic/subcnd_n.c              |   62 ------------
 mpn/powerpc64/mode64/aorscnd_n.asm  |  185 ------------------------------------
 mpn/powerpc64/mode64/cnd_aors_n.asm |  185 ++++++++++++++++++++++++++++++++++++
 mpn/x86_64/aorscnd_n.asm            |  172 ---------------------------------
 mpn/x86_64/cnd_aors_n.asm           |  172 +++++++++++++++++++++++++++++++++
 tests/devel/try.c                   |    8 +-
 tests/refmpn.c                      |    4 +-
 tests/tests.h                       |    4 +-
 tune/common.c                       |    8 +-
 tune/speed.c                        |    4 +-
 tune/speed.h                        |    4 +-
 22 files changed, 664 insertions(+), 635 deletions(-)

diffs (truncated from 1562 to 300 lines):

diff -r 405177858f21 -r 2c97edbdd90d ChangeLog
--- a/ChangeLog	Wed Mar 13 12:29:52 2013 +0100
+++ b/ChangeLog	Wed Mar 13 14:47:27 2013 +0100
@@ -1,3 +1,32 @@
+2013-03-12  Niels Möller  <nisse at lysator.liu.se>
+
+	New names mpn_cnd_add_n and mpn_cnd_sub_n.
+	* mpn/generic/cnd_add_n.c (mpn_cnd_add_n): Renamed file and
+	function, from addcnd.c:mpn_addcnd_n.
+	* mpn/generic/cnd_sub_n.c (mpn_cnd_sub_n): Renamed, from
+	subcnd.c:mpn_subcnd_n.
+	* mpn/arm/cnd_aors_n.asm: Renamed file, from aorscnd.asm, and
+	renamed functions.
+	* mpn/x86_64/cnd_aors_n.asm: Analogous renaming.
+	* mpn/powerpc64/mode64/cnd_aors_n.asm: Analogous renaming.
+	* gmp-impl.h (mpn_cnd_add_n, mpn_cnd_add_n): Updated prototypes
+	with new names.
+	* configure.ac: Updated for new names.
+	* tests/refmpn.c (refmpn_cnd_add_n): Renamed, from refmpn_addcnd_n.
+	(refmpn_cnd_sub_n): Renamed, from refmpn_subcnd_n.
+	* tests/tests.h (refmpn_cnd_add_n, refmpn_cnd_sub_n): Updated
+	prototypes with new names.
+	* tune/common.c (speed_mpn_cnd_add_n): Renamed, from
+	speed_mpn_addcnd_n, call mpn_cnd_add_n.
+	(speed_mpn_cnd_sub_n): Renamed, from speed_mpn_subcnd_n, call
+	mpn_cnd_sub_n.
+	* tune/speed.h (speed_mpn_cnd_add_n, speed_mpn_cnd_sub_n): Updated
+	prototypes with new names.
+	* tune/speed.c (routine): Updated list with new names.
+	* tests/devel/try.c: Updated for new mpn_cnd_* names.
+	* mpn/generic/sbpi1_div_sec.c: Likewise.
+	* mpn/generic/powm_sec.c: Likewise.
+
 2013-03-12  Torbjorn Granlund  <tege at gmplib.org>
 
 	* configure.ac: Add "missing" to extra_functions for coreibwl.
diff -r 405177858f21 -r 2c97edbdd90d configure.ac
--- a/configure.ac	Wed Mar 13 12:29:52 2013 +0100
+++ b/configure.ac	Wed Mar 13 14:47:27 2013 +0100
@@ -2718,7 +2718,7 @@
   add_n_sub_n addaddmul_1msb0"
 
 gmp_mpn_functions="$extra_functions					   \
-  add add_1 add_n sub sub_1 sub_n addcnd_n subcnd_n neg com		   \
+  add add_1 add_n sub sub_1 sub_n cnd_add_n cnd_sub_n neg com		   \
   mul_1 addmul_1 submul_1						   \
   add_err1_n add_err2_n add_err3_n sub_err1_n sub_err2_n sub_err3_n	   \
   lshift rshift dive_1 diveby3 divis divrem divrem_1 divrem_2		   \
@@ -2775,7 +2775,7 @@
 		     tmp_mulfunc="aors_err2_n" ;;
   add_err3_n|sub_err3_n)
 		     tmp_mulfunc="aors_err3_n" ;;
-  addcnd_n|subcnd_n) tmp_mulfunc="aorscnd_n"   ;;
+  cnd_add_n|cnd_sub_n) tmp_mulfunc="cnd_aors_n"   ;;
   addmul_1|submul_1) tmp_mulfunc="aorsmul_1" ;;
   mul_2|addmul_2)    tmp_mulfunc="aormul_2" ;;
   popcount|hamdist)  tmp_mulfunc="popham"    ;;
@@ -3268,7 +3268,6 @@
 #undef HAVE_NATIVE_mpn_add_n_sub_n
 #undef HAVE_NATIVE_mpn_add_nc
 #undef HAVE_NATIVE_mpn_addaddmul_1msb0
-#undef HAVE_NATIVE_mpn_addcnd_n
 #undef HAVE_NATIVE_mpn_addlsh1_n
 #undef HAVE_NATIVE_mpn_addlsh2_n
 #undef HAVE_NATIVE_mpn_addlsh_n
@@ -3301,6 +3300,8 @@
 #undef HAVE_NATIVE_mpn_bdiv_dbm1c
 #undef HAVE_NATIVE_mpn_bdiv_q_1
 #undef HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#undef HAVE_NATIVE_mpn_cnd_add_n
+#undef HAVE_NATIVE_mpn_cnd_sub_n
 #undef HAVE_NATIVE_mpn_com
 #undef HAVE_NATIVE_mpn_copyd
 #undef HAVE_NATIVE_mpn_copyi
@@ -3357,7 +3358,6 @@
 #undef HAVE_NATIVE_mpn_sqr_diag_addlsh1
 #undef HAVE_NATIVE_mpn_sub_n
 #undef HAVE_NATIVE_mpn_sub_nc
-#undef HAVE_NATIVE_mpn_subcnd_n
 #undef HAVE_NATIVE_mpn_sublsh1_n
 #undef HAVE_NATIVE_mpn_sublsh2_n
 #undef HAVE_NATIVE_mpn_sublsh_n
diff -r 405177858f21 -r 2c97edbdd90d gmp-impl.h
--- a/gmp-impl.h	Wed Mar 13 12:29:52 2013 +0100
+++ b/gmp-impl.h	Wed Mar 13 14:47:27 2013 +0100
@@ -1555,10 +1555,10 @@
 __GMP_DECLSPEC mp_size_t mpn_powm_sec_itch (mp_size_t, mp_size_t, mp_size_t);
 #define   mpn_tabselect __MPN(tabselect)
 __GMP_DECLSPEC void      mpn_tabselect (volatile mp_limb_t *, volatile mp_limb_t *, mp_size_t, mp_size_t, mp_size_t);
-#define   mpn_addcnd_n __MPN(addcnd_n)
-__GMP_DECLSPEC mp_limb_t mpn_addcnd_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
-#define   mpn_subcnd_n __MPN(subcnd_n)
-__GMP_DECLSPEC mp_limb_t mpn_subcnd_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define   mpn_cnd_add_n __MPN(cnd_add_n)
+__GMP_DECLSPEC mp_limb_t mpn_cnd_add_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define   mpn_cnd_sub_n __MPN(cnd_sub_n)
+__GMP_DECLSPEC mp_limb_t mpn_cnd_sub_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
 
 #define mpn_sb_div_qr_sec __MPN(sb_div_qr_sec)
 __GMP_DECLSPEC void mpn_sb_div_qr_sec (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
diff -r 405177858f21 -r 2c97edbdd90d mpn/arm/aorscnd_n.asm
--- a/mpn/arm/aorscnd_n.asm	Wed Mar 13 12:29:52 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,122 +0,0 @@
-dnl  ARM mpn_addcnd_n, mpn_subcnd_n
-
-dnl  Copyright 2012 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-A8	 ?
-C Cortex-A9	 2.5	slightly fluctuating
-C Cortex-A15	 ?
-
-define(`cnd',	`r0')
-define(`rp',	`r1')
-define(`up',	`r2')
-define(`vp',	`r3')
-
-define(`n',	`r12')
-
-
-ifdef(`OPERATION_addcnd_n', `
-	define(`ADDSUB',      adds)
-	define(`ADDSUBC',      adcs)
-	define(`INITCY',      `cmn	r0, #0')
-	define(`RETVAL',      `adc	r0, n, #0')
-	define(func,	      mpn_addcnd_n)')
-ifdef(`OPERATION_subcnd_n', `
-	define(`ADDSUB',      subs)
-	define(`ADDSUBC',      sbcs)
-	define(`INITCY',      `cmp	r0, #0')
-	define(`RETVAL',      `adc	r0, n, #0
-			      rsb	r0, r0, #1')
-	define(func,	      mpn_subcnd_n)')
-
-MULFUNC_PROLOGUE(mpn_addcnd_n mpn_subcnd_n)
-
-ASM_START()
-PROLOGUE(func)
-	push	{r4-r11}
-	ldr	n, [sp, #32]
-
-	INITCY				C really only needed for n = 0 (mod 4)
-
-	teq	cnd, #0			C could use this for clearing/setting cy
-	mvnne	cnd, #0			C conditionally set to 0xffffffff
-
-	ands	r4, n, #3
-	beq	L(top)
-	cmp	r4, #2
-	bcc	L(b1)
-	beq	L(b2)
-
-L(b3):	ldm	vp!, {r4,r5,r6}
-	ldm	up!, {r8,r9,r10}
-	and	r4, r4, cnd
-	and	r5, r5, cnd
-	and	r6, r6, cnd
-	ADDSUB	r8, r8, r4
-	ADDSUBC	r9, r9, r5
-	ADDSUBC	r10, r10, r6
-	stm	rp!, {r8,r9,r10}
-	sub	n, n, #3
-	teq	n, #0
-	bne	L(top)
-	b	L(end)
-
-L(b2):	ldm	vp!, {r4,r5}
-	ldm	up!, {r8,r9}
-	and	r4, r4, cnd
-	and	r5, r5, cnd
-	ADDSUB	r8, r8, r4
-	ADDSUBC	r9, r9, r5
-	stm	rp!, {r8,r9}
-	sub	n, n, #2
-	teq	n, #0
-	bne	L(top)
-	b	L(end)
-
-L(b1):	ldr	r4, [vp], #4
-	ldr	r8, [up], #4
-	and	r4, r4, cnd
-	ADDSUB	r8, r8, r4
-	str	r8, [rp], #4
-	sub	n, n, #1
-	teq	n, #0
-	beq	L(end)
-
-L(top):	ldm	vp!, {r4,r5,r6,r7}
-	ldm	up!, {r8,r9,r10,r11}
-	and	r4, r4, cnd
-	and	r5, r5, cnd
-	and	r6, r6, cnd
-	and	r7, r7, cnd
-	ADDSUBC	r8, r8, r4
-	ADDSUBC	r9, r9, r5
-	ADDSUBC	r10, r10, r6
-	ADDSUBC	r11, r11, r7
-	sub	n, n, #4
-	stm	rp!, {r8,r9,r10,r11}
-	teq	n, #0
-	bne	L(top)
-
-L(end):	RETVAL
-	pop	{r4-r11}
-	bx	r14
-EPILOGUE()
diff -r 405177858f21 -r 2c97edbdd90d mpn/arm/cnd_aors_n.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/arm/cnd_aors_n.asm	Wed Mar 13 14:47:27 2013 +0100
@@ -0,0 +1,122 @@
+dnl  ARM mpn_cnd_add_n, mpn_cnd_sub_n
+
+dnl  Copyright 2012 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-A8	 ?
+C Cortex-A9	 2.5	slightly fluctuating
+C Cortex-A15	 ?
+
+define(`cnd',	`r0')
+define(`rp',	`r1')
+define(`up',	`r2')
+define(`vp',	`r3')
+
+define(`n',	`r12')
+
+
+ifdef(`OPERATION_cnd_add_n', `
+	define(`ADDSUB',      adds)
+	define(`ADDSUBC',      adcs)
+	define(`INITCY',      `cmn	r0, #0')
+	define(`RETVAL',      `adc	r0, n, #0')
+	define(func,	      mpn_cnd_add_n)')
+ifdef(`OPERATION_cnd_sub_n', `
+	define(`ADDSUB',      subs)
+	define(`ADDSUBC',      sbcs)
+	define(`INITCY',      `cmp	r0, #0')
+	define(`RETVAL',      `adc	r0, n, #0
+			      rsb	r0, r0, #1')
+	define(func,	      mpn_cnd_sub_n)')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+	push	{r4-r11}
+	ldr	n, [sp, #32]
+
+	INITCY				C really only needed for n = 0 (mod 4)
+
+	teq	cnd, #0			C could use this for clearing/setting cy
+	mvnne	cnd, #0			C conditionally set to 0xffffffff
+
+	ands	r4, n, #3
+	beq	L(top)
+	cmp	r4, #2
+	bcc	L(b1)
+	beq	L(b2)
+
+L(b3):	ldm	vp!, {r4,r5,r6}
+	ldm	up!, {r8,r9,r10}


More information about the gmp-commit mailing list