diff options
author | Torbjorn Granlund <tege@gmplib.org> | 2009-12-27 20:30:53 +0100 |
---|---|---|
committer | Torbjorn Granlund <tege@gmplib.org> | 2009-12-27 20:30:53 +0100 |
commit | 7bae50bedb078dcca5716cb268d4a4e44bb59694 (patch) | |
tree | 0eb27df38243ebeb3b4ff7166b3691353d925c16 /mpz/n_pow_ui.c | |
parent | cfae7e7b98464542bd71d9830b9b6a2238f1b58a (diff) | |
download | gmp-7bae50bedb078dcca5716cb268d4a4e44bb59694.tar.gz |
(mpn_sqr): New name for mpn_sqr_n.
Diffstat (limited to 'mpz/n_pow_ui.c')
-rw-r--r-- | mpz/n_pow_ui.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/mpz/n_pow_ui.c b/mpz/n_pow_ui.c index c1d5e902d..6d527c36c 100644 --- a/mpz/n_pow_ui.c +++ b/mpz/n_pow_ui.c @@ -59,7 +59,7 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ from mpn_mul_1 or mpn_mul_2 in the bignum powering. It's felt that doing so would be more complicated than it's worth, and could well end up being a slowdown for small e. For big e on the other hand the algorithm is - dominated by mpn_sqr_n so there wouldn't much of a saving. The current + dominated by mpn_sqr so there wouldn't much of a saving. The current code can be viewed as simply doing the first few steps of the powering in a single or double limb where possible. @@ -79,10 +79,10 @@ along with the GNU MP Library. If not, see http://www.gnu.org/licenses/. */ /* The following are for convenience, they update the size and check the alloc. */ -#define MPN_SQR_N(dst, alloc, src, size) \ +#define MPN_SQR(dst, alloc, src, size) \ do { \ ASSERT (2*(size) <= (alloc)); \ - mpn_sqr_n (dst, src, size); \ + mpn_sqr (dst, src, size); \ (size) *= 2; \ (size) -= ((dst)[(size)-1] == 0); \ } while (0) @@ -435,7 +435,7 @@ mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, unsigned long int e) i, e, rsize, ralloc, talloc); mpn_trace ("r", rp, rsize)); - MPN_SQR_N (tp, talloc, rp, rsize); + MPN_SQR (tp, talloc, rp, rsize); SWAP_RP_TP; if ((e & (1L << i)) != 0) MPN_MUL_2 (rp, rsize, ralloc, mult); @@ -467,7 +467,7 @@ mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, unsigned long int e) i, e, rsize, ralloc, talloc); mpn_trace ("r", rp, rsize)); - MPN_SQR_N (tp, talloc, rp, rsize); + MPN_SQR (tp, talloc, rp, rsize); SWAP_RP_TP; if ((e & (1L << i)) != 0) MPN_MUL_1 (rp, rsize, ralloc, blimb); @@ -496,7 +496,7 @@ mpz_n_pow_ui (mpz_ptr r, mp_srcptr bp, mp_size_t bsize, unsigned long int e) i, e, rsize, ralloc, talloc); mpn_trace ("r", rp, rsize)); - MPN_SQR_N (tp, talloc, rp, rsize); + MPN_SQR (tp, talloc, rp, rsize); SWAP_RP_TP; if ((e & (1L << i)) != 0) { |