[Gmp-commit] /var/hg/gmp: Rename mpn_blah_sec to mpn_sec_blah.

mercurial at gmplib.org mercurial at gmplib.org
Wed Dec 25 23:12:50 UTC 2013


details:   /var/hg/gmp/rev/7cc19b7ff702
changeset: 16108:7cc19b7ff702
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Dec 26 00:12:47 2013 +0100
description:
Rename mpn_blah_sec to mpn_sec_blah.

diffstat:

 ChangeLog                             |   36 ++
 configure.ac                          |   14 +-
 gmp-impl.h                            |   30 +-
 mpn/alpha/sec_tabselect.asm           |  126 ++++++++++
 mpn/alpha/tabselect.asm               |  126 ----------
 mpn/arm/neon/sec_tabselect.asm        |  129 ++++++++++
 mpn/arm/neon/tabselect.asm            |  129 ----------
 mpn/arm/sec_tabselect.asm             |  120 +++++++++
 mpn/arm/tabselect.asm                 |  120 ---------
 mpn/asm-defs.m4                       |    2 +-
 mpn/generic/powm_sec.c                |  427 ----------------------------------
 mpn/generic/sb_div_sec.c              |  105 --------
 mpn/generic/sbpi1_div_sec.c           |  162 ------------
 mpn/generic/sec_div.c                 |  105 ++++++++
 mpn/generic/sec_pi1_div.c             |  162 ++++++++++++
 mpn/generic/sec_powm.c                |  426 +++++++++++++++++++++++++++++++++
 mpn/generic/sec_tabselect.c           |   47 +++
 mpn/generic/tabselect.c               |   47 ---
 mpn/ia64/sec_tabselect.asm            |  139 +++++++++++
 mpn/ia64/tabselect.asm                |  139 -----------
 mpn/powerpc32/sec_tabselect.asm       |  130 ++++++++++
 mpn/powerpc32/tabselect.asm           |  130 ----------
 mpn/powerpc64/sec_tabselect.asm       |  136 ++++++++++
 mpn/powerpc64/tabselect.asm           |  136 ----------
 mpn/sparc64/sec_tabselect.asm         |  151 ++++++++++++
 mpn/sparc64/tabselect.asm             |  151 ------------
 mpn/x86/mmx/sec_tabselect.asm         |  152 ++++++++++++
 mpn/x86/mmx/tabselect.asm             |  152 ------------
 mpn/x86/sec_tabselect.asm             |  104 ++++++++
 mpn/x86/tabselect.asm                 |  104 --------
 mpn/x86_64/bd1/sec_tabselect.asm      |   26 ++
 mpn/x86_64/bd1/tabselect.asm          |   26 --
 mpn/x86_64/core2/sec_tabselect.asm    |   26 ++
 mpn/x86_64/core2/tabselect.asm        |   26 --
 mpn/x86_64/coreinhm/sec_tabselect.asm |   26 ++
 mpn/x86_64/coreinhm/tabselect.asm     |   26 --
 mpn/x86_64/coreisbr/sec_tabselect.asm |   26 ++
 mpn/x86_64/coreisbr/tabselect.asm     |   26 --
 mpn/x86_64/fastsse/sec_tabselect.asm  |  181 ++++++++++++++
 mpn/x86_64/fastsse/tabselect.asm      |  181 --------------
 mpn/x86_64/k10/sec_tabselect.asm      |   26 ++
 mpn/x86_64/k10/tabselect.asm          |   26 --
 mpn/x86_64/pentium4/sec_tabselect.asm |   26 ++
 mpn/x86_64/pentium4/tabselect.asm     |   26 --
 mpn/x86_64/sec_tabselect.asm          |  165 +++++++++++++
 mpn/x86_64/tabselect.asm              |  165 -------------
 mpz/powm_sec.c                        |    4 +-
 tests/mpn/t-div.c                     |   14 +-
 tune/Makefile.am                      |    2 +-
 tune/common.c                         |    4 +-
 tune/speed.c                          |    2 +-
 tune/speed.h                          |    2 +-
 tune/tuneup.c                         |    6 +-
 53 files changed, 2505 insertions(+), 2470 deletions(-)

