diff options
author | tege <tege@gmplib.org> | 2002-04-18 20:35:32 +0200 |
---|---|---|
committer | tege <tege@gmplib.org> | 2002-04-18 20:35:32 +0200 |
commit | 7986315da640d9aca779541a5fcdf16b0caa4cff (patch) | |
tree | 3d647f62a21dadfbeac8c1f83c96e125118565fc /mpz/ui_pow_ui.c | |
parent | 1186456e3d4ceec8268fa4c99b07181f5460d157 (diff) | |
download | gmp-7986315da640d9aca779541a5fcdf16b0caa4cff.tar.gz |
Nailify.
Diffstat (limited to 'mpz/ui_pow_ui.c')
-rw-r--r-- | mpz/ui_pow_ui.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/mpz/ui_pow_ui.c b/mpz/ui_pow_ui.c index cce181632..bdd8cd0a2 100644 --- a/mpz/ui_pow_ui.c +++ b/mpz/ui_pow_ui.c @@ -23,17 +23,27 @@ MA 02111-1307, USA. */ #include "gmp-impl.h" -/* i386 gcc 2.95.3 doesn't recognise blimb can be eliminated when mp_limb_t - is an unsigned long, so only use a separate blimb when necessary. */ - void mpz_ui_pow_ui (mpz_ptr r, unsigned long b, unsigned long e) { + if (GMP_LIMB_BITS != 0 && b > GMP_NUMB_MAX) + { + mp_limb_t bb[2]; + bb[0] = b & GMP_NUMB_MASK; + bb[1] = b >> GMP_NUMB_BITS; + mpz_n_pow_ui (r, bb, (mp_size_t) 2, e); + } + else + { #ifdef _LONG_LONG_LIMB - mp_limb_t blimb = b; - mpz_n_pow_ui (r, &blimb, (mp_size_t) (b != 0), e); + /* i386 gcc 2.95.3 doesn't recognise blimb can be eliminated when + mp_limb_t is an unsigned long, so only use a separate blimb when + necessary. */ + mp_limb_t blimb = b; + mpz_n_pow_ui (r, &blimb, (mp_size_t) (b != 0), e); #else - mpz_n_pow_ui (r, &b, (mp_size_t) (b != 0), e); + mpz_n_pow_ui (r, &b, (mp_size_t) (b != 0), e); #endif + } } |