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

mercurial at gmplib.org mercurial at gmplib.org
Thu Mar 28 08:25:59 CET 2013


details:   /var/hg/gmp/rev/f40869b17557
changeset: 15656:f40869b17557
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Mar 28 08:25:47 2013 +0100
description:
(mpn_mod_1s_4p): Make precomputed arg 'const'.

details:   /var/hg/gmp/rev/c543f7c8e627
changeset: 15657:c543f7c8e627
user:      Torbjorn Granlund <tege at gmplib.org>
date:      Thu Mar 28 08:25:53 2013 +0100
description:
*** empty log message ***

diffstat:

 ChangeLog             |  13 +++++++++----
 mpn/sparc64/mod_1_4.c |  20 ++++++++++++--------
 2 files changed, 21 insertions(+), 12 deletions(-)

diffs (67 lines):

diff -r aece7ae6decf -r c543f7c8e627 ChangeLog
--- a/ChangeLog	Wed Mar 27 12:26:08 2013 +0100
+++ b/ChangeLog	Thu Mar 28 08:25:53 2013 +0100
@@ -1,11 +1,16 @@
+2013-03-28  Torbjorn Granlund  <tege at gmplib.org>
+
+	* mpn/sparc64/mod_1_4.c (mpn_mod_1s_4p): Make precomputed arg 'const'.
+	(mpn_mod_1s_4p_cps): Update from generic code.
+
 2013-03-27  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/generic/trialdiv.c: Make variables 'const' to match tables.
 
-	* mpn/generic/mod_1_1.c (mpn_mod_1s_4p): Make precomputed arg 'const'.
-	* mpn/generic/mod_1_2.c (mpn_mod_1s_3p): Likewise.
-	* mpn/generic/mod_1_3.c (mpn_mod_1s_2p): Likewise.
-	* mpn/generic/mod_1_4.c (mpn_mod_1_1p): Likewise.
+	* mpn/generic/mod_1_1.c (mpn_mod_1_1p): Make precomputed arg 'const'.
+	* mpn/generic/mod_1_2.c (mpn_mod_1s_2p): Likewise.
+	* mpn/generic/mod_1_3.c (mpn_mod_1s_3p): Likewise.
+	* mpn/generic/mod_1_4.c (mpn_mod_1s_4p): Likewise.
 	* gmp-impl.h: Update prototypes.
 
 	* mpn/x86_64/mulx/aorsmul_1.asm: New file.
diff -r aece7ae6decf -r c543f7c8e627 mpn/sparc64/mod_1_4.c
--- a/mpn/sparc64/mod_1_4.c	Wed Mar 27 12:26:08 2013 +0100
+++ b/mpn/sparc64/mod_1_4.c	Thu Mar 28 08:25:53 2013 +0100
@@ -46,19 +46,23 @@
   b <<= cnt;
   invert_limb (bi, b);
 
+  cps[0] = bi;
+  cps[1] = cnt;
+
   B1modb = -b * ((bi >> (GMP_LIMB_BITS-cnt)) | (CNST_LIMB(1) << cnt));
   ASSERT (B1modb <= b);		/* NB: not fully reduced mod b */
+  cps[2] = B1modb >> cnt;
+
   udiv_rnnd_preinv (B2modb, B1modb, 0, b, bi);
+  cps[3] = B2modb >> cnt;
+
   udiv_rnnd_preinv (B3modb, B2modb, 0, b, bi);
+  cps[4] = B3modb >> cnt;
+
   udiv_rnnd_preinv (B4modb, B3modb, 0, b, bi);
+  cps[5] = B4modb >> cnt;
+
   udiv_rnnd_preinv (B5modb, B4modb, 0, b, bi);
-
-  cps[0] = bi;
-  cps[1] = cnt;
-  cps[2] = B1modb >> cnt;
-  cps[3] = B2modb >> cnt;
-  cps[4] = B3modb >> cnt;
-  cps[5] = B4modb >> cnt;
   cps[6] = B5modb >> cnt;
 
 #if WANT_ASSERT
@@ -75,7 +79,7 @@
 }
 
 mp_limb_t
-mpn_mod_1s_4p (mp_srcptr ap, mp_size_t n, mp_limb_t b, mp_limb_t cps[7])
+mpn_mod_1s_4p (mp_srcptr ap, mp_size_t n, mp_limb_t b, const mp_limb_t cps[7])
 {
   mp_limb_t rh, rl, bi, ph, pl, ch, cl, r;
   mp_limb_t B1modb, B2modb, B3modb, B4modb, B5modb;


More information about the gmp-commit mailing list