diffs (truncated from 5298 to 300 lines):

diff -r c9c2135eefb8 -r 7cc19b7ff702 ChangeLog
--- a/ChangeLog	Wed Dec 25 16:45:16 2013 +0100
+++ b/ChangeLog	Thu Dec 26 00:12:47 2013 +0100
@@ -1,3 +1,39 @@
+2013-12-26  Torbjorn Granlund  <tege at gmplib.org>
+
+	* configure.ac: Rename mpn_blah_sec to mpn_sec_blah.
+	* gmp-impl.h: Corresponding changes.
+	* mpn/asm-defs.m4: Corresponding changes.
+	* tune/Makefile.am: Corresponding changes.
+	* tune/common.c: Corresponding changes.
+	* tune/speed.c: Corresponding changes.
+	* tune/speed.h: Corresponding changes.
+	* tune/tuneup.c: Corresponding changes.
+	* mpz/powm_sec.c: Update calls.
+	* tests/mpn/t-div.c: Likewise.
+
+	* mpn/generic/sec_powm.c: New name for mpn/generic/powm_sec.c.
+	* mpn/generic/sec_div.c: New name for mpn/generic/sb_div_sec.c.
+	* mpn/generic/sec_pi1_div.c: New name for mpn/generic/sbpi1_div_sec.c.
+	* mpn/generic/sec_tabselect.c: New name for mpn/generic/tabselect.c.
+
+	* mpn/alpha/sec_tabselect.asm: New name for tabselect.asm.
+	* mpn/arm/neon/sec_tabselect.asm: New name for tabselect.asm.
+	* mpn/arm/sec_tabselect.asm: New name for tabselect.asm.
+	* mpn/ia64/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/powerpc32/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/powerpc64/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/sparc64/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86/mmx/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/bd1/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/core2/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/coreinhm/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/coreisbr/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/fastsse/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/k10/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/pentium4/sec_tabselect.asm: New name for tabselect.asm
+	* mpn/x86_64/sec_tabselect.asm: New name for tabselect.asm
+
 2013-12-25  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpz/powm_sec.c: Handle 0^e mod m specially.
diff -r c9c2135eefb8 -r 7cc19b7ff702 configure.ac
--- a/configure.ac	Wed Dec 25 16:45:16 2013 +0100
+++ b/configure.ac	Thu Dec 26 00:12:47 2013 +0100
@@ -2830,11 +2830,11 @@
   dcpi1_bdiv_q dcpi1_bdiv_qr						   \
   mu_bdiv_q mu_bdiv_qr							   \
   bdiv_q bdiv_qr broot brootinv bsqrt bsqrtinv				   \
-  divexact bdiv_dbm1c redc_1 redc_2 redc_n powm powlo powm_sec		   \
-  sb_div_qr_sec sb_div_r_sec sbpi1_div_qr_sec sbpi1_div_r_sec		   \
+  divexact bdiv_dbm1c redc_1 redc_2 redc_n powm powlo sec_powm		   \
+  sec_div_qr sec_div_r sec_pi1_div_qr sec_pi1_div_r			   \
   trialdiv remove							   \
   and_n andn_n nand_n ior_n iorn_n nior_n xor_n xnor_n			   \
-  copyi copyd zero tabselect						   \
+  copyi copyd zero sec_tabselect					   \
   comb_tables								   \
   $gmp_mpn_functions_optional"
 
@@ -2878,10 +2878,10 @@
 		     tmp_mulfunc="aorrlsh_n sorrlsh_n aorsorrlsh_n";;
   rsh1add_n|rsh1sub_n)
 		     tmp_mulfunc="rsh1aors_n";;
