diff options
author | tege <tege@gmplib.org> | 2002-04-05 22:33:33 +0200 |
---|---|---|
committer | tege <tege@gmplib.org> | 2002-04-05 22:33:33 +0200 |
commit | 134f29e75edb37498f9d210a7e3898d86cb8106e (patch) | |
tree | 1e071501dd8ddd778f8785265d5fe1089d66cc26 /mpn | |
parent | 25ad2d384533c4ee9aed7819c915921de19b569c (diff) | |
download | gmp-134f29e75edb37498f9d210a7e3898d86cb8106e.tar.gz |
Nailify.
Diffstat (limited to 'mpn')
-rw-r--r-- | mpn/generic/sqr_basecase.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/mpn/generic/sqr_basecase.c b/mpn/generic/sqr_basecase.c index 82daeaaeb..623bb2a12 100644 --- a/mpn/generic/sqr_basecase.c +++ b/mpn/generic/sqr_basecase.c @@ -40,11 +40,17 @@ mpn_sqr_basecase (mp_ptr prodp, mp_srcptr up, mp_size_t n) { /* N.B.! We need the superfluous indirection through argh to work around a reloader bug in GCC 2.7.*. */ - mp_limb_t x; - mp_limb_t argh; - x = up[0]; - umul_ppmm (argh, prodp[0], x, x); +#if GMP_NAIL_BITS == 0 + mp_limb_t ul, argh; + ul = up[0]; + umul_ppmm (argh, prodp[0], ul, ul); prodp[1] = argh; +#else + mp_limb_t ul, lpl; + ul = up[0]; + umul_ppmm (prodp[1], lpl, ul, ul << GMP_NAIL_BITS); + prodp[0] = lpl >> GMP_NAIL_BITS; +#endif } if (n > 1) { @@ -68,9 +74,16 @@ mpn_sqr_basecase (mp_ptr prodp, mp_srcptr up, mp_size_t n) #else for (i = 1; i < n; i++) { - mp_limb_t x; - x = up[i]; - umul_ppmm (prodp[2 * i + 1], prodp[2 * i], x, x); +#if GMP_NAIL_BITS == 0 + mp_limb_t ul; + ul = up[i]; + umul_ppmm (prodp[2 * i + 1], prodp[2 * i], ul, ul); +#else + mp_limb_t ul, lpl; + ul = up[i]; + umul_ppmm (prodp[2 * i + 1], lpl, ul, ul << GMP_NAIL_BITS); + prodp[2 * i] = lpl >> GMP_NAIL_BITS; +#endif } #endif { |