[Gmp-commit] /home/hgfiles/gmp: addlsh2 in mpz_lucnum_ui.

mercurial at gmplib.org mercurial at gmplib.org
Sat Feb 5 19:49:26 CET 2011


details:   /home/hgfiles/gmp/rev/f409cd65c634
changeset: 13828:f409cd65c634
user:      Marco Bodrato <bodrato at mail.dm.unipi.it>
date:      Sat Feb 05 19:49:23 2011 +0100
description:
addlsh2 in mpz_lucnum_ui.

diffstat:

 ChangeLog       |  2 ++
 mpz/lucnum_ui.c |  5 +++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r 7cba880ba762 -r f409cd65c634 ChangeLog
--- a/ChangeLog	Sat Feb 05 14:51:43 2011 +0100
+++ b/ChangeLog	Sat Feb 05 19:49:23 2011 +0100
@@ -12,6 +12,8 @@
 	* tests/mpn/t-toom6h.c: No tests below MPN_TOOM6H_MIN.
 	* tests/mpn/t-toom8h.c: No tests below MPN_TOOM8H_MIN.
 
+	* mpz/lucnum_ui.c: Use mpn_addlsh2_n.
+	
 2011-02-04  Torbjorn Granlund  <tege at gmplib.org>
 
 	* mpn/x86_64/atom/rsh1aors_n.asm: Add a MULFUNC_PROLOGUE.
diff -r 7cba880ba762 -r f409cd65c634 mpz/lucnum_ui.c
--- a/mpz/lucnum_ui.c	Sat Feb 05 14:51:43 2011 +0100
+++ b/mpz/lucnum_ui.c	Sat Feb 05 19:49:23 2011 +0100
@@ -117,9 +117,10 @@
 	  lsize -= (c == 0);
 
 	  /* lp = 5*lp */
-#if HAVE_NATIVE_mpn_addlshift
-	  c = mpn_addlshift (lp, lp, lsize, 2);
+#if HAVE_NATIVE_mpn_addlsh2_n
+	  c = mpn_addlsh2_n (lp, lp, lp, lsize);
 #else
+	  /* FIXME: Is this faster than mpn_mul_1 ? */
 	  c = mpn_lshift (xp, lp, lsize, 2);
 	  c += mpn_add_n (lp, lp, xp, lsize);
 #endif


More information about the gmp-commit mailing list