Home
last modified time | relevance | path

Searched refs:GMP_NUMB_BITS (Results 1 – 25 of 219) sorted by relevance

123456789

/dragonfly/contrib/mpfr/src/
H A Dget_str.c115 n * GMP_NUMB_BITS - e, MPFR_RNDN, rnd, n * GMP_NUMB_BITS + f)) in mpfr_get_str_aux()
248 #elif GMP_NUMB_BITS == 16
250 #elif GMP_NUMB_BITS == 32
252 #elif GMP_NUMB_BITS == 64
254 #elif GMP_NUMB_BITS == 96
263 #elif GMP_NUMB_BITS == 16
265 #elif GMP_NUMB_BITS == 32
267 #elif GMP_NUMB_BITS == 64
269 #elif GMP_NUMB_BITS == 96
278 #elif GMP_NUMB_BITS == 16
[all …]
H A Deq.c81 if ((unsigned long) vsize * GMP_NUMB_BITS < n_bits) in mpfr_eq()
90 remains -= GMP_NUMB_BITS; in mpfr_eq()
95 if (k >= 0 && (((remains < GMP_NUMB_BITS) && in mpfr_eq()
115 size = 1 + (n_bits - 1) / GMP_NUMB_BITS; in mpfr_eq()
116 else if (n_bits > (unsigned long) size * GMP_NUMB_BITS) in mpfr_eq()
117 n_bits = size * GMP_NUMB_BITS; in mpfr_eq()
126 n_bits -= GMP_NUMB_BITS; in mpfr_eq()
134 MPFR_ASSERTD(n_bits <= GMP_NUMB_BITS); in mpfr_eq()
136 if (n_bits & (GMP_NUMB_BITS - 1)) in mpfr_eq()
137 return (up[i] >> (GMP_NUMB_BITS - (n_bits & (GMP_NUMB_BITS - 1))) == in mpfr_eq()
[all …]
H A Dround_p.c65 err = (mpfr_prec_t) bn * GMP_NUMB_BITS; in mpfr_round_p()
70 k = prec / GMP_NUMB_BITS; in mpfr_round_p()
71 s = GMP_NUMB_BITS - prec%GMP_NUMB_BITS; in mpfr_round_p()
72 n = err / GMP_NUMB_BITS - k; in mpfr_round_p()
80 mask = s == GMP_NUMB_BITS ? MP_LIMB_T_MAX : MPFR_LIMB_MASK (s); in mpfr_round_p()
86 s = GMP_NUMB_BITS - err % GMP_NUMB_BITS; in mpfr_round_p()
87 MPFR_ASSERTD (s < GMP_NUMB_BITS); in mpfr_round_p()
99 s = GMP_NUMB_BITS - err % GMP_NUMB_BITS; in mpfr_round_p()
100 if (s == GMP_NUMB_BITS) in mpfr_round_p()
112 s = GMP_NUMB_BITS - err % GMP_NUMB_BITS; in mpfr_round_p()
[all …]
H A Dcmp2.c62 bn = (MPFR_PREC(b) - 1) / GMP_NUMB_BITS; in mpfr_cmp2()
71 res += GMP_NUMB_BITS; in mpfr_cmp2()
96 res += GMP_NUMB_BITS; in mpfr_cmp2()
126 bn = (MPFR_PREC(c) - 1) / GMP_NUMB_BITS; in mpfr_cmp2()
127 cn = (MPFR_PREC(b) - 1) / GMP_NUMB_BITS; in mpfr_cmp2()
136 if (MPFR_LIKELY (diff_exp < GMP_NUMB_BITS)) in mpfr_cmp2()
145 diff_exp -= GMP_NUMB_BITS; /* cc = 0 */ in mpfr_cmp2()
166 lastc = cp[cn] << (GMP_NUMB_BITS - 1); in mpfr_cmp2()
174 res += GMP_NUMB_BITS; in mpfr_cmp2()
205 if (diff_exp >= GMP_NUMB_BITS) in mpfr_cmp2()
[all …]
H A Dmpn_exp.c65 bits = GMP_NUMB_BITS - h; in mpfr_mpn_exp()
75 f = h - (n - 1) * GMP_NUMB_BITS; in mpfr_mpn_exp()
80 t = GMP_NUMB_BITS - t; /* number of bits of exponent e */ in mpfr_mpn_exp()
90 bits = n * GMP_NUMB_BITS - mpn_scan1 (a, 0); in mpfr_mpn_exp()
91 n1 = (n * GMP_NUMB_BITS - bits) / GMP_NUMB_BITS; in mpfr_mpn_exp()
107 MPFR_SADD_OVERFLOW (f, f, n * GMP_NUMB_BITS, in mpfr_mpn_exp()
124 (mpn_scan1 (c + 2 * n1, 0) < (n - 2 * n1) * GMP_NUMB_BITS)) in mpfr_mpn_exp()
131 f += h + GMP_NUMB_BITS; in mpfr_mpn_exp()
165 if ((error - 1) >= ((n * GMP_NUMB_BITS - 1) / 2)) in mpfr_mpn_exp()
166 error = n * GMP_NUMB_BITS; /* result is completely wrong: in mpfr_mpn_exp()
H A Dfrac.c63 un = (uq - 1) / GMP_NUMB_BITS; /* index of most significant limb */ in mpfr_frac()
64 un -= (mp_size_t) (ue / GMP_NUMB_BITS); in mpfr_frac()
68 sh = ue % GMP_NUMB_BITS; in mpfr_frac()
80 MPFR_ASSERTN (sh < GMP_NUMB_BITS); in mpfr_frac()
85 re = sh - GMP_NUMB_BITS; in mpfr_frac()
88 re -= GMP_NUMB_BITS; in mpfr_frac()
98 t = (mp_size_t) (MPFR_PREC(r) - 1) / GMP_NUMB_BITS < un ? in mpfr_frac()
99 (mpfr_init2 (tmp, (un + 1) * GMP_NUMB_BITS), tmp) : r; in mpfr_frac()
106 tn = (MPFR_PREC(t) - 1) / GMP_NUMB_BITS; in mpfr_frac()
132 (mpfr_prec_t) (tn + 1) * GMP_NUMB_BITS, in mpfr_frac()
H A Dadd1.c48 aq2 = (mpfr_prec_t) an * GMP_NUMB_BITS; in mpfr_add1()
137 k = diff_exp / GMP_NUMB_BITS; in mpfr_add1()
143 shift = diff_exp % GMP_NUMB_BITS; in mpfr_add1()
248 rb = bb >> (GMP_NUMB_BITS - 1); in mpfr_add1()
274 difs = diff_exp % GMP_NUMB_BITS; in mpfr_add1()
315 rb = bb >> (GMP_NUMB_BITS - 1); in mpfr_add1()
317 bb |= bb >> (GMP_NUMB_BITS - 1); in mpfr_add1()
379 if (difs && cprev << (GMP_NUMB_BITS - difs)) in mpfr_add1()
404 rb = bb >> (GMP_NUMB_BITS - 1); in mpfr_add1()
442 difs = diff_exp % GMP_NUMB_BITS; in mpfr_add1()
[all …]
H A Dsub1.c152 cancel1 = (cancel + shift_b) / GMP_NUMB_BITS; in mpfr_sub1()
174 if ((UINT_MAX % GMP_NUMB_BITS) == (GMP_NUMB_BITS-1) in mpfr_sub1()
175 && ((-(unsigned) 1)%GMP_NUMB_BITS > 0)) in mpfr_sub1()
176 shift_c = ((mpfr_uexp_t) diff_exp - cancel) % GMP_NUMB_BITS; in mpfr_sub1()
179 shift_c = diff_exp - (cancel % GMP_NUMB_BITS); in mpfr_sub1()
180 shift_c = (shift_c + GMP_NUMB_BITS) % GMP_NUMB_BITS; in mpfr_sub1()
182 MPFR_ASSERTD( shift_c >= 0 && shift_c < GMP_NUMB_BITS); in mpfr_sub1()
229 cancel2 = (cancel - diff_exp + (GMP_NUMB_BITS - 1)) / GMP_NUMB_BITS; in mpfr_sub1()
231 cancel2 = - (mp_size_t) ((diff_exp - cancel) / GMP_NUMB_BITS); in mpfr_sub1()
324 sh = (mpfr_prec_t) an * GMP_NUMB_BITS - MPFR_PREC(a); in mpfr_sub1()
[all …]
H A Drec_sqrt.c169 MPFR_ASSERTN((GMP_NUMB_BITS >= 12) && ((GMP_NUMB_BITS & 1) == 0)); in mpfr_mpn_rec_sqrt()
186 i = a[an - 1] >> (GMP_NUMB_BITS - (12 + as)); in mpfr_mpn_rec_sqrt()
191 x[0] = t << (GMP_NUMB_BITS - p); in mpfr_mpn_rec_sqrt()
247 if (2 * h <= GMP_NUMB_BITS) /* xn=rn=1, and since p <= 2h-3, n=1, in mpfr_mpn_rec_sqrt()
251 cy = x[0] >> (GMP_NUMB_BITS >> 1); in mpfr_mpn_rec_sqrt()
372 pl = n * GMP_NUMB_BITS - p; /* low bits from x */ in mpfr_mpn_rec_sqrt()
382 cu = mpn_add_1 (u, u, un, u[-1] >> (GMP_NUMB_BITS - 1)); in mpfr_mpn_rec_sqrt()
512 if (wp < rn * GMP_NUMB_BITS) in mpfr_rec_sqrt()
513 wp = rn * GMP_NUMB_BITS; in mpfr_rec_sqrt()
535 mpfr_prec_t pl = wn * GMP_NUMB_BITS - wp; in mpfr_rec_sqrt()
[all …]
H A Dget_f.c81 precx = (mpfr_prec_t) sx * GMP_NUMB_BITS; in mpfr_get_f()
88 sh = MPFR_GET_EXP(y) % GMP_NUMB_BITS; in mpfr_get_f()
89 sh = sh <= 0 ? - sh : GMP_NUMB_BITS - sh; in mpfr_get_f()
110 EXP(x) = (MPFR_GET_EXP(y) + sh) / GMP_NUMB_BITS; in mpfr_get_f()
127 sh = MPFR_GET_EXP(z) % GMP_NUMB_BITS; in mpfr_get_f()
128 sh = sh <= 0 ? - sh : GMP_NUMB_BITS - sh; in mpfr_get_f()
140 EXP(x) = (MPFR_GET_EXP(z) + sh) / GMP_NUMB_BITS; in mpfr_get_f()
H A Dget_sj.c90 sh -= GMP_NUMB_BITS; in mpfr_get_sj()
98 MPFR_ASSERTD (sh < GMP_NUMB_BITS && -sh < GMP_NUMB_BITS); in mpfr_get_sj()
109 sh -= GMP_NUMB_BITS; in mpfr_get_sj()
110 MPFR_ASSERTD (sh < GMP_NUMB_BITS && -sh < GMP_NUMB_BITS); in mpfr_get_sj()
H A Dsqrt.c89 sh = GMP_NUMB_BITS; /* ugly case */ in mpfr_sqrt()
90 rsize = MPFR_LIMB_SIZE(r) + (sh == GMP_NUMB_BITS); in mpfr_sqrt()
96 rp = (sh < GMP_NUMB_BITS) ? rp0 : MPFR_TMP_LIMBS_ALLOC (rsize); in mpfr_sqrt()
148 sticky1 = rp[0] & ((sh < GMP_NUMB_BITS) ? MPFR_LIMB_MASK(sh) in mpfr_sqrt()
166 if (sh < GMP_NUMB_BITS) in mpfr_sqrt()
198 if (sh < GMP_NUMB_BITS) in mpfr_sqrt()
208 if (sh == GMP_NUMB_BITS) in mpfr_sqrt()
222 if (sh == GMP_NUMB_BITS) in mpfr_sqrt()
H A Dcmp_ui.c67 if (f < MPFR_EMAX_MAX - GMP_NUMB_BITS && in mpfr_cmp_ui_2exp()
68 e > f + GMP_NUMB_BITS) in mpfr_cmp_ui_2exp()
74 if ((int) (e - f) > GMP_NUMB_BITS - k) in mpfr_cmp_ui_2exp()
76 if ((int) (e - f) < GMP_NUMB_BITS - k) in mpfr_cmp_ui_2exp()
81 bn = (MPFR_PREC(b) - 1) / GMP_NUMB_BITS; in mpfr_cmp_ui_2exp()
H A Dround_raw_generic.c84 nw = yprec / GMP_NUMB_BITS; in mpfr_round_raw_generic()
85 rw = yprec & (GMP_NUMB_BITS - 1); in mpfr_round_raw_generic()
110 lomask = MPFR_LIMB_MASK (GMP_NUMB_BITS - rw); in mpfr_round_raw_generic()
124 mp_limb_t rbmask = MPFR_LIMB_ONE << (GMP_NUMB_BITS - 1 - rw); in mpfr_round_raw_generic()
174 MPFR_LIMB_ONE << (GMP_NUMB_BITS - rw) in mpfr_round_raw_generic()
229 rw ? MPFR_LIMB_ONE << (GMP_NUMB_BITS - rw) in mpfr_round_raw_generic()
246 himask = ~MPFR_LIMB_MASK (GMP_NUMB_BITS - rw); in mpfr_round_raw_generic()
H A Dcmp_si.c67 if (f < MPFR_EMAX_MAX - GMP_NUMB_BITS && in mpfr_cmp_si_2exp()
68 e > f + GMP_NUMB_BITS) in mpfr_cmp_si_2exp()
74 if ((int) (e - f) > GMP_NUMB_BITS - k) in mpfr_cmp_si_2exp()
76 if ((int) (e - f) < GMP_NUMB_BITS - k) in mpfr_cmp_si_2exp()
81 bn = (MPFR_PREC(b) - 1) / GMP_NUMB_BITS; in mpfr_cmp_si_2exp()
/dragonfly/contrib/gmp/mpn/generic/
H A Drootrem.c184 MPN_RSHIFT (cy, rp, up + kk / GMP_NUMB_BITS, rn, kk % GMP_NUMB_BITS); in mpn_rootrem_internal()
242 MPN_LSHIFT (cy, rp + b / GMP_NUMB_BITS, rp, rn, b % GMP_NUMB_BITS); in mpn_rootrem_internal()
243 rn = rn + b / GMP_NUMB_BITS; in mpn_rootrem_internal()
258 nl = 1 + (kk + b - 1) / GMP_NUMB_BITS - (kk / GMP_NUMB_BITS); in mpn_rootrem_internal()
269 MPN_RSHIFT (cy, rp, up + kk / GMP_NUMB_BITS, nl, kk % GMP_NUMB_BITS); in mpn_rootrem_internal()
329 MPN_LSHIFT (cy, sp + b / GMP_NUMB_BITS, sp, sn, b % GMP_NUMB_BITS); in mpn_rootrem_internal()
330 sn = sn + b / GMP_NUMB_BITS; in mpn_rootrem_internal()
344 save = sp[b / GMP_NUMB_BITS]; in mpn_rootrem_internal()
347 sp[b / GMP_NUMB_BITS] |= save; in mpn_rootrem_internal()
356 MPN_RSHIFT (cy, rp, up + kk / GMP_NUMB_BITS, un - kk / GMP_NUMB_BITS, kk % GMP_NUMB_BITS); in mpn_rootrem_internal()
[all …]
H A Drandom2.c30 #if GMP_NUMB_BITS < 32
31 #define BITS_PER_RANDCALL GMP_NUMB_BITS
51 bit_pos = ran % GMP_NUMB_BITS; in mpn_random2()
53 gmp_rrandomb (rp, rstate, n * GMP_NUMB_BITS - bit_pos); in mpn_random2()
65 i = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS - 1; in gmp_rrandomb()
66 rp[i] = GMP_NUMB_MAX >> (GMP_NUMB_BITS - (nbits % GMP_NUMB_BITS)) % GMP_NUMB_BITS; in gmp_rrandomb()
85 rp[bi / GMP_NUMB_BITS] ^= CNST_LIMB (1) << bi % GMP_NUMB_BITS; in gmp_rrandomb()
91 mpn_incr_u (rp + bi / GMP_NUMB_BITS, CNST_LIMB (1) << bi % GMP_NUMB_BITS); in gmp_rrandomb()
H A Dget_d.c146 if (UNLIKELY ((unsigned long) (GMP_NUMB_BITS * size) in mpn_get_d()
157 exp += GMP_NUMB_BITS * size; in mpn_get_d()
183 nbits += GMP_NUMB_BITS; in mpn_get_d()
191 nbits += GMP_NUMB_BITS; in mpn_get_d()
239 nbits += GMP_NUMB_BITS; in mpn_get_d()
247 nbits += GMP_NUMB_BITS; in mpn_get_d()
255 nbits += GMP_NUMB_BITS; in mpn_get_d()
307 #define ONE_LIMB (GMP_LIMB_BITS == 64 && 2*GMP_NUMB_BITS >= 53) in mpn_get_d()
308 #define TWO_LIMBS (GMP_LIMB_BITS == 32 && 3*GMP_NUMB_BITS >= 53) in mpn_get_d()
340 m1 = (m1 << GMP_NAIL_BITS) | (m2 >> (GMP_NUMB_BITS-GMP_NAIL_BITS)); in mpn_get_d()
/dragonfly/contrib/gmp/
H A Dextract-dbl.c155 sc = (unsigned) (exp + 64 * GMP_NUMB_BITS) % GMP_NUMB_BITS; in __gmp_extract_double()
158 exp = (exp + 64 * GMP_NUMB_BITS) / GMP_NUMB_BITS - 64 * GMP_NUMB_BITS / GMP_NUMB_BITS + 1; in __gmp_extract_double()
263 rp[0] = ((manh << (GMP_NUMB_BITS - GMP_NAIL_BITS + sc)) in __gmp_extract_double()
277 rp[i] = manh >> (BITS_PER_ULONG - GMP_NUMB_BITS); in __gmp_extract_double()
278 manh = ((manh << GMP_NUMB_BITS) in __gmp_extract_double()
279 | (manl >> (BITS_PER_ULONG - GMP_NUMB_BITS))); in __gmp_extract_double()
280 manl = manl << GMP_NUMB_BITS; in __gmp_extract_double()
293 rp[i] = manh >> (BITS_PER_ULONG - GMP_NUMB_BITS); in __gmp_extract_double()
294 manh = ((manh << GMP_NUMB_BITS) in __gmp_extract_double()
295 | (manl >> (BITS_PER_ULONG - GMP_NUMB_BITS))); in __gmp_extract_double()
[all …]
H A Drandlc2x.c111 tp[m2exp / GMP_NUMB_BITS] &= (CNST_LIMB (1) << m2exp % GMP_NUMB_BITS) - 1; in lc()
118 xn = bits / GMP_NUMB_BITS; in lc()
123 unsigned int cnt = bits % GMP_NUMB_BITS; in lc()
163 mp_ptr r2p = rp + rbitpos / GMP_NUMB_BITS; in randget_lc()
165 if (rbitpos % GMP_NUMB_BITS != 0) in randget_lc()
175 if ((chunk_nbits % GMP_NUMB_BITS + rbitpos % GMP_NUMB_BITS) in randget_lc()
176 > GMP_NUMB_BITS) in randget_lc()
195 if (rbitpos % GMP_NUMB_BITS != 0) in randget_lc()
203 if (rbitpos + tn * GMP_NUMB_BITS - rbitpos % GMP_NUMB_BITS < nbits) in randget_lc()
211 if (nbits % GMP_NUMB_BITS != 0) in randget_lc()
[all …]
/dragonfly/contrib/gmp/mpz/
H A Drrandomb.c32 nl = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS; in mpz_rrandomb()
45 #if GMP_NUMB_BITS < 32
46 #define BITS_PER_RANDCALL GMP_NUMB_BITS
60 i = (nbits + GMP_NUMB_BITS - 1) / GMP_NUMB_BITS - 1; in gmp_rrandomb()
61 rp[i] = GMP_NUMB_MAX >> (GMP_NUMB_BITS - (nbits % GMP_NUMB_BITS)) % GMP_NUMB_BITS; in gmp_rrandomb()
80 rp[bi / GMP_NUMB_BITS] ^= CNST_LIMB (1) << bi % GMP_NUMB_BITS; in gmp_rrandomb()
86 mpn_incr_u (rp + bi / GMP_NUMB_BITS, CNST_LIMB (1) << bi % GMP_NUMB_BITS); in gmp_rrandomb()
H A Dsetbit.c31 limb_index = bit_index / GMP_NUMB_BITS; in mpz_setbit()
36 dp[limb_index] |= (mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS); in mpz_setbit()
46 dp[limb_index] = (mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS); in mpz_setbit()
73 dlimb &= ~((mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS)); in mpz_setbit()
89 & ~((mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS))) + 1; in mpz_setbit()
112 (mp_limb_t) 1 << (bit_index % GMP_NUMB_BITS)); in mpz_setbit()
H A Dscan0.c37 mp_size_t starting_limb = starting_bit / GMP_NUMB_BITS; in mpz_scan0()
52 limb |= (CNST_LIMB(1) << (starting_bit % GMP_NUMB_BITS)) - 1; in mpz_scan0()
60 return (mp_bitcnt_t) abs_size * GMP_NUMB_BITS; in mpz_scan0()
93 limb &= (MP_LIMB_T_MAX << (starting_bit % GMP_NUMB_BITS)); in mpz_scan0()
118 return (mp_bitcnt_t) (p - u_ptr) * GMP_NUMB_BITS + cnt; in mpz_scan0()
/dragonfly/contrib/gmp/mpf/
H A Dmul_2exp.c83 if (exp % GMP_NUMB_BITS == 0) in mpf_mul_2exp()
94 r->_mp_exp = uexp + exp / GMP_NUMB_BITS; in mpf_mul_2exp()
108 GMP_NUMB_BITS - exp % GMP_NUMB_BITS); in mpf_mul_2exp()
114 cy_limb = mpn_lshift (rp, up, abs_usize, exp % GMP_NUMB_BITS); in mpf_mul_2exp()
120 r->_mp_exp = uexp + exp / GMP_NUMB_BITS + adj; in mpf_mul_2exp()
H A Ddiv_2exp.c89 if (exp % GMP_NUMB_BITS == 0) in mpf_div_2exp()
100 r->_mp_exp = uexp - exp / GMP_NUMB_BITS; in mpf_div_2exp()
113 cy_limb = mpn_rshift (rp + 1, up, abs_usize, exp % GMP_NUMB_BITS); in mpf_div_2exp()
120 GMP_NUMB_BITS - exp % GMP_NUMB_BITS); in mpf_div_2exp()
126 r->_mp_exp = uexp - exp / GMP_NUMB_BITS - 1 + adj; in mpf_div_2exp()

123456789