diff options
author | Kevin Ryde <user42@zip.com.au> | 2003-12-30 21:26:21 +0100 |
---|---|---|
committer | Kevin Ryde <user42@zip.com.au> | 2003-12-30 21:26:21 +0100 |
commit | 0f330b6ca12f365f333ad674ebe2c84da237e2e1 (patch) | |
tree | 163c4f35058ef934f5b6dafb4e599d5eb7dbd8c0 /mpz/lucnum_ui.c | |
parent | 192abc25a9b9516754f284528831e107911b5dea (diff) | |
download | gmp-0f330b6ca12f365f333ad674ebe2c84da237e2e1.tar.gz |
* mpz/lucnum_ui.c, mpz/lucnum2_ui.c: Use mpn_addlsh1_n when available.
Diffstat (limited to 'mpz/lucnum_ui.c')
-rw-r--r-- | mpz/lucnum_ui.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/mpz/lucnum_ui.c b/mpz/lucnum_ui.c index 2af6b3e5f..6be4469c9 100644 --- a/mpz/lucnum_ui.c +++ b/mpz/lucnum_ui.c @@ -1,6 +1,6 @@ /* mpz_lucnum_ui -- calculate Lucas number. -Copyright 2001 Free Software Foundation, Inc. +Copyright 2001, 2003 Free Software Foundation, Inc. This file is part of the GNU MP Library. @@ -102,8 +102,12 @@ mpz_lucnum_ui (mpz_ptr ln, unsigned long n) ASSERT (yp[ysize-1] != 0); /* xp = 2*F[k] + F[k-1] */ +#if HAVE_NATIVE_mpn_addlsh1_n + c = refmpn_addlsh1_n (xp, yp, xp, xsize); +#else c = mpn_lshift (xp, xp, xsize, 1); c += mpn_add_n (xp, xp, yp, xsize); +#endif ASSERT (xalloc >= xsize+1); xp[xsize] = c; xsize += (c != 0); |