-  sb_div_qr_sec|sb_div_r_sec)
-		     tmp_mulfunc="sb_div_sec";;
-  sbpi1_div_qr_sec|sbpi1_div_r_sec)
-		     tmp_mulfunc="sbpi1_div_sec";;
+  sec_div_qr|sec_div_r)
+		     tmp_mulfunc="sec_div";;
+  sec_pi1_div_qr|sec_pi1_div_r)
+		     tmp_mulfunc="sec_pi1_div";;
 esac
 ])
 
diff -r c9c2135eefb8 -r 7cc19b7ff702 gmp-impl.h
--- a/gmp-impl.h	Wed Dec 25 16:45:16 2013 +0100
+++ b/gmp-impl.h	Thu Dec 26 00:12:47 2013 +0100
@@ -1551,21 +1551,21 @@
 __GMP_DECLSPEC void      mpn_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
 #define   mpn_powlo __MPN(powlo)
 __GMP_DECLSPEC void      mpn_powlo (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_size_t, mp_ptr);
-#define   mpn_powm_sec __MPN(powm_sec)
-__GMP_DECLSPEC void      mpn_powm_sec (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
-#define   mpn_powm_sec_itch __MPN(powm_sec_itch)
-__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_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);
-#define mpn_sbpi1_div_qr_sec __MPN(sbpi1_div_qr_sec)
-__GMP_DECLSPEC mp_limb_t mpn_sbpi1_div_qr_sec (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
-#define mpn_sb_div_r_sec __MPN(sb_div_r_sec)
-__GMP_DECLSPEC void mpn_sb_div_r_sec (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
-#define mpn_sbpi1_div_r_sec __MPN(sbpi1_div_r_sec)
-__GMP_DECLSPEC void mpn_sbpi1_div_r_sec (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+#define   mpn_sec_powm __MPN(sec_powm)
+__GMP_DECLSPEC void      mpn_sec_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define   mpn_sec_powm_itch __MPN(sec_powm_itch)
+__GMP_DECLSPEC mp_size_t mpn_sec_powm_itch (mp_size_t, mp_size_t, mp_size_t);
+#define   mpn_sec_tabselect __MPN(sec_tabselect)
+__GMP_DECLSPEC void      mpn_sec_tabselect (volatile mp_limb_t *, volatile mp_limb_t *, mp_size_t, mp_size_t, mp_size_t);
+
+#define mpn_sec_div_qr __MPN(sec_div_qr)
+__GMP_DECLSPEC void mpn_sec_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_pi1_div_qr __MPN(sec_pi1_div_qr)
+__GMP_DECLSPEC mp_limb_t mpn_sec_pi1_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
+#define mpn_sec_div_r __MPN(sec_div_r)
+__GMP_DECLSPEC void mpn_sec_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+#define mpn_sec_pi1_div_r __MPN(sec_pi1_div_r)
+__GMP_DECLSPEC void mpn_sec_pi1_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
 
 
 /* Override mpn_addlsh1_n, mpn_addlsh2_n, mpn_sublsh1_n, etc with mpn_addlsh_n,
diff -r c9c2135eefb8 -r 7cc19b7ff702 mpn/alpha/sec_tabselect.asm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mpn/alpha/sec_tabselect.asm	Thu Dec 26 00:12:47 2013 +0100
@@ -0,0 +1,126 @@
+dnl  Alpha mpn_sec_tabselect.
+
+dnl  Contributed to the GNU project by Torbjörn Granlund.
+
+dnl  Copyright 2011-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 https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C      cycles/limb
+C EV4:      ?
+C EV5:      2.25
+C EV6:      1.64
+
+define(`rp',     `r16')
+define(`tp',     `r17')
+define(`n',      `r18')
+define(`nents',  `r19')
+define(`which',  `r20')
+
+define(`i',      `r21')
+define(`j',      `r22')
+define(`stride', `r23')
+define(`mask',   `r24')
+define(`k',      `r25')
+
+
+ASM_START()
+PROLOGUE(mpn_sec_tabselect)
+	subq	n, 4, j			C outer loop induction variable
+
+	blt	j, L(outer_end)
+L(outer_top):
+	mov	tp, r8
+	lda	r0, 0(r31)
+	lda	r1, 0(r31)
+	lda	r2, 0(r31)
+	lda	r3, 0(r31)
+	subq	j, 4, j			C outer loop induction variable
+	subq	nents, which, k
+	mov	nents, i
+
+	ALIGN(16)
+L(top):	ldq	r4, 0(tp)
+	ldq	r5, 8(tp)
+	cmpeq	k, i, mask
+	subq	i, 1, i
+	subq	r31, mask, mask
+	ldq	r6, 16(tp)
+	ldq	r7, 24(tp)
+	and	r4, mask, r4
+	and	r5, mask, r5
+	or	r0, r4, r0
+	or	r1, r5, r1
+	and	r6, mask, r6
+	and	r7, mask, r7
+	or	r2, r6, r2
+	or	r3, r7, r3
+	s8addq	n, tp, tp
+	bne	i, L(top)
+
+	stq	r0, 0(rp)
+	stq	r1, 8(rp)
+	stq	r2, 16(rp)
+	stq	r3, 24(rp)
+	addq	r8, 32, tp
+	addq	rp, 32, rp
+	bge	j, L(outer_top)
+L(outer_end):
+
+	and	n, 2, r0
+	beq	r0, L(b0x)
+L(b1x):	mov	tp, r8
+	lda	r0, 0(r31)
+	lda	r1, 0(r31)
+	subq	nents, which, k
+	mov	nents, i
+	ALIGN(16)
+L(tp2):	ldq	r4, 0(tp)
+	ldq	r5, 8(tp)
+	cmpeq	k, i, mask
+	subq	i, 1, i
+	subq	r31, mask, mask
+	and	r4, mask, r4
+	and	r5, mask, r5
+	or	r0, r4, r0
+	or	r1, r5, r1
+	s8addq	n, tp, tp
+	bne	i, L(tp2)
+	stq	r0, 0(rp)
+	stq	r1, 8(rp)
+	addq	r8, 16, tp
+	addq	rp, 16, rp
+
+L(b0x):	and	n, 1, r0
+	beq	r0, L(b00)
+L(b01):	lda	r0, 0(r31)
+	subq	nents, which, k
+	mov	nents, i
+	ALIGN(16)
+L(tp1):	ldq	r4, 0(tp)
+	cmpeq	k, i, mask
+	subq	i, 1, i
+	subq	r31, mask, mask
+	and	r4, mask, r4
+	or	r0, r4, r0
+	s8addq	n, tp, tp
+	bne	i, L(tp1)
+	stq	r0, 0(rp)
+
+L(b00):	ret	r31, (r26), 1
+EPILOGUE()
diff -r c9c2135eefb8 -r 7cc19b7ff702 mpn/alpha/tabselect.asm
--- a/mpn/alpha/tabselect.asm	Wed Dec 25 16:45:16 2013 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,126 +0,0 @@
-dnl  Alpha mpn_tabselect.
-
-dnl  Contributed to the GNU project by Torbjörn Granlund.
-
-dnl  Copyright 2011-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 https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C      cycles/limb
-C EV4:      ?
-C EV5:      2.25
-C EV6:      1.64
-
-define(`rp',     `r16')
-define(`tp',     `r17')
-define(`n',      `r18')
-define(`nents',  `r19')
-define(`which',  `r20')
-
-define(`i',      `r21')
-define(`j',      `r22')
-define(`stride', `r23')
-define(`mask',   `r24')
-define(`k',      `r25')
-
-
-ASM_START()
-PROLOGUE(mpn_tabselect)
-	subq	n, 4, j			C outer loop induction variable
-
-	blt	j, L(outer_end)
-L(outer_top):
-	mov	tp, r8
-	lda	r0, 0(r31)
-	lda	r1, 0(r31)


More information about the gmp-commit mailing list