diff options
author | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-01-08 19:13:48 +0000 |
---|---|---|
committer | zimmerma <zimmerma@280ebfd0-de03-0410-8827-d642c229c3f4> | 2010-01-08 19:13:48 +0000 |
commit | 1f7f06d17a7f5bacaa40d8cea4237ffe094ef433 (patch) | |
tree | 97fdc324d0ae9640c439df546f625d8a15ad50fe | |
parent | 8f36df5d6bf5f20f4c4e60e9ac22e9d4d4a6508e (diff) | |
download | mpfr-1f7f06d17a7f5bacaa40d8cea4237ffe094ef433.tar.gz |
BITS_PER_MP_LIMB -> GMP_LIMB_BITS
got rid of BYTES_PER_MP_LIMB in configure.in (no longer defined by GMP)
Note[VL] (mpfr-impl.h): a mpn_sqr_n() macro is defined to use mpn_mul
if it is not already defined (in gmp-impl.h from GMP 4.x).
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@6644 280ebfd0-de03-0410-8827-d642c229c3f4
-rw-r--r-- | add1.c | 38 | ||||
-rw-r--r-- | add1sp.c | 14 | ||||
-rw-r--r-- | add_ui.c | 4 | ||||
-rw-r--r-- | agm.c | 4 | ||||
-rw-r--r-- | algorithms.tex | 8 | ||||
-rw-r--r-- | atan.c | 2 | ||||
-rw-r--r-- | check.c | 8 | ||||
-rw-r--r-- | cmp.c | 4 | ||||
-rw-r--r-- | cmp2.c | 32 | ||||
-rw-r--r-- | cmp_si.c | 12 | ||||
-rw-r--r-- | cmp_ui.c | 12 | ||||
-rw-r--r-- | configure.in | 10 | ||||
-rw-r--r-- | div-short.c | 2 | ||||
-rw-r--r-- | div.c | 20 | ||||
-rw-r--r-- | div_ui.c | 10 | ||||
-rw-r--r-- | eq.c | 54 | ||||
-rw-r--r-- | exp.c | 4 | ||||
-rw-r--r-- | exp3.c | 8 | ||||
-rw-r--r-- | exp_2.c | 6 | ||||
-rw-r--r-- | extract.c | 2 | ||||
-rw-r--r-- | frac.c | 20 | ||||
-rw-r--r-- | get_d.c | 2 | ||||
-rw-r--r-- | get_d64.c | 4 | ||||
-rw-r--r-- | get_f.c | 22 | ||||
-rw-r--r-- | get_flt.c | 2 | ||||
-rw-r--r-- | get_ld.c | 6 | ||||
-rw-r--r-- | get_si.c | 2 | ||||
-rw-r--r-- | get_sj.c | 4 | ||||
-rw-r--r-- | get_str.c | 1510 | ||||
-rw-r--r-- | get_ui.c | 2 | ||||
-rw-r--r-- | get_uj.c | 2 | ||||
-rw-r--r-- | gmp_op.c | 4 | ||||
-rw-r--r-- | init2.c | 8 | ||||
-rw-r--r-- | int_ceil_log2.c | 2 | ||||
-rw-r--r-- | isinteger.c | 6 | ||||
-rw-r--r-- | lngamma.c | 8 | ||||
-rw-r--r-- | log.c | 8 | ||||
-rw-r--r-- | min_prec.c | 8 | ||||
-rw-r--r-- | mpfr-gmp.h | 23 | ||||
-rw-r--r-- | mpfr-impl.h | 85 | ||||
-rw-r--r-- | mpfr.h | 4 | ||||
-rw-r--r-- | mpn_exp.c | 30 | ||||
-rw-r--r-- | mul.c | 36 | ||||
-rw-r--r-- | mul_ui.c | 6 | ||||
-rw-r--r-- | pow.c | 10 | ||||
-rw-r--r-- | pow_si.c | 2 | ||||
-rw-r--r-- | pow_ui.c | 2 | ||||
-rw-r--r-- | pow_z.c | 4 | ||||
-rw-r--r-- | powerof2.c | 2 | ||||
-rw-r--r-- | print_raw.c | 10 | ||||
-rw-r--r-- | rec_sqrt.c | 12 | ||||
-rw-r--r-- | rint.c | 12 | ||||
-rw-r--r-- | round_p.c | 22 | ||||
-rw-r--r-- | round_prec.c | 18 | ||||
-rw-r--r-- | round_raw_generic.c | 16 | ||||
-rw-r--r-- | set.c | 2 | ||||
-rw-r--r-- | set_d.c | 18 | ||||
-rw-r--r-- | set_d64.c | 2 | ||||
-rw-r--r-- | set_f.c | 22 | ||||
-rw-r--r-- | set_ld.c | 8 | ||||
-rw-r--r-- | set_prc_raw.c | 2 | ||||
-rw-r--r-- | set_prec.c | 2 | ||||
-rw-r--r-- | set_q.c | 10 | ||||
-rw-r--r-- | set_si_2exp.c | 6 | ||||
-rw-r--r-- | set_ui_2exp.c | 6 | ||||
-rw-r--r-- | set_uj.c | 10 | ||||
-rw-r--r-- | set_z.c | 26 | ||||
-rw-r--r-- | setmax.c | 4 | ||||
-rw-r--r-- | setmin.c | 2 | ||||
-rw-r--r-- | speed.c | 10 | ||||
-rw-r--r-- | sqr.c | 6 | ||||
-rw-r--r-- | sqrt.c | 2 | ||||
-rw-r--r-- | sqrt_ui.c | 4 | ||||
-rw-r--r-- | stack_interface.c | 2 | ||||
-rw-r--r-- | strtofr.c | 24 | ||||
-rw-r--r-- | sub1.c | 30 | ||||
-rw-r--r-- | sub1sp.c | 30 | ||||
-rw-r--r-- | sub_ui.c | 4 | ||||
-rw-r--r-- | tests/mpfr-test.h | 2 | ||||
-rw-r--r-- | tests/random2.c | 2 | ||||
-rw-r--r-- | tests/tadd.c | 10 | ||||
-rw-r--r-- | tests/tcan_round.c | 4 | ||||
-rw-r--r-- | tests/tcheck.c | 4 | ||||
-rw-r--r-- | tests/tcmp2.c | 8 | ||||
-rw-r--r-- | tests/tcmp_ui.c | 4 | ||||
-rw-r--r-- | tests/tests.c | 2 | ||||
-rw-r--r-- | tests/tfprintf.c | 8 | ||||
-rw-r--r-- | tests/tget_d.c | 2 | ||||
-rw-r--r-- | tests/tget_f.c | 4 | ||||
-rw-r--r-- | tests/tget_z.c | 6 | ||||
-rw-r--r-- | tests/tgmpop.c | 2 | ||||
-rw-r--r-- | tests/tl2b.c | 2 | ||||
-rw-r--r-- | tests/tremquo.c | 6 | ||||
-rw-r--r-- | tests/tset_f.c | 4 | ||||
-rw-r--r-- | tests/tsqrt.c | 32 | ||||
-rw-r--r-- | tuneup.c | 22 | ||||
-rw-r--r-- | ui_div.c | 4 | ||||
-rw-r--r-- | ui_sub.c | 4 | ||||
-rw-r--r-- | urandomb.c | 8 | ||||
-rw-r--r-- | vasprintf.c | 6 | ||||
-rw-r--r-- | zeta_ui.c | 8 |
101 files changed, 1279 insertions, 1275 deletions
@@ -43,12 +43,12 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) bq = MPFR_PREC(b); cq = MPFR_PREC(c); - an = (aq-1)/BITS_PER_MP_LIMB+1; /* number of limbs of a */ - aq2 = (mp_prec_t) an * BITS_PER_MP_LIMB; + an = (aq-1)/GMP_LIMB_BITS+1; /* number of limbs of a */ + aq2 = (mp_prec_t) an * GMP_LIMB_BITS; sh = aq2 - aq; /* non-significant bits in low limb */ - bn = (bq-1)/BITS_PER_MP_LIMB+1; /* number of limbs of b */ - cn = (cq-1)/BITS_PER_MP_LIMB+1; /* number of limbs of c */ + bn = (bq-1)/GMP_LIMB_BITS+1; /* number of limbs of b */ + cn = (cq-1)/GMP_LIMB_BITS+1; /* number of limbs of c */ ap = MPFR_MANT(a); bp = MPFR_MANT(b); @@ -121,7 +121,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) dif = aq2 - diff_exp; /* dif is the number of bits of c which overlap with a' */ - difn = (dif-1)/BITS_PER_MP_LIMB + 1; + difn = (dif-1)/GMP_LIMB_BITS + 1; /* only the highest difn limbs from c have to be considered */ if (MPFR_UNLIKELY(difn > cn)) { @@ -131,13 +131,13 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPN_ZERO(ap, difn - cn); difn = cn; } - k = diff_exp / BITS_PER_MP_LIMB; + k = diff_exp / GMP_LIMB_BITS; /* zero the most significant k limbs of a */ a2p = ap + (an - k); MPN_ZERO(a2p, k); - shift = diff_exp % BITS_PER_MP_LIMB; + shift = diff_exp % GMP_LIMB_BITS; if (MPFR_LIKELY(shift)) { @@ -206,7 +206,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) /* determine rounding and sticky bits (and possible carry) */ - difw = (mp_exp_t) an - (mp_exp_t) (diff_exp / BITS_PER_MP_LIMB); + difw = (mp_exp_t) an - (mp_exp_t) (diff_exp / GMP_LIMB_BITS); /* difw is the number of limbs from b (regarded as having an infinite precision) that have already been combined with c; -n if the next n limbs from b won't be combined with c. */ @@ -242,7 +242,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { if (rb < 0) /* rb not initialized yet */ { - rb = bb >> (BITS_PER_MP_LIMB - 1); + rb = bb >> (GMP_LIMB_BITS - 1); bb |= MPFR_LIMB_HIGHBIT; } fb = 1; @@ -268,7 +268,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) int difs; ck = cn - difw; - difs = diff_exp % BITS_PER_MP_LIMB; + difs = diff_exp % GMP_LIMB_BITS; if (difs == 0 && ck == 0) goto c_read; @@ -281,7 +281,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) if (difs) { - cc = cprev << (BITS_PER_MP_LIMB - difs); + cc = cprev << (GMP_LIMB_BITS - difs); if (--ck >= 0) { cprev = cp[ck]; @@ -309,9 +309,9 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) if (rb < 0) /* rb not initialized yet */ { - rb = bb >> (BITS_PER_MP_LIMB - 1); + rb = bb >> (GMP_LIMB_BITS - 1); bb <<= 1; - bb |= bb >> (BITS_PER_MP_LIMB - 1); + bb |= bb >> (GMP_LIMB_BITS - 1); } fb = bb != 0; @@ -327,7 +327,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) { if (ck < 0) goto c_read; - cc = cprev << (BITS_PER_MP_LIMB - difs); + cc = cprev << (GMP_LIMB_BITS - difs); if (--ck >= 0) { cprev = cp[ck]; @@ -373,7 +373,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) if (fb || ck < 0) goto rounding; - if (difs && cprev << (BITS_PER_MP_LIMB - difs)) + if (difs && cprev << (GMP_LIMB_BITS - difs)) { fb = 1; goto rounding; @@ -398,7 +398,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) bb = bp[--bk]; if (rb < 0) /* rb not initialized yet */ { - rb = bb >> (BITS_PER_MP_LIMB - 1); + rb = bb >> (GMP_LIMB_BITS - 1); bb &= ~MPFR_LIMB_HIGHBIT; } fb = bb != 0; @@ -436,7 +436,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPFR_ASSERTD(difw >= 0 && cn >= difw); ck = cn - difw; - difs = diff_exp % BITS_PER_MP_LIMB; + difs = diff_exp % GMP_LIMB_BITS; if (difs == 0 && ck == 0) { /* c has entirely been read */ @@ -449,10 +449,10 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mp_limb_t cc; cc = difs ? (MPFR_ASSERTD(ck < cn), - cp[ck] << (BITS_PER_MP_LIMB - difs)) : cp[--ck]; + cp[ck] << (GMP_LIMB_BITS - difs)) : cp[--ck]; if (rb < 0) { - rb = cc >> (BITS_PER_MP_LIMB - 1); + rb = cc >> (GMP_LIMB_BITS - 1); cc &= ~MPFR_LIMB_HIGHBIT; } while (cc == 0) @@ -104,7 +104,7 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) /* Read prec and num of limbs */ p = MPFR_PREC(b); - n = (p+BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; + n = (p+GMP_LIMB_BITS-1)/GMP_LIMB_BITS; MPFR_UNSIGNED_MINUS_MODULO(sh, p); bx = MPFR_GET_EXP(b); d = (mpfr_uexp_t) (bx - MPFR_GET_EXP(c)); @@ -211,8 +211,8 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mpfr_uexp_t dm; mp_size_t m; - dm = d % BITS_PER_MP_LIMB; - m = d / BITS_PER_MP_LIMB; + dm = d % GMP_LIMB_BITS; + m = d / GMP_LIMB_BITS; if (MPFR_UNLIKELY(dm == 0)) { /* dm = 0 and m > 0: Just copy */ @@ -257,8 +257,8 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) else { mp_limb_t *tp = MPFR_MANT(c); - mp_size_t kx = n-1 - (x / BITS_PER_MP_LIMB); - mpfr_prec_t sx = BITS_PER_MP_LIMB-1-(x%BITS_PER_MP_LIMB); + mp_size_t kx = n-1 - (x / GMP_LIMB_BITS); + mpfr_prec_t sx = GMP_LIMB_BITS-1-(x%GMP_LIMB_BITS); DEBUG (printf ("(First) x=%lu Kx=%ld Sx=%lu\n", (unsigned long) x, (long) kx, (unsigned long) sx)); @@ -283,8 +283,8 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mp_limb_t *tp = MPFR_MANT(c); /* Start from bit x=p-d in mantissa C */ mpfr_prec_t x = p-d; - mp_size_t kx = n-1 - (x / BITS_PER_MP_LIMB); - mpfr_prec_t sx = BITS_PER_MP_LIMB-1-(x%BITS_PER_MP_LIMB); + mp_size_t kx = n-1 - (x / GMP_LIMB_BITS); + mpfr_prec_t sx = GMP_LIMB_BITS-1-(x%GMP_LIMB_BITS); MPFR_ASSERTD(p >= d); bcp = tp[kx] & (MPFR_LIMB_ONE<<sx); /* Looks at the last bits of limb kx (If sx=0, does nothing)*/ @@ -34,7 +34,7 @@ mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode int inex; MPFR_SAVE_EXPO_DECL (expo); - MPFR_TMP_INIT1 (up, uu, BITS_PER_MP_LIMB); + MPFR_TMP_INIT1 (up, uu, GMP_LIMB_BITS); MPFR_ASSERTD (u == (mp_limb_t) u); count_leading_zeros(cnt, (mp_limb_t) u); up[0] = (mp_limb_t) u << cnt; @@ -42,7 +42,7 @@ mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode /* Optimization note: Exponent save/restore operations may be removed if mpfr_add works even when uu is out-of-range. */ MPFR_SAVE_EXPO_MARK (expo); - MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt); + MPFR_SET_EXP (uu, GMP_LIMB_BITS - cnt); inex = mpfr_add(y, x, uu, rnd_mode); MPFR_SAVE_EXPO_FREE (expo); return mpfr_check_range(y, inex, rnd_mode); @@ -86,7 +86,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) q = MPFR_PREC(r); p = q + MPFR_INT_CEIL_LOG2(q) + 15; MPFR_ASSERTD (p >= 7); /* see algorithms.tex */ - s = (p - 1) / BITS_PER_MP_LIMB + 1; + s = (p - 1) / GMP_LIMB_BITS + 1; /* b (op2) and a (op1) are the 2 operands but we want b >= a */ compare = mpfr_cmp (op1, op2); @@ -157,7 +157,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode) /* Next iteration */ MPFR_ZIV_NEXT (loop, p); - s = (p - 1) / BITS_PER_MP_LIMB + 1; + s = (p - 1) / GMP_LIMB_BITS + 1; } MPFR_ZIV_FREE (loop); diff --git a/algorithms.tex b/algorithms.tex index 4dba48995..27aa4ad98 100644 --- a/algorithms.tex +++ b/algorithms.tex @@ -536,19 +536,19 @@ exponent of $c$ is smaller than that of $b$. n = 0; res = 0; while (b[n] == c[n]) n++; - res += BITS_PER_MP_LIMB; + res += GMP_LIMB_BITS; /* now b[n] > c[n] and the first res bits coincide */ dif = b[n] - c[n]; while (dif == 1) n++; - dif = (dif << BITS_PER_MP_LIMB) + b[n] - c[n]; - res += BITS_PER_MP_LIMB; + dif = (dif << GMP_LIMB_BITS) + b[n] - c[n]; + res += GMP_LIMB_BITS; /* now dif > 1 */ - res += BITS_PER_MP_LIMB - number_of_bits(dif); + res += GMP_LIMB_BITS - number_of_bits(dif); if (!is_power_of_two(dif)) return res; @@ -265,7 +265,7 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mpfr_rnd_t rnd_mode) } realprec = MPFR_PREC (atan) + MPFR_INT_CEIL_LOG2 (MPFR_PREC (atan)) + 4; - prec = realprec + BITS_PER_MP_LIMB; + prec = realprec + GMP_LIMB_BITS; /* Initialisation */ mpz_init (ukz); @@ -47,7 +47,7 @@ mpfr_check (mpfr_srcptr x) /* Check size of mantissa */ s = MPFR_GET_ALLOC_SIZE(x); if (s<=0 || s > MP_SIZE_T_MAX || - MPFR_PREC(x) > ((mp_prec_t)s*BITS_PER_MP_LIMB)) + MPFR_PREC(x) > ((mp_prec_t)s*GMP_LIMB_BITS)) return 0; /* Acces all the mp_limb of the mantissa: may do a seg fault */ for(i = 0 ; i < s ; i++) @@ -56,13 +56,13 @@ mpfr_check (mpfr_srcptr x) if (MPFR_IS_PURE_FP(x)) { /* Check first mp_limb of mantissa (Must start with a 1 bit) */ - if ( ((xm[MPFR_LIMB_SIZE(x)-1])>>(BITS_PER_MP_LIMB-1)) == 0) + if ( ((xm[MPFR_LIMB_SIZE(x)-1])>>(GMP_LIMB_BITS-1)) == 0) return 0; /* Check last mp_limb of mantissa */ - rw = (MPFR_PREC(x) % BITS_PER_MP_LIMB); + rw = (MPFR_PREC(x) % GMP_LIMB_BITS); if (rw != 0) { - tmp = MPFR_LIMB_MASK (BITS_PER_MP_LIMB - rw); + tmp = MPFR_LIMB_MASK (GMP_LIMB_BITS - rw); if ((xm[0] & tmp) != 0) return 0; } @@ -73,8 +73,8 @@ mpfr_cmp3 (mpfr_srcptr b, mpfr_srcptr c, int s) /* both signs and exponents are equal */ - bn = (MPFR_PREC(b)-1)/BITS_PER_MP_LIMB; - cn = (MPFR_PREC(c)-1)/BITS_PER_MP_LIMB; + bn = (MPFR_PREC(b)-1)/GMP_LIMB_BITS; + cn = (MPFR_PREC(c)-1)/GMP_LIMB_BITS; bp = MPFR_MANT(b); cp = MPFR_MANT(c); @@ -60,8 +60,8 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) bp = MPFR_MANT(b); cp = MPFR_MANT(c); - bn = (MPFR_PREC(b) - 1) / BITS_PER_MP_LIMB; - cn = (MPFR_PREC(c) - 1) / BITS_PER_MP_LIMB; /* # of limbs of c minus 1 */ + bn = (MPFR_PREC(b) - 1) / GMP_LIMB_BITS; + cn = (MPFR_PREC(c) - 1) / GMP_LIMB_BITS; /* # of limbs of c minus 1 */ if (MPFR_UNLIKELY( diff_exp == 0 )) { @@ -69,7 +69,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) { bn--; cn--; - res += BITS_PER_MP_LIMB; + res += GMP_LIMB_BITS; } if (MPFR_UNLIKELY (bn < 0)) @@ -94,7 +94,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) { if (--bn < 0) /* b = c */ return 0; - res += BITS_PER_MP_LIMB; + res += GMP_LIMB_BITS; } count_leading_zeros(z, bp[bn]); /* bp[bn] <> 0 */ @@ -124,8 +124,8 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) bp = MPFR_MANT(c); cp = MPFR_MANT(b); - bn = (MPFR_PREC(c) - 1) / BITS_PER_MP_LIMB; - cn = (MPFR_PREC(b) - 1) / BITS_PER_MP_LIMB; + bn = (MPFR_PREC(c) - 1) / GMP_LIMB_BITS; + cn = (MPFR_PREC(b) - 1) / GMP_LIMB_BITS; } /* now we have removed the identical upper limbs of b and c @@ -134,16 +134,16 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) diff_exp = EXP(b) - EXP(c). */ - if (MPFR_LIKELY (diff_exp < BITS_PER_MP_LIMB)) + if (MPFR_LIKELY (diff_exp < GMP_LIMB_BITS)) { cc = cp[cn] >> diff_exp; - /* warning: a shift by BITS_PER_MP_LIMB may give wrong results */ + /* warning: a shift by GMP_LIMB_BITS may give wrong results */ if (diff_exp) - lastc = cp[cn] << (BITS_PER_MP_LIMB - diff_exp); + lastc = cp[cn] << (GMP_LIMB_BITS - diff_exp); cn--; } else - diff_exp -= BITS_PER_MP_LIMB; /* cc = 0 */ + diff_exp -= GMP_LIMB_BITS; /* cc = 0 */ dif = bp[bn--] - cc; /* necessarily dif >= 1 */ MPFR_ASSERTD(dif >= 1); @@ -164,7 +164,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) else /* diff_exp = 1 */ { cc += cp[cn] >> 1; - lastc = cp[cn] << (BITS_PER_MP_LIMB - 1); + lastc = cp[cn] << (GMP_LIMB_BITS - 1); } } else @@ -172,7 +172,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) high_dif = 1 - mpn_sub_n (&dif, &bb, &cc, 1); bn--; cn--; - res += BITS_PER_MP_LIMB; + res += GMP_LIMB_BITS; } /* (cn<0 and lastc=0) or (high_dif,dif)<>(0,1) */ @@ -192,7 +192,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) count_leading_zeros(z, dif); /* dif > 1 here */ res += z; - if (MPFR_LIKELY(dif != (MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - z - 1)))) + if (MPFR_LIKELY(dif != (MPFR_LIMB_ONE << (GMP_LIMB_BITS - z - 1)))) { /* dif is not a power of two */ *cancel = res; return sign; @@ -202,8 +202,8 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) /* now result is res + (low(b) < low(c)) */ while (MPFR_UNLIKELY (bn >= 0 && (cn >= 0 || lastc != 0))) { - if (diff_exp >= BITS_PER_MP_LIMB) - diff_exp -= BITS_PER_MP_LIMB; + if (diff_exp >= GMP_LIMB_BITS) + diff_exp -= GMP_LIMB_BITS; else { cc = lastc; @@ -211,7 +211,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mp_prec_t *cancel) { cc += cp[cn] >> diff_exp; if (diff_exp != 0) - lastc = cp[cn] << (BITS_PER_MP_LIMB - diff_exp); + lastc = cp[cn] << (GMP_LIMB_BITS - diff_exp); } else lastc = 0; @@ -64,21 +64,21 @@ mpfr_cmp_si_2exp (mpfr_srcptr b, long int i, mp_exp_t f) e = MPFR_GET_EXP (b); /* 2^(e-1) <= b < 2^e */ if (e <= f) return -si; - if (f < MPFR_EMAX_MAX - BITS_PER_MP_LIMB && - e > f + BITS_PER_MP_LIMB) + if (f < MPFR_EMAX_MAX - GMP_LIMB_BITS && + e > f + GMP_LIMB_BITS) return si; - /* now f < e <= f + BITS_PER_MP_LIMB */ + /* now f < e <= f + GMP_LIMB_BITS */ c = (mp_limb_t) ai; count_leading_zeros(k, c); - if ((int) (e - f) > BITS_PER_MP_LIMB - k) + if ((int) (e - f) > GMP_LIMB_BITS - k) return si; - if ((int) (e - f) < BITS_PER_MP_LIMB - k) + if ((int) (e - f) < GMP_LIMB_BITS - k) return -si; /* now b and i*2^f have the same exponent */ c <<= k; - bn = (MPFR_PREC(b) - 1) / BITS_PER_MP_LIMB; + bn = (MPFR_PREC(b) - 1) / GMP_LIMB_BITS; bp = MPFR_MANT(b); if (bp[bn] > c) return si; @@ -64,21 +64,21 @@ mpfr_cmp_ui_2exp (mpfr_srcptr b, unsigned long int i, mp_exp_t f) e = MPFR_GET_EXP (b); /* 2^(e-1) <= b < 2^e */ if (e <= f) return -1; - if (f < MPFR_EMAX_MAX - BITS_PER_MP_LIMB && - e > f + BITS_PER_MP_LIMB) + if (f < MPFR_EMAX_MAX - GMP_LIMB_BITS && + e > f + GMP_LIMB_BITS) return 1; - /* now f < e <= f + BITS_PER_MP_LIMB */ + /* now f < e <= f + GMP_LIMB_BITS */ c = (mp_limb_t) i; count_leading_zeros(k, c); - if ((int) (e - f) > BITS_PER_MP_LIMB - k) + if ((int) (e - f) > GMP_LIMB_BITS - k) return 1; - if ((int) (e - f) < BITS_PER_MP_LIMB - k) + if ((int) (e - f) < GMP_LIMB_BITS - k) return -1; /* now b and i*2^f have the same exponent */ c <<= k; - bn = (MPFR_PREC(b) - 1) / BITS_PER_MP_LIMB; + bn = (MPFR_PREC(b) - 1) / GMP_LIMB_BITS; bp = MPFR_MANT(b); if (bp[bn] > c) return 1; diff --git a/configure.in b/configure.in index 69ead4de0..b717004c5 100644 --- a/configure.in +++ b/configure.in @@ -415,20 +415,20 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_FUNC_ALLOCA ]) -dnl Check for valid BITS_PER_MP_LIMB and BYTES_PER_MP_LIMB +dnl Check for valid GMP_LIMB_BITS +dnl (BYTES_PER_MP_LIMB is defined in mpfr-gmp.h from GMP_LIMB_BITS) dnl This test doesn't need to link with libgmp (at least it shouldn't). if test -n "$gmp_internal_file_check" ; then - AC_MSG_CHECKING(for valid BITS_PER_MP_LIMB and BYTES_PER_MP_LIMB) + AC_MSG_CHECKING(for valid GMP_LIMB_BITS) AC_RUN_IFELSE([AC_LANG_PROGRAM([[ #include <limits.h> #include "gmp.h" #include "gmp-impl.h" ]], [[ - return BITS_PER_MP_LIMB == BYTES_PER_MP_LIMB * CHAR_BIT - && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ? 0 : 1; + return GMP_LIMB_BITS == sizeof(mp_limb_t) * CHAR_BIT ? 0 : 1; ]])], [AC_MSG_RESULT(yes)], [ AC_MSG_RESULT(no) - AC_MSG_ERROR([BITS_PER_MP_LIMB or BYTES_PER_MP_LIMB are incorrect. + AC_MSG_ERROR([GMP_LIMB_BITS is incorrect. You probably need to change some of the GMP or MPFR compile options.])], [AC_MSG_RESULT([can't test])]) fi diff --git a/div-short.c b/div-short.c index 2a4c0abcc..46391386a 100644 --- a/div-short.c +++ b/div-short.c @@ -167,7 +167,7 @@ check (int argc, const char *argv[]) mp_limb_t max_error; count_leading_zeros (max_error, n); - max_error = 2*(BITS_PER_MP_LIMB-max_error); + max_error = 2*(GMP_LIMB_BITS-max_error); printf ("For N=%lu estimated max_error=%lu ulps\n", (unsigned long) n, (unsigned long) max_error); n0p = malloc (2 * n * sizeof (mp_limb_t)); @@ -31,9 +31,9 @@ mpfr_mpn_print3 (mp_ptr ap, mp_size_t n, mp_limb_t cy) mp_size_t i; for (i = 0; i < n; i++) printf ("+%lu*2^%lu", (unsigned long) ap[i], (unsigned long) - (BITS_PER_MP_LIMB * i)); + (GMP_LIMB_BITS * i)); if (cy) - printf ("+2^%lu", (unsigned long) (BITS_PER_MP_LIMB * n)); + printf ("+2^%lu", (unsigned long) (GMP_LIMB_BITS * n)); printf ("\n"); } #endif @@ -65,11 +65,11 @@ mpfr_mpn_cmp_aux (mp_ptr ap, mp_size_t an, mp_ptr bp, mp_size_t bn, int extra) while (cmp == 0 && bn > 0) { bn --; - bb = (extra) ? ((bp[bn+1] << (BITS_PER_MP_LIMB - 1)) | (bp[bn] >> 1)) + bb = (extra) ? ((bp[bn+1] << (GMP_LIMB_BITS - 1)) | (bp[bn] >> 1)) : bp[bn]; cmp = (ap[k + bn] > bb) ? 1 : ((ap[k + bn] < bb) ? -1 : 0); } - bb = (extra) ? bp[0] << (BITS_PER_MP_LIMB - 1) : MPFR_LIMB_ZERO; + bb = (extra) ? bp[0] << (GMP_LIMB_BITS - 1) : MPFR_LIMB_ZERO; while (cmp == 0 && k > 0) { k--; @@ -85,7 +85,7 @@ mpfr_mpn_cmp_aux (mp_ptr ap, mp_size_t an, mp_ptr bp, mp_size_t bn, int extra) while (cmp == 0 && an > 0) { an --; - bb = (extra) ? ((bp[k+an+1] << (BITS_PER_MP_LIMB - 1)) | (bp[k+an] >> 1)) + bb = (extra) ? ((bp[k+an+1] << (GMP_LIMB_BITS - 1)) | (bp[k+an] >> 1)) : bp[k+an]; if (ap[an] > bb) cmp = 1; @@ -95,7 +95,7 @@ mpfr_mpn_cmp_aux (mp_ptr ap, mp_size_t an, mp_ptr bp, mp_size_t bn, int extra) while (cmp == 0 && k > 0) { k--; - bb = (extra) ? ((bp[k+1] << (BITS_PER_MP_LIMB - 1)) | (bp[k] >> 1)) + bb = (extra) ? ((bp[k+1] << (GMP_LIMB_BITS - 1)) | (bp[k] >> 1)) : bp[k]; cmp = (bb != MPFR_LIMB_ZERO) ? -1 : 0; } @@ -116,7 +116,7 @@ mpfr_mpn_sub_aux (mp_ptr ap, mp_ptr bp, mp_size_t n, mp_limb_t cy, int extra) MPFR_ASSERTD (cy <= 1); while (n--) { - bb = (extra) ? ((bp[1] << (BITS_PER_MP_LIMB-1)) | (bp[0] >> 1)) : bp[0]; + bb = (extra) ? ((bp[1] << (GMP_LIMB_BITS-1)) | (bp[0] >> 1)) : bp[0]; rp = ap[0] - bb - cy; cy = (ap[0] < bb) || (cy && ~rp == MPFR_LIMB_ZERO) ? MPFR_LIMB_ONE : MPFR_LIMB_ZERO; @@ -346,11 +346,11 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode) { MPN_COPY (q0p, qp + 1, q0size); sticky3 = qp[0]; - sh2 = BITS_PER_MP_LIMB; + sh2 = GMP_LIMB_BITS; } qp[0] ^= sticky3; /* sticky3 contains the truncated bits from the quotient, - including the round bit, and 1 <= sh2 <= BITS_PER_MP_LIMB + including the round bit, and 1 <= sh2 <= GMP_LIMB_BITS is the number of bits in sticky3 */ inex = (sticky != MPFR_LIMB_ZERO) || (sticky3 != MPFR_LIMB_ZERO); #ifdef DEBUG @@ -625,7 +625,7 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode) sub_two_ulp: /* we cannot subtract MPFR_LIMB_MPFR_LIMB_ONE << (sh+1) since this is - undefined for sh = BITS_PER_MP_LIMB */ + undefined for sh = GMP_LIMB_BITS */ qh -= mpn_sub_1 (q0p, q0p, q0size, MPFR_LIMB_ONE << sh); /* go through */ @@ -138,7 +138,7 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode if (tmp[yn] == 0) { MPN_COPY(yp, tmp, yn); - exp -= BITS_PER_MP_LIMB; + exp -= GMP_LIMB_BITS; } else { @@ -152,11 +152,11 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode mp_limb_t w = tmp[0] << shlz; mpn_lshift (yp, tmp + 1, yn, shlz); - yp[0] += tmp[0] >> (BITS_PER_MP_LIMB - shlz); + yp[0] += tmp[0] >> (GMP_LIMB_BITS - shlz); - if (w > (MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - 1))) + if (w > (MPFR_LIMB_ONE << (GMP_LIMB_BITS - 1))) { middle = 1; } - else if (w < (MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - 1))) + else if (w < (MPFR_LIMB_ONE << (GMP_LIMB_BITS - 1))) { middle = -1; } else { middle = (c != 0); } @@ -166,7 +166,7 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode } else { /* this happens only if u == 1 and xp[xn-1] >= - 1<<(BITS_PER_MP_LIMB-1). It might be better to handle the + 1<<(GMP_LIMB_BITS-1). It might be better to handle the u == 1 case seperately ? */ @@ -56,8 +56,8 @@ mpfr_eq (mpfr_srcptr u, mpfr_srcptr v, unsigned long int n_bits) if (uexp != vexp) return 0; /* no bit agree */ - usize = (MPFR_PREC(u) - 1) / BITS_PER_MP_LIMB + 1; - vsize = (MPFR_PREC(v) - 1) / BITS_PER_MP_LIMB + 1; + usize = (MPFR_PREC(u) - 1) / GMP_LIMB_BITS + 1; + vsize = (MPFR_PREC(v) - 1) / GMP_LIMB_BITS + 1; if (vsize > usize) /* exchange u and v */ { @@ -78,23 +78,23 @@ mpfr_eq (mpfr_srcptr u, mpfr_srcptr v, unsigned long int n_bits) if (usize > vsize) { - if ((unsigned long) vsize * BITS_PER_MP_LIMB < n_bits) + if ((unsigned long) vsize * GMP_LIMB_BITS < n_bits) { - /* check if low min(PREC(u), n_bits) - (vsize * BITS_PER_MP_LIMB) + /* check if low min(PREC(u), n_bits) - (vsize * GMP_LIMB_BITS) bits from u are non-zero */ - unsigned long remains = n_bits - (vsize * BITS_PER_MP_LIMB); + unsigned long remains = n_bits - (vsize * GMP_LIMB_BITS); k = usize - vsize - 1; - while (k >= 0 && remains >= BITS_PER_MP_LIMB && !up[k]) + while (k >= 0 && remains >= GMP_LIMB_BITS && !up[k]) { k--; - remains -= BITS_PER_MP_LIMB; + remains -= GMP_LIMB_BITS; } /* now either k < 0: all low bits from u are zero - or remains < BITS_PER_MP_LIMB: check high bits from up[k] + or remains < GMP_LIMB_BITS: check high bits from up[k] or up[k] <> 0: different */ - if (k >= 0 && (((remains < BITS_PER_MP_LIMB) && - (up[k] >> (BITS_PER_MP_LIMB - remains))) || - (remains >= BITS_PER_MP_LIMB && up[k]))) + if (k >= 0 && (((remains < GMP_LIMB_BITS) && + (up[k] >> (GMP_LIMB_BITS - remains))) || + (remains >= GMP_LIMB_BITS && up[k]))) return 0; /* surely too different */ } size = vsize; @@ -108,34 +108,34 @@ mpfr_eq (mpfr_srcptr u, mpfr_srcptr v, unsigned long int n_bits) /* If size is too large wrt n_bits, reduce it to look only at the high n_bits bits. - Otherwise, if n_bits > size * BITS_PER_MP_LIMB, reduce n_bits to - size * BITS_PER_MP_LIMB, since the extra low bits of one of the + Otherwise, if n_bits > size * GMP_LIMB_BITS, reduce n_bits to + size * GMP_LIMB_BITS, since the extra low bits of one of the operands have already been check above. */ - if ((unsigned long) size > 1 + (n_bits - 1) / BITS_PER_MP_LIMB) - size = 1 + (n_bits - 1) / BITS_PER_MP_LIMB; - else if (n_bits > (unsigned long) size * BITS_PER_MP_LIMB) - n_bits = size * BITS_PER_MP_LIMB; + if ((unsigned long) size > 1 + (n_bits - 1) / GMP_LIMB_BITS) + size = 1 + (n_bits - 1) / GMP_LIMB_BITS; + else if (n_bits > (unsigned long) size * GMP_LIMB_BITS) + n_bits = size * GMP_LIMB_BITS; up += usize - size; vp += vsize - size; - for (i = size - 1; i > 0 && n_bits >= BITS_PER_MP_LIMB; i--) + for (i = size - 1; i > 0 && n_bits >= GMP_LIMB_BITS; i--) { if (up[i] != vp[i]) return 0; - n_bits -= BITS_PER_MP_LIMB; + n_bits -= GMP_LIMB_BITS; } - /* now either i=0 or n_bits<BITS_PER_MP_LIMB */ + /* now either i=0 or n_bits<GMP_LIMB_BITS */ - /* since n_bits <= size * BITS_PER_MP_LIMB before the above for-loop, - we have the invariant n_bits <= (i+1) * BITS_PER_MP_LIMB, thus - we always have n_bits <= BITS_PER_MP_LIMB here */ - MPFR_ASSERTD(n_bits <= BITS_PER_MP_LIMB); + /* since n_bits <= size * GMP_LIMB_BITS before the above for-loop, + we have the invariant n_bits <= (i+1) * GMP_LIMB_BITS, thus + we always have n_bits <= GMP_LIMB_BITS here */ + MPFR_ASSERTD(n_bits <= GMP_LIMB_BITS); - if (n_bits & (BITS_PER_MP_LIMB - 1)) - return (up[i] >> (BITS_PER_MP_LIMB - (n_bits & (BITS_PER_MP_LIMB - 1))) == - vp[i] >> (BITS_PER_MP_LIMB - (n_bits & (BITS_PER_MP_LIMB - 1)))); + if (n_bits & (GMP_LIMB_BITS - 1)) + return (up[i] >> (GMP_LIMB_BITS - (n_bits & (GMP_LIMB_BITS - 1))) == + vp[i] >> (GMP_LIMB_BITS - (n_bits & (GMP_LIMB_BITS - 1)))); else return (up[i] == vp[i]); } @@ -131,8 +131,8 @@ mpfr_exp (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mp_size_t yn; int sh; - yn = 1 + (MPFR_PREC(y) - 1) / BITS_PER_MP_LIMB; - sh = (mp_prec_t) yn * BITS_PER_MP_LIMB - MPFR_PREC(y); + yn = 1 + (MPFR_PREC(y) - 1) / GMP_LIMB_BITS; + sh = (mp_prec_t) yn * GMP_LIMB_BITS - MPFR_PREC(y); MPFR_MANT(y)[0] += MPFR_LIMB_ONE << sh; inexact = 1; } @@ -147,7 +147,7 @@ mpfr_exp_rational (mpfr_ptr y, mpz_ptr p, long r, int m, MPFR_SET_EXP (y, MPFR_GET_EXP (y) + expo - r * (i - 1) ); } -#define shift (BITS_PER_MP_LIMB/2) +#define shift (GMP_LIMB_BITS/2) int mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) @@ -174,7 +174,7 @@ mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) /* decompose x */ /* we first write x = 1.xxxxxxxxxxxxx ----- k bits -- */ - prec_x = MPFR_INT_CEIL_LOG2 (MPFR_PREC (x)) - MPFR_LOG2_BITS_PER_MP_LIMB; + prec_x = MPFR_INT_CEIL_LOG2 (MPFR_PREC (x)) - MPFR_LOG2_GMP_LIMB_BITS; if (prec_x < 0) prec_x = 0; @@ -207,10 +207,10 @@ mpfr_exp_3 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) int scaled = 0; MPFR_BLOCK_DECL (flags); - k = MPFR_INT_CEIL_LOG2 (Prec) - MPFR_LOG2_BITS_PER_MP_LIMB; + k = MPFR_INT_CEIL_LOG2 (Prec) - MPFR_LOG2_GMP_LIMB_BITS; /* now we have to extract */ - twopoweri = BITS_PER_MP_LIMB; + twopoweri = GMP_LIMB_BITS; /* Allocate tables */ P = (mpz_t*) (*__gmp_allocate_func) (3*(k+2)*sizeof(mpz_t)); @@ -120,7 +120,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) error_r = 0; else count_leading_zeros (error_r, (mp_limb_t) SAFE_ABS (unsigned long, n)); - error_r = BITS_PER_MP_LIMB - error_r + 2; + error_r = GMP_LIMB_BITS - error_r + 2; /* for the O(n^(1/2)*M(n)) method, the Taylor series computation of n/K terms costs about n/(2K) multiplications when computed in fixed @@ -188,7 +188,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) mpfr_div_2ui (r, r, K, MPFR_RNDU); /* r = (x-n*log(2))/2^K, exact */ MPFR_TMP_MARK(marker); - MY_INIT_MPZ(ss, 3 + 2*((q-1)/BITS_PER_MP_LIMB)); + MY_INIT_MPZ(ss, 3 + 2*((q-1)/GMP_LIMB_BITS)); exps = mpfr_get_z_exp (ss, s); /* s <- 1 + r/1! + r^2/2! + ... + r^l/l! */ MPFR_ASSERTD (MPFR_IS_PURE_FP (r) && MPFR_EXP (r) < 0); @@ -260,7 +260,7 @@ mpfr_exp2_aux (mpz_t s, mpfr_srcptr r, mp_prec_t q, mp_exp_t *exps) MPFR_ASSERTN (MPFR_IS_PURE_FP (r)); MPFR_TMP_MARK(marker); - qn = 1 + (q-1)/BITS_PER_MP_LIMB; + qn = 1 + (q-1)/GMP_LIMB_BITS; expt = 0; *exps = 1 - (mp_exp_t) q; /* s = 2^(q-1) */ MY_INIT_MPZ(t, 2*qn+1); @@ -25,7 +25,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., /* given 0 <= |p| < 1, this function extracts limbs of p and puts them in y. It is mainly designed for the "binary splitting" algorithm. - More precisely, if B = 2^BITS_PER_MP_LIMB: + More precisely, if B = 2^GMP_LIMB_BITS: - for i=0, y = floor(p * B) - for i>0, y = (p * B^(2^i)) mod B^(2^(i-1)) */ @@ -60,12 +60,12 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) /* Now |u| >= 1, meaning that an overflow is not possible. */ uq = MPFR_PREC(u); - un = (uq - 1) / BITS_PER_MP_LIMB; /* index of most significant limb */ - un -= (mp_size_t) (ue / BITS_PER_MP_LIMB); + un = (uq - 1) / GMP_LIMB_BITS; /* index of most significant limb */ + un -= (mp_size_t) (ue / GMP_LIMB_BITS); /* now the index of the MSL containing bits of the fractional part */ up = MPFR_MANT(u); - sh = ue % BITS_PER_MP_LIMB; + sh = ue % GMP_LIMB_BITS; k = up[un] << sh; /* the first bit of the fractional part is the MSB of k */ @@ -77,15 +77,15 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) /* first bit 1 of the fractional part -> MSB of the number */ re = -cnt; sh += cnt; - MPFR_ASSERTN (sh < BITS_PER_MP_LIMB); + MPFR_ASSERTN (sh < GMP_LIMB_BITS); k <<= cnt; } else { - re = sh - BITS_PER_MP_LIMB; + re = sh - GMP_LIMB_BITS; /* searching for the first bit 1 (exists since u isn't an integer) */ while (up[--un] == 0) - re -= BITS_PER_MP_LIMB; + re -= GMP_LIMB_BITS; MPFR_ASSERTN(un >= 0); k = up[un]; count_leading_zeros(sh, k); @@ -95,15 +95,15 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) /* The exponent of r will be re */ /* un: index of the limb of u that contains the first bit 1 of the FP */ - t = (mp_size_t) (MPFR_PREC(r) - 1) / BITS_PER_MP_LIMB < un ? - (mpfr_init2 (tmp, (un + 1) * BITS_PER_MP_LIMB), tmp) : r; + t = (mp_size_t) (MPFR_PREC(r) - 1) / GMP_LIMB_BITS < un ? + (mpfr_init2 (tmp, (un + 1) * GMP_LIMB_BITS), tmp) : r; /* t has enough precision to contain the fractional part of u */ /* If we use a temporary variable, we take the non-significant bits of u into account, because of the mpn_lshift below. */ MPFR_SET_SAME_SIGN(t, u); /* Put the fractional part of u into t */ - tn = (MPFR_PREC(t) - 1) / BITS_PER_MP_LIMB; + tn = (MPFR_PREC(t) - 1) / GMP_LIMB_BITS; MPFR_ASSERTN(tn >= un); t0 = tn - un; tp = MPFR_MANT(t); @@ -129,7 +129,7 @@ mpfr_frac (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) MPFR_EXP (r) = re; carry = mpfr_round_raw (tp, tp, - (mp_prec_t) (tn + 1) * BITS_PER_MP_LIMB, + (mp_prec_t) (tn + 1) * GMP_LIMB_BITS, MPFR_IS_NEG (r), MPFR_PREC (r), rnd_mode, &inex); if (carry) @@ -100,7 +100,7 @@ mpfr_get_d (mpfr_srcptr src, mpfr_rnd_t rnd_mode) nbits += (1021 + e); MPFR_ASSERTD (nbits >= 1); } - np = (nbits + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB; + np = (nbits + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; MPFR_ASSERTD ( np <= MPFR_LIMBS_PER_DOUBLE ); carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative, nbits, rnd_mode); @@ -269,8 +269,8 @@ string_to_Decimal64 (char *s) rn = mpn_set_str (rp, (unsigned char *) m, 16, 10); if (rn == 1) rp[1] = 0; -#if BITS_PER_MP_LIMB > 32 - rp[1] = rp[1] << (BITS_PER_MP_LIMB - 32); +#if GMP_LIMB_BITS > 32 + rp[1] = rp[1] << (GMP_LIMB_BITS - 32); rp[1] |= rp[0] >> 32; rp[0] &= 4294967295UL; #endif @@ -78,15 +78,15 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) sx = PREC(x); /* number of limbs of the mantissa of x */ precy = MPFR_PREC(y); - precx = (mp_prec_t) sx * BITS_PER_MP_LIMB; + precx = (mp_prec_t) sx * GMP_LIMB_BITS; sy = MPFR_LIMB_SIZE (y); xp = PTR (x); - /* since mpf numbers are represented in base 2^BITS_PER_MP_LIMB, - we loose -EXP(y) % BITS_PER_MP_LIMB bits in the most significant limb */ - sh = MPFR_GET_EXP(y) % BITS_PER_MP_LIMB; - sh = sh <= 0 ? - sh : BITS_PER_MP_LIMB - sh; + /* since mpf numbers are represented in base 2^GMP_LIMB_BITS, + we loose -EXP(y) % GMP_LIMB_BITS bits in the most significant limb */ + sh = MPFR_GET_EXP(y) % GMP_LIMB_BITS; + sh = sh <= 0 ? - sh : GMP_LIMB_BITS - sh; MPFR_ASSERTD (sh >= 0); if (precy + sh <= precx) /* we can copy directly */ { @@ -107,7 +107,7 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) MPN_COPY (xp + ds, MPFR_MANT (y), sy); if (ds > 0) MPN_ZERO (xp, ds); - EXP(x) = (MPFR_GET_EXP(y) + sh) / BITS_PER_MP_LIMB; + EXP(x) = (MPFR_GET_EXP(y) + sh) / GMP_LIMB_BITS; inex = 0; } else /* we have to round to precx - sh bits */ @@ -115,8 +115,8 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) mpfr_t z; mp_size_t sz; - /* Recall that precx = (mp_prec_t) sx * BITS_PER_MP_LIMB, thus removing - sh bits (sh < BITS_PER_MP_LIMBS) won't reduce the number of limbs. */ + /* Recall that precx = (mp_prec_t) sx * GMP_LIMB_BITS, thus removing + sh bits (sh < GMP_LIMB_BITSS) won't reduce the number of limbs. */ mpfr_init2 (z, precx - sh); sz = MPFR_LIMB_SIZE (z); MPFR_ASSERTN (sx == sz); @@ -124,8 +124,8 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) inex = mpfr_set (z, y, rnd_mode); /* warning, sh may change due to rounding, but then z is a power of two, thus we can safely ignore its last bit which is 0 */ - sh = MPFR_GET_EXP(z) % BITS_PER_MP_LIMB; - sh = sh <= 0 ? - sh : BITS_PER_MP_LIMB - sh; + sh = MPFR_GET_EXP(z) % GMP_LIMB_BITS; + sh = sh <= 0 ? - sh : GMP_LIMB_BITS - sh; MPFR_ASSERTD (sh >= 0); if (sh != 0) { @@ -137,7 +137,7 @@ mpfr_get_f (mpf_ptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode) } else MPN_COPY (xp, MPFR_MANT(z), sz); - EXP(x) = (MPFR_GET_EXP(z) + sh) / BITS_PER_MP_LIMB; + EXP(x) = (MPFR_GET_EXP(z) + sh) / GMP_LIMB_BITS; mpfr_clear (z); } @@ -92,7 +92,7 @@ mpfr_get_flt (mpfr_srcptr src, mpfr_rnd_t rnd_mode) nbits += (125 + e); MPFR_ASSERTD (nbits >= 1); } - np = (nbits + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB; + np = (nbits + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; MPFR_ASSERTD(np <= MPFR_LIMBS_PER_FLT); carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative, nbits, rnd_mode); @@ -132,10 +132,10 @@ mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode) in MPFR, thus any exponent <= -16382 corresponds to a subnormal number */ denorm = MPFR_UNLIKELY (e <= -16382) ? - e - 16382 + 1 : 0; -#if BITS_PER_MP_LIMB >= 64 +#if GMP_LIMB_BITS >= 64 ld.s.manl = (tmpmant[0] >> denorm); ld.s.manh = (tmpmant[0] >> denorm) >> 32; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 if (MPFR_LIKELY (denorm == 0)) { ld.s.manl = tmpmant[0]; @@ -152,7 +152,7 @@ mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode) ld.s.manh = 0; } #else -# error "BITS_PER_MP_LIMB must be 32 or >= 64" +# error "GMP_LIMB_BITS must be 32 or >= 64" /* Other values have never been supported anyway. */ #endif if (MPFR_LIKELY (denorm == 0)) @@ -57,7 +57,7 @@ mpfr_get_si (mpfr_srcptr f, mpfr_rnd_t rnd) /* now the result is in the most significant limb of x */ exp = MPFR_GET_EXP (x); /* since |x| >= 1, exp >= 1 */ n = MPFR_LIMB_SIZE(x); - a = MPFR_MANT(x)[n - 1] >> (BITS_PER_MP_LIMB - exp); + a = MPFR_MANT(x)[n - 1] >> (GMP_LIMB_BITS - exp); s = MPFR_SIGN(f) > 0 ? a : a <= LONG_MAX ? - (long) a : LONG_MIN; } @@ -95,7 +95,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) { for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0; n--) { - sh -= BITS_PER_MP_LIMB; + sh -= GMP_LIMB_BITS; /* Note the concerning the casts below: When sh >= 0, the cast must be performed before the shift for the case sizeof(intmax_t) > sizeof(mp_limb_t). @@ -112,7 +112,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd) { for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0; n--) { - sh -= BITS_PER_MP_LIMB; + sh -= GMP_LIMB_BITS; /* See above for the note concerning the casts. */ r -= (sh >= 0 ? (intmax_t) xp[n] << sh @@ -92,7 +92,7 @@ mpfr_get_str_aux (char *const str, mp_exp_t *const exp, mp_limb_t *const r, determine the integer Y */ MPFR_ASSERTN(f <= 0); /* if f is too small, then r*2^f is smaller than 1 */ - MPFR_ASSERTN(f > (-n * BITS_PER_MP_LIMB)); + MPFR_ASSERTN(f > (-n * GMP_LIMB_BITS)); MPFR_TMP_MARK(marker); @@ -105,24 +105,24 @@ mpfr_get_str_aux (char *const str, mp_exp_t *const exp, mp_limb_t *const r, /* check if is possible to round r with rnd mode where |r*2^f-Y| <= 2^(e+f) - the exponent of R is: f + n*BITS_PER_MP_LIMB - we must have e + f == f + n*BITS_PER_MP_LIMB - err - err = n*BITS_PER_MP_LIMB - e + the exponent of R is: f + n*GMP_LIMB_BITS + we must have e + f == f + n*GMP_LIMB_BITS - err + err = n*GMP_LIMB_BITS - e R contains exactly -f bits after the integer point: to determine the nearest integer, we thus need a precision of - n * BITS_PER_MP_LIMB + f */ + n * GMP_LIMB_BITS + f */ if (exact || mpfr_can_round_raw (r, n, (mp_size_t) 1, - n * BITS_PER_MP_LIMB - e, MPFR_RNDN, rnd, n * BITS_PER_MP_LIMB + f)) + n * GMP_LIMB_BITS - e, MPFR_RNDN, rnd, n * GMP_LIMB_BITS + f)) { /* compute the nearest integer to R */ /* bit of weight 0 in R has position j0 in limb r[i0] */ - i0 = (-f) / BITS_PER_MP_LIMB; - j0 = (-f) % BITS_PER_MP_LIMB; + i0 = (-f) / GMP_LIMB_BITS; + j0 = (-f) % GMP_LIMB_BITS; - ret = mpfr_round_raw (r + i0, r, n * BITS_PER_MP_LIMB, 0, - n * BITS_PER_MP_LIMB + f, rnd, &dir); + ret = mpfr_round_raw (r + i0, r, n * GMP_LIMB_BITS, 0, + n * GMP_LIMB_BITS + f, rnd, &dir); MPFR_ASSERTD(dir != MPFR_ROUND_FAILED); /* warning: mpfr_round_raw_generic returns MPFR_EVEN_INEX (2) or @@ -246,1832 +246,1832 @@ mpfr_get_str_aux (char *const str, mp_exp_t *const exp, mp_limb_t *const r, ***************************************************************************/ #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x0000, 0x8000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x80000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x8000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x800000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x80000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x8000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x8000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x00000000, 0x00000000, 0x80000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x0000000000000000, 0x8000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x800000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x80000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x8000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_3_0__tab[] = { 0x0e00, 0xcae0 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_3_0__tab[] = { 0xcae00e00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_3_0__tab[] = { 0xcae00e0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_3_0__tab[] = { 0xcae00e000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_3_0__tab[] = { 0xcae00e00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_3_0__tab[] = { 0xcae00e0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_3_1__tab[] = { 0x0448, 0xe94e, 0xa9a9, 0x9cc1, 0xa184 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_3_1__tab[] = { 0x04480000, 0xa9a9e94e, 0xa1849cc1 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_3_1__tab[] = { 0x0448000000000000, 0xa1849cc1a9a9e94e }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_3_1__tab[] = { 0xa1849cc1a9a9e94e04480000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_3_1__tab[] = { 0xa1849cc1a9a9e94e0448000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_3_1__tab[] = { 0xa1849cc1a9a9e94e044800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x0000, 0x8000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x80000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x8000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x800000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x80000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x8000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x8000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x00000000, 0x00000000, 0x80000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x0000000000000000, 0x8000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x800000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x80000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x8000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x7a00, 0x949a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x949a7a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x949a7a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x949a7a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x949a7a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x949a7a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_5_1__tab[] = { 0x67b8, 0x9728, 0x287b, 0xa348, 0xdc81 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_5_1__tab[] = { 0x67b80000, 0x287b9728, 0xdc81a348 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_5_1__tab[] = { 0x67b8000000000000, 0xdc81a348287b9728 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_5_1__tab[] = { 0xdc81a348287b972867b80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_5_1__tab[] = { 0xdc81a348287b972867b8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_5_1__tab[] = { 0xdc81a348287b972867b800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_6_0__tab[] = { 0x0800, 0xa570 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_6_0__tab[] = { 0xa5700800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_6_0__tab[] = { 0xa570080000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_6_0__tab[] = { 0xa57008000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_6_0__tab[] = { 0xa5700800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_6_0__tab[] = { 0xa570080000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xff10, 0xf9e9, 0xe054, 0x9236, 0xc611 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xff100000, 0xe054f9e9, 0xc6119236 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xff10000000000000, 0xc6119236e054f9e9 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xc6119236e054f9e9ff100000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xc6119236e054f9e9ff10000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xc6119236e054f9e9ff1000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb400, 0xb3ab }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb3abb400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb3abb40000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb3abb4000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb3abb400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb3abb40000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_7_1__tab[] = { 0x37b8, 0xa711, 0x754d, 0xc9d6, 0xb660 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_7_1__tab[] = { 0x37b80000, 0x754da711, 0xb660c9d6 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_7_1__tab[] = { 0x37b8000000000000, 0xb660c9d6754da711 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_7_1__tab[] = { 0xb660c9d6754da71137b80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_7_1__tab[] = { 0xb660c9d6754da71137b8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_7_1__tab[] = { 0xb660c9d6754da71137b800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_8_0__tab[] = { 0x0000, 0xc000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_8_0__tab[] = { 0xc0000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_8_0__tab[] = { 0xc000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_8_0__tab[] = { 0xc00000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_8_0__tab[] = { 0xc0000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_8_0__tab[] = { 0xc000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaab0, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaab00000, 0xaaaaaaaa, 0xaaaaaaaa }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaab0000000000000, 0xaaaaaaaaaaaaaaaa }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaaaaaaaaaaaaaaaaaab00000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaaaaaaaaaaaaaaaaaab0000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaaaaaaaaaaaaaaaaaab000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_9_0__tab[] = { 0x0e00, 0xcae0 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_9_0__tab[] = { 0xcae00e00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_9_0__tab[] = { 0xcae00e0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_9_0__tab[] = { 0xcae00e000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_9_0__tab[] = { 0xcae00e00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_9_0__tab[] = { 0xcae00e0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_9_1__tab[] = { 0x0448, 0xe94e, 0xa9a9, 0x9cc1, 0xa184 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_9_1__tab[] = { 0x04480000, 0xa9a9e94e, 0xa1849cc1 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_9_1__tab[] = { 0x0448000000000000, 0xa1849cc1a9a9e94e }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_9_1__tab[] = { 0xa1849cc1a9a9e94e04480000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_9_1__tab[] = { 0xa1849cc1a9a9e94e0448000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_9_1__tab[] = { 0xa1849cc1a9a9e94e044800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_10_0__tab[] = { 0x7a00, 0xd49a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_10_0__tab[] = { 0xd49a7a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_10_0__tab[] = { 0xd49a7a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_10_0__tab[] = { 0xd49a7a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_10_0__tab[] = { 0xd49a7a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_10_0__tab[] = { 0xd49a7a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x8f90, 0xf798, 0xfbcf, 0x9a84, 0x9a20 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x8f900000, 0xfbcff798, 0x9a209a84 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x8f90000000000000, 0x9a209a84fbcff798 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x9a209a84fbcff7988f900000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x9a209a84fbcff7988f90000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x9a209a84fbcff7988f9000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_11_0__tab[] = { 0x5400, 0xdd67 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_11_0__tab[] = { 0xdd675400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_11_0__tab[] = { 0xdd67540000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_11_0__tab[] = { 0xdd6754000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_11_0__tab[] = { 0xdd675400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_11_0__tab[] = { 0xdd67540000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_11_1__tab[] = { 0xe170, 0x9d10, 0xeb22, 0x4e0e, 0x9400 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_11_1__tab[] = { 0xe1700000, 0xeb229d10, 0x94004e0e }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_11_1__tab[] = { 0xe170000000000000, 0x94004e0eeb229d10 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_11_1__tab[] = { 0x94004e0eeb229d10e1700000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_11_1__tab[] = { 0x94004e0eeb229d10e170000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_11_1__tab[] = { 0x94004e0eeb229d10e17000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_12_0__tab[] = { 0x0800, 0xe570 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_12_0__tab[] = { 0xe5700800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_12_0__tab[] = { 0xe570080000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_12_0__tab[] = { 0xe57008000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_12_0__tab[] = { 0xe5700800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_12_0__tab[] = { 0xe570080000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_12_1__tab[] = { 0xfe28, 0x1c24, 0x0b03, 0x9c1a, 0x8ed1 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_12_1__tab[] = { 0xfe280000, 0x0b031c24, 0x8ed19c1a }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_12_1__tab[] = { 0xfe28000000000000, 0x8ed19c1a0b031c24 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_12_1__tab[] = { 0x8ed19c1a0b031c24fe280000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_12_1__tab[] = { 0x8ed19c1a0b031c24fe28000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_12_1__tab[] = { 0x8ed19c1a0b031c24fe2800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_13_0__tab[] = { 0x0200, 0xecd4 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_13_0__tab[] = { 0xecd40200 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_13_0__tab[] = { 0xecd4020000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_13_0__tab[] = { 0xecd402000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_13_0__tab[] = { 0xecd40200000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_13_0__tab[] = { 0xecd4020000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x57f8, 0xf7b4, 0xcb20, 0xa7c6, 0x8a5c }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x57f80000, 0xcb20f7b4, 0x8a5ca7c6 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x57f8000000000000, 0x8a5ca7c6cb20f7b4 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x8a5ca7c6cb20f7b457f80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x8a5ca7c6cb20f7b457f8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x8a5ca7c6cb20f7b457f800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xb400, 0xf3ab }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xf3abb400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xf3abb40000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xf3abb4000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xf3abb400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xf3abb40000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x85a8, 0x5cab, 0x96b5, 0xfff6, 0x8679 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x85a80000, 0x96b55cab, 0x8679fff6 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x85a8000000000000, 0x8679fff696b55cab }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x8679fff696b55cab85a80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x8679fff696b55cab85a8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x8679fff696b55cab85a800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_15_0__tab[] = { 0x8000, 0xfa0a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_15_0__tab[] = { 0xfa0a8000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_15_0__tab[] = { 0xfa0a800000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_15_0__tab[] = { 0xfa0a80000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_15_0__tab[] = { 0xfa0a8000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_15_0__tab[] = { 0xfa0a800000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x6f80, 0xa6aa, 0x69f0, 0xee23, 0x830c }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x6f800000, 0x69f0a6aa, 0x830cee23 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x6f80000000000000, 0x830cee2369f0a6aa }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x830cee2369f0a6aa6f800000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x830cee2369f0a6aa6f80000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x830cee2369f0a6aa6f8000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x0000, 0x8000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x80000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x8000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x800000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x80000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x8000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x8000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x00000000, 0x00000000, 0x80000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x0000000000000000, 0x8000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x800000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x80000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x8000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x8000, 0x82cc }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x82cc8000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x82cc800000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x82cc80000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x82cc8000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x82cc800000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_17_1__tab[] = { 0x8720, 0x259b, 0x62c4, 0xabf5, 0xfa85 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_17_1__tab[] = { 0x87200000, 0x62c4259b, 0xfa85abf5 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_17_1__tab[] = { 0x8720000000000000, 0xfa85abf562c4259b }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_17_1__tab[] = { 0xfa85abf562c4259b87200000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_17_1__tab[] = { 0xfa85abf562c4259b8720000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_17_1__tab[] = { 0xfa85abf562c4259b872000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x0800, 0x8570 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x85700800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x8570080000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x857008000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x85700800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x8570080000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_18_1__tab[] = { 0x3698, 0x1378, 0x5537, 0x6634, 0xf591 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_18_1__tab[] = { 0x36980000, 0x55371378, 0xf5916634 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_18_1__tab[] = { 0x3698000000000000, 0xf591663455371378 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_18_1__tab[] = { 0xf59166345537137836980000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_18_1__tab[] = { 0xf5916634553713783698000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_18_1__tab[] = { 0xf591663455371378369800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x0600, 0x87ef }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x87ef0600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x87ef060000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x87ef06000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x87ef0600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x87ef060000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_19_1__tab[] = { 0x0db8, 0x558c, 0x62ed, 0x08c0, 0xf10f }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_19_1__tab[] = { 0x0db80000, 0x62ed558c, 0xf10f08c0 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_19_1__tab[] = { 0x0db8000000000000, 0xf10f08c062ed558c }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_19_1__tab[] = { 0xf10f08c062ed558c0db80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_19_1__tab[] = { 0xf10f08c062ed558c0db8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_19_1__tab[] = { 0xf10f08c062ed558c0db800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x3e00, 0x8a4d }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x8a4d3e00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x8a4d3e0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x8a4d3e000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x8a4d3e00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x8a4d3e0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_20_1__tab[] = { 0x0b40, 0xa71c, 0x1cc1, 0x690a, 0xecee }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_20_1__tab[] = { 0x0b400000, 0x1cc1a71c, 0xecee690a }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_20_1__tab[] = { 0x0b40000000000000, 0xecee690a1cc1a71c }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_20_1__tab[] = { 0xecee690a1cc1a71c0b400000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_20_1__tab[] = { 0xecee690a1cc1a71c0b40000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_20_1__tab[] = { 0xecee690a1cc1a71c0b4000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_21_0__tab[] = { 0xde00, 0x8c8d }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_21_0__tab[] = { 0x8c8dde00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_21_0__tab[] = { 0x8c8dde0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_21_0__tab[] = { 0x8c8dde000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_21_0__tab[] = { 0x8c8dde00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_21_0__tab[] = { 0x8c8dde0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_21_1__tab[] = { 0x4108, 0x6b26, 0xb3d0, 0x63c1, 0xe922 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_21_1__tab[] = { 0x41080000, 0xb3d06b26, 0xe92263c1 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_21_1__tab[] = { 0x4108000000000000, 0xe92263c1b3d06b26 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_21_1__tab[] = { 0xe92263c1b3d06b2641080000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_21_1__tab[] = { 0xe92263c1b3d06b264108000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_21_1__tab[] = { 0xe92263c1b3d06b26410800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_22_0__tab[] = { 0xaa00, 0x8eb3 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_22_0__tab[] = { 0x8eb3aa00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_22_0__tab[] = { 0x8eb3aa0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_22_0__tab[] = { 0x8eb3aa000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_22_0__tab[] = { 0x8eb3aa00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_22_0__tab[] = { 0x8eb3aa0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xdbe8, 0xf061, 0x60b9, 0x2c4d, 0xe5a0 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xdbe80000, 0x60b9f061, 0xe5a02c4d }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xdbe8000000000000, 0xe5a02c4d60b9f061 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xe5a02c4d60b9f061dbe80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xe5a02c4d60b9f061dbe8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xe5a02c4d60b9f061dbe800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x0600, 0x90c1 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x90c10600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x90c1060000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x90c106000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x90c10600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x90c1060000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xc3e0, 0x586a, 0x46b9, 0xcadd, 0xe25e }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xc3e00000, 0x46b9586a, 0xe25ecadd }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xc3e0000000000000, 0xe25ecadd46b9586a }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xe25ecadd46b9586ac3e00000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xe25ecadd46b9586ac3e0000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xe25ecadd46b9586ac3e000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x0400, 0x92b8 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x92b80400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x92b8040000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x92b804000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x92b80400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x92b8040000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_24_1__tab[] = { 0x3668, 0x7263, 0xc7c6, 0xbb44, 0xdf56 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_24_1__tab[] = { 0x36680000, 0xc7c67263, 0xdf56bb44 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_24_1__tab[] = { 0x3668000000000000, 0xdf56bb44c7c67263 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_24_1__tab[] = { 0xdf56bb44c7c6726336680000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_24_1__tab[] = { 0xdf56bb44c7c672633668000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_24_1__tab[] = { 0xdf56bb44c7c67263366800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x7a00, 0x949a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x949a7a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x949a7a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x949a7a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x949a7a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x949a7a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_25_1__tab[] = { 0x67b8, 0x9728, 0x287b, 0xa348, 0xdc81 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_25_1__tab[] = { 0x67b80000, 0x287b9728, 0xdc81a348 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_25_1__tab[] = { 0x67b8000000000000, 0xdc81a348287b9728 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_25_1__tab[] = { 0xdc81a348287b972867b80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_25_1__tab[] = { 0xdc81a348287b972867b8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_25_1__tab[] = { 0xdc81a348287b972867b800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x0200, 0x966a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x966a0200 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x966a020000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x966a02000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x966a0200000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x966a020000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_26_1__tab[] = { 0x6458, 0x78a4, 0x7583, 0x19f9, 0xd9da }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_26_1__tab[] = { 0x64580000, 0x758378a4, 0xd9da19f9 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_26_1__tab[] = { 0x6458000000000000, 0xd9da19f9758378a4 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_26_1__tab[] = { 0xd9da19f9758378a464580000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_26_1__tab[] = { 0xd9da19f9758378a46458000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_26_1__tab[] = { 0xd9da19f9758378a4645800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x0a00, 0x9828 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x98280a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x98280a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x98280a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x98280a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x98280a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_27_1__tab[] = { 0x5b08, 0xe1bd, 0xe237, 0x7bac, 0xd75b }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_27_1__tab[] = { 0x5b080000, 0xe237e1bd, 0xd75b7bac }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_27_1__tab[] = { 0x5b08000000000000, 0xd75b7bace237e1bd }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_27_1__tab[] = { 0xd75b7bace237e1bd5b080000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_27_1__tab[] = { 0xd75b7bace237e1bd5b08000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_27_1__tab[] = { 0xd75b7bace237e1bd5b0800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_28_0__tab[] = { 0xda00, 0x99d5 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_28_0__tab[] = { 0x99d5da00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_28_0__tab[] = { 0x99d5da0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_28_0__tab[] = { 0x99d5da000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_28_0__tab[] = { 0x99d5da00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_28_0__tab[] = { 0x99d5da0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xdeb8, 0xe8b8, 0x71df, 0xc758, 0xd501 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xdeb80000, 0x71dfe8b8, 0xd501c758 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xdeb8000000000000, 0xd501c75871dfe8b8 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xd501c75871dfe8b8deb80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xd501c75871dfe8b8deb8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xd501c75871dfe8b8deb800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9600, 0x9b74 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9b749600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9b74960000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9b7496000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9b749600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9b74960000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xccc8, 0x62b3, 0x9c6c, 0x8315, 0xd2c9 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xccc80000, 0x9c6c62b3, 0xd2c98315 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xccc8000000000000, 0xd2c983159c6c62b3 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xd2c983159c6c62b3ccc80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xd2c983159c6c62b3ccc8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xd2c983159c6c62b3ccc800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x4000, 0x9d05 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x9d054000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x9d05400000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x9d0540000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x9d054000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x9d05400000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_30_1__tab[] = { 0x3588, 0x1732, 0x5cad, 0xa619, 0xd0af }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_30_1__tab[] = { 0x35880000, 0x5cad1732, 0xd0afa619 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_30_1__tab[] = { 0x3588000000000000, 0xd0afa6195cad1732 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_30_1__tab[] = { 0xd0afa6195cad173235880000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_30_1__tab[] = { 0xd0afa6195cad17323588000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_30_1__tab[] = { 0xd0afa6195cad1732358800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_31_0__tab[] = { 0xc800, 0x9e88 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_31_0__tab[] = { 0x9e88c800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_31_0__tab[] = { 0x9e88c80000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_31_0__tab[] = { 0x9e88c8000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_31_0__tab[] = { 0x9e88c800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_31_0__tab[] = { 0x9e88c80000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xd578, 0xf7ca, 0x63ee, 0x86e6, 0xceb1 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xd5780000, 0x63eef7ca, 0xceb186e6 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xd578000000000000, 0xceb186e663eef7ca }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xceb186e663eef7cad5780000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xceb186e663eef7cad578000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xceb186e663eef7cad57800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_32_0__tab[] = { 0x0000, 0xa000 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_32_0__tab[] = { 0xa0000000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_32_0__tab[] = { 0xa000000000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_32_0__tab[] = { 0xa00000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_32_0__tab[] = { 0xa0000000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_32_0__tab[] = { 0xa000000000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccd0, 0xcccc, 0xcccc, 0xcccc, 0xcccc }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccd00000, 0xcccccccc, 0xcccccccc }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccd0000000000000, 0xcccccccccccccccc }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccccccccccccccccccd00000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccccccccccccccccccd0000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccccccccccccccccccd000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xae00, 0xa16b }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xa16bae00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xa16bae0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xa16bae000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xa16bae00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xa16bae0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_33_1__tab[] = { 0x0888, 0xa187, 0x5304, 0x6404, 0xcaff }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_33_1__tab[] = { 0x08880000, 0x5304a187, 0xcaff6404 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_33_1__tab[] = { 0x0888000000000000, 0xcaff64045304a187 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_33_1__tab[] = { 0xcaff64045304a18708880000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_33_1__tab[] = { 0xcaff64045304a1870888000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_33_1__tab[] = { 0xcaff64045304a187088800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_34_0__tab[] = { 0x8000, 0xa2cc }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_34_0__tab[] = { 0xa2cc8000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_34_0__tab[] = { 0xa2cc800000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_34_0__tab[] = { 0xa2cc80000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_34_0__tab[] = { 0xa2cc8000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_34_0__tab[] = { 0xa2cc800000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xfb50, 0x17ca, 0x5a79, 0x73d8, 0xc947 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xfb500000, 0x5a7917ca, 0xc94773d8 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xfb50000000000000, 0xc94773d85a7917ca }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xc94773d85a7917cafb500000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xc94773d85a7917cafb50000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xc94773d85a7917cafb5000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_35_0__tab[] = { 0x1800, 0xa423 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_35_0__tab[] = { 0xa4231800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_35_0__tab[] = { 0xa423180000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_35_0__tab[] = { 0xa42318000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_35_0__tab[] = { 0xa4231800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_35_0__tab[] = { 0xa423180000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_35_1__tab[] = { 0x6960, 0x18c2, 0x6037, 0x567c, 0xc7a3 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_35_1__tab[] = { 0x69600000, 0x603718c2, 0xc7a3567c }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_35_1__tab[] = { 0x6960000000000000, 0xc7a3567c603718c2 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_35_1__tab[] = { 0xc7a3567c603718c269600000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_35_1__tab[] = { 0xc7a3567c603718c26960000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_35_1__tab[] = { 0xc7a3567c603718c2696000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_36_0__tab[] = { 0x0800, 0xa570 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_36_0__tab[] = { 0xa5700800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_36_0__tab[] = { 0xa570080000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_36_0__tab[] = { 0xa57008000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_36_0__tab[] = { 0xa5700800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_36_0__tab[] = { 0xa570080000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xff10, 0xf9e9, 0xe054, 0x9236, 0xc611 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xff100000, 0xe054f9e9, 0xc6119236 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xff10000000000000, 0xc6119236e054f9e9 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xc6119236e054f9e9ff100000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xc6119236e054f9e9ff10000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xc6119236e054f9e9ff1000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xd800, 0xa6b3 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xa6b3d800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xa6b3d80000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xa6b3d8000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xa6b3d800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xa6b3d80000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_37_1__tab[] = { 0x1618, 0x6b36, 0x70d7, 0xd3a2, 0xc490 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_37_1__tab[] = { 0x16180000, 0x70d76b36, 0xc490d3a2 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_37_1__tab[] = { 0x1618000000000000, 0xc490d3a270d76b36 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_37_1__tab[] = { 0xc490d3a270d76b3616180000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_37_1__tab[] = { 0xc490d3a270d76b361618000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_37_1__tab[] = { 0xc490d3a270d76b36161800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_38_0__tab[] = { 0x0600, 0xa7ef }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_38_0__tab[] = { 0xa7ef0600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_38_0__tab[] = { 0xa7ef060000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_38_0__tab[] = { 0xa7ef06000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_38_0__tab[] = { 0xa7ef0600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_38_0__tab[] = { 0xa7ef060000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xa3e0, 0x9505, 0x5182, 0xe8d2, 0xc31f }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xa3e00000, 0x51829505, 0xc31fe8d2 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xa3e0000000000000, 0xc31fe8d251829505 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xc31fe8d251829505a3e00000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xc31fe8d251829505a3e0000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xc31fe8d251829505a3e000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_39_0__tab[] = { 0x0400, 0xa922 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_39_0__tab[] = { 0xa9220400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_39_0__tab[] = { 0xa922040000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_39_0__tab[] = { 0xa92204000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_39_0__tab[] = { 0xa9220400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_39_0__tab[] = { 0xa922040000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xfcf8, 0xf1b5, 0x10ca, 0xbd32, 0xc1bd }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xfcf80000, 0x10caf1b5, 0xc1bdbd32 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xfcf8000000000000, 0xc1bdbd3210caf1b5 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xc1bdbd3210caf1b5fcf80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xc1bdbd3210caf1b5fcf8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xc1bdbd3210caf1b5fcf800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_40_0__tab[] = { 0x3e00, 0xaa4d }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_40_0__tab[] = { 0xaa4d3e00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_40_0__tab[] = { 0xaa4d3e0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_40_0__tab[] = { 0xaa4d3e000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_40_0__tab[] = { 0xaa4d3e00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_40_0__tab[] = { 0xaa4d3e0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xdce8, 0x4948, 0xeff7, 0x55ff, 0xc069 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xdce80000, 0xeff74948, 0xc06955ff }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xdce8000000000000, 0xc06955ffeff74948 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xc06955ffeff74948dce80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xc06955ffeff74948dce8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xc06955ffeff74948dce800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_41_0__tab[] = { 0x1200, 0xab71 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_41_0__tab[] = { 0xab711200 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_41_0__tab[] = { 0xab71120000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_41_0__tab[] = { 0xab7112000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_41_0__tab[] = { 0xab711200000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_41_0__tab[] = { 0xab71120000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xdc28, 0x7cef, 0xf695, 0xcf47, 0xbf21 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xdc280000, 0xf6957cef, 0xbf21cf47 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xdc28000000000000, 0xbf21cf47f6957cef }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xbf21cf47f6957cefdc280000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xbf21cf47f6957cefdc28000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xbf21cf47f6957cefdc2800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xde00, 0xac8d }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xac8dde00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xac8dde0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xac8dde000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xac8dde00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xac8dde0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xba10, 0x7125, 0x939b, 0x594a, 0xbde6 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xba100000, 0x939b7125, 0xbde6594a }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xba10000000000000, 0xbde6594a939b7125 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xbde6594a939b7125ba100000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xbde6594a939b7125ba10000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xbde6594a939b7125ba1000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xf600, 0xada3 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xada3f600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xada3f60000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xada3f6000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xada3f600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xada3f60000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_43_1__tab[] = { 0x9560, 0x2ab5, 0x9118, 0x363d, 0xbcb6 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_43_1__tab[] = { 0x95600000, 0x91182ab5, 0xbcb6363d }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_43_1__tab[] = { 0x9560000000000000, 0xbcb6363d91182ab5 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_43_1__tab[] = { 0xbcb6363d91182ab595600000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_43_1__tab[] = { 0xbcb6363d91182ab59560000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_43_1__tab[] = { 0xbcb6363d91182ab5956000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaa00, 0xaeb3 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaeb3aa00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaeb3aa0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaeb3aa000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaeb3aa00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaeb3aa0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_44_1__tab[] = { 0x1590, 0x4e90, 0x3a3d, 0xb859, 0xbb90 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_44_1__tab[] = { 0x15900000, 0x3a3d4e90, 0xbb90b859 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_44_1__tab[] = { 0x1590000000000000, 0xbb90b8593a3d4e90 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_44_1__tab[] = { 0xbb90b8593a3d4e9015900000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_44_1__tab[] = { 0xbb90b8593a3d4e901590000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_44_1__tab[] = { 0xbb90b8593a3d4e90159000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_45_0__tab[] = { 0x4400, 0xafbd }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_45_0__tab[] = { 0xafbd4400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_45_0__tab[] = { 0xafbd440000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_45_0__tab[] = { 0xafbd44000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_45_0__tab[] = { 0xafbd4400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_45_0__tab[] = { 0xafbd440000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_45_1__tab[] = { 0x1e78, 0x76f5, 0x1010, 0x4026, 0xba75 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_45_1__tab[] = { 0x1e780000, 0x101076f5, 0xba754026 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_45_1__tab[] = { 0x1e78000000000000, 0xba754026101076f5 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_45_1__tab[] = { 0xba754026101076f51e780000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_45_1__tab[] = { 0xba754026101076f51e78000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_45_1__tab[] = { 0xba754026101076f51e7800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_46_0__tab[] = { 0x0600, 0xb0c1 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_46_0__tab[] = { 0xb0c10600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_46_0__tab[] = { 0xb0c1060000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_46_0__tab[] = { 0xb0c106000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_46_0__tab[] = { 0xb0c10600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_46_0__tab[] = { 0xb0c1060000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb670, 0x0512, 0x69aa, 0x3b01, 0xb963 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb6700000, 0x69aa0512, 0xb9633b01 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb670000000000000, 0xb9633b0169aa0512 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb9633b0169aa0512b6700000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb9633b0169aa0512b670000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb9633b0169aa0512b67000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_47_0__tab[] = { 0x3200, 0xb1bf }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_47_0__tab[] = { 0xb1bf3200 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_47_0__tab[] = { 0xb1bf320000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_47_0__tab[] = { 0xb1bf32000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_47_0__tab[] = { 0xb1bf3200000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_47_0__tab[] = { 0xb1bf320000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_47_1__tab[] = { 0x5118, 0x4133, 0xfbe4, 0x21d0, 0xb85a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_47_1__tab[] = { 0x51180000, 0xfbe44133, 0xb85a21d0 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_47_1__tab[] = { 0x5118000000000000, 0xb85a21d0fbe44133 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_47_1__tab[] = { 0xb85a21d0fbe4413351180000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_47_1__tab[] = { 0xb85a21d0fbe441335118000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_47_1__tab[] = { 0xb85a21d0fbe44133511800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_48_0__tab[] = { 0x0400, 0xb2b8 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_48_0__tab[] = { 0xb2b80400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_48_0__tab[] = { 0xb2b8040000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_48_0__tab[] = { 0xb2b804000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_48_0__tab[] = { 0xb2b80400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_48_0__tab[] = { 0xb2b8040000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_48_1__tab[] = { 0x0490, 0x663d, 0x960d, 0x77de, 0xb759 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_48_1__tab[] = { 0x04900000, 0x960d663d, 0xb75977de }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_48_1__tab[] = { 0x0490000000000000, 0xb75977de960d663d }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_48_1__tab[] = { 0xb75977de960d663d04900000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_48_1__tab[] = { 0xb75977de960d663d0490000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_48_1__tab[] = { 0xb75977de960d663d049000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb400, 0xb3ab }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb3abb400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb3abb40000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb3abb4000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb3abb400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb3abb40000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_49_1__tab[] = { 0x37b8, 0xa711, 0x754d, 0xc9d6, 0xb660 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_49_1__tab[] = { 0x37b80000, 0x754da711, 0xb660c9d6 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_49_1__tab[] = { 0x37b8000000000000, 0xb660c9d6754da711 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_49_1__tab[] = { 0xb660c9d6754da71137b80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_49_1__tab[] = { 0xb660c9d6754da71137b8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_49_1__tab[] = { 0xb660c9d6754da71137b800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_50_0__tab[] = { 0x7a00, 0xb49a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_50_0__tab[] = { 0xb49a7a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_50_0__tab[] = { 0xb49a7a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_50_0__tab[] = { 0xb49a7a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_50_0__tab[] = { 0xb49a7a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_50_0__tab[] = { 0xb49a7a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_50_1__tab[] = { 0x27f0, 0xe532, 0x7344, 0xace3, 0xb56f }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_50_1__tab[] = { 0x27f00000, 0x7344e532, 0xb56face3 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_50_1__tab[] = { 0x27f0000000000000, 0xb56face37344e532 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_50_1__tab[] = { 0xb56face37344e53227f00000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_50_1__tab[] = { 0xb56face37344e53227f0000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_50_1__tab[] = { 0xb56face37344e53227f000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_51_0__tab[] = { 0x8400, 0xb584 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_51_0__tab[] = { 0xb5848400 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_51_0__tab[] = { 0xb584840000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_51_0__tab[] = { 0xb58484000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_51_0__tab[] = { 0xb5848400000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_51_0__tab[] = { 0xb584840000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_51_1__tab[] = { 0x4000, 0xe9a9, 0x0f8a, 0xbde5, 0xb485 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_51_1__tab[] = { 0x40000000, 0x0f8ae9a9, 0xb485bde5 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_51_1__tab[] = { 0x4000000000000000, 0xb485bde50f8ae9a9 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_51_1__tab[] = { 0xb485bde50f8ae9a940000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_51_1__tab[] = { 0xb485bde50f8ae9a94000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_51_1__tab[] = { 0xb485bde50f8ae9a9400000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_52_0__tab[] = { 0x0200, 0xb66a }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_52_0__tab[] = { 0xb66a0200 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_52_0__tab[] = { 0xb66a020000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_52_0__tab[] = { 0xb66a02000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_52_0__tab[] = { 0xb66a0200000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_52_0__tab[] = { 0xb66a020000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_52_1__tab[] = { 0x4608, 0xfcb3, 0xeecf, 0xa0bb, 0xb3a2 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_52_1__tab[] = { 0x46080000, 0xeecffcb3, 0xb3a2a0bb }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_52_1__tab[] = { 0x4608000000000000, 0xb3a2a0bbeecffcb3 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_52_1__tab[] = { 0xb3a2a0bbeecffcb346080000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_52_1__tab[] = { 0xb3a2a0bbeecffcb34608000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_52_1__tab[] = { 0xb3a2a0bbeecffcb3460800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_53_0__tab[] = { 0x2000, 0xb74b }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_53_0__tab[] = { 0xb74b2000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_53_0__tab[] = { 0xb74b200000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_53_0__tab[] = { 0xb74b20000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_53_0__tab[] = { 0xb74b2000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_53_0__tab[] = { 0xb74b200000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xa360, 0x8ccb, 0xeb5f, 0xffa9, 0xb2c5 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xa3600000, 0xeb5f8ccb, 0xb2c5ffa9 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xa360000000000000, 0xb2c5ffa9eb5f8ccb }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xb2c5ffa9eb5f8ccba3600000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xb2c5ffa9eb5f8ccba360000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xb2c5ffa9eb5f8ccba36000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_54_0__tab[] = { 0x0a00, 0xb828 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_54_0__tab[] = { 0xb8280a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_54_0__tab[] = { 0xb8280a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_54_0__tab[] = { 0xb8280a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_54_0__tab[] = { 0xb8280a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_54_0__tab[] = { 0xb8280a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xf368, 0xe940, 0x3e86, 0x8ac3, 0xb1ef }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xf3680000, 0x3e86e940, 0xb1ef8ac3 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xf368000000000000, 0xb1ef8ac33e86e940 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xb1ef8ac33e86e940f3680000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xb1ef8ac33e86e940f368000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xb1ef8ac33e86e940f36800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xe800, 0xb900 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xb900e800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xb900e80000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xb900e8000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xb900e800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xb900e80000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_55_1__tab[] = { 0x7a40, 0xd18e, 0xa4b5, 0xf76e, 0xb11e }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_55_1__tab[] = { 0x7a400000, 0xa4b5d18e, 0xb11ef76e }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_55_1__tab[] = { 0x7a40000000000000, 0xb11ef76ea4b5d18e }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_55_1__tab[] = { 0xb11ef76ea4b5d18e7a400000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_55_1__tab[] = { 0xb11ef76ea4b5d18e7a40000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_55_1__tab[] = { 0xb11ef76ea4b5d18e7a4000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xda00, 0xb9d5 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xb9d5da00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xb9d5da0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xb9d5da000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xb9d5da00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xb9d5da0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xe818, 0x4c7b, 0xaa2c, 0xfff2, 0xb053 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xe8180000, 0xaa2c4c7b, 0xb053fff2 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xe818000000000000, 0xb053fff2aa2c4c7b }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xb053fff2aa2c4c7be8180000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xb053fff2aa2c4c7be818000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xb053fff2aa2c4c7be81800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_57_0__tab[] = { 0x0a00, 0xbaa7 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_57_0__tab[] = { 0xbaa70a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_57_0__tab[] = { 0xbaa70a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_57_0__tab[] = { 0xbaa70a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_57_0__tab[] = { 0xbaa70a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_57_0__tab[] = { 0xbaa70a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xefb0, 0x814f, 0x8e2f, 0x630e, 0xaf8e }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xefb00000, 0x8e2f814f, 0xaf8e630e }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xefb0000000000000, 0xaf8e630e8e2f814f }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xaf8e630e8e2f814fefb00000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xaf8e630e8e2f814fefb0000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xaf8e630e8e2f814fefb000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_58_0__tab[] = { 0x9600, 0xbb74 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_58_0__tab[] = { 0xbb749600 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_58_0__tab[] = { 0xbb74960000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_58_0__tab[] = { 0xbb7496000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_58_0__tab[] = { 0xbb749600000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_58_0__tab[] = { 0xbb74960000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_58_1__tab[] = { 0x5d18, 0x41a1, 0x6114, 0xe39d, 0xaecd }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_58_1__tab[] = { 0x5d180000, 0x611441a1, 0xaecde39d }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_58_1__tab[] = { 0x5d18000000000000, 0xaecde39d611441a1 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_58_1__tab[] = { 0xaecde39d611441a15d180000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_58_1__tab[] = { 0xaecde39d611441a15d18000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_58_1__tab[] = { 0xaecde39d611441a15d1800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_59_0__tab[] = { 0x9e00, 0xbc3e }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_59_0__tab[] = { 0xbc3e9e00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_59_0__tab[] = { 0xbc3e9e0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_59_0__tab[] = { 0xbc3e9e000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_59_0__tab[] = { 0xbc3e9e00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_59_0__tab[] = { 0xbc3e9e0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xd000, 0x97df, 0x2f97, 0x4842, 0xae12 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xd0000000, 0x2f9797df, 0xae124842 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xd000000000000000, 0xae1248422f9797df }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xae1248422f9797dfd0000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xae1248422f9797dfd000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xae1248422f9797dfd00000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_60_0__tab[] = { 0x4000, 0xbd05 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_60_0__tab[] = { 0xbd054000 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_60_0__tab[] = { 0xbd05400000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_60_0__tab[] = { 0xbd0540000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_60_0__tab[] = { 0xbd054000000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_60_0__tab[] = { 0xbd05400000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xfe58, 0x206d, 0x3555, 0x5b1c, 0xad5b }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xfe580000, 0x3555206d, 0xad5b5b1c }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xfe58000000000000, 0xad5b5b1c3555206d }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xad5b5b1c3555206dfe580000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xad5b5b1c3555206dfe58000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xad5b5b1c3555206dfe5800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_61_0__tab[] = { 0x9a00, 0xbdc8 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_61_0__tab[] = { 0xbdc89a00 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_61_0__tab[] = { 0xbdc89a0000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_61_0__tab[] = { 0xbdc89a000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_61_0__tab[] = { 0xbdc89a00000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_61_0__tab[] = { 0xbdc89a0000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_61_1__tab[] = { 0x4df8, 0x7757, 0x31cb, 0xe982, 0xaca8 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_61_1__tab[] = { 0x4df80000, 0x31cb7757, 0xaca8e982 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_61_1__tab[] = { 0x4df8000000000000, 0xaca8e98231cb7757 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_61_1__tab[] = { 0xaca8e98231cb77574df80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_61_1__tab[] = { 0xaca8e98231cb77574df8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_61_1__tab[] = { 0xaca8e98231cb77574df800000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xc800, 0xbe88 }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xbe88c800 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xbe88c80000000000 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xbe88c8000000000000000000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xbe88c800000000000000000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xbe88c80000000000000000000000000000000000000000000000000000000000 }; #endif #if 0 -#elif BITS_PER_MP_LIMB == 16 +#elif GMP_LIMB_BITS == 16 const mp_limb_t mpfr_l2b_62_1__tab[] = { 0x74f8, 0xf905, 0x1831, 0xc3c4, 0xabfa }; -#elif BITS_PER_MP_LIMB == 32 +#elif GMP_LIMB_BITS == 32 const mp_limb_t mpfr_l2b_62_1__tab[] = { 0x74f80000, 0x1831f905, 0xabfac3c4 }; -#elif BITS_PER_MP_LIMB == 64 +#elif GMP_LIMB_BITS == 64 const mp_limb_t mpfr_l2b_62_1__tab[] = { 0x74f8000000000000, 0xabfac3c41831f905 }; -#elif BITS_PER_MP_LIMB == 96 +#elif GMP_LIMB_BITS == 96 const mp_limb_t mpfr_l2b_62_1__tab[] = { 0xabfac3c41831f90574f80000 }; -#elif BITS_PER_MP_LIMB == 128 +#elif GMP_LIMB_BITS == 128 const mp_limb_t mpfr_l2b_62_1__tab[] = { 0xabfac3c41831f90574f8000000000000 }; -#elif BITS_PER_MP_LIMB == 256 +#elif GMP_LIMB_BITS == 256 const mp_limb_t mpfr_l2b_62_1__tab[] = { 0xabfac3c41831f90574f800000000000000000000000000000000000000000000 }; #endif @@ -2337,7 +2337,7 @@ mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t r int inexp; count_leading_zeros (pow2, (mp_limb_t) b); - pow2 = BITS_PER_MP_LIMB - pow2 - 1; /* base = 2^pow2 */ + pow2 = GMP_LIMB_BITS - pow2 - 1; /* base = 2^pow2 */ /* set MPFR_EXP(x) = f*pow2 + r, 1 <= r <= pow2 */ f = (MPFR_GET_EXP (x) - 1) / pow2; @@ -2350,11 +2350,11 @@ mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t r /* the first digit will contain only r bits */ prec = (m - 1) * pow2 + r; /* total number of bits */ - n = (prec - 1) / BITS_PER_MP_LIMB + 1; + n = (prec - 1) / GMP_LIMB_BITS + 1; MPFR_TMP_MARK (marker); x1 = (mp_limb_t*) MPFR_TMP_ALLOC((n + 1) * sizeof (mp_limb_t)); - nb = n * BITS_PER_MP_LIMB - prec; + nb = n * GMP_LIMB_BITS - prec; /* round xp to the precision prec, and put it into x1 put the carry into x1[n] */ if ((x1[n] = mpfr_round_raw (x1, xp, MPFR_PREC(x), @@ -2416,21 +2416,21 @@ mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t r exact = 1; /* number of limbs */ - n = 1 + (prec - 1) / BITS_PER_MP_LIMB; + n = 1 + (prec - 1) / GMP_LIMB_BITS; /* a will contain the approximation of the mantissa */ a = (mp_limb_t*) MPFR_TMP_ALLOC (n * sizeof (mp_limb_t)); - nx = 1 + (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB; + nx = 1 + (MPFR_PREC(x) - 1) / GMP_LIMB_BITS; if ((mp_exp_t) m == g) /* final exponent is 0, no multiplication or division to perform */ { if (nx > n) - exact = mpn_scan1 (xp, 0) >= (nx - n) * BITS_PER_MP_LIMB; + exact = mpn_scan1 (xp, 0) >= (nx - n) * GMP_LIMB_BITS; err = !exact; MPN_COPY2 (a, n, xp, nx); - exp_a = MPFR_GET_EXP (x) - n * BITS_PER_MP_LIMB; + exp_a = MPFR_GET_EXP (x) - n * GMP_LIMB_BITS; } else if ((mp_exp_t) m > g) /* we have to multiply x by b^exp */ { @@ -2441,14 +2441,14 @@ mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t r /* here, the error on a is at most 2^err ulps */ exact = (err == -1); - /* x = x1*2^(n*BITS_PER_MP_LIMB) */ + /* x = x1*2^(n*GMP_LIMB_BITS) */ x1 = (nx >= n) ? xp + nx - n : xp; nx1 = (nx >= n) ? n : nx; /* nx1 = min(n, nx) */ /* test si exact */ if (nx > n) exact = (exact && - ((mpn_scan1 (xp, 0) >= (nx - n) * BITS_PER_MP_LIMB))); + ((mpn_scan1 (xp, 0) >= (nx - n) * GMP_LIMB_BITS))); /* we loose one more bit in the multiplication, except when err=0 where we loose two bits */ @@ -2458,14 +2458,14 @@ mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t r result = (mp_limb_t*) MPFR_TMP_ALLOC ((n + nx1) * sizeof (mp_limb_t)); mpn_mul (result, a, n, x1, nx1); exp_a += MPFR_GET_EXP (x); - if (mpn_scan1 (result, 0) < (nx1 * BITS_PER_MP_LIMB)) + if (mpn_scan1 (result, 0) < (nx1 * GMP_LIMB_BITS)) exact = 0; /* normalize a and truncate */ if ((result[n + nx1 - 1] & MPFR_LIMB_HIGHBIT) == 0) { mpn_lshift (a, result + nx1, n , 1); - a[0] |= result[nx1 - 1] >> (BITS_PER_MP_LIMB - 1); + a[0] |= result[nx1 - 1] >> (GMP_LIMB_BITS - 1); exp_a --; } else @@ -2487,12 +2487,12 @@ mpfr_get_str (char *s, mp_exp_t *e, int b, size_t m, mpfr_srcptr x, mpfr_rnd_t r /* initialize x1 = x */ MPN_COPY2 (x1, 2 * n, xp, nx); if ((exact) && (nx > 2 * n) && - (mpn_scan1 (xp, 0) < (nx - 2 * n) * BITS_PER_MP_LIMB)) + (mpn_scan1 (xp, 0) < (nx - 2 * n) * GMP_LIMB_BITS)) exact = 0; /* result = x / a */ mpn_tdiv_qr (result, reste, 0, x1, 2 * n, a, n); - exp_a = MPFR_GET_EXP (x) - exp_a - 2 * n * BITS_PER_MP_LIMB; + exp_a = MPFR_GET_EXP (x) - exp_a - 2 * n * GMP_LIMB_BITS; /* test if division was exact */ if (exact) @@ -54,7 +54,7 @@ mpfr_get_ui (mpfr_srcptr f, mpfr_rnd_t rnd) /* now the result is in the most significant limb of x */ exp = MPFR_GET_EXP (x); /* since |x| >= 1, exp >= 1 */ n = MPFR_LIMB_SIZE(x); - s = MPFR_MANT(x)[n - 1] >> (BITS_PER_MP_LIMB - exp); + s = MPFR_MANT(x)[n - 1] >> (GMP_LIMB_BITS - exp); } mpfr_clear (x); @@ -80,7 +80,7 @@ mpfr_get_uj (mpfr_srcptr f, mpfr_rnd_t rnd) MPFR_ASSERTN ((mp_prec_t) sh <= prec); for (n = MPFR_LIMB_SIZE(x) - 1; n >= 0; n--) { - sh -= BITS_PER_MP_LIMB; + sh -= GMP_LIMB_BITS; r += (sh >= 0 ? (uintmax_t) xp[n] << sh : (uintmax_t) xp[n] >> (- sh)); @@ -31,7 +31,7 @@ init_set_z (mpfr_ptr t, mpz_srcptr z) int i; if (mpz_size (z) <= 1) - p = BITS_PER_MP_LIMB; + p = GMP_LIMB_BITS; else MPFR_MPZ_SIZEINBASE2 (p, z); mpfr_init2 (t, p); @@ -313,7 +313,7 @@ mpfr_cmp_f (mpfr_srcptr x, mpf_srcptr z) mpfr_t t; int res; - mpfr_init2 (t, MPFR_PREC_MIN + ABS(SIZ(z)) * BITS_PER_MP_LIMB ); + mpfr_init2 (t, MPFR_PREC_MIN + ABS(SIZ(z)) * GMP_LIMB_BITS ); res = mpfr_set_f (t, z, MPFR_RNDN); MPFR_ASSERTD (res == 0); res = mpfr_cmp (x, t); @@ -32,11 +32,11 @@ mpfr_init2 (mpfr_ptr x, mp_prec_t p) * associated to the maximum of mpfr_prec_t*/ MPFR_ASSERTN( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/BYTES_PER_MP_LIMB) ); - /* Check for correct BITS_PER_MP_LIMB and BYTES_PER_MP_LIMB */ - MPFR_ASSERTN( BITS_PER_MP_LIMB == BYTES_PER_MP_LIMB * CHAR_BIT + /* Check for correct GMP_LIMB_BITS and BYTES_PER_MP_LIMB */ + MPFR_ASSERTN( GMP_LIMB_BITS == BYTES_PER_MP_LIMB * CHAR_BIT && sizeof(mp_limb_t) == BYTES_PER_MP_LIMB ); - MPFR_ASSERTN (mp_bits_per_limb == BITS_PER_MP_LIMB); + MPFR_ASSERTN (mp_bits_per_limb == GMP_LIMB_BITS); /* Check for correct EXP NAN, ZERO & INF in both mpfr.h and in mpfr-impl.h */ MPFR_ASSERTN( __MPFR_EXP_NAN == MPFR_EXP_NAN ); @@ -51,7 +51,7 @@ mpfr_init2 (mpfr_ptr x, mp_prec_t p) which both have an odd mantissa */ MPFR_ASSERTN(p >= MPFR_PREC_MIN && p <= MPFR_PREC_MAX); - xsize = (mp_size_t) ((p - 1) / BITS_PER_MP_LIMB) + 1; + xsize = (mp_size_t) ((p - 1) / GMP_LIMB_BITS) + 1; tmp = (mp_ptr) (*__gmp_allocate_func)(MPFR_MALLOC_SIZE(xsize)); MPFR_PREC(x) = p; /* Set prec */ diff --git a/int_ceil_log2.c b/int_ceil_log2.c index b96110266..2d8d78627 100644 --- a/int_ceil_log2.c +++ b/int_ceil_log2.c @@ -37,6 +37,6 @@ __gmpfr_int_ceil_log2 (unsigned long n) limb = n - 1; MPFR_ASSERTN (limb == n - 1); count_leading_zeros (b, limb); - return BITS_PER_MP_LIMB - b; + return GMP_LIMB_BITS - b; } } diff --git a/isinteger.c b/isinteger.c index 3b2c8c1d9..d68bb4991 100644 --- a/isinteger.c +++ b/isinteger.c @@ -44,13 +44,13 @@ mpfr_integer_p (mpfr_srcptr x) /* 0 < expo < prec */ - xn = (mp_size_t) ((prec - 1) / BITS_PER_MP_LIMB); /* index of last limb */ - xn -= (mp_size_t) (expo / BITS_PER_MP_LIMB); + xn = (mp_size_t) ((prec - 1) / GMP_LIMB_BITS); /* index of last limb */ + xn -= (mp_size_t) (expo / GMP_LIMB_BITS); /* now the index of the last limb containing bits of the fractional part */ xp = MPFR_MANT(x); MPFR_ASSERTN(xn >= 0); - if (xp[xn] << (expo % BITS_PER_MP_LIMB) != 0) + if (xp[xn] << (expo % GMP_LIMB_BITS) != 0) return 0; while (--xn >= 0) if (xp[xn] != 0) @@ -67,13 +67,13 @@ unit_bit (mpfr_srcptr (x)) /* Now, the unit bit is represented. */ - prec = ((prec - 1) / BITS_PER_MP_LIMB + 1) * BITS_PER_MP_LIMB - expo; + prec = ((prec - 1) / GMP_LIMB_BITS + 1) * GMP_LIMB_BITS - expo; /* number of represented fractional bits (including the trailing 0's) */ - x0 = *(MPFR_MANT (x) + prec / BITS_PER_MP_LIMB); + x0 = *(MPFR_MANT (x) + prec / GMP_LIMB_BITS); /* limb containing the unit bit */ - return (x0 >> (prec % BITS_PER_MP_LIMB)) & 1; + return (x0 >> (prec % GMP_LIMB_BITS)) & 1; } #endif @@ -369,7 +369,7 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd) } /* m <= maxm ensures that 2*m*(2*m+1) <= ULONG_MAX */ - maxm = 1UL << (BITS_PER_MP_LIMB / 2 - 1); + maxm = 1UL << (GMP_LIMB_BITS / 2 - 1); /* s:(1+u)^15, t:(1+u)^2, t <= 3/128 */ @@ -103,10 +103,10 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) /* use initial precision about q+lg(q)+5 */ p = q + 5 + 2 * MPFR_INT_CEIL_LOG2 (q); - /* % ~(mp_prec_t)BITS_PER_MP_LIMB ; + /* % ~(mp_prec_t)GMP_LIMB_BITS ; m=q; while (m) { p++; m >>= 1; } */ - /* if (MPFR_LIKELY(p % BITS_PER_MP_LIMB != 0)) - p += BITS_PER_MP_LIMB - (p%BITS_PER_MP_LIMB); */ + /* if (MPFR_LIKELY(p % GMP_LIMB_BITS != 0)) + p += GMP_LIMB_BITS - (p%GMP_LIMB_BITS); */ MPFR_TMP_MARK(marker); MPFR_SAVE_EXPO_MARK (expo); @@ -122,7 +122,7 @@ mpfr_log (mpfr_ptr r, mpfr_srcptr a, mpfr_rnd_t rnd_mode) m = (p + 1) / 2 - MPFR_GET_EXP (a) + 1; /* All the mpfr_t needed have a precision of p */ - size = (p-1)/BITS_PER_MP_LIMB+1; + size = (p-1)/GMP_LIMB_BITS+1; MPFR_TMP_INIT (tmp1p, tmp1, p, size); MPFR_TMP_INIT (tmp2p, tmp2, p, size); diff --git a/min_prec.c b/min_prec.c index 2b2b3237d..8655007d2 100644 --- a/min_prec.c +++ b/min_prec.c @@ -40,7 +40,7 @@ mpfr_min_prec (mpfr_srcptr x) /* Count full limbs set to zero */ for (n = 0; mx[n] == 0; n++) { - res += BITS_PER_MP_LIMB; + res += GMP_LIMB_BITS; } i = 0; @@ -51,11 +51,11 @@ mpfr_min_prec (mpfr_srcptr x) res += i; /* If we have trailing zero bits because the precision - * is not a multiple of BITS_PER_MP_LIMB, we must not count + * is not a multiple of GMP_LIMB_BITS, we must not count * those. */ - i = px % BITS_PER_MP_LIMB; + i = px % GMP_LIMB_BITS; if (i != 0) - res -= BITS_PER_MP_LIMB - i; + res -= GMP_LIMB_BITS - i; return px - res; } diff --git a/mpfr-gmp.h b/mpfr-gmp.h index ffa7f0828..4796221b9 100644 --- a/mpfr-gmp.h +++ b/mpfr-gmp.h @@ -53,22 +53,24 @@ char *alloca (); extern "C" { #endif -/* Define BITS_PER_MP_LIMB +/* Define GMP_LIMB_BITS Can't use sizeof(mp_limb_t) since it should be a preprocessor constant */ #if defined(GMP_NUMB_BITS) /* GMP 4.1.2 or above */ -# define BITS_PER_MP_LIMB (GMP_NUMB_BITS+GMP_NAIL_BITS) -#elif defined (__GMP_BITS_PER_MP_LIMB) /* Older versions 4.x.x */ -# define BITS_PER_MP_LIMB __GMP_BITS_PER_MP_LIMB -# define GMP_NUMB_BITS BITS_PER_MP_LIMB +#ifndef GMP_LIMB_BITS +# define GMP_LIMB_BITS (GMP_NUMB_BITS+GMP_NAIL_BITS) +#endif +#elif defined (__GMP_GMP_LIMB_BITS) /* Older versions 4.x.x */ +# define GMP_LIMB_BITS __GMP_GMP_LIMB_BITS +# define GMP_NUMB_BITS GMP_LIMB_BITS # ifndef GMP_NAIL_BITS # define GMP_NAIL_BITS 0 # endif #else -# error "Could not detect BITS_PER_MP_LIMB. Try with gmp internal files." +# error "Could not detect GMP_LIMB_BITS. Try with gmp internal files." #endif /* Define some macros */ -#define BYTES_PER_MP_LIMB (BITS_PER_MP_LIMB/CHAR_BIT) +#define BYTES_PER_MP_LIMB (GMP_LIMB_BITS/CHAR_BIT) #define MP_LIMB_T_MAX (~(mp_limb_t)0) @@ -140,10 +142,7 @@ extern "C" { #define MPN_SAME_OR_DECR_P(dst, src, size) \ MPN_SAME_OR_DECR2_P(dst, size, src, size) -/* If sqr_n or mul_basecase are not exported, used mpn_mul instead */ -#ifndef mpn_sqr_n -# define mpn_sqr_n(dst,src,n) mpn_mul((dst),(src),(n),(src),(n)) -#endif +/* If mul_basecase or mpn_sqr_basecase are not exported, used mpn_mul instead */ #ifndef mpn_mul_basecase # define mpn_mul_basecase(dst,s1,n1,s2,n2) mpn_mul((dst),(s1),(n1),(s2),(n2)) #endif @@ -193,7 +192,7 @@ typedef unsigned long int UDItype; #endif typedef mp_limb_t UWtype; typedef unsigned int UHWtype; -#define W_TYPE_SIZE BITS_PER_MP_LIMB +#define W_TYPE_SIZE GMP_LIMB_BITS /* Remap names of internal mpn functions (for longlong.h). */ #undef __clz_tab diff --git a/mpfr-impl.h b/mpfr-impl.h index 577608293..0ab167dcb 100644 --- a/mpfr-impl.h +++ b/mpfr-impl.h @@ -90,6 +90,11 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #endif #undef MPFR_NEED_LONGLONG_H +/* if mpn_sqr_n is not exported, use mpn_mul instead */ +#ifndef mpn_sqr_n +# define mpn_sqr_n(dst,src,n) mpn_mul((dst),(src),(n),(src),(n)) +#endif + /* For the definition of MPFR_THREAD_ATTR. GCC/ICC detection macros are no longer used, as they sometimes gave incorrect information about the support of thread-local variables. A configure check is now done. @@ -156,22 +161,22 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., # error "MPFR doesn't support nonzero values of GMP_NAIL_BITS" #endif -#if (BITS_PER_MP_LIMB<32) || (BITS_PER_MP_LIMB & (BITS_PER_MP_LIMB - 1)) -# error "BITS_PER_MP_LIMB must be a power of 2, and >= 32" +#if (GMP_LIMB_BITS<32) || (GMP_LIMB_BITS & (GMP_LIMB_BITS - 1)) +# error "GMP_LIMB_BITS must be a power of 2, and >= 32" #endif -#if BITS_PER_MP_LIMB == 16 -# define MPFR_LOG2_BITS_PER_MP_LIMB 4 -#elif BITS_PER_MP_LIMB == 32 -# define MPFR_LOG2_BITS_PER_MP_LIMB 5 -#elif BITS_PER_MP_LIMB == 64 -# define MPFR_LOG2_BITS_PER_MP_LIMB 6 -#elif BITS_PER_MP_LIMB == 128 -# define MPFR_LOG2_BITS_PER_MP_LIMB 7 -#elif BITS_PER_MP_LIMB == 256 -# define MPFR_LOG2_BITS_PER_MP_LIMB 8 +#if GMP_LIMB_BITS == 16 +# define MPFR_LOG2_GMP_LIMB_BITS 4 +#elif GMP_LIMB_BITS == 32 +# define MPFR_LOG2_GMP_LIMB_BITS 5 +#elif GMP_LIMB_BITS == 64 +# define MPFR_LOG2_GMP_LIMB_BITS 6 +#elif GMP_LIMB_BITS == 128 +# define MPFR_LOG2_GMP_LIMB_BITS 7 +#elif GMP_LIMB_BITS == 256 +# define MPFR_LOG2_GMP_LIMB_BITS 8 #else -# error "Can't compute log2(BITS_PER_MP_LIMB)" +# error "Can't compute log2(GMP_LIMB_BITS)" #endif #if __MPFR_GNUC(3,0) || __MPFR_ICC(8,1,0) @@ -380,12 +385,12 @@ __MPFR_DECLSPEC extern const mpfr_t __gmpfr_four; #ifndef IEEE_DBL_MANT_DIG #define IEEE_DBL_MANT_DIG 53 #endif -#define MPFR_LIMBS_PER_DOUBLE ((IEEE_DBL_MANT_DIG-1)/BITS_PER_MP_LIMB+1) +#define MPFR_LIMBS_PER_DOUBLE ((IEEE_DBL_MANT_DIG-1)/GMP_LIMB_BITS+1) #ifndef IEEE_FLT_MANT_DIG #define IEEE_FLT_MANT_DIG 24 #endif -#define MPFR_LIMBS_PER_FLT ((IEEE_FLT_MANT_DIG-1)/BITS_PER_MP_LIMB+1) +#define MPFR_LIMBS_PER_FLT ((IEEE_FLT_MANT_DIG-1)/GMP_LIMB_BITS+1) /* Visual C++ doesn't support +1.0/.00, -1.0/0.0 and 0.0/0.0 at compile time. */ @@ -453,7 +458,7 @@ static double double_zero = 0.0; # define MPFR_LDBL_MANT_DIG LDBL_MANT_DIG #else # define MPFR_LDBL_MANT_DIG \ - (sizeof(long double)*BITS_PER_MP_LIMB/sizeof(mp_limb_t)) + (sizeof(long double)*GMP_LIMB_BITS/sizeof(mp_limb_t)) #endif #define MPFR_LIMBS_PER_LONG_DOUBLE \ ((sizeof(long double)-1)/sizeof(mp_limb_t)+1) @@ -549,7 +554,7 @@ typedef union { /* #undef MPFR_LDBL_MANT_DIG */ #undef MPFR_LIMBS_PER_LONG_DOUBLE /* #define MPFR_LDBL_MANT_DIG 64 */ -#define MPFR_LIMBS_PER_LONG_DOUBLE ((64-1)/BITS_PER_MP_LIMB+1) +#define MPFR_LIMBS_PER_LONG_DOUBLE ((64-1)/GMP_LIMB_BITS+1) #endif @@ -569,14 +574,14 @@ union ieee_double_decimal64 { double d; _Decimal64 d64; }; #define MPFR_PREC(x) ((x)->_mpfr_prec) #define MPFR_EXP(x) ((x)->_mpfr_exp) #define MPFR_MANT(x) ((x)->_mpfr_d) -#define MPFR_LIMB_SIZE(x) ((MPFR_PREC((x))-1)/BITS_PER_MP_LIMB+1) +#define MPFR_LIMB_SIZE(x) ((MPFR_PREC((x))-1)/GMP_LIMB_BITS+1) #if _MPFR_PREC_FORMAT == 1 -# define MPFR_INTPREC_MAX (USHRT_MAX & ~(unsigned int) (BITS_PER_MP_LIMB - 1)) +# define MPFR_INTPREC_MAX (USHRT_MAX & ~(unsigned int) (GMP_LIMB_BITS - 1)) #elif _MPFR_PREC_FORMAT == 2 -# define MPFR_INTPREC_MAX (UINT_MAX & ~(unsigned int) (BITS_PER_MP_LIMB - 1)) +# define MPFR_INTPREC_MAX (UINT_MAX & ~(unsigned int) (GMP_LIMB_BITS - 1)) #elif _MPFR_PREC_FORMAT == 3 -# define MPFR_INTPREC_MAX (ULONG_MAX & ~(unsigned long) (BITS_PER_MP_LIMB - 1)) +# define MPFR_INTPREC_MAX (ULONG_MAX & ~(unsigned long) (GMP_LIMB_BITS - 1)) #else # error "Invalid MPFR Prec format" #endif @@ -618,7 +623,7 @@ typedef intmax_t mpfr_eexp_t; /* Invalid exponent value (to track bugs...) */ #define MPFR_EXP_INVALID \ - ((mp_exp_t) 1 << (BITS_PER_MP_LIMB*sizeof(mp_exp_t)/sizeof(mp_limb_t)-2)) + ((mp_exp_t) 1 << (GMP_LIMB_BITS*sizeof(mp_exp_t)/sizeof(mp_limb_t)-2)) /* Definition of the exponent limits for MPFR numbers. * These limits are chosen so that if e is such an exponent, then 2e-1 and @@ -942,7 +947,7 @@ extern unsigned char *mpfr_stack; _limb = (x) - 1; \ MPFR_ASSERTN (_limb == (x) - 1); \ count_leading_zeros (_b, _limb); \ - (BITS_PER_MP_LIMB - _b); })) + (GMP_LIMB_BITS - _b); })) #else # define MPFR_INT_CEIL_LOG2(x) (__gmpfr_int_ceil_log2(x)) #endif @@ -987,21 +992,21 @@ do { \ MPFR_MANT(x)[_size] = MPFR_LIMB_HIGHBIT; \ } while (0) -/* Compute s = (-a) % BITS_PER_MP_LIMB +/* Compute s = (-a) % GMP_LIMB_BITS * a is unsigned! Check if it works, * otherwise tries another way to compute it */ #define MPFR_UNSIGNED_MINUS_MODULO(s, a) \ do \ { \ - if (IS_POW2 (BITS_PER_MP_LIMB)) \ - (s) = (-(a)) % BITS_PER_MP_LIMB; \ + if (IS_POW2 (GMP_LIMB_BITS)) \ + (s) = (-(a)) % GMP_LIMB_BITS; \ else \ { \ - (s) = (a) % BITS_PER_MP_LIMB; \ + (s) = (a) % GMP_LIMB_BITS; \ if ((s) != 0) \ - (s) = BITS_PER_MP_LIMB - (s); \ + (s) = GMP_LIMB_BITS - (s); \ } \ - MPFR_ASSERTD ((s) >= 0 && (s) < BITS_PER_MP_LIMB); \ + MPFR_ASSERTD ((s) >= 0 && (s) < GMP_LIMB_BITS); \ } \ while (0) @@ -1033,7 +1038,7 @@ do { \ MPFR_ASSERTD (mpz_sgn (z) != 0); \ _size = ABSIZ(z); \ count_leading_zeros (_cnt, PTR(z)[_size-1]); \ - (r) = _size * BITS_PER_MP_LIMB - _cnt; \ + (r) = _size * GMP_LIMB_BITS - _cnt; \ } while (0) /* Needs <locale.h> */ @@ -1130,8 +1135,8 @@ typedef struct { _destp = MPFR_MANT (dest); \ if (MPFR_UNLIKELY (_destprec >= _srcprec)) \ { \ - _srcs = (_srcprec + BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; \ - _dests = (_destprec + BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB - _srcs; \ + _srcs = (_srcprec + GMP_LIMB_BITS-1)/GMP_LIMB_BITS; \ + _dests = (_destprec + GMP_LIMB_BITS-1)/GMP_LIMB_BITS - _srcs; \ MPN_COPY (_destp + _dests, srcp, _srcs); \ MPN_ZERO (_destp, _dests); \ inexact = 0; \ @@ -1144,12 +1149,12 @@ typedef struct { mp_limb_t _rb, _sb, _ulp; \ \ /* Compute Position and shift */ \ - _srcs = (_srcprec + BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; \ - _dests = (_destprec + BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; \ + _srcs = (_srcprec + GMP_LIMB_BITS-1)/GMP_LIMB_BITS; \ + _dests = (_destprec + GMP_LIMB_BITS-1)/GMP_LIMB_BITS; \ MPFR_UNSIGNED_MINUS_MODULO (_sh, _destprec); \ _sp = srcp + _srcs - _dests; \ \ - /* General case when prec % BITS_PER_MP_LIMB != 0 */ \ + /* General case when prec % GMP_LIMB_BITS != 0 */ \ if (MPFR_LIKELY (_sh != 0)) \ { \ mp_limb_t _mask; \ @@ -1350,7 +1355,7 @@ typedef struct { #ifndef MPFR_USE_LOGGING #define MPFR_ZIV_DECL(_x) mp_prec_t _x -#define MPFR_ZIV_INIT(_x, _p) (_x) = BITS_PER_MP_LIMB +#define MPFR_ZIV_INIT(_x, _p) (_x) = GMP_LIMB_BITS #define MPFR_ZIV_NEXT(_x, _p) ((_p) += (_x), (_x) = (_p)/2) #define MPFR_ZIV_FREE(x) @@ -1377,7 +1382,7 @@ typedef struct { "%s: Ziv failed %2.2f%% (%lu bad cases / %lu calls)\n", _x ## _fname, \ (double) 100.0 * _x ## _bad / _x ## _loop, _x ## _bad, _x ## _loop ); } -#define MPFR_ZIV_INIT(_x, _p) ((_x) = BITS_PER_MP_LIMB, _x ## _loop ++); \ +#define MPFR_ZIV_INIT(_x, _p) ((_x) = GMP_LIMB_BITS, _x ## _loop ++); \ if (MPFR_LOG_BADCASE_F&mpfr_log_type && mpfr_log_current<=mpfr_log_level) \ fprintf (mpfr_log_file, "%s:ZIV 1st prec=%lu\n", __func__, \ (unsigned long) (_p)) @@ -1514,7 +1519,7 @@ struct mpfr_group_t { MPFR_ASSERTD (_prec >= MPFR_PREC_MIN); \ if (MPFR_UNLIKELY (_prec > MPFR_PREC_MAX)) \ mpfr_abort_prec_max (); \ - _size = (mp_prec_t) (_prec + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB; \ + _size = (mp_prec_t) (_prec + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; \ if (MPFR_UNLIKELY (_size * (num) > MPFR_GROUP_STATIC_SIZE)) \ { \ (g).alloc = (num) * _size * sizeof (mp_limb_t); \ @@ -1561,7 +1566,7 @@ struct mpfr_group_t { MPFR_ASSERTD (_prec >= MPFR_PREC_MIN); \ if (MPFR_UNLIKELY (_prec > MPFR_PREC_MAX)) \ mpfr_abort_prec_max (); \ - _size = (mp_prec_t) (_prec + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB; \ + _size = (mp_prec_t) (_prec + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; \ (g).alloc = (num) * _size * sizeof (mp_limb_t); \ if (MPFR_LIKELY (_oalloc == 0)) \ (g).mant = (mp_limb_t *) (*__gmp_allocate_func) ((g).alloc); \ @@ -1659,7 +1664,7 @@ __MPFR_DECLSPEC int mpfr_round_raw_4 _MPFR_PROTO ((mp_limb_t *, const mp_limb_t *, mp_prec_t, int, mp_prec_t, mpfr_rnd_t)); #define mpfr_round_raw2(xp, xn, neg, r, prec) \ - mpfr_round_raw_2((xp),(xn)*BITS_PER_MP_LIMB,(neg),(prec),(r)) + mpfr_round_raw_2((xp),(xn)*GMP_LIMB_BITS,(neg),(prec),(r)) __MPFR_DECLSPEC int mpfr_check _MPFR_PROTO ((mpfr_srcptr)); @@ -142,12 +142,12 @@ typedef struct { /* The represented number is _sign*(_d[k-1]/B+_d[k-2]/B^2+...+_d[0]/B^k)*2^_exp - where k=ceil(_mp_prec/BITS_PER_MP_LIMB) and B=2^BITS_PER_MP_LIMB. + where k=ceil(_mp_prec/GMP_LIMB_BITS) and B=2^GMP_LIMB_BITS. For the msb (most significant bit) normalized representation, we must have _d[k-1]>=B/2, unless the number is singular. - We must also have the last k*BITS_PER_MP_LIMB-_prec bits set to zero. + We must also have the last k*GMP_LIMB_BITS-_prec bits set to zero. */ typedef __mpfr_struct mpfr_t[1]; @@ -31,7 +31,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., that is: a*2^exp_r <= b^e <= 2^exp_r (a + 2^f), where a represents {a, n}, i.e. the integer - a[0] + a[1]*B + ... + a[n-1]*B^(n-1) where B=2^BITS_PER_MP_LIMB + a[0] + a[1]*B + ... + a[n-1]*B^(n-1) where B=2^GMP_LIMB_BITS Return -1 is the result is exact. Return -2 if an overflow occurred in the computation of exp_r. @@ -63,7 +63,7 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) B = (mp_limb_t) b; count_leading_zeros (h, B); - bits = BITS_PER_MP_LIMB - h; + bits = GMP_LIMB_BITS - h; B = B << h; h = - h; @@ -73,14 +73,14 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) a [n - 1] = B; MPN_ZERO (a, n - 1); /* initial exponent for A: invariant is A = {a, n} * 2^f */ - f = h - (n - 1) * BITS_PER_MP_LIMB; + f = h - (n - 1) * GMP_LIMB_BITS; /* determine number of bits in e */ count_leading_zeros (t, (mp_limb_t) e); - t = BITS_PER_MP_LIMB - t; /* number of bits of exponent e */ + t = GMP_LIMB_BITS - t; /* number of bits of exponent e */ - error = t; /* error <= BITS_PER_MP_LIMB */ + error = t; /* error <= GMP_LIMB_BITS */ MPN_ZERO (c, 2 * n); @@ -88,8 +88,8 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) { /* determine precision needed */ - bits = n * BITS_PER_MP_LIMB - mpn_scan1 (a, 0); - n1 = (n * BITS_PER_MP_LIMB - bits) / BITS_PER_MP_LIMB; + bits = n * GMP_LIMB_BITS - mpn_scan1 (a, 0); + n1 = (n * GMP_LIMB_BITS - bits) / GMP_LIMB_BITS; /* square of A : {c+2n1, 2(n-n1)} = {a+n1, n-n1}^2 */ mpn_sqr_n (c + 2 * n1, a + n1, n - n1); @@ -103,9 +103,9 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) MPFR_TMP_FREE(marker); return -2; } - /* FIXME: Could f = 2*f + n * BITS_PER_MP_LIMB be used? */ + /* FIXME: Could f = 2*f + n * GMP_LIMB_BITS be used? */ f = 2*f; - MPFR_SADD_OVERFLOW (f, f, n * BITS_PER_MP_LIMB, + MPFR_SADD_OVERFLOW (f, f, n * GMP_LIMB_BITS, mp_exp_t, mpfr_uexp_t, MPFR_EXP_MIN, MPFR_EXP_MAX, goto overflow, goto overflow); @@ -122,14 +122,14 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) MPN_COPY (a, c + n, n); if ((error == t) && (2 * n1 <= n) && - (mpn_scan1 (c + 2 * n1, 0) < (n - 2 * n1) * BITS_PER_MP_LIMB)) + (mpn_scan1 (c + 2 * n1, 0) < (n - 2 * n1) * GMP_LIMB_BITS)) error = i; if (e & ((mp_exp_t) 1 << i)) { /* multiply A by B */ c[2 * n - 1] = mpn_mul_1 (c + n - 1, a, n, B); - f += h + BITS_PER_MP_LIMB; + f += h + GMP_LIMB_BITS; if ((c[2 * n - 1] & MPFR_LIMB_HIGHBIT) == 0) { /* shift A by one bit to the left */ mpn_lshift (a, c + n, n, 1); @@ -153,7 +153,7 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) if (error == t) return -1; /* result is exact */ - else /* error <= t-2 <= BITS_PER_MP_LIMB-2 + else /* error <= t-2 <= GMP_LIMB_BITS-2 err_s_ab, err_s_a2 <= t-1 */ { /* if there are p loops after the first inexact result, with @@ -163,11 +163,11 @@ mpfr_mpn_exp (mp_limb_t *a, mp_exp_t *exp_r, int b, mp_exp_t e, size_t n) */ error = error + err_s_ab + err_s_a2 / 2 + 3; /* <= 5t/2-1/2 */ #if 0 - if ((error - 1) >= ((n * BITS_PER_MP_LIMB - 1) / 2)) - error = n * BITS_PER_MP_LIMB; /* result is completely wrong: + if ((error - 1) >= ((n * GMP_LIMB_BITS - 1) / 2)) + error = n * GMP_LIMB_BITS; /* result is completely wrong: this is very unlikely since error is at most 5/2*log_2(e), and - n * BITS_PER_MP_LIMB is at least + n * GMP_LIMB_BITS is at least 3*log_2(e) */ #endif return error; @@ -98,10 +98,10 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPFR_ASSERTD(bq+cq > bq); /* PREC_MAX is /2 so no integer overflow */ - bn = (bq+BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; /* number of limbs of b */ - cn = (cq+BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; /* number of limbs of c */ + bn = (bq+GMP_LIMB_BITS-1)/GMP_LIMB_BITS; /* number of limbs of b */ + cn = (cq+GMP_LIMB_BITS-1)/GMP_LIMB_BITS; /* number of limbs of c */ k = bn + cn; /* effective nb of limbs used by b*c (= tn or tn+1) below */ - tn = (bq + cq + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB; + tn = (bq + cq + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; /* <= k, thus no int overflow */ MPFR_ASSERTD(tn <= k); @@ -116,8 +116,8 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) : mpn_mul (tmp, MPFR_MANT(c), cn, MPFR_MANT(b), bn); /* now tmp[0]..tmp[k-1] contains the product of both mantissa, - with tmp[k-1]>=2^(BITS_PER_MP_LIMB-2) */ - b1 >>= BITS_PER_MP_LIMB - 1; /* msb from the product */ + with tmp[k-1]>=2^(GMP_LIMB_BITS-2) */ + b1 >>= GMP_LIMB_BITS - 1; /* msb from the product */ /* if the mantissas of b and c are uniformly distributed in ]1/2, 1], then their product is in ]1/4, 1/2] with probability 2*ln(2)-1 ~ 0.386 @@ -283,10 +283,10 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPFR_ASSERTD (bq+cq > bq); /* PREC_MAX is /2 so no integer overflow */ - bn = (bq+BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; /* number of limbs of b */ - cn = (cq+BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB; /* number of limbs of c */ + bn = (bq+GMP_LIMB_BITS-1)/GMP_LIMB_BITS; /* number of limbs of b */ + cn = (cq+GMP_LIMB_BITS-1)/GMP_LIMB_BITS; /* number of limbs of c */ k = bn + cn; /* effective nb of limbs used by b*c (= tn or tn+1) below */ - tn = (bq + cq + BITS_PER_MP_LIMB - 1) / BITS_PER_MP_LIMB; + tn = (bq + cq + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS; MPFR_ASSERTD (tn <= k); /* tn <= k, thus no int overflow */ /* Check for no size_t overflow*/ @@ -339,7 +339,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) tmp[3] += (tmp[2] < t1); b1 = tmp[3]; } - b1 >>= (BITS_PER_MP_LIMB - 1); + b1 >>= (GMP_LIMB_BITS - 1); tmp += k - tn; if (MPFR_UNLIKELY (b1 == 0)) mpn_lshift (tmp, tmp, tn, 1); /* tn <= k, so no stack corruption */ @@ -383,12 +383,12 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) /* It is not the faster way, but it is safer */ MPFR_SET_SAME_SIGN (b_tmp, b); MPFR_SET_EXP (b_tmp, MPFR_GET_EXP (b)); - MPFR_PREC (b_tmp) = bn * BITS_PER_MP_LIMB; + MPFR_PREC (b_tmp) = bn * GMP_LIMB_BITS; MPFR_MANT (b_tmp) = bp; MPFR_SET_SAME_SIGN (c_tmp, c); MPFR_SET_EXP (c_tmp, MPFR_GET_EXP (c)); - MPFR_PREC (c_tmp) = cn * BITS_PER_MP_LIMB; + MPFR_PREC (c_tmp) = cn * GMP_LIMB_BITS; MPFR_MANT (c_tmp) = cp; /* Call again mpfr_mul with the fixed arguments */ @@ -401,7 +401,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) n = MPFR_LIMB_SIZE (a) + 1; n = MIN (n, cn); MPFR_ASSERTD (n >= 1 && 2*n <= k && n <= cn && n <= bn); - p = n * BITS_PER_MP_LIMB - MPFR_INT_CEIL_LOG2 (n + 2); + p = n * GMP_LIMB_BITS - MPFR_INT_CEIL_LOG2 (n + 2); bp += bn - n; cp += cn - n; @@ -409,7 +409,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) We may lost 1 bit due to RNDN, 1 due to final shift. */ if (MPFR_UNLIKELY (MPFR_PREC (a) > p - 5)) { - if (MPFR_UNLIKELY (MPFR_PREC (a) > p - 5 + BITS_PER_MP_LIMB + if (MPFR_UNLIKELY (MPFR_PREC (a) > p - 5 + GMP_LIMB_BITS || bn <= MPFR_MUL_THRESHOLD+1)) { /* MulHigh can't produce a roundable result. */ @@ -436,7 +436,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) } /* We will compute with one extra limb */ n++; - p = n * BITS_PER_MP_LIMB - MPFR_INT_CEIL_LOG2 (n + 2); + p = n * GMP_LIMB_BITS - MPFR_INT_CEIL_LOG2 (n + 2); /* Due to some nasty reasons we can have only 4 bits */ MPFR_ASSERTD (MPFR_PREC (a) <= p - 4); @@ -450,8 +450,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) /* Compute an approximation of the product of b and c */ mpfr_mulhigh_n (tmp + k - 2 * n, bp, cp, n); /* now tmp[0]..tmp[k-1] contains the product of both mantissa, - with tmp[k-1]>=2^(BITS_PER_MP_LIMB-2) */ - b1 = tmp[k-1] >> (BITS_PER_MP_LIMB - 1); /* msb from the product */ + with tmp[k-1]>=2^(GMP_LIMB_BITS-2) */ + b1 = tmp[k-1] >> (GMP_LIMB_BITS - 1); /* msb from the product */ /* If the mantissas of b and c are uniformly distributed in (1/2, 1], then their product is in (1/4, 1/2] with probability 2*ln(2)-1 @@ -477,8 +477,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) b1 = mpn_mul (tmp, MPFR_MANT (b), bn, MPFR_MANT (c), cn); /* now tmp[0]..tmp[k-1] contains the product of both mantissa, - with tmp[k-1]>=2^(BITS_PER_MP_LIMB-2) */ - b1 >>= BITS_PER_MP_LIMB - 1; /* msb from the product */ + with tmp[k-1]>=2^(GMP_LIMB_BITS-2) */ + b1 >>= GMP_LIMB_BITS - 1; /* msb from the product */ /* if the mantissas of b and c are uniformly distributed in (1/2, 1], then their product is in (1/4, 1/2] with probability 2*ln(2)-1 @@ -101,13 +101,13 @@ mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode } /* now yp[xn], ..., yp[0] is msb-normalized too, and has at most - PREC(x) + (BITS_PER_MP_LIMB - cnt) non-zero bits */ - MPFR_RNDRAW (inexact, y, yp, (mp_prec_t) (xn + 1) * BITS_PER_MP_LIMB, + PREC(x) + (GMP_LIMB_BITS - cnt) non-zero bits */ + MPFR_RNDRAW (inexact, y, yp, (mp_prec_t) (xn + 1) * GMP_LIMB_BITS, rnd_mode, MPFR_SIGN (x), cnt -- ); MPFR_TMP_FREE (marker); - cnt = BITS_PER_MP_LIMB - cnt; + cnt = GMP_LIMB_BITS - cnt; if (MPFR_UNLIKELY (__gmpfr_emax < MPFR_EMAX_MIN + cnt || MPFR_GET_EXP (x) > __gmpfr_emax - cnt)) return mpfr_overflow (y, rnd_mode, MPFR_SIGN(x)); @@ -136,17 +136,17 @@ is_odd (mpfr_srcptr y) (b) all the 'z' bits are zero */ - prec = ((prec - 1) / BITS_PER_MP_LIMB + 1) * BITS_PER_MP_LIMB - expo; + prec = ((prec - 1) / GMP_LIMB_BITS + 1) * GMP_LIMB_BITS - expo; /* number of z+0 bits */ - yn = prec / BITS_PER_MP_LIMB; + yn = prec / GMP_LIMB_BITS; MPFR_ASSERTN(yn >= 0); /* yn is the index of limb containing the 't' bit */ yp = MPFR_MANT(y); - /* if expo is a multiple of BITS_PER_MP_LIMB, t is bit 0 */ - if (expo % BITS_PER_MP_LIMB == 0 ? (yp[yn] & 1) == 0 - : yp[yn] << ((expo % BITS_PER_MP_LIMB) - 1) != MPFR_LIMB_HIGHBIT) + /* if expo is a multiple of GMP_LIMB_BITS, t is bit 0 */ + if (expo % GMP_LIMB_BITS == 0 ? (yp[yn] & 1) == 0 + : yp[yn] << ((expo % GMP_LIMB_BITS) - 1) != MPFR_LIMB_HIGHBIT) return 0; while (--yn >= 0) if (yp[yn] != 0) @@ -150,7 +150,7 @@ mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd) abs_n = - (unsigned long) n; count_leading_zeros (size_n, (mp_limb_t) abs_n); - size_n = BITS_PER_MP_LIMB - size_n; + size_n = GMP_LIMB_BITS - size_n; /* initial working precision */ Ny = MPFR_PREC (y); @@ -87,7 +87,7 @@ mpfr_pow_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd) MPFR_SAVE_EXPO_MARK (expo); /* setup initial precision */ - prec = MPFR_PREC (y) + 3 + BITS_PER_MP_LIMB + prec = MPFR_PREC (y) + 3 + GMP_LIMB_BITS + MPFR_INT_CEIL_LOG2 (MPFR_PREC (y)); mpfr_init2 (res, prec); @@ -125,7 +125,7 @@ mpfr_pow_pos_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd, int cr) MPFR_ASSERTD (mpfr_cmp_si_2exp (x, MPFR_SIGN (x), MPFR_EXP (x) - 1) != 0); mpfr_init2 (y2, 2); - mpfr_init2 (zz, ABS (SIZ (z)) * BITS_PER_MP_LIMB); + mpfr_init2 (zz, ABS (SIZ (z)) * GMP_LIMB_BITS); inexact = mpfr_set_z (zz, z, MPFR_RNDN); MPFR_ASSERTN (inexact == 0); inexact = mpfr_pow_general (y2, x, zz, rnd, 1, @@ -328,7 +328,7 @@ mpfr_pow_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd) MPFR_ASSERTD (mpfr_cmp_si_2exp (x, MPFR_SIGN (x), MPFR_EXP (x) - 1) != 0); mpfr_init2 (y2, 2); - mpfr_init2 (zz, ABS (SIZ (z)) * BITS_PER_MP_LIMB); + mpfr_init2 (zz, ABS (SIZ (z)) * GMP_LIMB_BITS); inexact = mpfr_set_z (zz, z, MPFR_RNDN); MPFR_ASSERTN (inexact == 0); inexact = mpfr_pow_general (y2, x, zz, rnd, 1, diff --git a/powerof2.c b/powerof2.c index bae77cdc5..e2cd4549d 100644 --- a/powerof2.c +++ b/powerof2.c @@ -35,7 +35,7 @@ mpfr_powerof2_raw (mpfr_srcptr x) So we don't want to test if it is a pure FP. MPFR_ASSERTN(MPFR_IS_PURE_FP(x)); */ xp = MPFR_MANT(x); - xn = (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB; + xn = (MPFR_PREC(x) - 1) / GMP_LIMB_BITS; /*if (NOT_POW2(xp[xn]))*/ if (xp[xn] != MPFR_LIMB_HIGHBIT) return 0; diff --git a/print_raw.c b/print_raw.c index 437e7c646..02823cacd 100644 --- a/print_raw.c +++ b/print_raw.c @@ -49,7 +49,7 @@ mpfr_fprint_binary (FILE *stream, mpfr_srcptr x) px = MPFR_PREC (x); fprintf (stream, "0."); - for (n = (px - 1) / BITS_PER_MP_LIMB; ; n--) + for (n = (px - 1) / GMP_LIMB_BITS; ; n--) { mp_limb_t wd, t; @@ -84,12 +84,12 @@ mpfr_print_mant_binary(const char *str, const mp_limb_t *p, mp_prec_t r) int i; mp_prec_t count = 0; char c; - mp_size_t n = (r - 1) / BITS_PER_MP_LIMB + 1; + mp_size_t n = (r - 1) / GMP_LIMB_BITS + 1; printf("%s ", str); for(n-- ; n>=0 ; n--) { - for(i = BITS_PER_MP_LIMB-1 ; i >=0 ; i--) + for(i = GMP_LIMB_BITS-1 ; i >=0 ; i--) { c = (p[n] & (((mp_limb_t)1L)<<i)) ? '1' : '0'; putchar(c); @@ -109,11 +109,11 @@ mpfr_dump_mant (const mp_limb_t *p, mp_prec_t r, mp_prec_t precx, int i; mp_prec_t count = 0; char c; - mp_size_t n = (r - 1) / BITS_PER_MP_LIMB + 1; + mp_size_t n = (r - 1) / GMP_LIMB_BITS + 1; for(n-- ; n>=0 ; n--) { - for(i = BITS_PER_MP_LIMB-1 ; i >=0 ; i--) + for(i = GMP_LIMB_BITS-1 ; i >=0 ; i--) { c = (p[n] & (((mp_limb_t)1L)<<i)) ? '1' : '0'; putchar(c); diff --git a/rec_sqrt.c b/rec_sqrt.c index de497a46f..9d4e645d9 100644 --- a/rec_sqrt.c +++ b/rec_sqrt.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_NEED_LONGLONG_H /* for umul_ppmm */ #include "mpfr-impl.h" -#define LIMB_SIZE(x) ((((x)-1)>>MPFR_LOG2_BITS_PER_MP_LIMB) + 1) +#define LIMB_SIZE(x) ((((x)-1)>>MPFR_LOG2_GMP_LIMB_BITS) + 1) #define MPFR_COM_N(x,y,n) \ { \ @@ -209,7 +209,7 @@ mpfr_mpn_rec_sqrt (mp_ptr x, mp_prec_t p, thus the h-3 most significant bits of t should be zero, which is in fact h+1+as-3 because of the normalization of A. This corresponds to th=floor((h+1+as-3)/GMP_NUMB_BITS) limbs. */ - th = (h + 1 + as - 3) >> MPFR_LOG2_BITS_PER_MP_LIMB; + th = (h + 1 + as - 3) >> MPFR_LOG2_GMP_LIMB_BITS; tn = LIMB_SIZE(2 * h + 1 + as); /* we need h+1+as bits of a */ @@ -487,8 +487,8 @@ mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) up to a full limb to maximize the chance of rounding, while avoiding to allocate extra space */ wp = rp + 11; - if (wp < rn * BITS_PER_MP_LIMB) - wp = rn * BITS_PER_MP_LIMB; + if (wp < rn * GMP_LIMB_BITS) + wp = rn * GMP_LIMB_BITS; for (;;) { MPFR_TMP_MARK (marker); @@ -511,7 +511,7 @@ mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) mantissa is exactly 1/2 and the exponent is odd. */ if (s == 0 && mpfr_cmp_ui_2exp (u, 1, MPFR_EXP(u) - 1) == 0) { - mp_prec_t pl = wn * BITS_PER_MP_LIMB - wp; + mp_prec_t pl = wn * GMP_LIMB_BITS - wp; /* we should have x=111...111 */ mpn_add_1 (x, x, wn, MPFR_LIMB_ONE << pl); @@ -521,7 +521,7 @@ mpfr_rec_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) } MPFR_TMP_FREE(marker); - wp += BITS_PER_MP_LIMB; + wp += GMP_LIMB_BITS; } cy = mpfr_round_raw (MPFR_MANT(r), x, wp, 0, rp, rnd_mode, &inex); MPFR_EXP(r) = - (MPFR_EXP(u) - 1 - s) / 2; @@ -81,7 +81,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) mp_size_t rm; rp = MPFR_MANT(r); - rm = (MPFR_PREC(r) - 1) / BITS_PER_MP_LIMB; + rm = (MPFR_PREC(r) - 1) / GMP_LIMB_BITS; rp[rm] = MPFR_LIMB_HIGHBIT; MPN_ZERO(rp, rm); MPFR_SET_EXP (r, 1); /* |r| = 1 */ @@ -116,7 +116,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) MPFR_SET_EXP (r, exp); /* Does nothing if r==u */ - if ((exp - 1) / BITS_PER_MP_LIMB >= un) + if ((exp - 1) / GMP_LIMB_BITS >= un) { ui = un; idiff = 0; @@ -126,10 +126,10 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) { mp_size_t uj; - ui = (exp - 1) / BITS_PER_MP_LIMB + 1; /* #limbs of the int part */ + ui = (exp - 1) / GMP_LIMB_BITS + 1; /* #limbs of the int part */ MPFR_ASSERTD (un >= ui); uj = un - ui; /* lowest limb of the integer part */ - idiff = exp % BITS_PER_MP_LIMB; /* #int-part bits in up[uj] or 0 */ + idiff = exp % GMP_LIMB_BITS; /* #int-part bits in up[uj] or 0 */ uflags = idiff == 0 || (up[uj] << idiff) == 0 ? 0 : 2; if (uflags == 0) @@ -186,7 +186,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) } if (uflags == 0) { /* u is an integer; determine if it is representable in r */ - if (sh != 0 && rp[0] << (BITS_PER_MP_LIMB - sh) != 0) + if (sh != 0 && rp[0] << (GMP_LIMB_BITS - sh) != 0) uflags = 1; /* u is not representable in r */ else { @@ -216,7 +216,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) rn = ui; /* number of fractional bits in whole rp[0] */ - ush = idiff == 0 ? 0 : BITS_PER_MP_LIMB - idiff; + ush = idiff == 0 ? 0 : GMP_LIMB_BITS - idiff; if (rj == 0 && ush < sh) { @@ -62,14 +62,14 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) mp_limb_t tmp, mask; int s; - err = (mp_prec_t) bn * BITS_PER_MP_LIMB; + err = (mp_prec_t) bn * GMP_LIMB_BITS; if (MPFR_UNLIKELY (err0 <= 0 || (mpfr_uexp_t) err0 <= prec || prec >= err)) return 0; /* can't round */ err = MIN (err, (mpfr_uexp_t) err0); - k = prec / BITS_PER_MP_LIMB; - s = BITS_PER_MP_LIMB - prec%BITS_PER_MP_LIMB; - n = err / BITS_PER_MP_LIMB - k; + k = prec / GMP_LIMB_BITS; + s = GMP_LIMB_BITS - prec%GMP_LIMB_BITS; + n = err / GMP_LIMB_BITS - k; MPFR_ASSERTD (n >= 0); MPFR_ASSERTD (bn > k); @@ -77,14 +77,14 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) /* Check first limb */ bp += bn-1-k; tmp = *bp--; - mask = s == BITS_PER_MP_LIMB ? MP_LIMB_T_MAX : MPFR_LIMB_MASK (s); + mask = s == GMP_LIMB_BITS ? MP_LIMB_T_MAX : MPFR_LIMB_MASK (s); tmp &= mask; if (MPFR_LIKELY (n == 0)) { /* prec and error are in the same limb */ - s = BITS_PER_MP_LIMB - err % BITS_PER_MP_LIMB; - MPFR_ASSERTD (s < BITS_PER_MP_LIMB); + s = GMP_LIMB_BITS - err % GMP_LIMB_BITS; + MPFR_ASSERTD (s < GMP_LIMB_BITS); tmp >>= s; mask >>= s; return tmp != 0 && tmp != mask; @@ -96,8 +96,8 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) if (*bp-- != 0) return 1; /* Check if final error limb is 0 */ - s = BITS_PER_MP_LIMB - err % BITS_PER_MP_LIMB; - if (s == BITS_PER_MP_LIMB) + s = GMP_LIMB_BITS - err % GMP_LIMB_BITS; + if (s == GMP_LIMB_BITS) return 0; tmp = *bp >> s; return tmp != 0; @@ -109,8 +109,8 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mp_exp_t err0, mp_prec_t prec) if (*bp-- != MP_LIMB_T_MAX) return 1; /* Check if final error limb is 0 */ - s = BITS_PER_MP_LIMB - err % BITS_PER_MP_LIMB; - if (s == BITS_PER_MP_LIMB) + s = GMP_LIMB_BITS - err % GMP_LIMB_BITS; + if (s == GMP_LIMB_BITS) return 0; tmp = *bp >> s; return tmp != (MP_LIMB_T_MAX >> s); diff --git a/round_prec.c b/round_prec.c index d73e5108e..994ba372d 100644 --- a/round_prec.c +++ b/round_prec.c @@ -55,7 +55,7 @@ mpfr_prec_round (mpfr_ptr x, mp_prec_t prec, mpfr_rnd_t rnd_mode) MPFR_ASSERTN(prec >= MPFR_PREC_MIN && prec <= MPFR_PREC_MAX); - nw = 1 + (prec - 1) / BITS_PER_MP_LIMB; /* needed allocated limbs */ + nw = 1 + (prec - 1) / GMP_LIMB_BITS; /* needed allocated limbs */ /* check if x has enough allocated space for the mantissa */ ow = MPFR_GET_ALLOC_SIZE(x); @@ -108,7 +108,7 @@ mpfr_prec_round (mpfr_ptr x, mp_prec_t prec, mpfr_rnd_t rnd_mode) return inexact; } -/* assumption: BITS_PER_MP_LIMB is a power of 2 */ +/* assumption: GMP_LIMB_BITS is a power of 2 */ /* assuming b is an approximation to x in direction rnd1 with error at most 2^(MPFR_EXP(b)-err), returns 1 if one is able to round exactly @@ -141,7 +141,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, if (MPFR_UNLIKELY(err0 < 0 || (mpfr_uexp_t) err0 <= prec)) return 0; /* can't round */ - else if (MPFR_UNLIKELY (prec > (mp_prec_t) bn * BITS_PER_MP_LIMB)) + else if (MPFR_UNLIKELY (prec > (mp_prec_t) bn * GMP_LIMB_BITS)) { /* then ulp(b) < precision < error */ return rnd2 == MPFR_RNDN && (mpfr_uexp_t) err0 - 2 >= prec; /* can round only in rounding to the nearest and err0 >= prec + 2 */ @@ -152,23 +152,23 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mp_exp_t err0, /* if the error is smaller than ulp(b), then anyway it will propagate up to ulp(b) */ - err = ((mpfr_uexp_t) err0 > (mp_prec_t) bn * BITS_PER_MP_LIMB) ? - (mp_prec_t) bn * BITS_PER_MP_LIMB : (mp_prec_t) err0; + err = ((mpfr_uexp_t) err0 > (mp_prec_t) bn * GMP_LIMB_BITS) ? + (mp_prec_t) bn * GMP_LIMB_BITS : (mp_prec_t) err0; - /* warning: if k = m*BITS_PER_MP_LIMB, consider limb m-1 and not m */ - k = (err - 1) / BITS_PER_MP_LIMB; + /* warning: if k = m*GMP_LIMB_BITS, consider limb m-1 and not m */ + k = (err - 1) / GMP_LIMB_BITS; MPFR_UNSIGNED_MINUS_MODULO(s, err); /* the error corresponds to bit s in limb k, the most significant limb being limb 0 */ - k1 = (prec - 1) / BITS_PER_MP_LIMB; + k1 = (prec - 1) / GMP_LIMB_BITS; MPFR_UNSIGNED_MINUS_MODULO(s1, prec); /* the last significant bit is bit s1 in limb k1 */ /* don't need to consider the k1 most significant limbs */ k -= k1; bn -= k1; - prec -= (mp_prec_t) k1 * BITS_PER_MP_LIMB; + prec -= (mp_prec_t) k1 * GMP_LIMB_BITS; /* if when adding or subtracting (1 << s) in bp[bn-1-k], it does not change bp[bn-1] >> s1, then we can round */ diff --git a/round_raw_generic.c b/round_raw_generic.c index 151c7d94b..c7cddf16a 100644 --- a/round_raw_generic.c +++ b/round_raw_generic.c @@ -80,9 +80,9 @@ mpfr_round_raw_generic( (xprec <= yprec || MPFR_IS_LIKE_RNDZ (rnd_mode, neg))) return 0; - xsize = (xprec-1)/BITS_PER_MP_LIMB + 1; - nw = yprec / BITS_PER_MP_LIMB; - rw = yprec & (BITS_PER_MP_LIMB - 1); + xsize = (xprec-1)/GMP_LIMB_BITS + 1; + nw = yprec / GMP_LIMB_BITS; + rw = yprec & (GMP_LIMB_BITS - 1); if (MPFR_UNLIKELY(xprec <= yprec)) { /* No rounding is necessary. */ @@ -107,7 +107,7 @@ mpfr_round_raw_generic( if (MPFR_LIKELY(rw)) { nw++; - lomask = MPFR_LIMB_MASK (BITS_PER_MP_LIMB - rw); + lomask = MPFR_LIMB_MASK (GMP_LIMB_BITS - rw); himask = ~lomask; } else @@ -121,7 +121,7 @@ mpfr_round_raw_generic( if (MPFR_LIKELY( rnd_mode == MPFR_RNDN) ) { /* Rounding to nearest */ - mp_limb_t rbmask = MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - 1 - rw); + mp_limb_t rbmask = MPFR_LIMB_ONE << (GMP_LIMB_BITS - 1 - rw); if (sb & rbmask) /* rounding bit */ sb &= ~rbmask; /* it is 1, clear it */ else @@ -171,7 +171,7 @@ mpfr_round_raw_generic( #else carry = mpn_add_1 (yp, xp + xsize - nw, nw, rw ? - MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - rw) + MPFR_LIMB_ONE << (GMP_LIMB_BITS - rw) : MPFR_LIMB_ONE); yp[0] &= himask; return carry; @@ -226,7 +226,7 @@ mpfr_round_raw_generic( return 1; #else carry = mpn_add_1(yp, xp + xsize - nw, nw, - rw ? MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - rw) + rw ? MPFR_LIMB_ONE << (GMP_LIMB_BITS - rw) : 1); yp[0] &= himask; return carry; @@ -243,7 +243,7 @@ mpfr_round_raw_generic( if (MPFR_LIKELY(rw)) { nw++; - himask = ~MPFR_LIMB_MASK (BITS_PER_MP_LIMB - rw); + himask = ~MPFR_LIMB_MASK (GMP_LIMB_BITS - rw); } else himask = ~(mp_limb_t) 0; @@ -49,7 +49,7 @@ mpfr_set4 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, int signb) * just copy the mantissa, and set the exponent and the sign * The result is exact. */ MPN_COPY (MPFR_MANT (a), MPFR_MANT (b), - (MPFR_PREC (b) + BITS_PER_MP_LIMB-1)/BITS_PER_MP_LIMB); + (MPFR_PREC (b) + GMP_LIMB_BITS-1)/GMP_LIMB_BITS); MPFR_RET (0); } else @@ -26,22 +26,22 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_NEED_LONGLONG_H #include "mpfr-impl.h" -/* extracts the bits of d in rp[0..n-1] where n=ceil(53/BITS_PER_MP_LIMB). +/* extracts the bits of d in rp[0..n-1] where n=ceil(53/GMP_LIMB_BITS). Assumes d is neither 0 nor NaN nor Inf. */ static long __gmpfr_extract_double (mp_ptr rp, double d) - /* e=0 iff BITS_PER_MP_LIMB=32 and rp has only one limb */ + /* e=0 iff GMP_LIMB_BITS=32 and rp has only one limb */ { long exp; mp_limb_t manl; -#if BITS_PER_MP_LIMB == 32 +#if GMP_LIMB_BITS == 32 mp_limb_t manh; #endif /* BUGS 1. Should handle Inf and NaN in IEEE specific code. 2. Handle Inf and NaN also in default code, to avoid hangs. - 3. Generalize to handle all BITS_PER_MP_LIMB. + 3. Generalize to handle all GMP_LIMB_BITS. 4. This lits is incomplete and misspelled. */ @@ -58,7 +58,7 @@ __gmpfr_extract_double (mp_ptr rp, double d) exp = x.s.exp; if (exp) { -#if BITS_PER_MP_LIMB >= 64 +#if GMP_LIMB_BITS >= 64 manl = ((MPFR_LIMB_ONE << 63) | ((mp_limb_t) x.s.manh << 43) | ((mp_limb_t) x.s.manl << 11)); #else @@ -68,7 +68,7 @@ __gmpfr_extract_double (mp_ptr rp, double d) } else /* denormalized number */ { -#if BITS_PER_MP_LIMB >= 64 +#if GMP_LIMB_BITS >= 64 manl = ((mp_limb_t) x.s.manh << 43) | ((mp_limb_t) x.s.manl << 11); #else manh = (x.s.manh << 11) /* high 21 bits */ @@ -117,7 +117,7 @@ __gmpfr_extract_double (mp_ptr rp, double d) } d *= MP_BASE_AS_DOUBLE; -#if BITS_PER_MP_LIMB >= 64 +#if GMP_LIMB_BITS >= 64 manl = d; #else manh = (mp_limb_t) d; @@ -127,7 +127,7 @@ __gmpfr_extract_double (mp_ptr rp, double d) #endif /* _GMP_IEEE_FLOATS */ -#if BITS_PER_MP_LIMB >= 64 +#if GMP_LIMB_BITS >= 64 rp[0] = manl; #else rp[1] = manh; @@ -242,7 +242,7 @@ mpfr_set_d (mpfr_ptr r, double d, mpfr_rnd_t rnd_mode) MPN_ZERO (tmpmant, k); /* don't use MPFR_SET_EXP here since the exponent may be out of range */ - MPFR_EXP(tmp) -= (mp_exp_t) (cnt + k * BITS_PER_MP_LIMB); + MPFR_EXP(tmp) -= (mp_exp_t) (cnt + k * GMP_LIMB_BITS); /* tmp is exact since PREC(tmp)=53 */ inexact = mpfr_set4 (r, tmp, rnd_mode, signd); @@ -185,7 +185,7 @@ decimal64_to_string (char *s, _Decimal64 d) rp[1] &= 524287; /* 2^19-1: cancel G[11] */ rp[1] |= 2097152; /* add 2^21 */ } -#if BITS_PER_MP_LIMB >= 54 +#if GMP_LIMB_BITS >= 54 rp[0] |= rp[1] << 32; rn = 1; #endif @@ -43,7 +43,7 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) if (SIZ(x) * MPFR_FROM_SIGN_TO_INT(MPFR_SIGN(y)) < 0) MPFR_CHANGE_SIGN (y); - sy = 1 + (MPFR_PREC(y) - 1) / BITS_PER_MP_LIMB; + sy = 1 + (MPFR_PREC(y) - 1) / GMP_LIMB_BITS; my = MPFR_MANT(y); mx = PTR(x); @@ -51,7 +51,7 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) if (sy <= sx) /* we may have to round even when sy = sx */ { - unsigned long xprec = sx * BITS_PER_MP_LIMB; + unsigned long xprec = sx * GMP_LIMB_BITS; MPFR_TMP_MARK(marker); tmp = (mp_limb_t*) MPFR_TMP_ALLOC(sx * BYTES_PER_MP_LIMB); @@ -78,21 +78,21 @@ mpfr_set_f (mpfr_ptr y, mpf_srcptr x, mpfr_rnd_t rnd_mode) inexact = 0; } - /* warning: EXP(x) * BITS_PER_MP_LIMB may exceed the maximal exponent */ - if (EXP(x) > 1 + (__gmpfr_emax - 1) / BITS_PER_MP_LIMB) + /* warning: EXP(x) * GMP_LIMB_BITS may exceed the maximal exponent */ + if (EXP(x) > 1 + (__gmpfr_emax - 1) / GMP_LIMB_BITS) { - /* EXP(x) >= 2 + floor((__gmpfr_emax-1)/BITS_PER_MP_LIMB) - EXP(x) >= 2 + (__gmpfr_emax - BITS_PER_MP_LIMB) / BITS_PER_MP_LIMB - >= 1 + __gmpfr_emax / BITS_PER_MP_LIMB - EXP(x) * BITS_PER_MP_LIMB >= __gmpfr_emax + BITS_PER_MP_LIMB - Since 0 <= cnt <= BITS_PER_MP_LIMB-1, and 0 <= carry <= 1, - we have then EXP(x) * BITS_PER_MP_LIMB - cnt + carry > __gmpfr_emax */ + /* EXP(x) >= 2 + floor((__gmpfr_emax-1)/GMP_LIMB_BITS) + EXP(x) >= 2 + (__gmpfr_emax - GMP_LIMB_BITS) / GMP_LIMB_BITS + >= 1 + __gmpfr_emax / GMP_LIMB_BITS + EXP(x) * GMP_LIMB_BITS >= __gmpfr_emax + GMP_LIMB_BITS + Since 0 <= cnt <= GMP_LIMB_BITS-1, and 0 <= carry <= 1, + we have then EXP(x) * GMP_LIMB_BITS - cnt + carry > __gmpfr_emax */ return mpfr_overflow (y, rnd_mode, MPFR_SIGN (y)); } else { /* Do not use MPFR_SET_EXP as the exponent may be out of range. */ - MPFR_EXP (y) = EXP (x) * BITS_PER_MP_LIMB - (mp_exp_t) cnt + carry; + MPFR_EXP (y) = EXP (x) * GMP_LIMB_BITS - (mp_exp_t) cnt + carry; } return mpfr_check_range (y, inexact, rnd_mode); @@ -198,8 +198,8 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode) /* Since mpfr_add was inexact, the sticky bit is 1. */ tp = MPFR_MANT (t); rb_mask = MPFR_LIMB_ONE << - (BITS_PER_MP_LIMB - 1 - - (MPFR_PREC (r) & (BITS_PER_MP_LIMB - 1))); + (GMP_LIMB_BITS - 1 - + (MPFR_PREC (r) & (GMP_LIMB_BITS - 1))); if (rnd_mode == MPFR_RNDN) rnd_mode = (*tp & rb_mask) ^ MPFR_IS_NEG (t) ? MPFR_RNDU : MPFR_RNDD; @@ -283,7 +283,7 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode) } /* Extract mantissa */ -#if BITS_PER_MP_LIMB >= 64 +#if GMP_LIMB_BITS >= 64 tmpmant[0] = ((mp_limb_t) x.s.manh << 32) | ((mp_limb_t) x.s.manl); #else tmpmant[0] = (mp_limb_t) x.s.manl; @@ -309,7 +309,7 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode) else exp -= 0x3FFE; - MPFR_SET_EXP (tmp, exp - cnt - k * BITS_PER_MP_LIMB); + MPFR_SET_EXP (tmp, exp - cnt - k * GMP_LIMB_BITS); /* tmp is exact */ inexact = mpfr_set4 (r, tmp, rnd_mode, signd); diff --git a/set_prc_raw.c b/set_prc_raw.c index 2c3a340f3..981bf8787 100644 --- a/set_prc_raw.c +++ b/set_prc_raw.c @@ -26,6 +26,6 @@ void mpfr_set_prec_raw (mpfr_ptr x, mpfr_prec_t p) { MPFR_ASSERTN (p >= MPFR_PREC_MIN && p <= MPFR_PREC_MAX); - MPFR_ASSERTN (p <= (mpfr_prec_t) MPFR_GET_ALLOC_SIZE(x) * BITS_PER_MP_LIMB); + MPFR_ASSERTN (p <= (mpfr_prec_t) MPFR_GET_ALLOC_SIZE(x) * GMP_LIMB_BITS); MPFR_PREC(x) = p; } diff --git a/set_prec.c b/set_prec.c index 4bba22876..221fc63b4 100644 --- a/set_prec.c +++ b/set_prec.c @@ -32,7 +32,7 @@ mpfr_set_prec (mpfr_ptr x, mpfr_prec_t p) MPFR_ASSERTN (p >= MPFR_PREC_MIN && p <= MPFR_PREC_MAX); /* Calculate the new number of limbs */ - xsize = (p - 1) / BITS_PER_MP_LIMB + 1; + xsize = (p - 1) / GMP_LIMB_BITS + 1; /* Realloc only if the new size is greater than the old */ xoldsize = MPFR_GET_ALLOC_SIZE (x); @@ -43,7 +43,7 @@ set_z (mpfr_ptr f, mpz_srcptr z, mp_size_t *zs) /* Get working precision */ count_leading_zeros (c, p[s-1]); - pf = s * BITS_PER_MP_LIMB - c; + pf = s * GMP_LIMB_BITS - c; if (pf < MPFR_PREC_MIN) pf = MPFR_PREC_MIN; mpfr_init2 (f, pf); @@ -102,12 +102,12 @@ mpfr_set_q (mpfr_ptr f, mpq_srcptr q, mpfr_rnd_t rnd) cd = set_z (d, den, &sd); sn -= sd; - if (MPFR_UNLIKELY (sn > MPFR_EMAX_MAX / BITS_PER_MP_LIMB)) + if (MPFR_UNLIKELY (sn > MPFR_EMAX_MAX / GMP_LIMB_BITS)) { inexact = mpfr_overflow (f, rnd, MPFR_SIGN (f)); goto end; } - if (MPFR_UNLIKELY (sn < MPFR_EMIN_MIN / BITS_PER_MP_LIMB -1)) + if (MPFR_UNLIKELY (sn < MPFR_EMIN_MIN / GMP_LIMB_BITS -1)) { if (rnd == MPFR_RNDN) rnd = MPFR_RNDZ; @@ -116,8 +116,8 @@ mpfr_set_q (mpfr_ptr f, mpq_srcptr q, mpfr_rnd_t rnd) } inexact = mpfr_div (f, n, d, rnd); - shift = BITS_PER_MP_LIMB*sn+cn-cd; - MPFR_ASSERTD (shift == BITS_PER_MP_LIMB*sn+cn-cd); + shift = GMP_LIMB_BITS*sn+cn-cd; + MPFR_ASSERTD (shift == GMP_LIMB_BITS*sn+cn-cd); cd = mpfr_mul_2si (f, f, shift, rnd); MPFR_SAVE_EXPO_FREE (expo); if (MPFR_UNLIKELY (cd != 0)) diff --git a/set_si_2exp.c b/set_si_2exp.c index d28b407b6..c5c9b25ef 100644 --- a/set_si_2exp.c +++ b/set_si_2exp.c @@ -45,9 +45,9 @@ mpfr_set_si_2exp (mpfr_ptr x, long i, mp_exp_t e, mpfr_rnd_t rnd_mode) MPFR_ASSERTN (SAFE_ABS (unsigned long, i) == ai); /* Position of the highest limb */ - xn = (MPFR_PREC (x) - 1) / BITS_PER_MP_LIMB; + xn = (MPFR_PREC (x) - 1) / GMP_LIMB_BITS; count_leading_zeros (cnt, ai); - MPFR_ASSERTD (cnt < BITS_PER_MP_LIMB); /* OK since i != 0 */ + MPFR_ASSERTD (cnt < GMP_LIMB_BITS); /* OK since i != 0 */ xp = MPFR_MANT(x); xp[xn] = ai << cnt; @@ -55,7 +55,7 @@ mpfr_set_si_2exp (mpfr_ptr x, long i, mp_exp_t e, mpfr_rnd_t rnd_mode) MPN_ZERO(xp, xn); MPFR_SET_SIGN (x, i < 0 ? MPFR_SIGN_NEG : MPFR_SIGN_POS); - nbits = BITS_PER_MP_LIMB - cnt; + nbits = GMP_LIMB_BITS - cnt; e += nbits; /* exponent _before_ the rounding */ /* round if MPFR_PREC(x) smaller than length of i */ diff --git a/set_ui_2exp.c b/set_ui_2exp.c index 706dd0f5b..f9843d835 100644 --- a/set_ui_2exp.c +++ b/set_ui_2exp.c @@ -45,16 +45,16 @@ mpfr_set_ui_2exp (mpfr_ptr x, unsigned long i, mp_exp_t e, mpfr_rnd_t rnd_mode) MPFR_ASSERTD (i == (mp_limb_t) i); /* Position of the highest limb */ - xn = (MPFR_PREC (x) - 1) / BITS_PER_MP_LIMB; + xn = (MPFR_PREC (x) - 1) / GMP_LIMB_BITS; count_leading_zeros (cnt, (mp_limb_t) i); - MPFR_ASSERTD (cnt < BITS_PER_MP_LIMB); /* OK since i != 0 */ + MPFR_ASSERTD (cnt < GMP_LIMB_BITS); /* OK since i != 0 */ xp = MPFR_MANT(x); xp[xn] = ((mp_limb_t) i) << cnt; /* Zero the xn lower limbs. */ MPN_ZERO(xp, xn); - nbits = BITS_PER_MP_LIMB - cnt; + nbits = GMP_LIMB_BITS - cnt; e += nbits; /* exponent _before_ the rounding */ /* round if MPFR_PREC(x) smaller than length of i */ @@ -59,7 +59,7 @@ mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd) mp_limb_t yp[sizeof(uintmax_t) / sizeof(mp_limb_t)]; mpfr_t y; unsigned long uintmax_bit_size = sizeof(uintmax_t) * CHAR_BIT; - unsigned long bpml = BITS_PER_MP_LIMB % uintmax_bit_size; + unsigned long bpml = GMP_LIMB_BITS % uintmax_bit_size; /* Special case */ if (j == 0) @@ -78,9 +78,9 @@ mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd) limb = yp[0] = j; else { - /* Note: either BITS_PER_MP_LIMB = uintmax_bit_size, then k = 1 the - shift j >>= bpml is never done, or BITS_PER_MP_LIMB < uintmax_bit_size - and bpml = BITS_PER_MP_LIMB. */ + /* Note: either GMP_LIMB_BITS = uintmax_bit_size, then k = 1 the + shift j >>= bpml is never done, or GMP_LIMB_BITS < uintmax_bit_size + and bpml = GMP_LIMB_BITS. */ for (i = 0; i < k; i++, j >>= bpml) yp[i] = j; /* Only the low bits are copied */ @@ -110,7 +110,7 @@ mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd) else MPN_ZERO (yp, len); /* Zeroing the last limbs */ } - e += k * BITS_PER_MP_LIMB - cnt; /* Update Expo */ + e += k * GMP_LIMB_BITS - cnt; /* Update Expo */ MPFR_ASSERTD (MPFR_LIMB_MSB(yp[numberof (yp) - 1]) != 0); /* Check expo underflow / overflow (can't use mpfr_check_range) */ @@ -43,7 +43,7 @@ mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mpfr_rnd_t rnd_mode) zn = ABS(SIZ(z)); MPFR_ASSERTD (zn >= 1); - if (MPFR_UNLIKELY (zn > MPFR_EMAX_MAX / BITS_PER_MP_LIMB + 1)) + if (MPFR_UNLIKELY (zn > MPFR_EMAX_MAX / GMP_LIMB_BITS + 1)) return mpfr_overflow (f, rnd_mode, sign_z); fp = MPFR_MANT (f); @@ -51,15 +51,15 @@ mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mpfr_rnd_t rnd_mode) dif = zn - fn; zp = PTR(z); count_leading_zeros (k, zp[zn-1]); - /* because zn >= __gmpfr_emax / BITS_PER_MP_LIMB + 2 - and zn * BITS_PER_MP_LIMB >= __gmpfr_emax + BITS_PER_MP_LIMB + 1 - and exp = zn * BITS_PER_MP_LIMB - k > __gmpfr_emax */ - - /* now zn <= MPFR_EMAX_MAX / BITS_PER_MP_LIMB + 1 - thus zn * BITS_PER_MP_LIMB <= MPFR_EMAX_MAX + BITS_PER_MP_LIMB - and exp = zn * BITS_PER_MP_LIMB - k - <= MPFR_EMAX_MAX + BITS_PER_MP_LIMB */ - exp = (mp_prec_t) zn * BITS_PER_MP_LIMB - k; + /* because zn >= __gmpfr_emax / GMP_LIMB_BITS + 2 + and zn * GMP_LIMB_BITS >= __gmpfr_emax + GMP_LIMB_BITS + 1 + and exp = zn * GMP_LIMB_BITS - k > __gmpfr_emax */ + + /* now zn <= MPFR_EMAX_MAX / GMP_LIMB_BITS + 1 + thus zn * GMP_LIMB_BITS <= MPFR_EMAX_MAX + GMP_LIMB_BITS + and exp = zn * GMP_LIMB_BITS - k + <= MPFR_EMAX_MAX + GMP_LIMB_BITS */ + exp = (mp_prec_t) zn * GMP_LIMB_BITS - k; /* The exponent will be exp or exp + 1 (due to rounding) */ if (MPFR_UNLIKELY (exp > __gmpfr_emax)) return mpfr_overflow (f, rnd_mode, sign_z); @@ -77,7 +77,7 @@ mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mpfr_rnd_t rnd_mode) { mpn_lshift (fp, &zp[dif], fn, k); if (MPFR_LIKELY (dif > 0)) - fp[0] |= zp[dif - 1] >> (BITS_PER_MP_LIMB - k); + fp[0] |= zp[dif - 1] >> (GMP_LIMB_BITS - k); } else MPN_COPY (fp, zp + dif, fn); @@ -95,7 +95,7 @@ mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mpfr_rnd_t rnd_mode) } else /* sh == 0 */ { - mp_limb_t mask = MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - 1 - k); + mp_limb_t mask = MPFR_LIMB_ONE << (GMP_LIMB_BITS - 1 - k); if (MPFR_LIKELY (dif > 0)) { rb = zp[--dif] & mask; @@ -110,7 +110,7 @@ mpfr_set_z (mpfr_ptr f, mpz_srcptr z, mpfr_rnd_t rnd_mode) { sb = zp[--dif]; if (MPFR_LIKELY (k != 0)) - sb &= MPFR_LIMB_MASK (BITS_PER_MP_LIMB - k); + sb &= MPFR_LIMB_MASK (GMP_LIMB_BITS - k); if (MPFR_UNLIKELY (sb == 0) && MPFR_LIKELY (dif > 0)) do { sb = zp[--dif]; @@ -32,8 +32,8 @@ mpfr_setmax (mpfr_ptr x, mp_exp_t e) mp_limb_t *xp; MPFR_SET_EXP (x, e); - xn = 1 + (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB; - sh = (mp_prec_t) xn * BITS_PER_MP_LIMB - MPFR_PREC(x); + xn = 1 + (MPFR_PREC(x) - 1) / GMP_LIMB_BITS; + sh = (mp_prec_t) xn * GMP_LIMB_BITS - MPFR_PREC(x); xp = MPFR_MANT(x); xp[0] = MP_LIMB_T_MAX << sh; for (i = 1; i < xn; i++) @@ -31,7 +31,7 @@ mpfr_setmin (mpfr_ptr x, mp_exp_t e) mp_limb_t *xp; MPFR_SET_EXP (x, e); - xn = (MPFR_PREC(x) - 1) / BITS_PER_MP_LIMB; + xn = (MPFR_PREC(x) - 1) / GMP_LIMB_BITS; xp = MPFR_MANT(x); xp[xn] = MPFR_LIMB_HIGHBIT; MPN_ZERO(xp, xn); @@ -57,7 +57,7 @@ int verbose; SPEED_RESTRICT_COND (s->size <= MPFR_PREC_MAX); \ MPFR_TMP_MARK (marker); \ \ - size = (s->size-1)/BITS_PER_MP_LIMB+1; \ + size = (s->size-1)/GMP_LIMB_BITS+1; \ s->xp[size-1] |= MPFR_LIMB_HIGHBIT; \ MPFR_TMP_INIT1 (s->xp, x, s->size); \ MPFR_SET_EXP (x, 0); \ @@ -91,7 +91,7 @@ int verbose; SPEED_RESTRICT_COND (s->size <= MPFR_PREC_MAX); \ MPFR_TMP_MARK (marker); \ \ - size = (s->size-1)/BITS_PER_MP_LIMB+1; \ + size = (s->size-1)/GMP_LIMB_BITS+1; \ s->xp[size-1] |= MPFR_LIMB_HIGHBIT; \ MPFR_TMP_INIT1 (s->xp, x, s->size); \ MPFR_SET_EXP (x, 0); \ @@ -144,7 +144,7 @@ static double domeasure (mp_prec_t *threshold, s.align_xp = s.align_yp = s.align_wp = 64; s.size = p; - size = (p - 1)/BITS_PER_MP_LIMB+1; + size = (p - 1)/GMP_LIMB_BITS+1; s.xp = malloc (2*size*sizeof (mp_limb_t)); if (s.xp == NULL) { @@ -183,7 +183,7 @@ tune_simple_func (mp_prec_t *threshold, { measure = domeasure (threshold, func, p); printf ("prec=%lu mpfr_mul=%e ", p, measure); - n = 1 + (p - 1) / BITS_PER_MP_LIMB; + n = 1 + (p - 1) / GMP_LIMB_BITS; if (n <= MPFR_MUL_THRESHOLD) k = MUL_FFT_THRESHOLD + 1; else if (n < MPFR_MULHIGH_TAB_SIZE) @@ -255,7 +255,7 @@ all (void) printf ("Measuring mpfr_mul with mpfr_mul_threshold=%lu...\n", mpfr_mul_threshold); tune_simple_func (&mpfr_mul_threshold, speed_mpfr_mul, - 2*BITS_PER_MP_LIMB+1, 1000); + 2*GMP_LIMB_BITS+1, 1000); /* End of tuning */ time (&end_time); @@ -57,7 +57,7 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) MPFR_ASSERTD (2 * bq > bq); /* PREC_MAX is /2 so no integer overflow */ bn = MPFR_LIMB_SIZE(b); /* number of limbs of b */ - tn = 1 + (2 * bq - 1) / BITS_PER_MP_LIMB; /* number of limbs of square, + tn = 1 + (2 * bq - 1) / GMP_LIMB_BITS; /* number of limbs of square, 2*bn or 2*bn-1 */ MPFR_TMP_MARK(marker); @@ -68,8 +68,8 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode) b1 = tmp[2 * bn - 1]; /* now tmp[0]..tmp[2*bn-1] contains the product of both mantissa, - with tmp[2*bn-1]>=2^(BITS_PER_MP_LIMB-2) */ - b1 >>= BITS_PER_MP_LIMB - 1; /* msb from the product */ + with tmp[2*bn-1]>=2^(GMP_LIMB_BITS-2) */ + b1 >>= GMP_LIMB_BITS - 1; /* msb from the product */ /* if the mantissas of b and c are uniformly distributed in ]1/2, 1], then their product is in ]1/4, 1/2] with probability 2*ln(2)-1 ~ 0.386 @@ -208,7 +208,7 @@ mpfr_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode) 2nd most significant bit of up[k-1]; (b) if the exponent of u is odd, the 1/4 bit is the 1st most significant bit of up[k-1]; */ - sticky1 = MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - 2 + odd_exp); + sticky1 = MPFR_LIMB_ONE << (GMP_LIMB_BITS - 2 + odd_exp); if (up[k - 1] < sticky1) inexact = -1; else if (up[k - 1] > sticky1) @@ -34,13 +34,13 @@ mpfr_sqrt_ui (mpfr_ptr r, unsigned long u, mpfr_rnd_t rnd_mode) int inex; MPFR_SAVE_EXPO_DECL (expo); - MPFR_TMP_INIT1 (up, uu, BITS_PER_MP_LIMB); + MPFR_TMP_INIT1 (up, uu, GMP_LIMB_BITS); MPFR_ASSERTN (u == (mp_limb_t) u); count_leading_zeros (cnt, (mp_limb_t) u); *up = (mp_limb_t) u << cnt; MPFR_SAVE_EXPO_MARK (expo); - MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt); + MPFR_SET_EXP (uu, GMP_LIMB_BITS - cnt); inex = mpfr_sqrt(r, uu, rnd_mode); MPFR_SAVE_EXPO_FREE (expo); return mpfr_check_range(r, inex, rnd_mode); diff --git a/stack_interface.c b/stack_interface.c index 8dd33d69b..d7c6336c2 100644 --- a/stack_interface.c +++ b/stack_interface.c @@ -26,7 +26,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., size_t mpfr_custom_get_size (mp_prec_t prec) { - return (prec + BITS_PER_MP_LIMB -1) / BITS_PER_MP_LIMB * BYTES_PER_MP_LIMB; + return (prec + GMP_LIMB_BITS -1) / GMP_LIMB_BITS * BYTES_PER_MP_LIMB; } #undef mpfr_custom_init @@ -460,20 +460,20 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd) /* Set y to the value of the ~prec most significant bits of pstr->mant (as long as we guarantee correct rounding, we don't need to get exactly prec bits). */ - ysize = (prec - 1) / BITS_PER_MP_LIMB + 1; + ysize = (prec - 1) / GMP_LIMB_BITS + 1; /* prec bits corresponds to ysize limbs */ - ysize_bits = ysize * BITS_PER_MP_LIMB; + ysize_bits = ysize * GMP_LIMB_BITS; /* and to ysize_bits >= prec > MPFR_PREC (x) bits */ y = (mp_limb_t*) MPFR_TMP_ALLOC ((2 * ysize + 1) * sizeof (mp_limb_t)); y += ysize; /* y has (ysize+1) allocated limbs */ /* pstr_size is the number of characters we read in pstr->mant to have at least ysize full limbs. - We must have base^(pstr_size-1) >= (2^(BITS_PER_MP_LIMB))^ysize + We must have base^(pstr_size-1) >= (2^(GMP_LIMB_BITS))^ysize (in the worst case, the first digit is one and all others are zero). - i.e., pstr_size >= 1 + ysize*BITS_PER_MP_LIMB/log2(base) - Since ysize ~ prec/BITS_PER_MP_LIMB and prec < Umax/2 => - ysize*BITS_PER_MP_LIMB can not overflow. + i.e., pstr_size >= 1 + ysize*GMP_LIMB_BITS/log2(base) + Since ysize ~ prec/GMP_LIMB_BITS and prec < Umax/2 => + ysize*GMP_LIMB_BITS can not overflow. We compute pstr_size = 1 + ceil(ysize_bits * Num / Den) where Num/Den >= 1/log2(base) It is not exactly ceil(1/log2(base)) but could be one more (base 2) @@ -527,20 +527,20 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd) } /* for each bit shift decrease exponent of y */ /* (This should not overflow) */ - exp = - ((ysize - real_ysize) * BITS_PER_MP_LIMB + count); + exp = - ((ysize - real_ysize) * GMP_LIMB_BITS + count); } else /* shift y to the right, by doing this we might lose some bits from the result of mpn_set_str (in addition to the characters neglected from pstr->mant) */ { - /* shift {y, num_limb} for (BITS_PER_MP_LIMB - count) bits + /* shift {y, num_limb} for (GMP_LIMB_BITS - count) bits to the right. FIXME: can we prove that count cannot be zero here, - since mpn_rshift does not accept a shift of BITS_PER_MP_LIMB? */ + since mpn_rshift does not accept a shift of GMP_LIMB_BITS? */ MPFR_ASSERTD (count != 0); - exact = mpn_rshift (y, y, real_ysize, BITS_PER_MP_LIMB - count) == + exact = mpn_rshift (y, y, real_ysize, GMP_LIMB_BITS - count) == MPFR_LIMB_ZERO; /* for each bit shift increase exponent of y */ - exp = BITS_PER_MP_LIMB - count; + exp = GMP_LIMB_BITS - count; } /* compute base^(exp_s-pr) on n limbs */ @@ -551,7 +551,7 @@ parsed_string_to_mpfr (mpfr_t x, struct parsed_string *pstr, mpfr_rnd_t rnd) mp_exp_t tmp; count_leading_zeros (pow2, (mp_limb_t) pstr->base); - pow2 = BITS_PER_MP_LIMB - pow2 - 1; /* base = 2^pow2 */ + pow2 = GMP_LIMB_BITS - pow2 - 1; /* base = 2^pow2 */ MPFR_ASSERTD (0 < pow2 && pow2 <= 5); /* exp += pow2 * (pstr->exp_base - pstr_size) + pstr->exp_bin with overflow checking @@ -144,10 +144,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) diff_exp = (mpfr_uexp_t) MPFR_GET_EXP (b) - MPFR_GET_EXP (c); /* reserve a space to store b aligned with the result, i.e. shifted by - (-cancel) % BITS_PER_MP_LIMB to the right */ + (-cancel) % GMP_LIMB_BITS to the right */ bn = MPFR_LIMB_SIZE (b); MPFR_UNSIGNED_MINUS_MODULO (shift_b, cancel); - cancel1 = (cancel + shift_b) / BITS_PER_MP_LIMB; + cancel1 = (cancel + shift_b) / GMP_LIMB_BITS; /* the high cancel1 limbs from b should not be taken into account */ if (MPFR_UNLIKELY (shift_b == 0)) @@ -167,17 +167,17 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) } /* reserve a space to store c aligned with the result, i.e. shifted by - (diff_exp-cancel) % BITS_PER_MP_LIMB to the right */ + (diff_exp-cancel) % GMP_LIMB_BITS to the right */ cn = MPFR_LIMB_SIZE(c); - if ((UINT_MAX % BITS_PER_MP_LIMB) == (BITS_PER_MP_LIMB-1) - && ((-(unsigned) 1)%BITS_PER_MP_LIMB > 0)) - shift_c = (diff_exp - cancel) % BITS_PER_MP_LIMB; + if ((UINT_MAX % GMP_LIMB_BITS) == (GMP_LIMB_BITS-1) + && ((-(unsigned) 1)%GMP_LIMB_BITS > 0)) + shift_c = (diff_exp - cancel) % GMP_LIMB_BITS; else { - shift_c = diff_exp - (cancel % BITS_PER_MP_LIMB); - shift_c = (shift_c + BITS_PER_MP_LIMB) % BITS_PER_MP_LIMB; + shift_c = diff_exp - (cancel % GMP_LIMB_BITS); + shift_c = (shift_c + GMP_LIMB_BITS) % GMP_LIMB_BITS; } - MPFR_ASSERTD( shift_c >= 0 && shift_c < BITS_PER_MP_LIMB); + MPFR_ASSERTD( shift_c >= 0 && shift_c < GMP_LIMB_BITS); if (MPFR_UNLIKELY(shift_c == 0)) { @@ -203,11 +203,11 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPFR_ASSERTD (ap != cp); MPFR_ASSERTD (bp != cp); - /* here we have shift_c = (diff_exp - cancel) % BITS_PER_MP_LIMB, - 0 <= shift_c < BITS_PER_MP_LIMB - thus we want cancel2 = ceil((cancel - diff_exp) / BITS_PER_MP_LIMB) */ + /* here we have shift_c = (diff_exp - cancel) % GMP_LIMB_BITS, + 0 <= shift_c < GMP_LIMB_BITS + thus we want cancel2 = ceil((cancel - diff_exp) / GMP_LIMB_BITS) */ - cancel2 = (long int) (cancel - (diff_exp - shift_c)) / BITS_PER_MP_LIMB; + cancel2 = (long int) (cancel - (diff_exp - shift_c)) / GMP_LIMB_BITS; /* the high cancel2 limbs from b should not be taken into account */ #ifdef DEBUG printf ("cancel=%lu cancel1=%lu cancel2=%ld\n", @@ -298,7 +298,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) #endif /* now perform rounding */ - sh = (mp_prec_t) an * BITS_PER_MP_LIMB - MPFR_PREC(a); + sh = (mp_prec_t) an * GMP_LIMB_BITS - MPFR_PREC(a); /* last unused bits from a */ carry = ap[0] & MPFR_LIMB_MASK (sh); ap[0] -= carry; @@ -485,7 +485,7 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) inexact = 1; /* result larger than exact value */ truncate: - if (MPFR_UNLIKELY((ap[an-1] >> (BITS_PER_MP_LIMB - 1)) == 0)) + if (MPFR_UNLIKELY((ap[an-1] >> (GMP_LIMB_BITS - 1)) == 0)) /* case 1 - epsilon */ { ap[an-1] = MPFR_LIMB_HIGHBIT; @@ -155,7 +155,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) /* Read prec and num of limbs */ p = MPFR_PREC(b); - n = (p-1)/BITS_PER_MP_LIMB+1; + n = (p-1)/GMP_LIMB_BITS+1; /* Fast cmp of |b| and |c|*/ bx = MPFR_GET_EXP (b); @@ -231,7 +231,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) bx -= cnt; /* Update final expo */ } /* Last limb should be ok */ - MPFR_ASSERTD(!(ap[0] & MPFR_LIMB_MASK((-p)%BITS_PER_MP_LIMB))); + MPFR_ASSERTD(!(ap[0] & MPFR_LIMB_MASK((-p)%GMP_LIMB_BITS))); } else { @@ -258,9 +258,9 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPN_COPY_DECR(ap+len, ap, k); } MPN_ZERO(ap, len); /* Zeroing the last limbs */ - bx -= cnt + len*BITS_PER_MP_LIMB; /* Update Expo */ + bx -= cnt + len*GMP_LIMB_BITS; /* Update Expo */ /* Last limb should be ok */ - MPFR_ASSERTD(!(ap[len]&MPFR_LIMB_MASK((-p)%BITS_PER_MP_LIMB))); + MPFR_ASSERTD(!(ap[len]&MPFR_LIMB_MASK((-p)%GMP_LIMB_BITS))); } /* Check expo underflow */ if (MPFR_UNLIKELY(bx < __gmpfr_emin)) @@ -364,7 +364,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) carry = cp[k]&MPFR_LIMB_ONE; k--; } while (k>=0 && - bp[k]==(carry=cp[k]/2+(carry<<(BITS_PER_MP_LIMB-1)))); + bp[k]==(carry=cp[k]/2+(carry<<(GMP_LIMB_BITS-1)))); if (MPFR_UNLIKELY(k<0)) { /*If carry then (sh==0 and Virtual c'[-1] > Virtual b[-1]) */ @@ -384,7 +384,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) MPFR_TMP_FREE (marker); return 0; } - /* carry = cp[k]/2+(cp[k-1]&1)<<(BITS_PER_MP_LIMB-1) = c'[k]*/ + /* carry = cp[k]/2+(cp[k-1]&1)<<(GMP_LIMB_BITS-1) = c'[k]*/ else if (bp[k] > carry) goto SubD1NoLose; else @@ -406,7 +406,7 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) /* cp == -1 and c'p+1 = ? */ bcp = 1; /* We need Cp+1 later for a very improbable case. */ - bbcp = (MPFR_MANT(c)[n-1] & (MPFR_LIMB_ONE<<(BITS_PER_MP_LIMB-2))); + bbcp = (MPFR_MANT(c)[n-1] & (MPFR_LIMB_ONE<<(GMP_LIMB_BITS-2))); /* We need also C'p+1 for an even more unprobable case... */ if (MPFR_LIKELY( bbcp )) bcp1 = 1; @@ -498,8 +498,8 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) cp = (mp_limb_t*) MPFR_TMP_ALLOC(n * BYTES_PER_MP_LIMB); /* Shift c in temporary allocated place */ - dm = d % BITS_PER_MP_LIMB; - m = d / BITS_PER_MP_LIMB; + dm = d % GMP_LIMB_BITS; + m = d / GMP_LIMB_BITS; if (MPFR_UNLIKELY(dm == 0)) { /* dm = 0 and m > 0: Just copy */ @@ -543,8 +543,8 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) else { mp_limb_t *tp = MPFR_MANT(c); - mp_size_t kx = n-1 - (x / BITS_PER_MP_LIMB); - mpfr_prec_t sx = BITS_PER_MP_LIMB-1-(x%BITS_PER_MP_LIMB); + mp_size_t kx = n-1 - (x / GMP_LIMB_BITS); + mpfr_prec_t sx = GMP_LIMB_BITS-1-(x%GMP_LIMB_BITS); DEBUG (printf ("(First) x=%lu Kx=%ld Sx=%lu\n", (unsigned long) x, (long) kx, (unsigned long) sx)); @@ -569,8 +569,8 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mp_limb_t *tp = MPFR_MANT(c); /* Start from bit x=p-d in mantissa C */ mpfr_prec_t x = p-d; - mp_size_t kx = n-1 - (x / BITS_PER_MP_LIMB); - mpfr_prec_t sx = BITS_PER_MP_LIMB-1-(x%BITS_PER_MP_LIMB); + mp_size_t kx = n-1 - (x / GMP_LIMB_BITS); + mpfr_prec_t sx = GMP_LIMB_BITS-1-(x%GMP_LIMB_BITS); MPFR_ASSERTD(p >= d); bcp = (tp[kx] & (MPFR_LIMB_ONE<<sx)); /* Looks at the last bits of limb kx (If sx=0, does nothing)*/ @@ -605,8 +605,8 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode) mp_limb_t *tp = MPFR_MANT(c); /* Start from bit x=(p+1)-d in mantissa C */ mp_prec_t x = p+1-d; - mp_size_t kx = n-1 - (x/BITS_PER_MP_LIMB); - mp_prec_t sx = BITS_PER_MP_LIMB-1-(x%BITS_PER_MP_LIMB); + mp_size_t kx = n-1 - (x/GMP_LIMB_BITS); + mp_prec_t sx = GMP_LIMB_BITS-1-(x%GMP_LIMB_BITS); MPFR_ASSERTD(p > d); DEBUG (printf ("(pre) x=%lu Kx=%ld Sx=%lu\n", (unsigned long) x, (long) kx, @@ -36,7 +36,7 @@ mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode MPFR_SAVE_EXPO_DECL (expo); - MPFR_TMP_INIT1 (up, uu, BITS_PER_MP_LIMB); + MPFR_TMP_INIT1 (up, uu, GMP_LIMB_BITS); MPFR_ASSERTN (u == (mp_limb_t) u); count_leading_zeros (cnt, (mp_limb_t) u); *up = (mp_limb_t) u << cnt; @@ -44,7 +44,7 @@ mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode /* Optimization note: Exponent save/restore operations may be removed if mpfr_sub works even when uu is out-of-range. */ MPFR_SAVE_EXPO_MARK (expo); - MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt); + MPFR_SET_EXP (uu, GMP_LIMB_BITS - cnt); inex = mpfr_sub (y, x, uu, rnd_mode); MPFR_SAVE_EXPO_FREE (expo); return mpfr_check_range (y, inex, rnd_mode); diff --git a/tests/mpfr-test.h b/tests/mpfr-test.h index cc0cbad87..79d44cb7b 100644 --- a/tests/mpfr-test.h +++ b/tests/mpfr-test.h @@ -138,7 +138,7 @@ mpfr_print_raw (mpfr_srcptr x) mx = MPFR_MANT (x); px = MPFR_PREC (x); - for (n = (px - 1) / BITS_PER_MP_LIMB; ; n--) + for (n = (px - 1) / GMP_LIMB_BITS; ; n--) { mp_limb_t wd, t; diff --git a/tests/random2.c b/tests/random2.c index 6997c0a37..1e38e2b20 100644 --- a/tests/random2.c +++ b/tests/random2.c @@ -136,7 +136,7 @@ mpfr_random2 (mpfr_ptr x, mp_size_t size, mp_exp_t exp, } /* Generate random exponent. */ - mpfr_rand_raw (&elimb, RANDS, BITS_PER_MP_LIMB); + mpfr_rand_raw (&elimb, RANDS, GMP_LIMB_BITS); exp = ABS (exp); MPFR_SET_EXP (x, elimb % (2 * exp + 1) - exp); diff --git a/tests/tadd.c b/tests/tadd.c index cb6044a28..4dda3c5d2 100644 --- a/tests/tadd.c +++ b/tests/tadd.c @@ -818,18 +818,18 @@ coverage_bk_eq_0 (void) mpfr_t a, b, c; int inex; - mpfr_init2 (a, BITS_PER_MP_LIMB); - mpfr_init2 (b, 2 * BITS_PER_MP_LIMB); - mpfr_init2 (c, BITS_PER_MP_LIMB); + mpfr_init2 (a, GMP_LIMB_BITS); + mpfr_init2 (b, 2 * GMP_LIMB_BITS); + mpfr_init2 (c, GMP_LIMB_BITS); - mpfr_set_ui_2exp (b, 1, 2 * BITS_PER_MP_LIMB, MPFR_RNDN); + mpfr_set_ui_2exp (b, 1, 2 * GMP_LIMB_BITS, MPFR_RNDN); mpfr_sub_ui (b, b, 1, MPFR_RNDN); /* b = 111...111 (in base 2) where the 1's fit 2 whole limbs */ mpfr_set_ui_2exp (c, 1, -1, MPFR_RNDN); /* c = 1/2 */ inex = mpfr_add (a, b, c, MPFR_RNDU); - mpfr_set_ui_2exp (c, 1, 2 * BITS_PER_MP_LIMB, MPFR_RNDN); + mpfr_set_ui_2exp (c, 1, 2 * GMP_LIMB_BITS, MPFR_RNDN); if (! mpfr_equal_p (a, c)) { printf ("Error in coverage_bk_eq_0\n"); diff --git a/tests/tcan_round.c b/tests/tcan_round.c index b9b550bc6..e76881af4 100644 --- a/tests/tcan_round.c +++ b/tests/tcan_round.c @@ -41,8 +41,8 @@ check_round_p (void) /* avoid mpn_random which leaks memory */ for (i = 0; i < n; i++) buf[i] = randlimb (); - p = (mp_prec_t) randlimb() % ((n-1) * BITS_PER_MP_LIMB) + MPFR_PREC_MIN; - err = p + randlimb () % BITS_PER_MP_LIMB; + p = (mp_prec_t) randlimb() % ((n-1) * GMP_LIMB_BITS) + MPFR_PREC_MIN; + err = p + randlimb () % GMP_LIMB_BITS; r1 = mpfr_round_p (buf, n, err, p); r2 = mpfr_can_round_raw (buf, n, MPFR_SIGN_POS, err, MPFR_RNDN, MPFR_RNDZ, p); diff --git a/tests/tcheck.c b/tests/tcheck.c index eb131616c..ec4270573 100644 --- a/tests/tcheck.c +++ b/tests/tcheck.c @@ -96,13 +96,13 @@ main (void) MPFR_SET_ALLOC_SIZE(a, s); /* Check normal form */ tmp = MPFR_MANT(a)[0]; - if ((pr % BITS_PER_MP_LIMB) != 0) + if ((pr % GMP_LIMB_BITS) != 0) { MPFR_MANT(a)[0] = ~0; if (mpfr_check(a)) ERROR("last bits non 0"); } MPFR_MANT(a)[0] = tmp; - MPFR_MANT(a)[MPFR_LIMB_SIZE(a)-1] &= MPFR_LIMB_MASK (BITS_PER_MP_LIMB-1); + MPFR_MANT(a)[MPFR_LIMB_SIZE(a)-1] &= MPFR_LIMB_MASK (GMP_LIMB_BITS-1); if (mpfr_check(a)) ERROR("last bits non 0"); /* Final */ mpfr_set_ui(a, 2137, MPFR_RNDN); diff --git a/tests/tcmp2.c b/tests/tcmp2.c index cf9c3f1d5..44fefcd1f 100644 --- a/tests/tcmp2.c +++ b/tests/tcmp2.c @@ -284,13 +284,13 @@ special (void) exit (1); } - mpfr_set_prec (x, 2 * BITS_PER_MP_LIMB); - mpfr_set_prec (y, BITS_PER_MP_LIMB); + mpfr_set_prec (x, 2 * GMP_LIMB_BITS); + mpfr_set_prec (y, GMP_LIMB_BITS); mpfr_set_ui (x, 1, MPFR_RNDN); /* x = 1 */ mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_nextbelow (y); /* y = 1 - 2^(-BITS_PER_MP_LIMB) */ + mpfr_nextbelow (y); /* y = 1 - 2^(-GMP_LIMB_BITS) */ mpfr_cmp2 (x, y, &j); - if (mpfr_cmp2 (x, y, &j) <= 0 || j != BITS_PER_MP_LIMB) + if (mpfr_cmp2 (x, y, &j) <= 0 || j != GMP_LIMB_BITS) { printf ("Error in mpfr_cmp2 (2)\n"); exit (1); diff --git a/tests/tcmp_ui.c b/tests/tcmp_ui.c index 105e87d4c..d5c3ee7be 100644 --- a/tests/tcmp_ui.c +++ b/tests/tcmp_ui.c @@ -209,8 +209,8 @@ main (void) /* corner case */ mpfr_set_ui (x, 1, MPFR_RNDZ); - mpfr_mul_2exp (x, x, BITS_PER_MP_LIMB - 1, MPFR_RNDZ); - /* now EXP(x)=BITS_PER_MP_LIMB */ + mpfr_mul_2exp (x, x, GMP_LIMB_BITS - 1, MPFR_RNDZ); + /* now EXP(x)=GMP_LIMB_BITS */ MPFR_ASSERTN(mpfr_cmp_si (x, 1) > 0); mpfr_clear (x); diff --git a/tests/tests.c b/tests/tests.c index d2c20eceb..c0d599ef4 100644 --- a/tests/tests.c +++ b/tests/tests.c @@ -334,7 +334,7 @@ randlimb (void) { mp_limb_t limb; - mpfr_rand_raw (&limb, RANDS, BITS_PER_MP_LIMB); + mpfr_rand_raw (&limb, RANDS, GMP_LIMB_BITS); return limb; } diff --git a/tests/tfprintf.c b/tests/tfprintf.c index 981a92fb0..3a15c27cb 100644 --- a/tests/tfprintf.c +++ b/tests/tfprintf.c @@ -216,11 +216,11 @@ check_mixed (FILE *fout) #if (__GNU_MP_VERSION * 10 + __GNU_MP_VERSION_MINOR) >= 42 /* The 'M' specifier was added in gmp 4.2.0 */ check_vfprintf (fout, "a. %Mx b. %Re%Mn", limb[0], mpfr, &limb[0]); - if (limb[0] != 14 + BITS_PER_MP_LIMB / 4 || limb[1] != ~ (mp_limb_t) 0 + if (limb[0] != 14 + GMP_LIMB_BITS / 4 || limb[1] != ~ (mp_limb_t) 0 || limb[2] != ~ (mp_limb_t) 0) { printf ("Error in test #11: mpfr_vfprintf did not print %d characters" - " as expected\n", 14 + (int) BITS_PER_MP_LIMB / 4); + " as expected\n", 14 + (int) GMP_LIMB_BITS / 4); exit (1); } @@ -229,11 +229,11 @@ check_mixed (FILE *fout) and check it doesn't go through */ check_vfprintf (fout, "a. %Re .b %Nx%Nn", mpfr, limb, limb_size, limb, limb_size - 1); - if (limb[0] != 14 + 3 * BITS_PER_MP_LIMB / 4 || limb[1] != (mp_limb_t) 0 + if (limb[0] != 14 + 3 * GMP_LIMB_BITS / 4 || limb[1] != (mp_limb_t) 0 || limb[2] != ~ (mp_limb_t) 0) { printf ("Error in test #12: mpfr_vfprintf did not print %d characters" - " as expected\n", 14 + (int) BITS_PER_MP_LIMB / 4); + " as expected\n", 14 + (int) GMP_LIMB_BITS / 4); exit (1); } #endif diff --git a/tests/tget_d.c b/tests/tget_d.c index 46833786c..57553f7c5 100644 --- a/tests/tget_d.c +++ b/tests/tget_d.c @@ -34,7 +34,7 @@ check_denorms (void) double d, d2, dd, f; int fail = 0, k, n; - mpfr_init2 (x, BITS_PER_MP_LIMB); + mpfr_init2 (x, GMP_LIMB_BITS); rnd_mode = MPFR_RNDN; for (k = -17; k <= 17; k += 2) diff --git a/tests/tget_f.c b/tests/tget_f.c index d7e9ef770..00e0eeed0 100644 --- a/tests/tget_f.c +++ b/tests/tget_f.c @@ -182,7 +182,7 @@ ternary_test (void) { mpf_set_prec (x, prec); - mpfr_set_prec (y, PREC (x) * BITS_PER_MP_LIMB + 1); + mpfr_set_prec (y, PREC (x) * GMP_LIMB_BITS + 1); /* y == 1 */ mpfr_set_ui_2exp (y, 1, prec, MPFR_RNDN); @@ -326,7 +326,7 @@ main (void) } /* bug reported by Jim White */ - for (e = 0; e <= 2 * BITS_PER_MP_LIMB; e++) + for (e = 0; e <= 2 * GMP_LIMB_BITS; e++) { /* test with 2^(-e) */ mpfr_set_ui (y, 1, MPFR_RNDN); diff --git a/tests/tget_z.c b/tests/tget_z.c index f349f9409..99155d555 100644 --- a/tests/tget_z.c +++ b/tests/tget_z.c @@ -83,7 +83,7 @@ check_one (mpz_ptr z) mpfr_init2 (f, MAX( mpz_sizeinbase (z, 2), MPFR_PREC_MIN) ); mpz_init (got); - for (sh = -2*BITS_PER_MP_LIMB ; sh < 2*BITS_PER_MP_LIMB ; sh++) + for (sh = -2*GMP_LIMB_BITS ; sh < 2*GMP_LIMB_BITS ; sh++) { for (neg = 0; neg <= 1; neg++) { @@ -139,10 +139,10 @@ check (void) mpz_set_si (z, 123L); check_one (z); - mpz_rrandomb (z, RANDS, 2*BITS_PER_MP_LIMB); + mpz_rrandomb (z, RANDS, 2*GMP_LIMB_BITS); check_one (z); - mpz_rrandomb (z, RANDS, 5*BITS_PER_MP_LIMB); + mpz_rrandomb (z, RANDS, 5*GMP_LIMB_BITS); check_one (z); mpz_clear (z); diff --git a/tests/tgmpop.c b/tests/tgmpop.c index e84024072..fab42e8de 100644 --- a/tests/tgmpop.c +++ b/tests/tgmpop.c @@ -284,7 +284,7 @@ test_cmp_f (mp_prec_t pmin, mp_prec_t pmax, int nmax) int n; mpfr_init (x); - mpfr_init2 (z, pmax+BITS_PER_MP_LIMB); + mpfr_init2 (z, pmax+GMP_LIMB_BITS); mpf_init2 (y, MPFR_PREC_MIN); for(p=pmin ; p < pmax ; p+=3) { diff --git a/tests/tl2b.c b/tests/tl2b.c index 5bd69bcb5..fb75e24b0 100644 --- a/tests/tl2b.c +++ b/tests/tl2b.c @@ -48,7 +48,7 @@ print_mpfr (mpfr_srcptr x, const char *name) { fprintf (stderr, "Error in printf\n"); exit (1); } for (i = 0; i < size_of_bits2use; i++) { - if (printf ("#elif BITS_PER_MP_LIMB == %d\n" + if (printf ("#elif GMP_LIMB_BITS == %d\n" "const mp_limb_t %s__tab[] = { 0x", bits2use[i], name) < 0) { fprintf (stderr, "Error in printf\n"); exit (1); } size = mpn_get_str (temp, 256, MPFR_MANT (x), MPFR_LIMB_SIZE (x)); diff --git a/tests/tremquo.c b/tests/tremquo.c index 857414816..4e6b3c7b5 100644 --- a/tests/tremquo.c +++ b/tests/tremquo.c @@ -63,9 +63,9 @@ main (int argc, char *argv[]) if (argc == 3) /* usage: tremquo x y (rnd=MPFR_RNDN implicit) */ { - mpfr_init2 (x, BITS_PER_MP_LIMB); - mpfr_init2 (y, BITS_PER_MP_LIMB); - mpfr_init2 (r, BITS_PER_MP_LIMB); + mpfr_init2 (x, GMP_LIMB_BITS); + mpfr_init2 (y, GMP_LIMB_BITS); + mpfr_init2 (r, GMP_LIMB_BITS); mpfr_set_str (x, argv[1], 10, MPFR_RNDN); mpfr_set_str (y, argv[2], 10, MPFR_RNDN); mpfr_remquo (r, q, x, y, MPFR_RNDN); diff --git a/tests/tset_f.c b/tests/tset_f.c index e232ea74a..0d6278804 100644 --- a/tests/tset_f.c +++ b/tests/tset_f.c @@ -94,7 +94,7 @@ main (void) pr = 2 + (randlimb () & 255); mpf_set_prec (z, pr); mpf_urandomb (z, RANDS, z->_mp_prec); - mpfr_set_prec (u, ((pr / BITS_PER_MP_LIMB + 1) * BITS_PER_MP_LIMB)); + mpfr_set_prec (u, ((pr / GMP_LIMB_BITS + 1) * GMP_LIMB_BITS)); mpfr_set_f (u, z, MPFR_RNDN); if (mpfr_cmp_f (u , z) != 0) { @@ -102,7 +102,7 @@ main (void) printf ("mpf (precision=%lu)=", pr); mpf_out_str (stdout, 16, 0, z); printf ("\nmpfr(precision=%lu)=", - ((pr / BITS_PER_MP_LIMB + 1) * BITS_PER_MP_LIMB)); + ((pr / GMP_LIMB_BITS + 1) * GMP_LIMB_BITS)); mpfr_out_str (stdout, 16, 0, u, MPFR_RNDN); putchar ('\n'); exit (1); diff --git a/tests/tsqrt.c b/tests/tsqrt.c index ba6ba71be..f3ad39597 100644 --- a/tests/tsqrt.c +++ b/tests/tsqrt.c @@ -342,31 +342,31 @@ special (void) } /* corner case rw = 0 in rounding to nearest */ - mpfr_set_prec (z, BITS_PER_MP_LIMB - 1); - mpfr_set_prec (y, BITS_PER_MP_LIMB - 1); + mpfr_set_prec (z, GMP_LIMB_BITS - 1); + mpfr_set_prec (y, GMP_LIMB_BITS - 1); mpfr_set_ui (y, 1, MPFR_RNDN); - mpfr_mul_2exp (y, y, BITS_PER_MP_LIMB - 1, MPFR_RNDN); + mpfr_mul_2exp (y, y, GMP_LIMB_BITS - 1, MPFR_RNDN); mpfr_nextabove (y); - for (p = 2 * BITS_PER_MP_LIMB - 1; p <= 1000; p++) + for (p = 2 * GMP_LIMB_BITS - 1; p <= 1000; p++) { mpfr_set_prec (x, p); mpfr_set_ui (x, 1, MPFR_RNDN); - mpfr_set_exp (x, BITS_PER_MP_LIMB); + mpfr_set_exp (x, GMP_LIMB_BITS); mpfr_add_ui (x, x, 1, MPFR_RNDN); - /* now x = 2^(BITS_PER_MP_LIMB - 1) + 1 (BITS_PER_MP_LIMB bits) */ + /* now x = 2^(GMP_LIMB_BITS - 1) + 1 (GMP_LIMB_BITS bits) */ MPFR_ASSERTN (mpfr_mul (x, x, x, MPFR_RNDN) == 0); /* exact */ inexact = test_sqrt (z, x, MPFR_RNDN); - /* even rule: z should be 2^(BITS_PER_MP_LIMB - 1) */ + /* even rule: z should be 2^(GMP_LIMB_BITS - 1) */ MPFR_ASSERTN (inexact < 0); - MPFR_ASSERTN (mpfr_cmp_ui_2exp (z, 1, BITS_PER_MP_LIMB - 1) == 0); + MPFR_ASSERTN (mpfr_cmp_ui_2exp (z, 1, GMP_LIMB_BITS - 1) == 0); mpfr_nextbelow (x); - /* now x is just below [2^(BITS_PER_MP_LIMB - 1) + 1]^2 */ + /* now x is just below [2^(GMP_LIMB_BITS - 1) + 1]^2 */ inexact = test_sqrt (z, x, MPFR_RNDN); MPFR_ASSERTN(inexact < 0 && - mpfr_cmp_ui_2exp (z, 1, BITS_PER_MP_LIMB - 1) == 0); + mpfr_cmp_ui_2exp (z, 1, GMP_LIMB_BITS - 1) == 0); mpfr_nextabove (x); mpfr_nextabove (x); - /* now x is just above [2^(BITS_PER_MP_LIMB - 1) + 1]^2 */ + /* now x is just above [2^(GMP_LIMB_BITS - 1) + 1]^2 */ inexact = test_sqrt (z, x, MPFR_RNDN); if (mpfr_cmp (z, y)) { @@ -392,23 +392,23 @@ special (void) printf ("Error in sqrt(9:1000) for prec=10\n"); exit (1); } - mpfr_set_prec (y, BITS_PER_MP_LIMB); + mpfr_set_prec (y, GMP_LIMB_BITS); mpfr_nextabove (x); inexact = test_sqrt (y, x, MPFR_RNDN); if (mpfr_cmp_ui (y, 3) || inexact >= 0) { - printf ("Error in sqrt(9:1000) for prec=%d\n", (int) BITS_PER_MP_LIMB); + printf ("Error in sqrt(9:1000) for prec=%d\n", (int) GMP_LIMB_BITS); exit (1); } - mpfr_set_prec (x, 2 * BITS_PER_MP_LIMB); - mpfr_set_prec (y, BITS_PER_MP_LIMB); + mpfr_set_prec (x, 2 * GMP_LIMB_BITS); + mpfr_set_prec (y, GMP_LIMB_BITS); mpfr_set_ui (y, 1, MPFR_RNDN); mpfr_nextabove (y); mpfr_set (x, y, MPFR_RNDN); inexact = test_sqrt (y, x, MPFR_RNDN); if (mpfr_cmp_ui (y, 1) || inexact >= 0) { - printf ("Error in sqrt(1) for prec=%d\n", (int) BITS_PER_MP_LIMB); + printf ("Error in sqrt(1) for prec=%d\n", (int) GMP_LIMB_BITS); mpfr_dump (y); exit (1); } @@ -48,7 +48,7 @@ int verbose; SPEED_RESTRICT_COND (s->size <= MPFR_PREC_MAX); \ MPFR_TMP_MARK (marker); \ \ - size = (s->size-1)/BITS_PER_MP_LIMB+1; \ + size = (s->size-1)/GMP_LIMB_BITS+1; \ s->xp[size-1] |= MPFR_LIMB_HIGHBIT; \ MPFR_TMP_INIT1 (s->xp, x, s->size); \ MPFR_SET_EXP (x, 0); \ @@ -83,7 +83,7 @@ int verbose; SPEED_RESTRICT_COND (s->size <= MPFR_PREC_MAX); \ MPFR_TMP_MARK (marker); \ \ - size = (s->size-1)/BITS_PER_MP_LIMB+1; \ + size = (s->size-1)/GMP_LIMB_BITS+1; \ s->xp[size-1] |= MPFR_LIMB_HIGHBIT; \ MPFR_TMP_INIT1 (s->xp, x, s->size); \ MPFR_SET_EXP (x, 0); \ @@ -119,7 +119,7 @@ int verbose; SPEED_RESTRICT_COND (s->size <= MPFR_PREC_MAX); \ MPFR_TMP_MARK (marker); \ \ - size = (s->size-1)/BITS_PER_MP_LIMB+1; \ + size = (s->size-1)/GMP_LIMB_BITS+1; \ s->xp[size-1] |= MPFR_LIMB_HIGHBIT; \ MPFR_TMP_INIT1 (s->xp, x, s->size); \ MPFR_SET_EXP (x, 0); \ @@ -227,7 +227,7 @@ static double domeasure (mp_prec_t *threshold, s.align_xp = s.align_yp = s.align_wp = 64; s.size = p; - size = (p - 1)/BITS_PER_MP_LIMB+1; + size = (p - 1)/GMP_LIMB_BITS+1; s.xp = malloc (2*size*sizeof (mp_limb_t)); if (s.xp == NULL) { @@ -302,7 +302,7 @@ tune_simple_func (mp_prec_t *threshold, d = domeasure (threshold, func, pmin); if (d < 0.10) break; - pmin += BITS_PER_MP_LIMB; + pmin += GMP_LIMB_BITS; } /* then look for an upper bound within 20% */ @@ -318,7 +318,7 @@ tune_simple_func (mp_prec_t *threshold, try = 0; while ((pmax-pmin) >= THRESHOLD_FINAL_WINDOW) { - pstep = MAX(MIN(BITS_PER_MP_LIMB/2,(pmax-pmin)/(2*THRESHOLD_WINDOW)),1); + pstep = MAX(MIN(GMP_LIMB_BITS/2,(pmax-pmin)/(2*THRESHOLD_WINDOW)),1); if (verbose) printf ("Pmin = %8lu Pmax = %8lu Pstep=%lu\n", pmin, pmax, pstep); p = (pmin + pmax) / 2; @@ -587,16 +587,16 @@ all (const char *filename) if (verbose) printf ("Tuning mpfr_mul...\n"); tune_simple_func (&mpfr_mul_threshold, speed_mpfr_mul, - 2*BITS_PER_MP_LIMB+1); + 2*GMP_LIMB_BITS+1); fprintf (f, "#define MPFR_MUL_THRESHOLD %lu /* limbs */\n", - (unsigned long) (mpfr_mul_threshold - 1) / BITS_PER_MP_LIMB + 1); + (unsigned long) (mpfr_mul_threshold - 1) / GMP_LIMB_BITS + 1); /* Tune mpfr_exp_2 */ if (verbose) printf ("Tuning mpfr_exp_2...\n"); tune_simple_func (&mpfr_exp_2_threshold, speed_mpfr_exp_2, MPFR_PREC_MIN); - mpfr_exp_2_threshold = MAX (BITS_PER_MP_LIMB, mpfr_exp_2_threshold); + mpfr_exp_2_threshold = MAX (GMP_LIMB_BITS, mpfr_exp_2_threshold); fprintf (f, "#define MPFR_EXP_2_THRESHOLD %lu /* bits */\n", (unsigned long) mpfr_exp_2_threshold); @@ -604,7 +604,7 @@ all (const char *filename) if (verbose) printf ("Tuning mpfr_exp...\n"); tune_simple_func (&mpfr_exp_threshold, speed_mpfr_exp, - MPFR_PREC_MIN+3*BITS_PER_MP_LIMB); + MPFR_PREC_MIN+3*GMP_LIMB_BITS); fprintf (f, "#define MPFR_EXP_THRESHOLD %lu /* bits */\n", (unsigned long) mpfr_exp_threshold); @@ -612,7 +612,7 @@ all (const char *filename) if (verbose) printf ("Tuning mpfr_sin_cos...\n"); tune_simple_func (&mpfr_sincos_threshold, speed_mpfr_sincos, - MPFR_PREC_MIN+3*BITS_PER_MP_LIMB); + MPFR_PREC_MIN+3*GMP_LIMB_BITS); fprintf (f, "#define MPFR_SINCOS_THRESHOLD %lu /* bits */\n", (unsigned long) mpfr_sincos_threshold); @@ -65,11 +65,11 @@ mpfr_ui_div (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode } else if (MPFR_LIKELY(u != 0)) { - MPFR_TMP_INIT1(up, uu, BITS_PER_MP_LIMB); + MPFR_TMP_INIT1(up, uu, GMP_LIMB_BITS); MPFR_ASSERTN(u == (mp_limb_t) u); count_leading_zeros(cnt, (mp_limb_t) u); up[0] = (mp_limb_t) u << cnt; - MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt); + MPFR_SET_EXP (uu, GMP_LIMB_BITS - cnt); return mpfr_div (y, uu, x, rnd_mode); } else /* u = 0, and x != 0 */ @@ -53,11 +53,11 @@ mpfr_ui_sub (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode } else { - MPFR_TMP_INIT1 (up, uu, BITS_PER_MP_LIMB); + MPFR_TMP_INIT1 (up, uu, GMP_LIMB_BITS); MPFR_ASSERTN(u == (mp_limb_t) u); count_leading_zeros (cnt, (mp_limb_t) u); *up = (mp_limb_t) u << cnt; - MPFR_SET_EXP (uu, BITS_PER_MP_LIMB - cnt); + MPFR_SET_EXP (uu, GMP_LIMB_BITS - cnt); return mpfr_sub (y, uu, x, rnd_mode); } } diff --git a/urandomb.c b/urandomb.c index fe730087f..521a669de 100644 --- a/urandomb.c +++ b/urandomb.c @@ -54,10 +54,10 @@ mpfr_urandomb (mpfr_ptr rop, gmp_randstate_t rstate) MPFR_SET_POS (rop); /* Uniform non-normalized significand */ - mpfr_rand_raw (rp, rstate, nlimbs * BITS_PER_MP_LIMB); + mpfr_rand_raw (rp, rstate, nlimbs * GMP_LIMB_BITS); - /* If nbits isn't a multiple of BITS_PER_MP_LIMB, mask the low bits */ - cnt = nlimbs * BITS_PER_MP_LIMB - nbits; + /* If nbits isn't a multiple of GMP_LIMB_BITS, mask the low bits */ + cnt = nlimbs * GMP_LIMB_BITS - nbits; if (MPFR_LIKELY (cnt != 0)) rp[0] &= ~MPFR_LIMB_MASK (cnt); @@ -68,7 +68,7 @@ mpfr_urandomb (mpfr_ptr rop, gmp_randstate_t rstate) { k ++; nlimbs --; - exp -= BITS_PER_MP_LIMB; + exp -= GMP_LIMB_BITS; } if (MPFR_LIKELY (nlimbs != 0)) /* otherwise value is zero */ diff --git a/vasprintf.c b/vasprintf.c index 86c7a3523..de697e9f2 100644 --- a/vasprintf.c +++ b/vasprintf.c @@ -798,14 +798,14 @@ next_base_power_p (mpfr_srcptr x, int base, mpfr_rnd_t rnd) return 0; xm = MPFR_MANT (x) [MPFR_LIMB_SIZE (x) - 1]; - pm = MPFR_LIMB_MASK (BITS_PER_MP_LIMB - nbits); + pm = MPFR_LIMB_MASK (GMP_LIMB_BITS - nbits); if ((xm & ~pm) ^ ~pm) /* do no round up if some of the nbits first bits are 0s. */ return 0; if (rnd == MPFR_RNDN) /* mask for rounding bit */ - pm = (MPFR_LIMB_ONE << (BITS_PER_MP_LIMB - nbits - 1)); + pm = (MPFR_LIMB_ONE << (GMP_LIMB_BITS - nbits - 1)); /* round up if some remaining bits are 1 */ /* warning: the return value must be an int */ @@ -1043,7 +1043,7 @@ regular_ab (struct number_parts *np, mpfr_srcptr p, { int digit; mp_limb_t msl = MPFR_MANT (p)[MPFR_LIMB_SIZE (p) - 1]; - int rnd_bit = BITS_PER_MP_LIMB - 5; + int rnd_bit = GMP_LIMB_BITS - 5; /* pick up the 4 first bits */ digit = msl >> (rnd_bit+1); @@ -120,9 +120,9 @@ mpfr_zeta_ui (mpfr_ptr z, unsigned long m, mpfr_rnd_t r) for (k = n; k > 0; k--) { count_leading_zeros (kbits, k); - kbits = BITS_PER_MP_LIMB - kbits; + kbits = GMP_LIMB_BITS - kbits; /* if k^m is too large, use mpz_tdiv_q */ - if (m * kbits > 2 * BITS_PER_MP_LIMB) + if (m * kbits > 2 * GMP_LIMB_BITS) { /* if we know in advance that k^m > d, then floor(d/k^m) will be zero below, so there is no need to compute k^m */ @@ -165,9 +165,9 @@ mpfr_zeta_ui (mpfr_ptr z, unsigned long m, mpfr_rnd_t r) /* we have d[k] = sum(t[i], i=k+1..n) with t[i] = n*(n+i-1)!*4^i/(n-i)!/(2i)! t[k-1]/t[k] = k*(2k-1)/(n-k+1)/(n+k-1)/2 */ -#if (BITS_PER_MP_LIMB == 32) +#if (GMP_LIMB_BITS == 32) #define KMAX 46341 /* max k such that k*(2k-1) < 2^32 */ -#elif (BITS_PER_MP_LIMB == 64) +#elif (GMP_LIMB_BITS == 64) #define KMAX 3037000500 #endif #ifdef KMAX |