summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-07-12 09:25:07 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2020-07-12 09:25:07 +0000
commit66a1282e4e7e96b71e2cfb45acc282a2040a7acb (patch)
tree39d6b05033785ad995eefec457d7e6a332b7bb78
parentcffbc490ae11d44a67e8890a76086448ff67e76b (diff)
mpfr-4.1.0
git-svn-id: svn://tug.org/texlive/trunk@55817 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r--Build/source/libs/README2
-rw-r--r--Build/source/libs/mpfr/ChangeLog5
-rw-r--r--Build/source/libs/mpfr/Makefile.am11
-rw-r--r--Build/source/libs/mpfr/Makefile.in31
-rw-r--r--Build/source/libs/mpfr/TLpatches/ChangeLog6
-rw-r--r--Build/source/libs/mpfr/TLpatches/TL-Changes2
-rw-r--r--Build/source/libs/mpfr/TLpatches/patch-01-TL18
-rwxr-xr-xBuild/source/libs/mpfr/configure20
-rw-r--r--Build/source/libs/mpfr/mpfr-src/AUTHORS1
-rw-r--r--Build/source/libs/mpfr/mpfr-src/BUGS2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/ChangeLog16187
-rw-r--r--Build/source/libs/mpfr/mpfr-src/INSTALL117
-rw-r--r--Build/source/libs/mpfr/mpfr-src/Makefile.am27
-rw-r--r--Build/source/libs/mpfr/mpfr-src/NEWS57
-rw-r--r--Build/source/libs/mpfr/mpfr-src/README12
-rw-r--r--Build/source/libs/mpfr/mpfr-src/TODO161
-rw-r--r--Build/source/libs/mpfr/mpfr-src/VERSION2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/acinclude.m4637
-rw-r--r--Build/source/libs/mpfr/mpfr-src/configure.ac458
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/Makefile.am83
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/abort_prec_max.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/acos.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/acosh.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/add.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/add1.c12
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/add1sp.c548
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/add1sp1_extracted.c363
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/add_d.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/add_ui.c40
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/agm.c24
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ai.c163
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/amd/amdfam10/mparam.h236
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/amd/athlon/mparam.h90
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/amd/k8/mparam.h236
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/amd/mparam.h233
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/arm/mparam.h409
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/asin.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/asinh.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/atan.c27
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/atan2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/atanh.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/bernoulli.c16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/beta.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/buildopt.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cache.c64
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cbrt.c104
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/check.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/clear.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/clears.c3
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp2.c254
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp_d.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp_si.c19
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmp_ui.c19
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmpabs.c (renamed from Build/source/libs/mpfr/mpfr-src/src/cmp_abs.c)4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cmpabs_ui.c (renamed from Build/source/libs/mpfr/mpfr-src/src/get_patches.c)16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/comparisons.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/const_catalan.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/const_euler.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/const_log2.c33
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/const_pi.c9
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/constant.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/copysign.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cos.c10
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cosh.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/cot.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/coth.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/csc.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/csch.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/d_div.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/d_sub.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/digamma.c61
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/dim.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/div.c215
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/div_2exp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/div_2si.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/div_2ui.c22
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/div_d.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/div_ui.c22
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/dot.c59
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/dump.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/eint.c44
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/eq.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/erandom.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/erf.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/erfc.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exceptions.c28
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exp10.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exp2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exp3.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/exp_2.c14
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/expm1.c43
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/extract.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/factorial.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_intmax.c14
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_s.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_sint.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_slong.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_sshort.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_u.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_uint.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_uintmax.c10
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_ulong.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fits_ushort.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fma.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fmma.c11
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fms.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/fpif.c75
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/frac.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/free_cache.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/frexp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/gamma.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/gamma_inc.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/gammaonethird.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/gen_inverse.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/generic/coverage/mparam.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/generic/mparam.h5
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_d.c52
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_d128.c441
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_d64.c160
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_exp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_f.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_float128.c16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_flt.c16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_ld.c104
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_q.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_si.c28
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_sj.c54
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_str.c363
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_ui.c26
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_uj.c12
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_z.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/get_z_exp.c16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/gmp_op.c15
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/grandom.c40
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/hppa/mparam.h233
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/hypot.c28
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ia64/mparam.h233
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ieee_floats.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/init.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/init2.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/inits.c3
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/inits2.c3
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/inp_str.c43
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/int_ceil_log2.c10
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/invert_limb.h5
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/invsqrt_limb.h9
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/isinf.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/isinteger.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/isnan.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/isnum.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/isqrt.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/isregular.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/iszero.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/jn.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/jyn_asympt.c50
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/li2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/lngamma.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/log.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/log10.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/log1p.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/log2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/log_ui.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/logging.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/min_prec.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/minmax.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mips/mparam.h355
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/modf.c5
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mp_clz_tab.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mparam_h.in70
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpf2mpfr.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-cvers.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.h207
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h550
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-intmax.h53
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-longlong.h339
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.c126
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.h19
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-sassert.h18
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr-thread.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpfr.h102
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mpn_exp.c96
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul.c100
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_1_extracted.c325
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_2exp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_2si.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_2ui.c36
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_d.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mul_ui.c112
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/mulders.c248
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/nbits_ulong.c83
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/neg.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/next.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/nrandom.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/odd_p.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/out_str.c26
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/pool.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/pow.c151
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/pow_si.c7
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/pow_ui.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/pow_z.c6
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/powerof2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/powerpc32/mparam.h232
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/powerpc64/mparam.h410
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/print_raw.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/print_rnd_mode.c5
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/printf.c13
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/random_deviate.c57
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/random_deviate.h2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/rec_sqrt.c36
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/reldiff.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/rem1.c24
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/rint.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/rndna.c12
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/root.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/round_near_x.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/round_p.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/round_prec.c69
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/round_raw_generic.c76
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/scale2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sec.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sech.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_d.c148
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_d128.c495
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_d64.c108
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_dfl_prec.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_exp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_f.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_float128.c25
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_flt.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_inf.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_ld.c114
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_nan.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_prc_raw.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_prec.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_q.c32
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_rnd.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_si.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_si_2exp.c24
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_sj.c10
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_str.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_str_raw.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_ui.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_ui_2exp.c23
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_uj.c28
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_z.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_z_exp.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/set_zero.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/setmax.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/setmin.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/setsign.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sgn.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/si_op.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/signbit.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sin.c8
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sin_cos.c22
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sinh.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sinh_cosh.c5
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sparc64/mparam.h411
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sqr.c91
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sqrt.c73
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sqrt_ui.c19
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/stack_interface.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/strtofr.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub1.c126
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub1sp.c1091
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub1sp1_extracted.c530
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub_d.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sub_ui.c40
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/subnormal.c31
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/sum.c12
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/swap.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/tan.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/tanh.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/total_order.c42
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ubf.c24
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/uceil_exp2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/uceil_log2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ufloor_log2.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ui_div.c37
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ui_pow.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ui_pow_ui.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/ui_sub.c40
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/urandom.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/urandomb.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/vasprintf.c633
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/version.c4
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/volatile.c2
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/x86/core2/mparam.h234
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/x86/mparam.h413
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/x86_64/core2/mparam.h414
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/x86_64/mparam.h233
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/x86_64/pentium4/mparam.h160
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/yn.c16
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/zeta.c31
-rw-r--r--Build/source/libs/mpfr/mpfr-src/src/zeta_ui.c2
-rw-r--r--Build/source/libs/mpfr/version.ac2
302 files changed, 24019 insertions, 9452 deletions
diff --git a/Build/source/libs/README b/Build/source/libs/README
index a292ea43ad0..b8fe30cb41b 100644
--- a/Build/source/libs/README
+++ b/Build/source/libs/README
@@ -46,7 +46,7 @@ lua 5.3.5 - checked 21jul18
luajit 2.1.0-beta3 - checked 20jun17
http://luajit.org/download/LuaJIT-2.1.0-beta3.tar.gz
-mpfr 4.0.2 - checked 1jan19
+mpfr 4.1.0 - checked 12jul20
http://ftp.gnu.org/gnu/mpfr/
pixman 0.40.0 - checked 21apr20
diff --git a/Build/source/libs/mpfr/ChangeLog b/Build/source/libs/mpfr/ChangeLog
index 2e7c59593bc..c0487720393 100644
--- a/Build/source/libs/mpfr/ChangeLog
+++ b/Build/source/libs/mpfr/ChangeLog
@@ -1,3 +1,8 @@
+2020-07-12 Akira Kakuto <kakuto@w32tex.org>
+
+ Import mpfr-4.1.0.
+ * Makefile.am, version.ac: Adjust.
+
2019-02-01 Akira Kakuto <kakuto@w32tex.org>
Import mpfr-4.0.2.
diff --git a/Build/source/libs/mpfr/Makefile.am b/Build/source/libs/mpfr/Makefile.am
index 870847ac536..92144338ee4 100644
--- a/Build/source/libs/mpfr/Makefile.am
+++ b/Build/source/libs/mpfr/Makefile.am
@@ -43,7 +43,7 @@ nodist_libmpfr_a_SOURCES = \
@MPFR_TREE@/src/clears.c \
@MPFR_TREE@/src/cmp.c \
@MPFR_TREE@/src/cmp2.c \
- @MPFR_TREE@/src/cmp_abs.c \
+ @MPFR_TREE@/src/cmpabs.c \
@MPFR_TREE@/src/cmp_si.c \
@MPFR_TREE@/src/cmp_ui.c \
@MPFR_TREE@/src/comparisons.c \
@@ -88,6 +88,7 @@ nodist_libmpfr_a_SOURCES = \
@MPFR_TREE@/src/mul_2ui.c \
@MPFR_TREE@/src/mul_ui.c \
@MPFR_TREE@/src/mulders.c \
+ @MPFR_TREE@/src/nbits_ulong.c \
@MPFR_TREE@/src/neg.c \
@MPFR_TREE@/src/next.c \
@MPFR_TREE@/src/pool.c \
@@ -145,6 +146,7 @@ unused_sources = \
@MPFR_TREE@/src/check.c \
@MPFR_TREE@/src/cmp_d.c \
@MPFR_TREE@/src/cmp_ld.c \
+ @MPFR_TREE@/src/cmpabs_ui.c \
@MPFR_TREE@/src/copysign.c \
@MPFR_TREE@/src/cosh.c \
@MPFR_TREE@/src/cot.c \
@@ -157,6 +159,7 @@ unused_sources = \
@MPFR_TREE@/src/dim.c \
@MPFR_TREE@/src/div_2exp.c \
@MPFR_TREE@/src/div_d.c \
+ @MPFR_TREE@/src/dot.c \
@MPFR_TREE@/src/dump.c \
@MPFR_TREE@/src/eint.c \
@MPFR_TREE@/src/eq.c \
@@ -182,12 +185,12 @@ unused_sources = \
@MPFR_TREE@/src/gamma_inc.c \
@MPFR_TREE@/src/gammaonethird.c \
@MPFR_TREE@/src/get_d64.c \
+ @MPFR_TREE@/src/get_d128.c \
@MPFR_TREE@/src/get_exp.c \
@MPFR_TREE@/src/get_f.c \
@MPFR_TREE@/src/get_float128.c \
@MPFR_TREE@/src/get_flt.c \
@MPFR_TREE@/src/get_ld.c \
- @MPFR_TREE@/src/get_patches.c \
@MPFR_TREE@/src/get_q.c \
@MPFR_TREE@/src/get_sj.c \
@MPFR_TREE@/src/get_ui.c \
@@ -215,6 +218,7 @@ unused_sources = \
@MPFR_TREE@/src/mpfr-mini-gmp.c \
@MPFR_TREE@/src/mul_2exp.c \
@MPFR_TREE@/src/mul_d.c \
+ @MPFR_TREE@/src/mul_1_extracted.c \
@MPFR_TREE@/src/nrandom.c \
@MPFR_TREE@/src/odd_p.c \
@MPFR_TREE@/src/out_str.c \
@@ -233,6 +237,7 @@ unused_sources = \
@MPFR_TREE@/src/sec.c \
@MPFR_TREE@/src/sech.c \
@MPFR_TREE@/src/set_d64.c \
+ @MPFR_TREE@/src/set_d128.c \
@MPFR_TREE@/src/set_exp.c \
@MPFR_TREE@/src/set_flt.c \
@MPFR_TREE@/src/set_float128.c \
@@ -251,10 +256,12 @@ unused_sources = \
@MPFR_TREE@/src/sinh_cosh.c \
@MPFR_TREE@/src/stack_interface.c \
@MPFR_TREE@/src/sub_d.c \
+ @MPFR_TREE@/src/sub1sp1_extracted.c \
@MPFR_TREE@/src/subnormal.c \
@MPFR_TREE@/src/sum.c \
@MPFR_TREE@/src/tan.c \
@MPFR_TREE@/src/tanh.c \
+ @MPFR_TREE@/src/total_order.c \
@MPFR_TREE@/src/uceil_exp2.c \
@MPFR_TREE@/src/uceil_log2.c \
@MPFR_TREE@/src/ufloor_log2.c \
diff --git a/Build/source/libs/mpfr/Makefile.in b/Build/source/libs/mpfr/Makefile.in
index f161800d398..0ae08301014 100644
--- a/Build/source/libs/mpfr/Makefile.in
+++ b/Build/source/libs/mpfr/Makefile.in
@@ -132,7 +132,7 @@ nodist_libmpfr_a_OBJECTS = @MPFR_TREE@/src/abort_prec_max.$(OBJEXT) \
@MPFR_TREE@/src/clear.$(OBJEXT) \
@MPFR_TREE@/src/clears.$(OBJEXT) @MPFR_TREE@/src/cmp.$(OBJEXT) \
@MPFR_TREE@/src/cmp2.$(OBJEXT) \
- @MPFR_TREE@/src/cmp_abs.$(OBJEXT) \
+ @MPFR_TREE@/src/cmpabs.$(OBJEXT) \
@MPFR_TREE@/src/cmp_si.$(OBJEXT) \
@MPFR_TREE@/src/cmp_ui.$(OBJEXT) \
@MPFR_TREE@/src/comparisons.$(OBJEXT) \
@@ -172,6 +172,7 @@ nodist_libmpfr_a_OBJECTS = @MPFR_TREE@/src/abort_prec_max.$(OBJEXT) \
@MPFR_TREE@/src/mul_2ui.$(OBJEXT) \
@MPFR_TREE@/src/mul_ui.$(OBJEXT) \
@MPFR_TREE@/src/mulders.$(OBJEXT) \
+ @MPFR_TREE@/src/nbits_ulong.$(OBJEXT) \
@MPFR_TREE@/src/neg.$(OBJEXT) @MPFR_TREE@/src/next.$(OBJEXT) \
@MPFR_TREE@/src/pool.$(OBJEXT) \
@MPFR_TREE@/src/powerof2.$(OBJEXT) \
@@ -244,9 +245,9 @@ am__depfiles_remade = ./$(DEPDIR)/mpfrtest-mpfrtest.Po \
@MPFR_TREE@/src/$(DEPDIR)/clears.Po \
@MPFR_TREE@/src/$(DEPDIR)/cmp.Po \
@MPFR_TREE@/src/$(DEPDIR)/cmp2.Po \
- @MPFR_TREE@/src/$(DEPDIR)/cmp_abs.Po \
@MPFR_TREE@/src/$(DEPDIR)/cmp_si.Po \
@MPFR_TREE@/src/$(DEPDIR)/cmp_ui.Po \
+ @MPFR_TREE@/src/$(DEPDIR)/cmpabs.Po \
@MPFR_TREE@/src/$(DEPDIR)/comparisons.Po \
@MPFR_TREE@/src/$(DEPDIR)/const_catalan.Po \
@MPFR_TREE@/src/$(DEPDIR)/const_euler.Po \
@@ -289,6 +290,7 @@ am__depfiles_remade = ./$(DEPDIR)/mpfrtest-mpfrtest.Po \
@MPFR_TREE@/src/$(DEPDIR)/mul_2ui.Po \
@MPFR_TREE@/src/$(DEPDIR)/mul_ui.Po \
@MPFR_TREE@/src/$(DEPDIR)/mulders.Po \
+ @MPFR_TREE@/src/$(DEPDIR)/nbits_ulong.Po \
@MPFR_TREE@/src/$(DEPDIR)/neg.Po \
@MPFR_TREE@/src/$(DEPDIR)/next.Po \
@MPFR_TREE@/src/$(DEPDIR)/pool.Po \
@@ -785,7 +787,7 @@ nodist_libmpfr_a_SOURCES = \
@MPFR_TREE@/src/clears.c \
@MPFR_TREE@/src/cmp.c \
@MPFR_TREE@/src/cmp2.c \
- @MPFR_TREE@/src/cmp_abs.c \
+ @MPFR_TREE@/src/cmpabs.c \
@MPFR_TREE@/src/cmp_si.c \
@MPFR_TREE@/src/cmp_ui.c \
@MPFR_TREE@/src/comparisons.c \
@@ -830,6 +832,7 @@ nodist_libmpfr_a_SOURCES = \
@MPFR_TREE@/src/mul_2ui.c \
@MPFR_TREE@/src/mul_ui.c \
@MPFR_TREE@/src/mulders.c \
+ @MPFR_TREE@/src/nbits_ulong.c \
@MPFR_TREE@/src/neg.c \
@MPFR_TREE@/src/next.c \
@MPFR_TREE@/src/pool.c \
@@ -887,6 +890,7 @@ unused_sources = \
@MPFR_TREE@/src/check.c \
@MPFR_TREE@/src/cmp_d.c \
@MPFR_TREE@/src/cmp_ld.c \
+ @MPFR_TREE@/src/cmpabs_ui.c \
@MPFR_TREE@/src/copysign.c \
@MPFR_TREE@/src/cosh.c \
@MPFR_TREE@/src/cot.c \
@@ -899,6 +903,7 @@ unused_sources = \
@MPFR_TREE@/src/dim.c \
@MPFR_TREE@/src/div_2exp.c \
@MPFR_TREE@/src/div_d.c \
+ @MPFR_TREE@/src/dot.c \
@MPFR_TREE@/src/dump.c \
@MPFR_TREE@/src/eint.c \
@MPFR_TREE@/src/eq.c \
@@ -924,12 +929,12 @@ unused_sources = \
@MPFR_TREE@/src/gamma_inc.c \
@MPFR_TREE@/src/gammaonethird.c \
@MPFR_TREE@/src/get_d64.c \
+ @MPFR_TREE@/src/get_d128.c \
@MPFR_TREE@/src/get_exp.c \
@MPFR_TREE@/src/get_f.c \
@MPFR_TREE@/src/get_float128.c \
@MPFR_TREE@/src/get_flt.c \
@MPFR_TREE@/src/get_ld.c \
- @MPFR_TREE@/src/get_patches.c \
@MPFR_TREE@/src/get_q.c \
@MPFR_TREE@/src/get_sj.c \
@MPFR_TREE@/src/get_ui.c \
@@ -957,6 +962,7 @@ unused_sources = \
@MPFR_TREE@/src/mpfr-mini-gmp.c \
@MPFR_TREE@/src/mul_2exp.c \
@MPFR_TREE@/src/mul_d.c \
+ @MPFR_TREE@/src/mul_1_extracted.c \
@MPFR_TREE@/src/nrandom.c \
@MPFR_TREE@/src/odd_p.c \
@MPFR_TREE@/src/out_str.c \
@@ -975,6 +981,7 @@ unused_sources = \
@MPFR_TREE@/src/sec.c \
@MPFR_TREE@/src/sech.c \
@MPFR_TREE@/src/set_d64.c \
+ @MPFR_TREE@/src/set_d128.c \
@MPFR_TREE@/src/set_exp.c \
@MPFR_TREE@/src/set_flt.c \
@MPFR_TREE@/src/set_float128.c \
@@ -993,10 +1000,12 @@ unused_sources = \
@MPFR_TREE@/src/sinh_cosh.c \
@MPFR_TREE@/src/stack_interface.c \
@MPFR_TREE@/src/sub_d.c \
+ @MPFR_TREE@/src/sub1sp1_extracted.c \
@MPFR_TREE@/src/subnormal.c \
@MPFR_TREE@/src/sum.c \
@MPFR_TREE@/src/tan.c \
@MPFR_TREE@/src/tanh.c \
+ @MPFR_TREE@/src/total_order.c \
@MPFR_TREE@/src/uceil_exp2.c \
@MPFR_TREE@/src/uceil_log2.c \
@MPFR_TREE@/src/ufloor_log2.c \
@@ -1119,7 +1128,7 @@ clean-noinstLIBRARIES:
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@MPFR_TREE@/src/cmp2.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
-@MPFR_TREE@/src/cmp_abs.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
+@MPFR_TREE@/src/cmpabs.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@MPFR_TREE@/src/cmp_si.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@@ -1212,6 +1221,9 @@ clean-noinstLIBRARIES:
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@MPFR_TREE@/src/mulders.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
+@MPFR_TREE@/src/nbits_ulong.$(OBJEXT): \
+ @MPFR_TREE@/src/$(am__dirstamp) \
+ @MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@MPFR_TREE@/src/neg.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
@MPFR_TREE@/src/$(DEPDIR)/$(am__dirstamp)
@MPFR_TREE@/src/next.$(OBJEXT): @MPFR_TREE@/src/$(am__dirstamp) \
@@ -1332,9 +1344,9 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/clears.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/cmp.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/cmp2.Po@am__quote@ # am--include-marker
-@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/cmp_abs.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/cmp_si.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/cmp_ui.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/cmpabs.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/comparisons.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/const_catalan.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/const_euler.Po@am__quote@ # am--include-marker
@@ -1377,6 +1389,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/mul_2ui.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/mul_ui.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/mulders.Po@am__quote@ # am--include-marker
+@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/nbits_ulong.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/neg.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/next.Po@am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@MPFR_TREE@/src/$(DEPDIR)/pool.Po@am__quote@ # am--include-marker
@@ -1985,9 +1998,9 @@ distclean: distclean-recursive
-rm -f @MPFR_TREE@/src/$(DEPDIR)/clears.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp2.Po
- -rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp_abs.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp_si.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp_ui.Po
+ -rm -f @MPFR_TREE@/src/$(DEPDIR)/cmpabs.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/comparisons.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/const_catalan.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/const_euler.Po
@@ -2030,6 +2043,7 @@ distclean: distclean-recursive
-rm -f @MPFR_TREE@/src/$(DEPDIR)/mul_2ui.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/mul_ui.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/mulders.Po
+ -rm -f @MPFR_TREE@/src/$(DEPDIR)/nbits_ulong.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/neg.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/next.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/pool.Po
@@ -2134,9 +2148,9 @@ maintainer-clean: maintainer-clean-recursive
-rm -f @MPFR_TREE@/src/$(DEPDIR)/clears.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp2.Po
- -rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp_abs.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp_si.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/cmp_ui.Po
+ -rm -f @MPFR_TREE@/src/$(DEPDIR)/cmpabs.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/comparisons.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/const_catalan.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/const_euler.Po
@@ -2179,6 +2193,7 @@ maintainer-clean: maintainer-clean-recursive
-rm -f @MPFR_TREE@/src/$(DEPDIR)/mul_2ui.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/mul_ui.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/mulders.Po
+ -rm -f @MPFR_TREE@/src/$(DEPDIR)/nbits_ulong.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/neg.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/next.Po
-rm -f @MPFR_TREE@/src/$(DEPDIR)/pool.Po
diff --git a/Build/source/libs/mpfr/TLpatches/ChangeLog b/Build/source/libs/mpfr/TLpatches/ChangeLog
index 30b29b18953..40610a8ec82 100644
--- a/Build/source/libs/mpfr/TLpatches/ChangeLog
+++ b/Build/source/libs/mpfr/TLpatches/ChangeLog
@@ -1,3 +1,9 @@
+2020-07-12 Akira Kakuto <kakuto@w32tex.org>
+
+ Imported mpfr-4.1.0 source tree from:
+ http://ftp.gnu.org/gnu/mpfr/
+ * patch-01-TL: Adapted.
+
2019-02-01 Akira Kakuto <kakuto@w32tex.org>
Imported mpfr-4.0.2 source tree from:
diff --git a/Build/source/libs/mpfr/TLpatches/TL-Changes b/Build/source/libs/mpfr/TLpatches/TL-Changes
index 91cee9a8a33..88c1501ab1d 100644
--- a/Build/source/libs/mpfr/TLpatches/TL-Changes
+++ b/Build/source/libs/mpfr/TLpatches/TL-Changes
@@ -1,4 +1,4 @@
-Changes applied to the mpfr-4.0.2/ tree as obtained from:
+Changes applied to the mpfr-4.1.0/ tree as obtained from:
http://ftp.gnu.org/gnu/mpfr/
Removed:
diff --git a/Build/source/libs/mpfr/TLpatches/patch-01-TL b/Build/source/libs/mpfr/TLpatches/patch-01-TL
index d65e399ab95..fe9a5c6a662 100644
--- a/Build/source/libs/mpfr/TLpatches/patch-01-TL
+++ b/Build/source/libs/mpfr/TLpatches/patch-01-TL
@@ -1,12 +1,12 @@
-diff -ur mpfr-4.0.2/src/mparam_h.in mpfr-src/src/mparam_h.in
---- mpfr-4.0.2/src/mparam_h.in Mon Jan 07 22:53:20 2019
-+++ mpfr-src/src/mparam_h.in Fri Feb 01 13:50:51 2019
-@@ -32,6 +32,8 @@
- for example with gcc -dM -E -xc /dev/null
- As of gcc 4.2, you can also use: -march=native or -mtune=native */
+diff -ur mpfr-4.1.0/src/mparam_h.in mpfr-src/src/mparam_h.in
+--- mpfr-4.1.0/src/mparam_h.in Thu Jan 09 03:11:13 2020
++++ mpfr-src/src/mparam_h.in Sun Jul 12 16:40:20 2020
+@@ -31,6 +31,8 @@
+ /* Note: the different macros used here are those defined by gcc,
+ for example with gcc -mtune=native -dM -E -xc /dev/null */
+#elif 1 /* no processor specific optimization for TeX Live */
+#define MPFR_TUNE_CASE "default"
- #elif defined (__tune_pentium4__) /* Threshold for Pentium 4 */
- #define MPFR_TUNE_CASE "src/x86_64/pentium4/mparam.h"
- #include "x86_64/pentium4/mparam.h"
+ #elif (defined (__tune_core2__) || defined (__tune_nocona__)) && defined (__x86_64) /* 64-bit Core 2 or Xeon */
+ #define MPFR_TUNE_CASE "src/x86_64/core2/mparam.h"
+ #include "x86_64/core2/mparam.h"
diff --git a/Build/source/libs/mpfr/configure b/Build/source/libs/mpfr/configure
index b8768fa23c2..45b4238c4a1 100755
--- a/Build/source/libs/mpfr/configure
+++ b/Build/source/libs/mpfr/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for mpfr (TeX Live) 4.0.2.
+# Generated by GNU Autoconf 2.69 for mpfr (TeX Live) 4.1.0.
#
# Report bugs to <tex-k@tug.org>.
#
@@ -580,8 +580,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='mpfr (TeX Live)'
PACKAGE_TARNAME='mpfr--tex-live-'
-PACKAGE_VERSION='4.0.2'
-PACKAGE_STRING='mpfr (TeX Live) 4.0.2'
+PACKAGE_VERSION='4.1.0'
+PACKAGE_STRING='mpfr (TeX Live) 4.1.0'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''
@@ -1295,7 +1295,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures mpfr (TeX Live) 4.0.2 to adapt to many kinds of systems.
+\`configure' configures mpfr (TeX Live) 4.1.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1365,7 +1365,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of mpfr (TeX Live) 4.0.2:";;
+ short | recursive ) echo "Configuration of mpfr (TeX Live) 4.1.0:";;
esac
cat <<\_ACEOF
@@ -1469,7 +1469,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-mpfr (TeX Live) configure 4.0.2
+mpfr (TeX Live) configure 4.1.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1938,7 +1938,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by mpfr (TeX Live) $as_me 4.0.2, which was
+It was created by mpfr (TeX Live) $as_me 4.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3862,7 +3862,7 @@ fi
# Define the identity of the package.
PACKAGE='mpfr--tex-live-'
- VERSION='4.0.2'
+ VERSION='4.1.0'
cat >>confdefs.h <<_ACEOF
@@ -7612,7 +7612,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by mpfr (TeX Live) $as_me 4.0.2, which was
+This file was extended by mpfr (TeX Live) $as_me 4.1.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7682,7 +7682,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-mpfr (TeX Live) config.status 4.0.2
+mpfr (TeX Live) config.status 4.1.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
diff --git a/Build/source/libs/mpfr/mpfr-src/AUTHORS b/Build/source/libs/mpfr/mpfr-src/AUTHORS
index 51985370199..6967838073a 100644
--- a/Build/source/libs/mpfr/mpfr-src/AUTHORS
+++ b/Build/source/libs/mpfr/mpfr-src/AUTHORS
@@ -20,6 +20,7 @@ Sylvain Chevillard Original version of ai.c
Charles Karney mpfr_nrandom and mpfr_erandom functions
Fredrik Johansson New version of mpfr_const_euler
Mickaël Gastineau MPFRbench program
+Jianyang Pan Formally proven code for mpfr_add1sp1
The main authors are included in the MPFR mailing-list <mpfr@inria.fr>.
This is the preferred way to contact us. For further information, please
diff --git a/Build/source/libs/mpfr/mpfr-src/BUGS b/Build/source/libs/mpfr/mpfr-src/BUGS
index a30dcb96847..e4901559a22 100644
--- a/Build/source/libs/mpfr/mpfr-src/BUGS
+++ b/Build/source/libs/mpfr/mpfr-src/BUGS
@@ -1,4 +1,4 @@
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/ChangeLog b/Build/source/libs/mpfr/mpfr-src/ChangeLog
index 9e46b94182b..c5a5d61985e 100644
--- a/Build/source/libs/mpfr/mpfr-src/ChangeLog
+++ b/Build/source/libs/mpfr/mpfr-src/ChangeLog
@@ -1,44 +1,4388 @@
------------------------------------------------------------------------
-r13433 | vlefevre | 2019-01-31 20:33:50 +0000 (Thu, 31 Jan 2019) | 2 lines
+r14065 | vlefevre | 2020-07-10 11:52:33 +0000 (Fri, 10 Jul 2020) | 1 line
Changed paths:
- M /branches/4.0/NEWS
+ M /branches/4.1/VERSION
+ M /branches/4.1/configure.ac
+ M /branches/4.1/doc/mpfr.texi
+ M /branches/4.1/src/mpfr.h
+ M /branches/4.1/src/version.c
-[NEWS] Put the "Option -pedantic is now always removed [...]" line
-at the right place (4.0.2, not 4.0.1: r13422 was wrong).
+Updated version to 4.1.0.
------------------------------------------------------------------------
-r13432 | vlefevre | 2019-01-31 20:29:48 +0000 (Thu, 31 Jan 2019) | 1 line
+r14064 | vlefevre | 2020-07-10 11:50:59 +0000 (Fri, 10 Jul 2020) | 1 line
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /branches/4.1/doc/mpfr.texi
-Updated version to 4.0.2.
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r14063 | vlefevre | 2020-07-10 10:33:32 +0000 (Fri, 10 Jul 2020) | 6 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/doc/README.dev
+ M /branches/4.1/src/jyn_asympt.c
+ M /branches/4.1/tests/tjn.c
+
+[src/jyn_asympt.c] Partly solved the slowness of jn(733333,733333).
+[tests/tjn.c] Added tests of jn(73333,73333) and jn(733333,733333),
+ enabled only with MPFR_CHECK_EXPENSIVE.
+[doc/README.dev] In the MPFR_CHECK_EXPENSIVE description, say that
+ --enable-assert=full should not be used (too expensive, not needed).
+(merged changesets r14053-14062 from the trunk)
+------------------------------------------------------------------------
+r14050 | vlefevre | 2020-07-01 21:39:57 +0000 (Wed, 01 Jul 2020) | 1 line
+Changed paths:
+ M /branches/4.1/ChangeLog
+
+ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
+------------------------------------------------------------------------
+r14049 | vlefevre | 2020-07-01 21:37:36 +0000 (Wed, 01 Jul 2020) | 1 line
+Changed paths:
+ M /branches/4.1/VERSION
+ M /branches/4.1/configure.ac
+ M /branches/4.1/doc/mpfr.texi
+ M /branches/4.1/src/mpfr.h
+ M /branches/4.1/src/version.c
+
+Updated version to 4.1.0-rc2.
+------------------------------------------------------------------------
+r14048 | vlefevre | 2020-07-01 13:59:32 +0000 (Wed, 01 Jul 2020) | 3 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/NEWS
+
+[NEWS] Added an item saying that TLS can safely be (re-)enabled
+on Sparc.
+(merged changeset r14047 from the trunk)
+------------------------------------------------------------------------
+r14046 | vlefevre | 2020-06-29 13:57:32 +0000 (Mon, 29 Jun 2020) | 7 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/tests/mpfr-test.h
+
+[tests/mpfr-test.h] Avoid a GCC bug on Sparc, at least when using TLS.
+The MPFR library itself is not affected, only a particular test. Normal
+code using the MPFR library should not be affected either, as the bug
+occurs when accessing __gmpfr_flags directly (and the public mpfr.h
+header file does not provide any macro that accesses an internal
+variable directly). So a workaround for the tests is the best solution.
+(merged changeset r14045 from the trunk)
+------------------------------------------------------------------------
+r14043 | vlefevre | 2020-06-18 17:37:41 +0000 (Thu, 18 Jun 2020) | 1 line
+Changed paths:
+ M /branches/4.1/VERSION
+ M /branches/4.1/configure.ac
+ M /branches/4.1/doc/mpfr.texi
+ M /branches/4.1/src/mpfr.h
+ M /branches/4.1/src/version.c
+
+Updated version to 4.1.0-dev (due to changes since 4.1.0-rc1).
+------------------------------------------------------------------------
+r14042 | vlefevre | 2020-06-18 17:17:18 +0000 (Thu, 18 Jun 2020) | 54 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/doc/mpfr.texi
+ M /branches/4.1/src/digamma.c
+ M /branches/4.1/src/get_str.c
+ M /branches/4.1/src/mpfr-longlong.h
+ M /branches/4.1/tests/mpfr-test.h
+ M /branches/4.1/tests/tabort_defalloc1.c
+ M /branches/4.1/tests/tabort_defalloc2.c
+ M /branches/4.1/tests/tcmp_ui.c
+ M /branches/4.1/tests/tdigamma.c
+ M /branches/4.1/tests/tests.c
+ M /branches/4.1/tests/tset_ld.c
+
+Merged r14021-14036 from the trunk:
+
+r14021:
+[tests] Skip tabort_defalloc1 and tabort_defalloc2 under Valgrind, as
+Valgrind complains due to the large allocation size.
+ * mpfr-test.h, tests.c: added tests_run_within_valgrind() function to
+ guess whether the test runs within Valgrind.
+ * tabort_defalloc1.c, tabort_defalloc2.c: skip the test (exit code 77)
+ if this function returns true.
+
+r14022-14023:
+[tests/tset_ld.c] In bug_20160907 (tests on subnormals, specific to
+x86 extended precision):
+ * Replaced an assertion by a test with detailed output.
+ * In case of incorrect result, detect whether Valgrind is used and
+ one gets the result obtained with Valgrind due to
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=890215
+ https://bugs.kde.org/show_bug.cgi?id=421262
+ (long double behaves as double); in this case, output a message
+ without an error since Valgrind is the only cause of the
+ miscalculation.
+ * Corrected a value in a test, which did not match the comment.
+
+r14024-14027:
+[src/digamma.c]
+ * Replaced some MPFR_EXP / mpfr_get_exp by MPFR_GET_EXP to check that
+ the MPFR number has an exponent (i.e. it is not a special value).
+ * Added an integer overflow check on a precision.
+ * Fixed a bug: an exponent was read while the value could be zero.
+
+r14028:
+[tests/tdigamma.c] Increase the number of tests.
+
+r14029,14031:
+[doc/mpfr.texi] Specify the range of b for mpfr_get_str_ndigits.
+
+r14030:
+[src/get_str.c] Since the mpfr_get_str_ndigits function is in the
+public API, use MPFR_ASSERTN instead of MPFR_ASSERTD on the condition
+on the argument b in order to get an assertion failure (by default)
+if this condition is not satisfied.
+
+r14032,14035-14036:
+[src/mpfr-longlong.h] Applied patch on
+ https://gmplib.org/list-archives/gmp-bugs/2020-June/004807.html
+to fix add_ssaaaa and sub_ddmmss on arm / aarch64, in order to resolve
+ https://sympa.inria.fr/sympa/arc/mpfr/2020-06/msg00017.html
+ https://sympa.inria.fr/sympa/arc/mpfr/2020-06/msg00059.html
+
+r14034:
+[tests/tcmp_ui.c] Added a comment about a failing test with tcc if
+one adds tcc support for macros using __builtin_constant_p in mpfr.h
+by testing __TINYC__.
+Bug report against tcc: https://savannah.nongnu.org/bugs/?58606
+------------------------------------------------------------------------
+r14019 | vlefevre | 2020-06-13 13:22:33 +0000 (Sat, 13 Jun 2020) | 5 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/configure.ac
+
+[configure.ac] No longer add -Wc++-compat to CFLAGS when the compiler
+is GCC not in C++ mode (reverting the change done in r13406) since this
+option is not available before GCC 4.1:
+ https://sympa.inria.fr/sympa/arc/mpfr/2020-06/msg00008.html
+(merged changeset r14018 from the trunk)
+------------------------------------------------------------------------
+r14016 | vlefevre | 2020-06-13 09:32:51 +0000 (Sat, 13 Jun 2020) | 7 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/doc/mpfr.texi
+ M /branches/4.1/tests/tfpif.c
+
+Merged the latest changes from the trunk:
+
+r14012:
+[tests/tfpif.c] Updated comment about the bug detected on AIX.
+
+r14015:
+[doc/mpfr.texi] ACM TOMS article: use the preferred DOI URL.
+------------------------------------------------------------------------
+r14011 | vlefevre | 2020-06-13 01:05:59 +0000 (Sat, 13 Jun 2020) | 8 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/NEWS
+ M /branches/4.1/tools/announce-text
+
+Merged the latest changes from the trunk:
+
+r14008,14010:
+[tools/announce-text] For release candidates, automatically adapt the
+flow of the text.
+
+r14009:
+[NEWS] Updated mpfr.org URLs (http → https).
+------------------------------------------------------------------------
+r14006 | vlefevre | 2020-06-12 17:55:05 +0000 (Fri, 12 Jun 2020) | 17 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/README
+ M /branches/4.1/tests/tests.c
+ M /branches/4.1/tests/tfpif.c
+
+Merged the latest changes from the trunk:
+
+r14003:
+[tests/tfpif.c] Fixed a bug (in the test) detected on AIX[*], where
+an fclose failed due to a previous read failure. At the same time,
+check that a read failure no longer occurs. Note: the read failure
+made mpfr_fpif_import fail, but this is a test where it is expected
+to fail, i.e. we now check that it fails for a good reason.
+[*] gcc119.fsffrance.org on the GCC Compile farm.
+
+r14004:
+[tests/tests.c] Removed a useless "#include <errno.h>" (added in r5252,
+useless since r5253).
+
+r14005:
+[README] Added URL of the official GNU MPFR website and a note about the
+future migration, since InriaForge will shut down in December 2020.
+------------------------------------------------------------------------
+r14002 | vlefevre | 2020-06-12 12:17:11 +0000 (Fri, 12 Jun 2020) | 1 line
+Changed paths:
+ M /branches/4.1/ChangeLog
+
+ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
+------------------------------------------------------------------------
+r14001 | vlefevre | 2020-06-12 12:10:28 +0000 (Fri, 12 Jun 2020) | 1 line
+Changed paths:
+ M /branches/4.1/VERSION
+ M /branches/4.1/configure.ac
+ M /branches/4.1/doc/mpfr.texi
+ M /branches/4.1/src/mpfr.h
+ M /branches/4.1/src/version.c
+
+Updated version to 4.1.0-rc1.
+------------------------------------------------------------------------
+r14000 | vlefevre | 2020-06-12 12:09:52 +0000 (Fri, 12 Jun 2020) | 2 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/tools/update-version
+
+[tools/update-version] Improved a message.
+(merged changeset r13999 from the trunk)
+------------------------------------------------------------------------
+r13998 | vlefevre | 2020-06-12 12:02:30 +0000 (Fri, 12 Jun 2020) | 3 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/src/mpfr-longlong.h
+
+[src/mpfr-longlong.h] Corrected a comment from GMP's longlong.h, which
+makes codespell complain in particular.
+(merged changeset r13997 from the trunk)
+------------------------------------------------------------------------
+r13996 | vlefevre | 2020-06-12 11:56:18 +0000 (Fri, 12 Jun 2020) | 4 lines
+Changed paths:
+ M /branches/4.1
+ M /branches/4.1/tools/mpfrlint
+
+[tools/mpfrlint] Improved the __GMP_DECLSPEC test:
+ * No longer exclude "src/mpfr.h".
+ * Avoid false positives in "src/mpfr.h" and "src/mpfr-longlong.h".
+(merged changeset r13995 from the trunk)
+------------------------------------------------------------------------
+r13994 | vlefevre | 2020-06-12 11:45:04 +0000 (Fri, 12 Jun 2020) | 1 line
+Changed paths:
+ M /branches/4.1/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13991 | vlefevre | 2020-06-12 11:40:23 +0000 (Fri, 12 Jun 2020) | 1 line
+Changed paths:
+ A /branches/4.1 (from /trunk:13990)
+
+Created branch 4.1.
+------------------------------------------------------------------------
+r13990 | vlefevre | 2020-06-12 11:39:36 +0000 (Fri, 12 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/ChangeLog
+
+ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
+------------------------------------------------------------------------
+r13989 | vlefevre | 2020-06-11 21:22:20 +0000 (Thu, 11 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/mpfr.h
+ M /trunk/src/total_order.c
+ M /trunk/tests/ttotal_order.c
+
+Renamed mpfr_total_order to mpfr_total_order_p for consistency with the
+other predicates (by convention, the function name should end with _p).
+------------------------------------------------------------------------
+r13987 | vlefevre | 2020-06-11 15:15:52 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] New function mpfr_total_order. Detailed mpfr_get_str_ndigits.
+------------------------------------------------------------------------
+r13986 | vlefevre | 2020-06-11 15:07:52 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated "To make a release".
+------------------------------------------------------------------------
+r13980 | vlefevre | 2020-06-11 13:01:58 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated "To make a release".
+------------------------------------------------------------------------
+r13979 | vlefevre | 2020-06-11 12:44:42 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] Updated -version-info to 7:0:1 for MPFR 4.1.0.
+------------------------------------------------------------------------
+r13978 | vlefevre | 2020-06-11 12:41:25 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Additional details, in particular binary compatibility.
+------------------------------------------------------------------------
+r13977 | vlefevre | 2020-06-11 12:05:29 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Some improvements.
+------------------------------------------------------------------------
+r13976 | zimmerma | 2020-06-11 07:44:42 +0000 (Thu, 11 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] one more test is skipped now
+
+------------------------------------------------------------------------
+r13975 | zimmerma | 2020-06-11 07:44:00 +0000 (Thu, 11 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] add test results with reduced limb size (int)
+
+------------------------------------------------------------------------
+r13974 | vlefevre | 2020-06-11 00:00:45 +0000 (Thu, 11 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated "To make a release".
+------------------------------------------------------------------------
+r13973 | vlefevre | 2020-06-10 23:19:17 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Added release name for 4.1.0: "épinards à la crème".
+------------------------------------------------------------------------
+r13971 | vlefevre | 2020-06-10 21:53:27 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] English usage improvement.
+------------------------------------------------------------------------
+r13970 | vlefevre | 2020-06-10 21:50:12 +0000 (Wed, 10 Jun 2020) | 15 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/tests/tvalist.c
+
+Fixed 2 issues with tests/tvalist.c:
+ 1. When building with mini-gmp (--with-mini-gmp=DIR) without
+ optimizations (-O0), the build of tvalist was failing because
+ the formatted output functions are not supported (this issue
+ wasn't noticed with optimizations due to dead code elimination).
+ Fix: this test is disabled with mini-gmp (not needed anyway).
+ 2. Dead code elimination with optimizations partly broke the goal
+ of this test, i.e. checking that mpfr_vfprintf was available.
+ This dead code was introduced in r7648 "Make sure that fct is
+ used (avoid a warning)." (where fct = mpfr_vfprintf) but was
+ actually not sufficient.
+ Fix: call mpfr_vfprintf unconditionally, but on an empty string
+ in order to avoid output to stdout.
+In addition to these changes in tests/tvalist.c, src/mpfr-impl.h could
+be simplified as a consequence.
+------------------------------------------------------------------------
+r13969 | vlefevre | 2020-06-10 21:26:07 +0000 (Wed, 10 Jun 2020) | 5 lines
+Changed paths:
+ M /trunk/src/clears.c
+ M /trunk/src/inits.c
+ M /trunk/src/inits2.c
+ M /trunk/tests/tvalist.c
+
+Removed '# undef HAVE_STDARG' before '# include "config.h"' when it
+was used, as it was not always undefined (e.g. in tests/tsprintf.c)
+and there are no reasons to undefine this macro specifically.
+Note: this code was introduced in r2665 (2004-02-06), perhaps for
+the MPFR build inside GMP, which has been dropped a long time ago.
+------------------------------------------------------------------------
+r13968 | vlefevre | 2020-06-10 21:07:30 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tvalist.c
+
+[tests/tvalist.c] Updated a comment.
+------------------------------------------------------------------------
+r13967 | vlefevre | 2020-06-10 21:01:12 +0000 (Wed, 10 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tvalist.c
+
+[tests/tvalist.c] Correction when config.h is used (code copied from
+src/inits.c).
+------------------------------------------------------------------------
+r13966 | zimmerma | 2020-06-10 14:27:40 +0000 (Wed, 10 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] review
+
+------------------------------------------------------------------------
+r13964 | vlefevre | 2020-06-10 12:48:02 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Typo in option name.
+------------------------------------------------------------------------
+r13963 | vlefevre | 2020-06-10 10:58:36 +0000 (Wed, 10 Jun 2020) | 5 lines
+Changed paths:
+ M /trunk/src/mpfr-longlong.h
+
+[src/mpfr-longlong.h]
+ * Updated comment about this file and the changes against GMP 6.2.0.
+ * Define __GMP_GNUC_PREREQ if it isn't defined (this is currently not
+ needed since it is defined in gmp.h as used also there, but this is
+ useful in case some future gmp.h version no longer defines it).
+------------------------------------------------------------------------
+r13962 | vlefevre | 2020-06-10 10:39:09 +0000 (Wed, 10 Jun 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-longlong.h
+
+[src/mpfr-longlong.h] Update: applied the diff of GMP's longlong.h
+between GMP 6.1.0 and GMP 6.2.0, after reverting changesets 13251,
+11042, 11025, and 10727, as these changes are present in the diff.
+------------------------------------------------------------------------
+r13961 | vlefevre | 2020-06-10 10:21:51 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] With mini-gmp, also check the availability of srand48.
+------------------------------------------------------------------------
+r13960 | vlefevre | 2020-06-10 10:15:52 +0000 (Wed, 10 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] For gmp_randseed_ui, which uses srand48, use
+a portable version of the conversion from unsigned long to long.
+------------------------------------------------------------------------
+r13959 | vlefevre | 2020-06-10 09:37:15 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] Note also that the random functions are not thread-safe.
+------------------------------------------------------------------------
+r13958 | vlefevre | 2020-06-10 09:21:46 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] Major update.
+------------------------------------------------------------------------
+r13957 | vlefevre | 2020-06-10 08:40:02 +0000 (Wed, 10 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Removed a FIXME (no problems found).
+------------------------------------------------------------------------
+r13955 | vlefevre | 2020-06-09 15:53:51 +0000 (Tue, 09 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Code style: replaced (mp_limb_t) -1 by MPFR_LIMB_MAX.
+------------------------------------------------------------------------
+r13954 | vlefevre | 2020-06-09 15:46:19 +0000 (Tue, 09 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mul_ui.c
+
+[src/mul_ui.c] Bug fix: in the code where MPFR_LONG_WITHIN_LIMB is
+not defined, update the flags (needed for the possible overflow).
+------------------------------------------------------------------------
+r13953 | vlefevre | 2020-06-09 15:37:58 +0000 (Tue, 09 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tmul_ui.c
+
+[tests/tmul_ui.c] Added an overflow check that fails in MPFR_RNDZ with
+mini-gmp and mp_limb_t < long (e.g. "-DMINI_GMP_LIMB_TYPE=short").
+------------------------------------------------------------------------
+r13952 | vlefevre | 2020-06-09 15:15:04 +0000 (Tue, 09 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tgeneric.c
+
+[tests/tgeneric.c] In the MPFR_SUSPICIOUS_OVERFLOW case, output yprec.
+------------------------------------------------------------------------
+r13951 | vlefevre | 2020-06-09 15:04:19 +0000 (Tue, 09 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Changed the code that defines MPFR_LONG_WITHIN_LIMB
+in order to support mini-gmp with -DMINI_GMP_LIMB_TYPE=...
+------------------------------------------------------------------------
+r13950 | vlefevre | 2020-06-09 13:39:35 +0000 (Tue, 09 Jun 2020) | 8 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] Fixed build failure with GMP_NUMB_BITS == 8 due to the
+use of uint64_t in src/get_ld.c, while <stdint.h> was not included:
+replaced it by "unsigned long long", which does not need a specific
+header (an exact 64-bit type is not needed, we just need at least a
+64-bit width, which unsigned long long is guaranteed to have).
+Note: unsigned long long may not be available with a pre-C99 compiler,
+but this is not worse than uint64_t. This limitation is currently OK
+as GMP_NUMB_BITS == 8 support is just for testing.
+------------------------------------------------------------------------
+r13949 | vlefevre | 2020-06-09 10:53:21 +0000 (Tue, 09 Jun 2020) | 12 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Make MPFR_CHECK_MP_LIMB_T_VS_LONG and
+MPFR_CHECK_MP_LIMB_T_VS_INTMAX similar:
+ * Use AC_LINK_IFELSE in MPFR_CHECK_MP_LIMB_T_VS_LONG too: this
+ is safer than AC_COMPILE_IFELSE, as it will detect undefined
+ function-like macros.
+ * Define MPFR_USE_STATIC_ASSERT in MPFR_CHECK_MP_LIMB_T_VS_INTMAX
+ too in order to make sure that a static assertion is used (not
+ the MPFR_ASSERTN fallback).
+Note: These constitute redundant safeguards because if MPFR_ASSERTN
+is used, it will be regarded as a function since the macro is not
+defined in this context, and linking will fail as a consequence.
+But this redundancy will protect more against MPFR code evolution.
+------------------------------------------------------------------------
+r13948 | vlefevre | 2020-06-09 09:41:51 +0000 (Tue, 09 Jun 2020) | 16 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed MPFR_CHECK_MP_LIMB_T_VS_LONG macro by forcing
+MPFR_USE_STATIC_ASSERT to 1 before including mpfr-sassert.h, i.e.
+by requiring static assertions: because AC_COMPILE_IFELSE is used
+(i.e. just compiling, no linking), the test could incorrectly succeed
+when MPFR_USE_STATIC_ASSERT was not defined, i.e. whatever the value
+of "(mp_limb_t) -1 >= (unsigned long) -1"; indeed, in this case,
+MPFR_ASSERTN() was used instead of a static assertion, and since the
+macro was not defined here, MPFR_ASSERTN was regarded as a function
+(without a prototype), which was fine for compiling (except when the
+compiler is configured to regard warnings such as missing prototype
+as errors). In short, one could get "yes" while long was larger than
+mp_limb_t.
+Note: In uncommon cases (non-standard compiler...), one can still get
+"no" while a long fits in mp_limb_t, but this isn't much an issue as
+the MPFR code should work in such a case. Moreover, src/mpfr-impl.h
+will also have the chance to set MPFR_LONG_WITHIN_LIMB in practice.
+------------------------------------------------------------------------
+r13947 | vlefevre | 2020-06-09 00:57:05 +0000 (Tue, 09 Jun 2020) | 28 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/src/mpfr-sassert.h
+ M /trunk/tune/tuneup.c
+
+Removed MPFR_DECL_STATIC_ASSERT macro as it was buggy, unused, rather
+useless, and it had drawbacks. Details:
+ * In src/mpfr-sassert.h, the default definition of this macro in the
+ MPFR_USE_STATIC_ASSERT case ended with a spurious ";". Since this
+ macro was unused, this wasn't noticeable... except in the configure
+ test for static assertions, which failed in some cases (e.g. with
+ CFLAGS="-std=c99 -pedantic-errors -Wno-error=overlength-strings")
+ for this reason, which had the effect to let MPFR_USE_STATIC_ASSERT
+ undefined, while static assertions were actually working.
+ * Still in src/mpfr-sassert.h, but when MPFR_USE_STATIC_ASSERT is not
+ defined, the MPFR_DECL_STATIC_ASSERT(c) expanded to nothing, which
+ would yield invalid code as
+ MPFR_DECL_STATIC_ASSERT(some_assertion);
+ would yield an extra ";" (about the same issue as above). Given
+ the fact that the portable MPFR_USE_STATIC_ASSERT code does not
+ work with this compiler, it is not clear whether this is fixable
+ in a completely reliable way.
+ * MPFR_DECL_STATIC_ASSERT can be replaced by MPFR_STAT_STATIC_ASSERT
+ after moving it to the statement section of a function, with almost
+ no drawbacks (just a bit readability in some cases?).
+ * When MPFR_USE_STATIC_ASSERT is not defined, MPFR_STAT_STATIC_ASSERT
+ will check the assertion at run time (for free, since the result is
+ known at compile time), while MPFR_DECL_STATIC_ASSERT would not be
+ able to do anything useful.
+Changes:
+ * acinclude.m4: removed the test of MPFR_DECL_STATIC_ASSERT.
+ * src/mpfr-sassert.h: removed MPFR_DECL_STATIC_ASSERT definitions.
+ * tune/tuneup.c: removed MPFR_DECL_STATIC_ASSERT redefinition.
+------------------------------------------------------------------------
+r13946 | vlefevre | 2020-06-08 23:55:33 +0000 (Mon, 08 Jun 2020) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] MPFR_CHECK_MP_LIMB_T_VS_LONG: updated comment to say
+that using MPFR_ASSERTN (as the code tries to do if static assertions
+are not supported, but currently fails) would be incorrect.
+------------------------------------------------------------------------
+r13945 | vlefevre | 2020-06-08 13:45:33 +0000 (Mon, 08 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] In MPFR_CHECK_MP_LIMB_T_VS_INTMAX, do the test only if
+intmax_t is defined (assuming that it is iff uintmax_t is defined).
+------------------------------------------------------------------------
+r13944 | vlefevre | 2020-06-08 13:39:32 +0000 (Mon, 08 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Also output the results of the detection of
+"long within limb" and "intmax_t within limb".
+------------------------------------------------------------------------
+r13942 | vlefevre | 2020-06-04 16:22:38 +0000 (Thu, 04 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Removed an obsolete FIXME, which is probably wrong.
+------------------------------------------------------------------------
+r13941 | vlefevre | 2020-06-04 16:17:12 +0000 (Thu, 04 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated a comment, replacing a resolved FIXME.
+------------------------------------------------------------------------
+r13940 | vlefevre | 2020-06-04 15:53:59 +0000 (Thu, 04 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] MPFR_CHECK_DBL2INT_BUG test: avoid potentially reserved
+exit status.
+------------------------------------------------------------------------
+r13939 | vlefevre | 2020-06-04 14:29:17 +0000 (Thu, 04 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed r13938: the new MPFR_C_REALFP_FORMAT macro also
+needs to take the printf length modifier in argument.
+------------------------------------------------------------------------
+r13938 | vlefevre | 2020-06-04 13:51:32 +0000 (Thu, 04 Jun 2020) | 11 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Improved the code to determine the format of double,
+resolving the FIXME. The issue was that it used an AC_RUN_IFELSE,
+so that the format could not be determined when cross-compiling.
+The code to determine the format of long double did not have such
+an issue: the object file was analyzed by an awk script. Since a
+long double can have the same format as a double, this code was
+already able to recognize a double, in particular. So the change
+consisted in slightly adapting this code to accept the tested type
+as an argument ("double" or "long double", the mpfr_cv_… variable
+name being obtained thanks to AS_VAR_PUSHDEF) and reusing it for
+the detection of the format of double.
+------------------------------------------------------------------------
+r13937 | vlefevre | 2020-06-04 13:21:09 +0000 (Thu, 04 Jun 2020) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] MPFR_C_LONG_DOUBLE_FORMAT cleanup:
+ * Removed an unused AH_VERBATIM.
+ * Removed "not available" condition, no longer possible since r13936.
+------------------------------------------------------------------------
+r13936 | vlefevre | 2020-06-04 12:34:18 +0000 (Thu, 04 Jun 2020) | 6 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fix concerning r13935: also removed code that tested
+the availability of long double. This code was useless since it was
+just outputting "not available" if long double was missing, and one
+would get an error later since MPFR requires long double. But since
+long double is in ISO C89, it is useless to add a test just to return
+an error for pre-C89 compilers.
+------------------------------------------------------------------------
+r13935 | vlefevre | 2020-06-04 12:17:15 +0000 (Thu, 04 Jun 2020) | 4 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+[acinclude.m4] Removed "AC_CHECK_TYPES([long double])", whose only
+ purpose is to define a HAVE_LONG_DOUBLE macro.
+[configure.ac] Removed HAVE_LONG_DOUBLE from the cleanup: no longer
+ needed with the change in acinclude.m4.
+------------------------------------------------------------------------
+r13934 | vlefevre | 2020-06-03 13:44:24 +0000 (Wed, 03 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Minor change in a comment.
+------------------------------------------------------------------------
+r13933 | vlefevre | 2020-06-03 13:38:17 +0000 (Wed, 03 Jun 2020) | 10 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+Cleanup about the function detection by autoconf.
+ * acinclude.m4: removed the detection of memmove, memset and strtol,
+ which was not used (a macro "HAVE_..." was defined... to be removed
+ in configure.ac!); for AC_CHECK_FUNCS, remove options starting with
+ "-Werror" as they can yield a spurious failure due to the way this
+ test is done (this occurred on memmove and memset with GCC due to
+ builtins, and similar issues could still occur in practice with the
+ remaining functions in the AC_CHECK_FUNCS list).
+ * configure.ac: removed HAVE_STRTOL from the macro cleanup: no longer
+ needed since strtol has been removed from the AC_CHECK_FUNCS list.
+------------------------------------------------------------------------
+r13932 | vlefevre | 2020-06-03 12:11:13 +0000 (Wed, 03 Jun 2020) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Minor improvement: in the MPFR_CHECK_GMP test, changed
+the exit status values 1..3 to 81..83 in order to avoid confusion, as
+low values can typically be returned in case of compile or link error.
+------------------------------------------------------------------------
+r13931 | vlefevre | 2020-06-02 22:43:08 +0000 (Tue, 02 Jun 2020) | 1 line
+Changed paths:
+ M /trunk/tests/memory.c
+
+[tests/memory.c] Updated a comment.
+------------------------------------------------------------------------
+r13930 | vlefevre | 2020-06-02 21:35:11 +0000 (Tue, 02 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-longlong.h
+
+[src/mpfr-longlong.h] Added code to check that mpfr-longlong.h is not
+included directly; MPFR_NEED_LONGLONG_H must be defined instead.
+------------------------------------------------------------------------
+r13929 | vlefevre | 2020-06-02 21:26:51 +0000 (Tue, 02 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] To complete r13928, one also needs to define
+MPFR_NEED_INTMAX_H here when mpfr-intmax.h is used.
+------------------------------------------------------------------------
+r13928 | vlefevre | 2020-06-02 21:21:45 +0000 (Tue, 02 Jun 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+
+[src/{mpfr-impl.h,mpfr-intmax.h}] Added code to check that mpfr-intmax.h
+is not included directly; MPFR_NEED_INTMAX_H must be defined instead.
+------------------------------------------------------------------------
+r13923 | vlefevre | 2020-06-01 10:39:52 +0000 (Mon, 01 Jun 2020) | 12 lines
+Changed paths:
+ M /trunk/src/fits_intmax.c
+ M /trunk/src/fits_uintmax.c
+ M /trunk/src/get_sj.c
+ M /trunk/src/get_str.c
+ M /trunk/src/get_uj.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+ M /trunk/src/set_sj.c
+ M /trunk/src/set_uj.c
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/memory.c
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tversion.c
+
+Bug fixes and cleanup related to "src/mpfr-intmax.h" by introducing
+a new macro MPFR_NEED_INTMAX_H, which should be defined instead of
+using: #include "mpfr-intmax.h"
+
+Details on the bugs fixed:
+ * The code added in r13916 forgot a #include <limits.h> since this
+ code does a test on ULLONG_MAX. With the cleanup, <limits.h> is
+ already always included by mpfr-impl.h (early enough).
+ * In src/get_str.c and tests/memory.c, a #include "config.h" was
+ missing before #include "mpfr-intmax.h"; this issue would affect
+ platforms where "config.h" is needed and where <inttypes.h> or
+ <stdint.h> does not exist or does not work.
+------------------------------------------------------------------------
+r13922 | vlefevre | 2020-06-01 00:15:37 +0000 (Mon, 01 Jun 2020) | 3 lines
+Changed paths:
+ M /trunk/tests/tgamma.c
+
+[tests/tgamma.c] For the non-regression test added in r13907, one
+also needs to temporarily increase the memory limit, thus require
+MPFR_CHECK_LARGEMEM too.
+------------------------------------------------------------------------
+r13920 | vlefevre | 2020-05-26 11:24:25 +0000 (Tue, 26 May 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] If decimal floats are explicitly disabled, do not do
+the check of the bit-field ordering for _Decimal128.
+------------------------------------------------------------------------
+r13919 | vlefevre | 2020-05-26 11:12:21 +0000 (Tue, 26 May 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed detection of bit-field ordering for _Decimal128:
+a compiler error with exit status 1 was mixed up with little endian.
+------------------------------------------------------------------------
+r13916 | vlefevre | 2020-05-24 17:53:31 +0000 (Sun, 24 May 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-intmax.h
+
+[src/mpfr-intmax.h] Added support for Silicon Graphics IRIX 6.5 (1998)
+with native /usr/bin/cc, which knows the long long type but defines
+ULONGLONG_MAX, etc. instead of ULLONG_MAX, etc.
+------------------------------------------------------------------------
+r13915 | vlefevre | 2020-05-24 01:35:17 +0000 (Sun, 24 May 2020) | 4 lines
+Changed paths:
+ M /trunk/tests/tget_ld_2exp.c
+
+[tests/tget_ld_2exp.c] Reverted r13914 as we still need to support
+pre-C99 compilers (and this change was useless).
+If C99 syntax is needed, there should be a configure test, and the
+code should be conditional.
+------------------------------------------------------------------------
+r13914 | zimmerma | 2020-05-23 19:53:25 +0000 (Sat, 23 May 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_ld_2exp.c
+
+[tests/tget_ld_2exp.c] put expected value in hex in bug20180904()
+
+------------------------------------------------------------------------
+r13913 | vlefevre | 2020-05-20 01:13:35 +0000 (Wed, 20 May 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] "To make a release": mention MPFR_CHECK_EXPENSIVE.
+------------------------------------------------------------------------
+r13912 | zimmerma | 2020-05-19 21:19:06 +0000 (Tue, 19 May 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tgamma.c
+
+[tests/tgamma.c] added comment about bug fix
+
+------------------------------------------------------------------------
+r13911 | zimmerma | 2020-05-19 21:13:36 +0000 (Tue, 19 May 2020) | 3 lines
+Changed paths:
+ M /trunk/src/bernoulli.c
+
+[src/bernoulli.c] improve initial precision in mpfr_bernoulli_internal()
+ (avoid failures for n <= 10000)
+
+------------------------------------------------------------------------
+r13910 | zimmerma | 2020-05-19 20:01:02 +0000 (Tue, 19 May 2020) | 2 lines
+Changed paths:
+ M /trunk/src/bernoulli.c
+
+[src/bernoulli.c] fix bug with non-regression test added in r13907
+
+------------------------------------------------------------------------
+r13909 | zimmerma | 2020-05-19 17:59:41 +0000 (Tue, 19 May 2020) | 3 lines
+Changed paths:
+ M /trunk/src/bernoulli.c
+
+[src/bernoulli.c] temporary fix for the bug in mpfr_gamma, something must be
+ wrong in the error analysis of mpfr_bernoulli_internal()
+
+------------------------------------------------------------------------
+r13908 | zimmerma | 2020-05-19 16:13:09 +0000 (Tue, 19 May 2020) | 3 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/tests/tgamma.c
+
+[doc/README.dev] added MPFR_CHECK_EXPENSIVE
+[tests/tgamma.c] use MPFR_CHECK_EXPENSIVE
+
+------------------------------------------------------------------------
+r13907 | zimmerma | 2020-05-19 15:06:58 +0000 (Tue, 19 May 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tgamma.c
+
+added non-regression test for bug reported by Frithjof Blomquist
+
+------------------------------------------------------------------------
+r13906 | vlefevre | 2020-05-04 15:25:13 +0000 (Mon, 04 May 2020) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Use of codespell: better workaround to python ugliness.
+------------------------------------------------------------------------
+r13898 | vlefevre | 2020-04-27 20:12:09 +0000 (Mon, 27 Apr 2020) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Section "Rounding" / even-rounding rule: the odd
+radices β are actually not concerned since in such radices, β^k
+is always odd, so that the exponent does not matter.
+------------------------------------------------------------------------
+r13897 | vlefevre | 2020-04-27 19:59:50 +0000 (Mon, 27 Apr 2020) | 7 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] In Section "Rounding", for MPFR_RNDN, added a note
+about the even-rounding rule in particular cases: 1-digit precision
+and odd radices.
+Note: A short explanation was already in the mpfr_get_str description,
+which is where the issue could occur at the time the minimum precision
+of MPFR numbers was 2. Now that the minimum precision is 1, this rule
+in such special cases is more general.
+------------------------------------------------------------------------
+r13896 | vlefevre | 2020-04-27 19:27:57 +0000 (Mon, 27 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] + "than": also in a comment.
+------------------------------------------------------------------------
+r13895 | vlefevre | 2020-04-27 19:19:53 +0000 (Mon, 27 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Corrected a typo. Changed "{less,greater} or equal to"
+to the more common "{less,greater} than or equal to".
+------------------------------------------------------------------------
+r13893 | vlefevre | 2020-04-26 16:07:20 +0000 (Sun, 26 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] In the paragraph on mpfr_rnd_t, give a reference
+to Section "Rounding".
+------------------------------------------------------------------------
+r13892 | vlefevre | 2020-04-26 15:58:59 +0000 (Sun, 26 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] s/can not/cannot/
+------------------------------------------------------------------------
+r13891 | vlefevre | 2020-04-26 15:57:16 +0000 (Sun, 26 Apr 2020) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Improved Section "Rounding" even more:
+ * Added a note about the sign of the result (important for 0).
+ * Described the directed rounding modes (BTW, this notion of
+ "directed rounding modes" was used but never defined).
+------------------------------------------------------------------------
+r13890 | vlefevre | 2020-04-26 15:13:10 +0000 (Sun, 26 Apr 2020) | 5 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Improved the description of the rounding modes:
+ * Be more clear that MPFR_RNDN uses the even rounding rule.
+ * In "two representable numbers", add "consecutive".
+ * Be more general than radix 2 (due to conversions to a string).
+ * Consistent typography.
+------------------------------------------------------------------------
+r13889 | vlefevre | 2020-04-25 15:08:40 +0000 (Sat, 25 Apr 2020) | 5 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi]
+ * mpfr_init2: mention mpfr_prec_round; added a note about
+ memory allocation.
+ * mpfr_prec_round: clarification ("new allocation" could be
+ surprising since one needs less memory).
+------------------------------------------------------------------------
+r13888 | zimmerma | 2020-04-25 14:42:58 +0000 (Sat, 25 Apr 2020) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] document that mpfr_prec_round does no new allocation
+ in case the allocated memory is enough
+
+------------------------------------------------------------------------
+r13886 | vlefevre | 2020-04-22 15:27:07 +0000 (Wed, 22 Apr 2020) | 5 lines
+Changed paths:
+ M /trunk/src/atan.c
+
+[src/atan.c] Removing the FIXME: I can't see anything wrong in the
+MPFR code. This could be a bug in GCC's analyzer (which is currently
+experimental). And GCC bug 94713 in the analyzer prevents debugging
+as it makes impossible to track uninitialized values: warnings do not
+occur the first time an uninitialized value occurs.
+------------------------------------------------------------------------
+r13885 | vlefevre | 2020-04-22 15:10:28 +0000 (Wed, 22 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/src/atan.c
+
+[src/atan.c] Added an assertion.
+------------------------------------------------------------------------
+r13884 | vlefevre | 2020-04-22 15:02:31 +0000 (Wed, 22 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/src/atan.c
+
+[src/atan.c] Reduce the number of mpz_get_ui calls with assertions.
+------------------------------------------------------------------------
+r13883 | vlefevre | 2020-04-22 12:23:39 +0000 (Wed, 22 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/src/atan.c
+
+[src/atan.c] Added a FIXME.
+------------------------------------------------------------------------
+r13881 | vlefevre | 2020-04-14 11:12:16 +0000 (Tue, 14 Apr 2020) | 5 lines
+Changed paths:
+ M /trunk/doc/texinfo.tex
+
+[doc/texinfo.tex] Update to 2020-02-11.09 with "autoreconf -i -f"
+under Debian/unstable.
+Note: The generated mpfr.html and mpfr.info files remain the same.
+In mpfr.pdf, there are minor changes concerning horizontal spacing
+in paragraphs with a URL.
+------------------------------------------------------------------------
+r13879 | vlefevre | 2020-04-11 01:53:36 +0000 (Sat, 11 Apr 2020) | 4 lines
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Fixed missing "#if _MPFR_IEEE_FLOATS" that
+became visible with r13878 now that the encoding of decimal floats
+can be detected at compile time. But by fixing the defined macros
+manually, this issue could be visible before r13878.
+------------------------------------------------------------------------
+r13878 | vlefevre | 2020-04-10 11:19:19 +0000 (Fri, 10 Apr 2020) | 11 lines
+Changed paths:
+ M /trunk/INSTALL
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/README.dev
+ M /trunk/src/get_d64.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tversion.c
+
+Reworked decimal support and detection, resolving FIXMEs.
+ * INSTALL, acinclude.m4, configure.ac: --enable-decimal-float can
+ take new values. Change of macro DPD_FORMAT (DPD was assumed in
+ case of cross-compilation, which could be wrong) to 3 new macros:
+ DECIMAL_DPD_FORMAT, DECIMAL_BID_FORMAT, DECIMAL_GENERIC_CODE.
+ * doc/README.dev: documented these 3 new macros.
+ * src/mpfr-impl.h: the detection of the BID encoding can now be
+ done at compile time when GCC defines __DECIMAL_BID_FORMAT__
+ (as on x86); support of the 3 new macros.
+ * src/{get_d64.c,set_d64.c,set_d128.c}: update.
+ * tests/{tget_set_d64.c,tget_set_d128.c,tversion.c}: update.
+------------------------------------------------------------------------
+r13877 | vlefevre | 2020-04-08 22:39:35 +0000 (Wed, 08 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/ChangeLog
+ M /trunk/INSTALL
+ M /trunk/src/get_d128.c
+ M /trunk/src/get_d64.c
+ M /trunk/src/mpfr-sassert.h
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+ M /trunk/tests/tests.c
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tsprintf.c
+
+Updated URLs of the GCC mailing-list archives.
+------------------------------------------------------------------------
+r13876 | vlefevre | 2020-04-06 21:06:10 +0000 (Mon, 06 Apr 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] Updated FIXME about AC_FUNC_ALLOCA (in 2019-01, I
+already noticed a probable bug in the AC_FUNC_ALLOCA description,
+but forgot about it).
+------------------------------------------------------------------------
+r13875 | vlefevre | 2020-04-06 14:03:01 +0000 (Mon, 06 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13874 | vlefevre | 2020-04-06 14:02:01 +0000 (Mon, 06 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Formatted output functions: added a comment with the URL
+of the bug report.
+------------------------------------------------------------------------
+r13873 | vlefevre | 2020-04-06 13:59:38 +0000 (Mon, 06 Apr 2020) | 3 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/doc/mpfr.texi
+
+[NEWS,doc/mpfr.texi] Documented the improvement in the formatted output
+functions (mpfr_printf, etc.) with an empty precision field, about
+trailing zeros.
+------------------------------------------------------------------------
+r13868 | vlefevre | 2020-04-03 10:56:49 +0000 (Fri, 03 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Corrected MPFR_ASSERTD to MPFR_ASSERTN.
+------------------------------------------------------------------------
+r13867 | vlefevre | 2020-04-03 10:54:16 +0000 (Fri, 03 Apr 2020) | 9 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Reverted r13862 and fixed the test_ubf test: A random
+precision was too small, so that an input for the test was not computed
+exactly (I had modified the values of the inputs for better tests, but
+forgot to change the minimum precision). Also check that the inputs are
+computed exactly (which is what I often do, but here, I had forgotten),
+in order to make errors like the above one easier to understand in case
+the test will have to be modified later.
+Note: With the incorrect input, the mpfr_sub1 result and flags were
+actually correct, so that this was only a bug in the test.
+------------------------------------------------------------------------
+r13866 | zimmerma | 2020-04-03 06:32:52 +0000 (Fri, 03 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] update CompCert instructions
+
+------------------------------------------------------------------------
+r13865 | zimmerma | 2020-04-02 20:35:33 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] fixed CompCert instructions
+
+------------------------------------------------------------------------
+r13864 | vlefevre | 2020-04-02 15:55:35 +0000 (Thu, 02 Apr 2020) | 6 lines
+Changed paths:
+ M /trunk/tests/tset_ld.c
+
+[tests/tset_ld.c] Reverted r13858: the check_overflow test was already
+in MPFR 4.0.1 and was succeeding on armv5tejl-unknown-linux-gnueabi,
+which had mpfr_cv_c_long_double_format='IEEE double, little endian'.
+The issue should be investigated.
+Note: MPFR_LDBL_MANT_DIG may be larger than the actual number of bits,
+but this should not cause a failure in the tests.
+------------------------------------------------------------------------
+r13863 | vlefevre | 2020-04-02 15:43:04 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_ld_2exp.c
+
+[tests/tget_ld_2exp.c] Proper fix: the bug20180904 test was designed
+for the x87 extended precision, so enable it only in this case.
+------------------------------------------------------------------------
+r13862 | zimmerma | 2020-04-02 14:06:30 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] modify test_ubf() to always hit a current failing test
+
+------------------------------------------------------------------------
+r13861 | vlefevre | 2020-04-02 13:49:16 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Fixed the change done in r13853 (about removed macros),
+making the code simpler and more maintainable at the same time.
+------------------------------------------------------------------------
+r13860 | zimmerma | 2020-04-02 11:48:28 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] added configuration for CompCert test
+
+------------------------------------------------------------------------
+r13859 | vlefevre | 2020-04-02 11:31:51 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] Removed obsolete workaround due to LDBL_MAX being buggy
+on old i386 systems (the tests were not using this workaround).
+------------------------------------------------------------------------
+r13858 | zimmerma | 2020-04-02 11:12:28 +0000 (Thu, 02 Apr 2020) | 3 lines
+Changed paths:
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tset_ld.c
+
+[tests/tget_ld_2exp.c] fixed for case where long double = double
+[tests/tset_ld.c] likewise
+
+------------------------------------------------------------------------
+r13857 | vlefevre | 2020-04-02 10:58:19 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Moved MPFR_CONFIGS invocation: MPFR_CONFIGS uses LDFLAGS,
+thus must be invoked after LDFLAGS has been determined completely.
+------------------------------------------------------------------------
+r13856 | zimmerma | 2020-04-02 10:32:50 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] now all tests pass with compcert
+
+------------------------------------------------------------------------
+r13855 | zimmerma | 2020-04-02 10:19:13 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] added missing LDFLAGS for long double test
+
+------------------------------------------------------------------------
+r13854 | vlefevre | 2020-04-02 09:56:46 +0000 (Thu, 02 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added HAVE_ALLOCA description.
+------------------------------------------------------------------------
+r13853 | vlefevre | 2020-04-02 09:53:55 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Do not remove the HAVE_ALLOCA macro, which is now used
+by MPFR to determine the default MPFR_ALLOCA_MAX value.
+------------------------------------------------------------------------
+r13852 | zimmerma | 2020-04-02 09:51:09 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] update CompCert instructions
+
+------------------------------------------------------------------------
+r13851 | vlefevre | 2020-04-02 09:45:31 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Output whether MPFR is built with the GMP build,
+and the MPFR_ALLOCA_MAX value if not.
+------------------------------------------------------------------------
+r13850 | vlefevre | 2020-04-02 09:24:44 +0000 (Thu, 02 Apr 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] If HAVE_ALLOCA is not defined, i.e. if alloca() is
+not available (as detected by the configure script), then set the
+default MPFR_ALLOCA_MAX value to 0 so that alloca() is not used.
+------------------------------------------------------------------------
+r13849 | zimmerma | 2020-04-02 06:57:07 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] added instructions for CompCert
+
+------------------------------------------------------------------------
+r13848 | vlefevre | 2020-04-02 01:26:46 +0000 (Thu, 02 Apr 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated MPFR_ALLOCA_MAX description.
+------------------------------------------------------------------------
+r13847 | vlefevre | 2020-04-02 01:04:08 +0000 (Thu, 02 Apr 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] When MPFR_ALLOCA_MAX = 0 (set at configure time),
+do not reference alloca() since we don't need it.
+------------------------------------------------------------------------
+r13844 | vlefevre | 2020-03-31 13:11:09 +0000 (Tue, 31 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] About mpfr_printf with %Re and empty precision field,
+added a comment with URLs of the discussion and the bug report.
+------------------------------------------------------------------------
+r13840 | vlefevre | 2020-03-30 19:07:12 +0000 (Mon, 30 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Typo in a comment.
+------------------------------------------------------------------------
+r13839 | vlefevre | 2020-03-30 14:52:53 +0000 (Mon, 30 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated message output when the gmp.h vs libgmp test
+fails: another cause may be that LD_RUN_PATH is not honored (problem
+seen under OpenBSD 6.6 / gcc302.fsffrance.org).
+------------------------------------------------------------------------
+r13835 | vlefevre | 2020-03-27 17:36:26 +0000 (Fri, 27 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tset_sj.c
+
+[tests/tset_sj.c] Forgot a "#ifndef NPRINTF_J" for printf("%jd",...).
+------------------------------------------------------------------------
+r13834 | vlefevre | 2020-03-27 15:45:17 +0000 (Fri, 27 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/set_uj.c
+
+[src/set_uj.c] Fixed underflow detection.
+------------------------------------------------------------------------
+r13833 | vlefevre | 2020-03-27 15:12:51 +0000 (Fri, 27 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/set_uj.c
+
+[src/set_uj.c] Added early overflow detection to avoid a possible
+integer overflow. Added a FIXME (incorrect underflow detection).
+------------------------------------------------------------------------
+r13832 | vlefevre | 2020-03-27 15:05:03 +0000 (Fri, 27 Mar 2020) | 6 lines
+Changed paths:
+ M /trunk/tests/tset_sj.c
+
+[tests/tset_sj.c] Added tests of mpfr_set_sj_2exp and mpfr_set_uj_2exp
+in precision 3 with integers from -31 to 31 and exponents MPFR_EXP_MIN,
+MPFR_EMIN_MIN-7 to MPFR_EMIN_MIN, MPFR_EMAX_MAX-7 to MPFR_EMAX_MAX,
+MPFR_EXP_MAX-7 to MPFR_EXP_MAX (like in tset_si.c, see r13808), but
+also exponents INTMAX_MIN and INTMAX_MAX. This shows bugs in set_uj.c,
+to be fixed...
+------------------------------------------------------------------------
+r13831 | vlefevre | 2020-03-27 14:17:10 +0000 (Fri, 27 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/set_sj.c
+
+[src/set_sj.c] Coding style.
+------------------------------------------------------------------------
+r13830 | vlefevre | 2020-03-27 13:59:05 +0000 (Fri, 27 Mar 2020) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+
+[src] Moved the definition of the numberof() macro from mpfr-gmp.h to
+mpfr-impl.h in order to always use our own. Also make sure that the
+type is signed, so that the value can be used in arbitrary expressions
+without the risk of silently switching to unsigned arithmetic.
+------------------------------------------------------------------------
+r13827 | vlefevre | 2020-03-26 12:58:24 +0000 (Thu, 26 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/texpm1.c
+
+[tests/texpm1.c] Updated the bad_cases() parameters to increase the
+proportion of generated bad cases.
+------------------------------------------------------------------------
+r13826 | vlefevre | 2020-03-26 11:51:33 +0000 (Thu, 26 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tset_si.c
+
+[tests/tset_si.c] Forgot a cast for MPFR_EXP_FSPEC argument.
+------------------------------------------------------------------------
+r13825 | vlefevre | 2020-03-26 10:07:00 +0000 (Thu, 26 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13824 | vlefevre | 2020-03-26 10:00:46 +0000 (Thu, 26 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/dump.c
+ M /trunk/src/mpfr-impl.h
+
+Consistency: "a UBF" → "an UBF" since UBF stands for "unbounded float".
+------------------------------------------------------------------------
+r13823 | vlefevre | 2020-03-26 09:56:45 +0000 (Thu, 26 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Updated UBF comment about aliasing rules.
+------------------------------------------------------------------------
+r13822 | vlefevre | 2020-03-26 09:53:55 +0000 (Thu, 26 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Updated UBF comment about aliasing rules.
+------------------------------------------------------------------------
+r13821 | vlefevre | 2020-03-26 09:35:25 +0000 (Thu, 26 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Bug fix (MPFR_ZEXP(x) as used for an assignment
+could yield undefined behavior on platforms where mpfr_exp_t has
+trap representations); this is also a general improvement.
+------------------------------------------------------------------------
+r13818 | vlefevre | 2020-03-26 02:45:48 +0000 (Thu, 26 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Avoid the build failure with -Werror=strict-aliasing by
+replacing x[…] by p[…] (but this doesn't eliminate the problem itself).
+------------------------------------------------------------------------
+r13816 | vlefevre | 2020-03-26 00:17:17 +0000 (Thu, 26 Mar 2020) | 5 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] UBF: updated comment: this breaks aliasing rules, but
+there isn't any other acceptable solution.
+Note: when trying to build MPFR without --enable-assert, with GCC and
+CFLAGS="-O2 -Werror=strict-aliasing", the compilation of tests/tsub.c
+currently fails because of that.
+------------------------------------------------------------------------
+r13815 | vlefevre | 2020-03-25 20:24:23 +0000 (Wed, 25 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Fixed tests on UBF.
+------------------------------------------------------------------------
+r13814 | vlefevre | 2020-03-25 20:04:16 +0000 (Wed, 25 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Fixed underflow handling in case c small (can occur only
+with UBF).
+------------------------------------------------------------------------
+r13813 | vlefevre | 2020-03-25 19:40:39 +0000 (Wed, 25 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Minor correction.
+------------------------------------------------------------------------
+r13812 | vlefevre | 2020-03-25 19:39:40 +0000 (Wed, 25 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Changed a RND_LOOP to RND_LOOP_NO_RNDF as the behavior
+with RNDF changed after a bug fix.
+------------------------------------------------------------------------
+r13811 | vlefevre | 2020-03-25 17:52:01 +0000 (Wed, 25 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Completed tests for UBF (currently fail).
+------------------------------------------------------------------------
+r13810 | vlefevre | 2020-03-25 17:28:45 +0000 (Wed, 25 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Bug fix for UBF and MPFR_RNDF.
+------------------------------------------------------------------------
+r13809 | vlefevre | 2020-03-25 17:07:02 +0000 (Wed, 25 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/set_si_2exp.c
+ M /trunk/src/set_ui_2exp.c
+
+[src/set_{si,ui}_2exp.c] Bug fix in MPFR_LONG_WITHIN_LIMB defined case:
+added early underflow/overflow checking to avoid integer overflow or
+errors due to special exponent values.
+------------------------------------------------------------------------
+r13808 | vlefevre | 2020-03-25 16:55:37 +0000 (Wed, 25 Mar 2020) | 5 lines
+Changed paths:
+ M /trunk/tests/tset_si.c
+
+[tests/tset_si.c] Added tests of mpfr_set_si_2exp and mpfr_set_ui_2exp
+in precision 3 with integers from -31 to 31 and exponents MPFR_EXP_MIN,
+MPFR_EMIN_MIN-7 to MPFR_EMIN_MIN, MPFR_EMAX_MAX-7 to MPFR_EMAX_MAX,
+MPFR_EXP_MAX-7 to MPFR_EXP_MAX, showing bugs in these functions when
+MPFR_LONG_WITHIN_LIMB is defined.
+------------------------------------------------------------------------
+r13807 | vlefevre | 2020-03-24 15:41:55 +0000 (Tue, 24 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] More tests on UBF. The results are not checked yet,
+but running the tests with UBsan could allow one to trigger bugs
+(such as the one fixed in r13806).
+------------------------------------------------------------------------
+r13806 | vlefevre | 2020-03-24 15:32:22 +0000 (Tue, 24 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] If exp_b = MPFR_EXP_MIN, an integer overflow may occur in
+the "MAX (aq, bq) + 2 <= diff_exp" branch. This is possible only with
+UBF. Fixed this bug with an early underflow detection in the UBF case.
+------------------------------------------------------------------------
+r13805 | vlefevre | 2020-03-24 13:47:38 +0000 (Tue, 24 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tfmma.c
+
+[tests/tfmma.c] Added extreme_underflow test: before the r13798 bug fix,
+this was triggering an integer overflow.
+------------------------------------------------------------------------
+r13804 | vlefevre | 2020-03-24 12:41:29 +0000 (Tue, 24 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Corrected a function name.
+------------------------------------------------------------------------
+r13803 | vlefevre | 2020-03-24 11:27:52 +0000 (Tue, 24 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] More tests on UBF, in particular with an exponent change
+(including subnormal → normal and normal → overflow due to that).
+------------------------------------------------------------------------
+r13802 | vlefevre | 2020-03-24 01:31:09 +0000 (Tue, 24 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Tests on UBF: underflow/overflow cases done.
+------------------------------------------------------------------------
+r13801 | vlefevre | 2020-03-23 16:05:46 +0000 (Mon, 23 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] More tests on UBF.
+------------------------------------------------------------------------
+r13800 | vlefevre | 2020-03-23 15:40:48 +0000 (Mon, 23 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] UBF: reordered macro definitions.
+------------------------------------------------------------------------
+r13799 | vlefevre | 2020-03-23 15:38:06 +0000 (Mon, 23 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/add1.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/sub1.c
+
+[src]
+ * mpfr-impl.h: define MPFR_UBF_GET_EXP macro.
+ * add1.c, sub1.c: use this macro.
+------------------------------------------------------------------------
+r13798 | vlefevre | 2020-03-23 15:13:34 +0000 (Mon, 23 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Detect an underflow case (before the main detection) to
+avoid a possible integer overflow with UBF.
+------------------------------------------------------------------------
+r13797 | vlefevre | 2020-03-23 13:19:56 +0000 (Mon, 23 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Added comments.
+------------------------------------------------------------------------
+r13796 | vlefevre | 2020-03-23 13:13:10 +0000 (Mon, 23 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] First tests on UBF.
+------------------------------------------------------------------------
+r13795 | vlefevre | 2020-03-23 11:09:53 +0000 (Mon, 23 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/agm.c
+
+[src/agm.c] Avoid a potential integer overflow with huge precisions.
+------------------------------------------------------------------------
+r13794 | vlefevre | 2020-03-16 10:57:40 +0000 (Mon, 16 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/root.c
+
+[src/root.c] Removed useless cast in a comparison, as both operands are
+non-negative.
+------------------------------------------------------------------------
+r13793 | vlefevre | 2020-03-16 10:53:56 +0000 (Mon, 16 Mar 2020) | 8 lines
+Changed paths:
+ M /trunk/src/rem1.c
+
+[src/rem1.c]
+ * Portability fix: when mpfr_exp_t <= long (which is the default),
+ an addition was done in unsigned integer arithmetic instead of
+ signed integer arithmetic, with a conversion back to a signed
+ type, i.e. with potentially implementation-defined behavior.
+ There could also be an integer overflow on huge-precision values
+ if mp_bitcnt_t > unsigned long.
+ * Updated a comment.
+------------------------------------------------------------------------
+r13792 | vlefevre | 2020-03-16 10:44:24 +0000 (Mon, 16 Mar 2020) | 8 lines
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c]
+ * Portability fix: when mpfr_exp_t <= long (which is the default),
+ an addition with a negative result was done in unsigned integer
+ arithmetic instead of signed integer arithmetic, with a conversion
+ back to a signed type, i.e. with implementation-defined behavior.
+ There could also be an integer overflow on huge-precision values
+ if mp_bitcnt_t > unsigned long.
+ * Updated comments.
+------------------------------------------------------------------------
+r13791 | vlefevre | 2020-03-16 10:34:26 +0000 (Mon, 16 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cos.c
+
+[src/cos.c] Updated a comment.
+------------------------------------------------------------------------
+r13790 | vlefevre | 2020-03-16 10:22:20 +0000 (Mon, 16 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cos.c
+
+[src/cos.c] Updated a comment.
+------------------------------------------------------------------------
+r13789 | vlefevre | 2020-03-16 10:07:34 +0000 (Mon, 16 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/const_log2.c
+
+[src/const_log2.c] Corrected type for the return value of mpz_scan1.
+------------------------------------------------------------------------
+r13788 | vlefevre | 2020-03-13 17:48:24 +0000 (Fri, 13 Mar 2020) | 5 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Revert a change done in r13783 for function bad_cases():
+ no longer fail if a generated value does not correspond to a bad case.
+ But fail if the MPFR_CHECK_BADCASES environment variable is defined
+ and too few bad cases are generated (less than 90%).
+[doc/README.dev] Document MPFR_CHECK_BADCASES.
+------------------------------------------------------------------------
+r13787 | vlefevre | 2020-03-13 16:40:17 +0000 (Fri, 13 Mar 2020) | 25 lines
+Changed paths:
+ M /trunk/tests/tatanh.c
+ M /trunk/tests/tests.c
+ M /trunk/tests/tlog1p.c
+ M /trunk/tests/trec_sqrt.c
+
+[tests] Update to test the ternary value in test5rm() when possible,
+and support the exact cases.
+ * tests.c:
+ - test5rm(): modified the prototype again and the behavior.
+ Now, either only one test is done and the ternary value is
+ not checked, or the test is done in the 5 rounding modes and
+ the ternary value is checked.
+ - data_check(): corresponding update; updated description.
+ - bad_cases(): test the exact cases too.
+ * tatanh.c: for the bad_cases() call, reduce emax to avoid errors in
+ the generation of bad cases due to the rounding of tanh(y) to 1,
+ which does not correspond to a bad case for atanh, but to an exact
+ case.
+ * tlog1p.c: for the bad_cases() call, reduce emax to avoid errors in
+ the generation of bad cases due to the rounding of expm1(y) to -1,
+ which does not correspond to a bad case for log1p, but to an exact
+ case.
+ * trec_sqrt.c: corrected the bad_cases() call to avoid negative
+ numbers.
+Note: the following tests
+ GMP_CHECK_RANDOMIZE=5 ./tacos
+ GMP_CHECK_RANDOMIZE=6 ./tatan
+ GMP_CHECK_RANDOMIZE=4 ./tcos
+currently fail, but because of a change in r13783 (see associated log
+for the reason). To be fixed later.
+------------------------------------------------------------------------
+r13786 | vlefevre | 2020-03-13 10:29:46 +0000 (Fri, 13 Mar 2020) | 5 lines
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Modified the prototype of test5rm() to support a
+parameter "exact". Therefore the parameter "test_one" is now a boolean
+(the value 2 is no longer supported, as redundant with "exact"), and
+about data_check() with rnd = '*', the loop is now done in test5rm(),
+i.e. test5rm() is called with test_one being false.
+------------------------------------------------------------------------
+r13785 | vlefevre | 2020-03-12 17:33:07 +0000 (Thu, 12 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] For bad_cases(), use the same pos and psup parameters
+as in troot.c for "rootn[2]", allowing inexact cases.
+------------------------------------------------------------------------
+r13784 | vlefevre | 2020-03-12 17:21:40 +0000 (Thu, 12 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tcbrt.c
+
+[tests/tcbrt.c] For bad_cases(), use the same pos and psup parameters
+as in troot.c for "rootn[3]", allowing inexact cases.
+------------------------------------------------------------------------
+r13783 | vlefevre | 2020-03-12 17:17:56 +0000 (Thu, 12 Mar 2020) | 19 lines
+Changed paths:
+ M /trunk/tests/tests.c
+ M /trunk/tests/troot.c
+
+[tests]
+ * tests.c, function bad_cases(): updated/added debug messages;
+ assume that the parameters are chosen in such a way that this
+ test always generates hard-to-round cases (including exact cases),
+ i.e. exit with an error if one does not get a bad case, otherwise
+ this can leave unexpected failures unnoticed (either due to a bug
+ in the MPFR library or due to poorly chosen parameters such as in
+ troot.c until now).
+ Note: ideally, this would require a proof, but it is better to get
+ (unlikely) spurious failures with a non-default GMP_CHECK_RANDOMIZE
+ value than missing important tests.
+ * troot.c, bad_cases() invocation:
+ - corrected the pos parameter: when n is even, it is useless to
+ generate a negative number as the function is not defined (the
+ inverse function generates a positive number, and the mismatch
+ now yields a failure due to the change in bad_cases); when n is
+ odd, generate as many negative numbers as positive ones.
+ - for n ≤ 5, reduce the psup parameter in order to also generate
+ inexact cases, instead of always exact cases.
+------------------------------------------------------------------------
+r13782 | vlefevre | 2020-03-12 16:17:38 +0000 (Thu, 12 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Added a TODO for bad_cases, as the exact cases are not
+tested yet. As a consequence, the bad_cases test added in tcbrt.c r13776
+is not really useful yet, as the cbrt bad cases are only exact cases.
+------------------------------------------------------------------------
+r13781 | vlefevre | 2020-03-12 15:48:34 +0000 (Thu, 12 Mar 2020) | 9 lines
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c]
+ * test5rm: removed additional useless tests added in r6037 in the
+ case test_one true and rnd = MPFR_RNDZ or MPFR_RNDA, since the
+ description was a bit incorrect and this was used only by
+ - data/digamma, where this yielded only duplicate tests (mode *);
+ - data/li2, where mode z is used on a few tests and could be
+ replaced by mode Z (i.e. test_one false) if need be;
+ updated description and added details.
+ * data_check: corrected/updated description.
+------------------------------------------------------------------------
+r13780 | vlefevre | 2020-03-12 13:05:16 +0000 (Thu, 12 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Minor change in an initialization.
+------------------------------------------------------------------------
+r13779 | vlefevre | 2020-03-12 00:57:34 +0000 (Thu, 12 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_{d64,d128}.c] Added a FIXME and improved a message.
+------------------------------------------------------------------------
+r13778 | vlefevre | 2020-03-12 00:44:26 +0000 (Thu, 12 Mar 2020) | 4 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added a FIXME: in case of cross-compiling, the guess
+"DPD" can be wrong, e.g. for the build with MinGW under Linux. One
+does not get a failure just because of other issues in the code,
+forcing the portable implementation of the decimal functions.
+------------------------------------------------------------------------
+r13776 | vlefevre | 2020-03-11 15:22:13 +0000 (Wed, 11 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tcbrt.c
+
+Added bad_cases tests for mpfr_cbrt.
+------------------------------------------------------------------------
+r13775 | vlefevre | 2020-03-11 15:12:09 +0000 (Wed, 11 Mar 2020) | 4 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Improved the algorithm in the case the precision of the
+input is larger than 3n, where n is the precision of the output, + 1
+if the rounding mode is MPFR_RNDN: instead of truncating the output,
+call mpz_root on the truncated input.
+------------------------------------------------------------------------
+r13774 | vlefevre | 2020-03-11 13:29:03 +0000 (Wed, 11 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tcbrt.c
+
+[tests/tcbrt.c] Test the ternary value on other exact cases.
+------------------------------------------------------------------------
+r13773 | vlefevre | 2020-03-11 13:23:28 +0000 (Wed, 11 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tcbrt.c
+
+[tests/tcbrt.c] Test the ternary value on special cases.
+------------------------------------------------------------------------
+r13772 | vlefevre | 2020-03-11 10:36:43 +0000 (Wed, 11 Mar 2020) | 5 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Description of the algorithm: improvement; corrected the
+end, which was incorrect and did not match the code (the comment was
+introduced in r2057 and was already incorrect in the round-down case;
+then the round-to-nearest case was improved in r2070, but the comment
+was not updated).
+------------------------------------------------------------------------
+r13771 | vlefevre | 2020-03-11 10:18:02 +0000 (Wed, 11 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Description of the algorithm: correction; added a TODO.
+------------------------------------------------------------------------
+r13769 | vlefevre | 2020-03-10 16:43:17 +0000 (Tue, 10 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Description of the algorithm: corrected indentation;
+renamed variable r to t in order to avoid confusion with the code
+(where r has a different meaning).
+------------------------------------------------------------------------
+r13768 | vlefevre | 2020-03-10 16:35:08 +0000 (Tue, 10 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Clarified a comment.
+------------------------------------------------------------------------
+r13767 | vlefevre | 2020-03-10 16:12:46 +0000 (Tue, 10 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Resolved the second FIXME and simplified the code
+(basically by removing duplicate code).
+------------------------------------------------------------------------
+r13766 | vlefevre | 2020-03-10 15:38:20 +0000 (Tue, 10 Mar 2020) | 4 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Description of the algorithm:
+ * Since there was no upper bound on s, let's remove the upper bound
+ on m (this now matches the code).
+ * Replaced the FIXME by one due to the lack of upper bound on s.
+------------------------------------------------------------------------
+r13765 | vlefevre | 2020-03-10 15:20:11 +0000 (Tue, 10 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Added another FIXME as the code does not match the
+algorithm described in a comment.
+------------------------------------------------------------------------
+r13764 | vlefevre | 2020-03-10 15:07:10 +0000 (Tue, 10 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Improved a condition to avoid operations that correspond
+to a no-op.
+------------------------------------------------------------------------
+r13763 | vlefevre | 2020-03-10 14:24:45 +0000 (Tue, 10 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Added an assertion.
+------------------------------------------------------------------------
+r13762 | vlefevre | 2020-03-10 14:15:11 +0000 (Tue, 10 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Code cleanup and simplification. Added logging messages and
+a FIXME about a comment (coming from r2057 with its associated code).
+------------------------------------------------------------------------
+r13761 | vlefevre | 2020-03-10 13:43:04 +0000 (Tue, 10 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/cbrt.c
+
+[src/cbrt.c] Removed a useless cast on a comparison operand, since
+both operands are non-negative.
+------------------------------------------------------------------------
+r13760 | vlefevre | 2020-03-10 13:38:06 +0000 (Tue, 10 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/atan.c
+
+[src/atan.c] Added assertions.
+------------------------------------------------------------------------
+r13759 | vlefevre | 2020-03-10 13:12:09 +0000 (Tue, 10 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Workaround to Debian bug 953369 in libpython3.8-minimal
+for the codespell invocation.
+------------------------------------------------------------------------
+r13758 | vlefevre | 2020-03-09 15:31:45 +0000 (Mon, 09 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/eint.c
+
+[src/eint.c] Bug fix: possible integer overflow with some
+C implementations (or some _MPFR_PREC_FORMAT / _MPFR_EXP_FORMAT values)
+due to the use of incorrect integer types.
+------------------------------------------------------------------------
+r13757 | vlefevre | 2020-03-09 14:41:06 +0000 (Mon, 09 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/eint.c
+
+[src/eint.c] Added other logging messages.
+------------------------------------------------------------------------
+r13756 | vlefevre | 2020-03-09 14:36:19 +0000 (Mon, 09 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/eint.c
+
+[src/eint.c] Added some logging messages.
+------------------------------------------------------------------------
+r13755 | zimmerma | 2020-03-09 09:54:57 +0000 (Mon, 09 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsin.c
+
+[tests/tsin.c] added one test
+
+------------------------------------------------------------------------
+r13753 | vlefevre | 2020-03-04 15:14:31 +0000 (Wed, 04 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] cancel: also log its value; range checking/tracking.
+------------------------------------------------------------------------
+r13752 | vlefevre | 2020-03-04 14:38:54 +0000 (Wed, 04 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Added a comment giving the range of the value returned
+in "cancel" and explaining why there is no integer overflow in the
+computation of this value.
+------------------------------------------------------------------------
+r13751 | vlefevre | 2020-03-04 14:28:29 +0000 (Wed, 04 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Comment: some absolute values are not needed (again).
+------------------------------------------------------------------------
+r13750 | vlefevre | 2020-03-04 14:26:40 +0000 (Wed, 04 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Minor correction for |EXP(b) - EXP(c)| >= MPFR_EXP_MAX.
+------------------------------------------------------------------------
+r13749 | vlefevre | 2020-03-04 14:24:49 +0000 (Wed, 04 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Better explanation when |EXP(b) - EXP(c)| >= MPFR_EXP_MAX.
+------------------------------------------------------------------------
+r13748 | vlefevre | 2020-03-03 15:09:21 +0000 (Tue, 03 Mar 2020) | 4 lines
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Finished the review of mpfr_cmp2: simplified the code even
+more; corrected/updated comments (in the case high_dif = 0, one can have
+dif = 1 if c has entirely been taken into account, so that the comment
+"dif > 1 here" was incorrect; only dif >= 1 is needed anyway).
+------------------------------------------------------------------------
+r13747 | vlefevre | 2020-03-03 14:17:32 +0000 (Tue, 03 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Changed high_dif to type int since it is manipulated like
+a boolean. Updated comments.
+------------------------------------------------------------------------
+r13746 | vlefevre | 2020-03-02 17:02:51 +0000 (Mon, 02 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Simplified the mpfr_cmp2 code and updated comments.
+------------------------------------------------------------------------
+r13745 | vlefevre | 2020-03-02 15:55:03 +0000 (Mon, 02 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Updated comments.
+------------------------------------------------------------------------
+r13744 | zimmerma | 2020-03-02 10:46:10 +0000 (Mon, 02 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] added comment
+
+------------------------------------------------------------------------
+r13743 | vlefevre | 2020-03-02 10:05:18 +0000 (Mon, 02 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] _MPFR_PREC_FORMAT and _MPFR_EXP_FORMAT: improved comment.
+------------------------------------------------------------------------
+r13742 | vlefevre | 2020-03-02 09:59:04 +0000 (Mon, 02 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] _MPFR_PREC_FORMAT and _MPFR_EXP_FORMAT: added a detailed
+comment (the previous comment was not obsolete, but misleading).
+------------------------------------------------------------------------
+r13741 | zimmerma | 2020-03-02 09:19:31 +0000 (Mon, 02 Mar 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] removed obsolete comment (_MPFR_PREC_FORMAT=3 is the default
+ under Linux x86_64)
+
+------------------------------------------------------------------------
+r13740 | zimmerma | 2020-03-01 18:07:02 +0000 (Sun, 01 Mar 2020) | 2 lines
+Changed paths:
+ M /trunk/src/rem1.c
+ M /trunk/src/sin.c
+
+[src/sin.c] increase initial precision even more
+
+------------------------------------------------------------------------
+r13739 | vlefevre | 2020-03-01 00:22:52 +0000 (Sun, 01 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] Replaced mpfr_cmp by !mpfr_equal_p for NaN detection.
+------------------------------------------------------------------------
+r13738 | vlefevre | 2020-03-01 00:19:05 +0000 (Sun, 01 Mar 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsin.c
+
+[tests/tsin.c] Replaced obsolete function mpfr_mul_2exp by mpfr_mul_2ui.
+------------------------------------------------------------------------
+r13737 | zimmerma | 2020-02-29 13:07:12 +0000 (Sat, 29 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/src/sin.c
+
+[src/sin.c] increase initial precision when x is large
+
+------------------------------------------------------------------------
+r13736 | zimmerma | 2020-02-29 11:04:14 +0000 (Sat, 29 Feb 2020) | 10 lines
+Changed paths:
+ M /trunk/src/rem1.c
+
+[src/rem1.c] workaround for efficiency bug in mpz_powm_ui, which was making
+argument reduction in mpfr_sin for huge x very slow.
+
+Before:
+$ ./mfv5 -p113 -e16384 -d-2 mpfr_sin
+ mpfr_sin: 3289620 / 3576511.59 / 6841956
+
+After this commit:
+ mpfr_sin: 166868 / 182661.01 / 343224
+
+------------------------------------------------------------------------
+r13735 | zimmerma | 2020-02-29 10:55:26 +0000 (Sat, 29 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] added one test
+
+------------------------------------------------------------------------
+r13734 | zimmerma | 2020-02-29 09:25:06 +0000 (Sat, 29 Feb 2020) | 4 lines
+Changed paths:
+ M /trunk/tools/mbench/mfv5.cc
+
+added value -2 for option -d to generate random number with exponent
+exactly e. Example:
+$ mfv5 -p113 -e16384 -d-2 -v mpfr_sin
+
+------------------------------------------------------------------------
+r13733 | zimmerma | 2020-02-28 15:29:10 +0000 (Fri, 28 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] added a test
+
+------------------------------------------------------------------------
+r13732 | zimmerma | 2020-02-28 15:20:42 +0000 (Fri, 28 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsin.c
+
+[tests/tsin.c] fixed and completed check_binary128()
+
+------------------------------------------------------------------------
+r13731 | vlefevre | 2020-02-28 15:07:26 +0000 (Fri, 28 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Started to review mpfr_cmp2. Minor changes.
+------------------------------------------------------------------------
+r13730 | vlefevre | 2020-02-28 13:19:58 +0000 (Fri, 28 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/cmp2.c
+
+[src/cmp2.c] Detailed a comment concerning UBF.
+------------------------------------------------------------------------
+r13727 | vlefevre | 2020-02-27 13:35:30 +0000 (Thu, 27 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsin.c
+
+[tests/tsin.c] Cleanup of the latest test (note: mpfr_equal_p is better
+than mpfr_cmp as it makes the test fail on a NaN result).
+------------------------------------------------------------------------
+r13726 | zimmerma | 2020-02-27 13:24:12 +0000 (Thu, 27 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsin.c
+
+[tests/tsin.c] added one test with precision 128
+
+------------------------------------------------------------------------
+r13725 | vlefevre | 2020-02-27 10:53:50 +0000 (Thu, 27 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] Updated a comment (underscore version of attribute name).
+------------------------------------------------------------------------
+r13724 | vlefevre | 2020-02-27 10:45:30 +0000 (Thu, 27 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Detect the use of the non-underscore version of the
+attribute names in mpfr.h (see README.dev).
+------------------------------------------------------------------------
+r13723 | vlefevre | 2020-02-25 17:26:07 +0000 (Tue, 25 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] Use the underscore version of the attribute names.
+[doc/README.dev] Added information on this subject.
+------------------------------------------------------------------------
+r13722 | vlefevre | 2020-02-25 16:17:57 +0000 (Tue, 25 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Added item on GNU Automake and -I options.
+------------------------------------------------------------------------
+r13721 | vlefevre | 2020-02-14 09:29:07 +0000 (Fri, 14 Feb 2020) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Removed an incorrect comment before MPFR_TMP_INIT1
+(this macro does not allocate anything, and MPFR_TMP_INIT just after
+can allocate more than 1 limb).
+------------------------------------------------------------------------
+r13720 | vlefevre | 2020-02-14 09:23:00 +0000 (Fri, 14 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] About the use of MPFR_MANT(x).
+------------------------------------------------------------------------
+r13719 | vlefevre | 2020-02-13 11:49:50 +0000 (Thu, 13 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Typo.
+------------------------------------------------------------------------
+r13718 | vlefevre | 2020-02-12 15:15:56 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tcmpabs.c
+
+[tests/tcmpabs.c] Added missing tests of mpfr_cmpabs with NaN.
+------------------------------------------------------------------------
+r13717 | vlefevre | 2020-02-12 15:12:10 +0000 (Wed, 12 Feb 2020) | 5 lines
+Changed paths:
+ M /trunk/tests/tcmpabs.c
+
+[tests/tcmpabs.c] For mpfr_cmpabs: like mpfr_cmpabs_ui, do each test
+in 4 different contexts, combinations of:
+ * flags all unset or flags all set;
+ * usual exponent range or reduced exponent range.
+Minor corrections in the old tests.
+------------------------------------------------------------------------
+r13716 | vlefevre | 2020-02-12 14:59:24 +0000 (Wed, 12 Feb 2020) | 4 lines
+Changed paths:
+ M /trunk/tests/tcmpabs.c
+
+[tests/tcmpabs.c] For mpfr_cmpabs_ui: do each test in 4 different
+contexts, combinations of:
+ * flags all unset or flags all set;
+ * usual exponent range or reduced exponent range.
+------------------------------------------------------------------------
+r13715 | zimmerma | 2020-02-12 13:49:46 +0000 (Wed, 12 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tcmpabs.c
+
+[tests/tcmpabs.c] added tests for mpfr_cmpabs_ui
+
+------------------------------------------------------------------------
+r13714 | vlefevre | 2020-02-12 13:38:47 +0000 (Wed, 12 Feb 2020) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h]
+ * MPFR_ALIAS: use the comma operator instead of "do ... while (0)"
+ so that this macro can be used in an expression context.
+ * MPFR_TMP_INIT_ABS, MPFR_TMP_INIT_NEG: use MPFR_ALIAS.
+------------------------------------------------------------------------
+r13713 | vlefevre | 2020-02-12 13:25:50 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] Added prototype for mpfr_cmpabs_ui.
+------------------------------------------------------------------------
+r13712 | vlefevre | 2020-02-12 13:10:07 +0000 (Wed, 12 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Added mpfr_cmpabs_ui to Section "Added Functions"
+(API Compatibility).
+------------------------------------------------------------------------
+r13711 | vlefevre | 2020-02-12 13:04:50 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/tests/trint.c
+
+[tests/trint.c] Replaced obsolete mpfr_cmp_abs by mpfr_cmpabs.
+------------------------------------------------------------------------
+r13710 | vlefevre | 2020-02-12 12:57:37 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Typo from r13708.
+------------------------------------------------------------------------
+r13709 | zimmerma | 2020-02-12 12:52:50 +0000 (Wed, 12 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] mention new mpfr_cmpabs_ui
+
+------------------------------------------------------------------------
+r13708 | zimmerma | 2020-02-12 12:51:55 +0000 (Wed, 12 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/Makefile.am
+ M /trunk/src/cmpabs.c
+ A /trunk/src/cmpabs_ui.c
+
+added new function mpfr_cmpabs_ui
+
+------------------------------------------------------------------------
+r13707 | zimmerma | 2020-02-12 12:25:47 +0000 (Wed, 12 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ D /trunk/src/cmp_abs.c
+ A /trunk/src/cmpabs.c (from /trunk/src/cmp_abs.c:13706)
+
+renamed cmp_abs.c to cmpabs.c
+
+------------------------------------------------------------------------
+r13706 | vlefevre | 2020-02-12 11:25:53 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Typo.
+------------------------------------------------------------------------
+r13705 | vlefevre | 2020-02-12 11:23:59 +0000 (Wed, 12 Feb 2020) | 3 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] + Serialization / Deserialization (suggested by Frédéric Pétrot).
+I've also added an idea of implementation to reuse most of the code and
+change very little.
+------------------------------------------------------------------------
+r13704 | vlefevre | 2020-02-12 01:38:57 +0000 (Wed, 12 Feb 2020) | 4 lines
+Changed paths:
+ M /trunk/src/ubf.c
+
+[src/ubf.c]
+ * Optimized mpfr_init_get_zexp() for _MPFR_EXP_FORMAT <= 3
+ (as in the default configuration).
+ * Updated comments.
+------------------------------------------------------------------------
+r13703 | vlefevre | 2020-02-12 01:15:34 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added UBF-related comments.
+------------------------------------------------------------------------
+r13702 | vlefevre | 2020-02-12 00:37:04 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added UBF-related comments.
+------------------------------------------------------------------------
+r13701 | vlefevre | 2020-02-12 00:04:34 +0000 (Wed, 12 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a comment for UBF and types.
+------------------------------------------------------------------------
+r13700 | vlefevre | 2020-02-11 14:38:49 +0000 (Tue, 11 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a comment for INEXPOS.
+------------------------------------------------------------------------
+r13699 | vlefevre | 2020-02-11 14:36:00 +0000 (Tue, 11 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] INEXPOS and VSIGN code improvement.
+------------------------------------------------------------------------
+r13698 | vlefevre | 2020-02-11 14:33:58 +0000 (Tue, 11 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/modf.c
+ M /trunk/src/sinh_cosh.c
+
+Removed duplicate macro definitions.
+------------------------------------------------------------------------
+r13696 | vlefevre | 2020-02-11 11:44:01 +0000 (Tue, 11 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tfmma.c
+
+[tests/tfmma.c] Use mpfr_set_str instead of mpfr_set_d.
+------------------------------------------------------------------------
+r13695 | vlefevre | 2020-02-11 10:06:46 +0000 (Tue, 11 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Got rid of some goto's. Added log messages.
+------------------------------------------------------------------------
+r13694 | vlefevre | 2020-02-10 15:17:34 +0000 (Mon, 10 Feb 2020) | 3 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Bug fix: the underflow case (possible with UBF, e.g. via
+mpfr_fmma or mpfr_fmms) was not tested in the case c small.
+Note: this completes r11418 and r12752 for underflow detection.
+------------------------------------------------------------------------
+r13693 | vlefevre | 2020-02-10 15:05:19 +0000 (Mon, 10 Feb 2020) | 2 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Added log messages and checked the UBF cases yielding
+exp_b == MPFR_EXP_MAX and/or diff_exp == MPFR_EXP_MAX.
+------------------------------------------------------------------------
+r13692 | vlefevre | 2020-02-08 10:59:39 +0000 (Sat, 08 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Added log messages for MPFR_PREC_ARG ('P' specifier).
+------------------------------------------------------------------------
+r13690 | vlefevre | 2020-02-08 02:21:15 +0000 (Sat, 08 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Fixed some tests: the 'P' specifier was missing.
+------------------------------------------------------------------------
+r13689 | vlefevre | 2020-02-06 10:23:15 +0000 (Thu, 06 Feb 2020) | 6 lines
+Changed paths:
+ M /trunk/src/fmma.c
+
+[src/fmma.c] Reverted the mpfr_check_range from r13688.
+The exponent range has not been extended by mpfr_fmma_aux, and the
+result comes from mpfr_add, mpfr_sub, or mpfr_set_1_2, which return
+results in the current range. If the result of mpfr_fmma_aux is not
+in the current range, this is due to a bug in one of these functions.
+Note: mpfr_add and mpfr_sub accept UBF inputs.
+------------------------------------------------------------------------
+r13688 | zimmerma | 2020-02-06 08:45:25 +0000 (Thu, 06 Feb 2020) | 3 lines
+Changed paths:
+ M /trunk/src/fmma.c
+ M /trunk/tests/tfmma.c
+
+[src/fmma.c] fixed bug (result might be out of exponent range)
+[tests/tfmma.c] added non-regression test
+
+------------------------------------------------------------------------
+r13685 | vlefevre | 2020-02-03 23:37:28 +0000 (Mon, 03 Feb 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r13431 | vlefevre | 2019-01-31 15:59:16 +0000 (Thu, 31 Jan 2019) | 3 lines
+r13684 | vlefevre | 2020-02-03 23:36:35 +0000 (Mon, 03 Feb 2020) | 4 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/Makefile.am
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] In the paragraph "MPFR internal data such as flags",
+no longer mention caches as caches may now also be global when MPFR
+has been compiled as thread safe (locking is used). Caches have been
+discussed earlier in the section anyway.
+------------------------------------------------------------------------
+r13683 | vlefevre | 2020-01-23 10:05:59 +0000 (Thu, 23 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] URL update.
+------------------------------------------------------------------------
+r13681 | vlefevre | 2020-01-20 16:02:54 +0000 (Mon, 20 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/ChangeLog
+
+ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC svn log -rHEAD:0 -v".
+------------------------------------------------------------------------
+r13678 | vlefevre | 2020-01-20 15:36:00 +0000 (Mon, 20 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/Makefile.am
+
+[tests/Makefile.am] Updated a comment; in particular, replaced the two
+obsolete gmane.org URLs by lists.gnu.org/archive/html/bug-gnulib ones.
+------------------------------------------------------------------------
+r13677 | vlefevre | 2020-01-20 15:25:19 +0000 (Mon, 20 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] Removed reference to a gmane.org URL, which no longer exists.
+------------------------------------------------------------------------
+r13674 | vlefevre | 2020-01-16 13:21:16 +0000 (Thu, 16 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/src/beta.c
+ M /trunk/tests/ttanh.c
+
+[src/beta.c,tests/ttanh.c] towards → toward (for consistency).
+------------------------------------------------------------------------
+r13671 | vlefevre | 2020-01-10 16:24:30 +0000 (Fri, 10 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tprintf.c
+
+[tests/{tfprintf.c,tprintf.c}] Updated an error message about MinGW,
+now output only if MinGW is used.
+------------------------------------------------------------------------
+r13670 | vlefevre | 2020-01-10 16:17:16 +0000 (Fri, 10 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Concerning MinGW, added a sentence about the use of
+the __USE_MINGW_ANSI_STDIO macro, confirming the existing note.
+------------------------------------------------------------------------
+r13669 | vlefevre | 2020-01-10 16:12:53 +0000 (Fri, 10 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Removed obsolete item on MinGW and -D__USE_MINGW_ANSI_STDIO.
+------------------------------------------------------------------------
+r13668 | vlefevre | 2020-01-10 16:11:46 +0000 (Fri, 10 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] Update concerning MinGW and the __USE_MINGW_ANSI_STDIO macro.
+------------------------------------------------------------------------
+r13667 | vlefevre | 2020-01-10 10:30:58 +0000 (Fri, 10 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated mpfr_get_str documentation, correcting r13666
+(we still need the extra two bytes and to take -@Inf@ into account).
+------------------------------------------------------------------------
+r13666 | zimmerma | 2020-01-10 09:21:11 +0000 (Fri, 10 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[mpfr.texi] fixed out-dated documentation for mpfr_get_str
+
+------------------------------------------------------------------------
+r13665 | vlefevre | 2020-01-09 18:01:59 +0000 (Thu, 09 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] In the latest update, forgot to remove the CC=...
+------------------------------------------------------------------------
+r13664 | vlefevre | 2020-01-09 17:57:53 +0000 (Thu, 09 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update about the test under Wine.
+------------------------------------------------------------------------
+r13663 | vlefevre | 2020-01-09 14:37:48 +0000 (Thu, 09 Jan 2020) | 7 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+[acinclude.m4,configure.ac]
+ * Moved the code that tries to determine the format of double from
+ configure.ac to acinclude.m4 in MPFR_CONFIGS (as required), just
+ before the one for long double.
+ * Added a FIXME comment: This code uses AC_RUN_IFELSE, which cannot
+ run the test when cross-compiling; use a test like for long double
+ instead.
+------------------------------------------------------------------------
+r13662 | vlefevre | 2020-01-09 14:27:27 +0000 (Thu, 09 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] English usage.
+------------------------------------------------------------------------
+r13661 | vlefevre | 2020-01-09 14:25:30 +0000 (Thu, 09 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+[acinclude.m4] Updated messages about the format of "long double".
+[configure.ac] Ditto for "double". Added missing AC_MSG_RESULT.
+------------------------------------------------------------------------
+r13658 | vlefevre | 2020-01-09 11:37:25 +0000 (Thu, 09 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Updated/fixed an output line to match the other ones.
+------------------------------------------------------------------------
+r13657 | vlefevre | 2020-01-09 10:23:44 +0000 (Thu, 09 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added tests for %Ra and %Rb on the value 0 with an
+empty precision field.
+------------------------------------------------------------------------
+r13656 | vlefevre | 2020-01-09 10:17:04 +0000 (Thu, 09 Jan 2020) | 3 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Fixed output precision bug with decimal output
+(i.e. e, f and g conversion specifiers) and an empty precision field
+on the value 0.
+------------------------------------------------------------------------
+r13655 | vlefevre | 2020-01-09 09:44:00 +0000 (Thu, 09 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Also added tests with %Rf, %Rg and %#Rg on 0.
+------------------------------------------------------------------------
+r13654 | vlefevre | 2020-01-09 09:39:45 +0000 (Thu, 09 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added a test with %Re and an empty precision field
+on the value 0; it currently fails.
+------------------------------------------------------------------------
+r13653 | vlefevre | 2020-01-08 18:28:42 +0000 (Wed, 08 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/tools/ck-copyright-notice
+
+[tools/ck-copyright-notice] Added a note about the mpfr.pc.in file.
+------------------------------------------------------------------------
+r13652 | vlefevre | 2020-01-08 18:11:13 +0000 (Wed, 08 Jan 2020) | 4 lines
+Changed paths:
+ M /trunk/BUGS
+ M /trunk/INSTALL
+ M /trunk/Makefile.am
+ M /trunk/NEWS
+ M /trunk/README
+ M /trunk/TODO
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/FAQ.html
+ M /trunk/doc/Makefile.am
+ M /trunk/doc/README.dev
+ M /trunk/doc/check-typography
+ M /trunk/doc/faq.xsl
+ M /trunk/doc/mpfr.texi
+ M /trunk/examples/can_round.c
+ M /trunk/examples/divworst.c
+ M /trunk/examples/rndo-add.c
+ M /trunk/examples/sample.c
+ M /trunk/examples/threads.c
+ M /trunk/examples/version.c
+ M /trunk/src/Makefile.am
+ M /trunk/src/abort_prec_max.c
+ M /trunk/src/acos.c
+ M /trunk/src/acosh.c
+ M /trunk/src/add.c
+ M /trunk/src/add1.c
+ M /trunk/src/add1sp.c
+ M /trunk/src/add1sp1_extracted.c
+ M /trunk/src/add_d.c
+ M /trunk/src/add_ui.c
+ M /trunk/src/agm.c
+ M /trunk/src/ai.c
+ M /trunk/src/amd/mparam.h
+ M /trunk/src/arm/mparam.h
+ M /trunk/src/asin.c
+ M /trunk/src/asinh.c
+ M /trunk/src/atan.c
+ M /trunk/src/atan2.c
+ M /trunk/src/atanh.c
+ M /trunk/src/bernoulli.c
+ M /trunk/src/beta.c
+ M /trunk/src/buildopt.c
+ M /trunk/src/cache.c
+ M /trunk/src/cbrt.c
+ M /trunk/src/check.c
+ M /trunk/src/clear.c
+ M /trunk/src/clears.c
+ M /trunk/src/cmp.c
+ M /trunk/src/cmp2.c
+ M /trunk/src/cmp_abs.c
+ M /trunk/src/cmp_d.c
+ M /trunk/src/cmp_ld.c
+ M /trunk/src/cmp_si.c
+ M /trunk/src/cmp_ui.c
+ M /trunk/src/comparisons.c
+ M /trunk/src/const_catalan.c
+ M /trunk/src/const_euler.c
+ M /trunk/src/const_log2.c
+ M /trunk/src/const_pi.c
+ M /trunk/src/constant.c
+ M /trunk/src/copysign.c
+ M /trunk/src/cos.c
+ M /trunk/src/cosh.c
+ M /trunk/src/cot.c
+ M /trunk/src/coth.c
+ M /trunk/src/csc.c
+ M /trunk/src/csch.c
+ M /trunk/src/d_div.c
+ M /trunk/src/d_sub.c
+ M /trunk/src/digamma.c
+ M /trunk/src/dim.c
+ M /trunk/src/div.c
+ M /trunk/src/div_2exp.c
+ M /trunk/src/div_2si.c
+ M /trunk/src/div_2ui.c
+ M /trunk/src/div_d.c
+ M /trunk/src/div_ui.c
+ M /trunk/src/dot.c
+ M /trunk/src/dump.c
+ M /trunk/src/eint.c
+ M /trunk/src/eq.c
+ M /trunk/src/erandom.c
+ M /trunk/src/erf.c
+ M /trunk/src/erfc.c
+ M /trunk/src/exceptions.c
+ M /trunk/src/exp.c
+ M /trunk/src/exp10.c
+ M /trunk/src/exp2.c
+ M /trunk/src/exp3.c
+ M /trunk/src/exp_2.c
+ M /trunk/src/expm1.c
+ M /trunk/src/extract.c
+ M /trunk/src/factorial.c
+ M /trunk/src/fits_intmax.c
+ M /trunk/src/fits_s.h
+ M /trunk/src/fits_sint.c
+ M /trunk/src/fits_slong.c
+ M /trunk/src/fits_sshort.c
+ M /trunk/src/fits_u.h
+ M /trunk/src/fits_uint.c
+ M /trunk/src/fits_uintmax.c
+ M /trunk/src/fits_ulong.c
+ M /trunk/src/fits_ushort.c
+ M /trunk/src/fma.c
+ M /trunk/src/fmma.c
+ M /trunk/src/fms.c
+ M /trunk/src/fpif.c
+ M /trunk/src/frac.c
+ M /trunk/src/free_cache.c
+ M /trunk/src/frexp.c
+ M /trunk/src/gamma.c
+ M /trunk/src/gamma_inc.c
+ M /trunk/src/gammaonethird.c
+ M /trunk/src/gen_inverse.h
+ M /trunk/src/generic/coverage/mparam.h
+ M /trunk/src/generic/mparam.h
+ M /trunk/src/get_d.c
+ M /trunk/src/get_d128.c
+ M /trunk/src/get_d64.c
+ M /trunk/src/get_exp.c
+ M /trunk/src/get_f.c
+ M /trunk/src/get_float128.c
+ M /trunk/src/get_flt.c
+ M /trunk/src/get_ld.c
+ M /trunk/src/get_q.c
+ M /trunk/src/get_si.c
+ M /trunk/src/get_sj.c
+ M /trunk/src/get_str.c
+ M /trunk/src/get_ui.c
+ M /trunk/src/get_uj.c
+ M /trunk/src/get_z.c
+ M /trunk/src/get_z_exp.c
+ M /trunk/src/gmp_op.c
+ M /trunk/src/grandom.c
+ M /trunk/src/hypot.c
+ M /trunk/src/ieee_floats.h
+ M /trunk/src/init.c
+ M /trunk/src/init2.c
+ M /trunk/src/inits.c
+ M /trunk/src/inits2.c
+ M /trunk/src/inp_str.c
+ M /trunk/src/int_ceil_log2.c
+ M /trunk/src/invert_limb.h
+ M /trunk/src/invsqrt_limb.h
+ M /trunk/src/isinf.c
+ M /trunk/src/isinteger.c
+ M /trunk/src/isnan.c
+ M /trunk/src/isnum.c
+ M /trunk/src/isqrt.c
+ M /trunk/src/isregular.c
+ M /trunk/src/iszero.c
+ M /trunk/src/jn.c
+ M /trunk/src/jyn_asympt.c
+ M /trunk/src/li2.c
+ M /trunk/src/lngamma.c
+ M /trunk/src/log.c
+ M /trunk/src/log10.c
+ M /trunk/src/log1p.c
+ M /trunk/src/log2.c
+ M /trunk/src/log_ui.c
+ M /trunk/src/logging.c
+ M /trunk/src/min_prec.c
+ M /trunk/src/minmax.c
+ M /trunk/src/mips/mparam.h
+ M /trunk/src/modf.c
+ M /trunk/src/mp_clz_tab.c
+ M /trunk/src/mparam_h.in
+ M /trunk/src/mpf2mpfr.h
+ M /trunk/src/mpfr-cvers.h
+ M /trunk/src/mpfr-gmp.c
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+ M /trunk/src/mpfr-longlong.h
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/mpfr-mini-gmp.h
+ M /trunk/src/mpfr-sassert.h
+ M /trunk/src/mpfr-thread.h
+ M /trunk/src/mpfr.h
+ M /trunk/src/mpn_exp.c
+ M /trunk/src/mul.c
+ M /trunk/src/mul_1_extracted.c
+ M /trunk/src/mul_2exp.c
+ M /trunk/src/mul_2si.c
+ M /trunk/src/mul_2ui.c
+ M /trunk/src/mul_d.c
+ M /trunk/src/mul_ui.c
+ M /trunk/src/mulders.c
+ M /trunk/src/nbits_ulong.c
+ M /trunk/src/neg.c
+ M /trunk/src/next.c
+ M /trunk/src/nrandom.c
+ M /trunk/src/odd_p.c
+ M /trunk/src/out_str.c
+ M /trunk/src/pool.c
+ M /trunk/src/pow.c
+ M /trunk/src/pow_si.c
+ M /trunk/src/pow_ui.c
+ M /trunk/src/pow_z.c
+ M /trunk/src/powerof2.c
+ M /trunk/src/powerpc64/mparam.h
+ M /trunk/src/print_raw.c
+ M /trunk/src/print_rnd_mode.c
+ M /trunk/src/printf.c
+ M /trunk/src/random_deviate.c
+ M /trunk/src/random_deviate.h
+ M /trunk/src/rec_sqrt.c
+ M /trunk/src/reldiff.c
+ M /trunk/src/rem1.c
+ M /trunk/src/rint.c
+ M /trunk/src/rndna.c
+ M /trunk/src/root.c
+ M /trunk/src/round_near_x.c
+ M /trunk/src/round_p.c
+ M /trunk/src/round_prec.c
+ M /trunk/src/round_raw_generic.c
+ M /trunk/src/scale2.c
+ M /trunk/src/sec.c
+ M /trunk/src/sech.c
+ M /trunk/src/set.c
+ M /trunk/src/set_d.c
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+ M /trunk/src/set_dfl_prec.c
+ M /trunk/src/set_exp.c
+ M /trunk/src/set_f.c
+ M /trunk/src/set_float128.c
+ M /trunk/src/set_flt.c
+ M /trunk/src/set_inf.c
+ M /trunk/src/set_ld.c
+ M /trunk/src/set_nan.c
+ M /trunk/src/set_prc_raw.c
+ M /trunk/src/set_prec.c
+ M /trunk/src/set_q.c
+ M /trunk/src/set_rnd.c
+ M /trunk/src/set_si.c
+ M /trunk/src/set_si_2exp.c
+ M /trunk/src/set_sj.c
+ M /trunk/src/set_str.c
+ M /trunk/src/set_str_raw.c
+ M /trunk/src/set_ui.c
+ M /trunk/src/set_ui_2exp.c
+ M /trunk/src/set_uj.c
+ M /trunk/src/set_z.c
+ M /trunk/src/set_z_exp.c
+ M /trunk/src/set_zero.c
+ M /trunk/src/setmax.c
+ M /trunk/src/setmin.c
+ M /trunk/src/setsign.c
+ M /trunk/src/sgn.c
+ M /trunk/src/si_op.c
+ M /trunk/src/signbit.c
+ M /trunk/src/sin.c
+ M /trunk/src/sin_cos.c
+ M /trunk/src/sinh.c
+ M /trunk/src/sinh_cosh.c
+ M /trunk/src/sparc64/mparam.h
+ M /trunk/src/sqr.c
+ M /trunk/src/sqrt.c
+ M /trunk/src/sqrt_ui.c
+ M /trunk/src/stack_interface.c
+ M /trunk/src/strtofr.c
+ M /trunk/src/sub.c
+ M /trunk/src/sub1.c
+ M /trunk/src/sub1sp.c
+ M /trunk/src/sub1sp1_extracted.c
+ M /trunk/src/sub_d.c
+ M /trunk/src/sub_ui.c
+ M /trunk/src/subnormal.c
+ M /trunk/src/sum.c
+ M /trunk/src/swap.c
+ M /trunk/src/tan.c
+ M /trunk/src/tanh.c
+ M /trunk/src/total_order.c
+ M /trunk/src/ubf.c
+ M /trunk/src/uceil_exp2.c
+ M /trunk/src/uceil_log2.c
+ M /trunk/src/ufloor_log2.c
+ M /trunk/src/ui_div.c
+ M /trunk/src/ui_pow.c
+ M /trunk/src/ui_pow_ui.c
+ M /trunk/src/ui_sub.c
+ M /trunk/src/urandom.c
+ M /trunk/src/urandomb.c
+ M /trunk/src/vasprintf.c
+ M /trunk/src/version.c
+ M /trunk/src/volatile.c
+ M /trunk/src/x86/mparam.h
+ M /trunk/src/x86_64/core2/mparam.h
+ M /trunk/src/x86_64/mparam.h
+ M /trunk/src/yn.c
+ M /trunk/src/zeta.c
+ M /trunk/src/zeta_ui.c
+ M /trunk/tests/Makefile.am
+ M /trunk/tests/cmp_str.c
+ M /trunk/tests/data/digamma
+ M /trunk/tests/data/li2
+ M /trunk/tests/memory.c
+ M /trunk/tests/mpf_compat.c
+ M /trunk/tests/mpf_compat.h
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/mpfr_compat.c
+ M /trunk/tests/random2.c
+ M /trunk/tests/reuse.c
+ M /trunk/tests/rnd_mode.c
+ M /trunk/tests/tabort_defalloc1.c
+ M /trunk/tests/tabort_defalloc2.c
+ M /trunk/tests/tabort_prec_max.c
+ M /trunk/tests/tabs.c
+ M /trunk/tests/tacos.c
+ M /trunk/tests/tacosh.c
+ M /trunk/tests/tadd.c
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tadd_d.c
+ M /trunk/tests/tadd_ui.c
+ M /trunk/tests/tagm.c
+ M /trunk/tests/tai.c
+ M /trunk/tests/talloc-cache.c
+ M /trunk/tests/talloc.c
+ M /trunk/tests/tasin.c
+ M /trunk/tests/tasinh.c
+ M /trunk/tests/tassert.c
+ M /trunk/tests/tatan.c
+ M /trunk/tests/tatanh.c
+ M /trunk/tests/taway.c
+ M /trunk/tests/tbeta.c
+ M /trunk/tests/tbuildopt.c
+ M /trunk/tests/tcan_round.c
+ M /trunk/tests/tcbrt.c
+ M /trunk/tests/tcheck.c
+ M /trunk/tests/tcmp.c
+ M /trunk/tests/tcmp2.c
+ M /trunk/tests/tcmp_d.c
+ M /trunk/tests/tcmp_ld.c
+ M /trunk/tests/tcmp_ui.c
+ M /trunk/tests/tcmpabs.c
+ M /trunk/tests/tcomparisons.c
+ M /trunk/tests/tconst_catalan.c
+ M /trunk/tests/tconst_euler.c
+ M /trunk/tests/tconst_log2.c
+ M /trunk/tests/tconst_pi.c
+ M /trunk/tests/tcopysign.c
+ M /trunk/tests/tcos.c
+ M /trunk/tests/tcosh.c
+ M /trunk/tests/tcot.c
+ M /trunk/tests/tcoth.c
+ M /trunk/tests/tcsc.c
+ M /trunk/tests/tcsch.c
+ M /trunk/tests/td_div.c
+ M /trunk/tests/td_sub.c
+ M /trunk/tests/tdigamma.c
+ M /trunk/tests/tdim.c
+ M /trunk/tests/tdiv.c
+ M /trunk/tests/tdiv_d.c
+ M /trunk/tests/tdiv_ui.c
+ M /trunk/tests/tdot.c
+ M /trunk/tests/teint.c
+ M /trunk/tests/teq.c
+ M /trunk/tests/terandom.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/terf.c
+ M /trunk/tests/tests.c
+ M /trunk/tests/texceptions.c
+ M /trunk/tests/texp.c
+ M /trunk/tests/texp10.c
+ M /trunk/tests/texp2.c
+ M /trunk/tests/texpm1.c
+ M /trunk/tests/tfactorial.c
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tfma.c
+ M /trunk/tests/tfmma.c
+ M /trunk/tests/tfmod.c
+ M /trunk/tests/tfms.c
+ M /trunk/tests/tfpif.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tfrac.c
+ M /trunk/tests/tfrexp.c
+ M /trunk/tests/tgamma.c
+ M /trunk/tests/tgamma_inc.c
+ M /trunk/tests/tgeneric.c
+ M /trunk/tests/tgeneric_ui.c
+ M /trunk/tests/tget_d.c
+ M /trunk/tests/tget_d_2exp.c
+ M /trunk/tests/tget_f.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tget_q.c
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tget_str.c
+ M /trunk/tests/tget_z.c
+ M /trunk/tests/tgmpop.c
+ M /trunk/tests/tgrandom.c
+ M /trunk/tests/thyperbolic.c
+ M /trunk/tests/thypot.c
+ M /trunk/tests/tinits.c
+ M /trunk/tests/tinp_str.c
+ M /trunk/tests/tinternals.c
+ M /trunk/tests/tisnan.c
+ M /trunk/tests/tisqrt.c
+ M /trunk/tests/tj0.c
+ M /trunk/tests/tj1.c
+ M /trunk/tests/tjn.c
+ M /trunk/tests/tl2b.c
+ M /trunk/tests/tlgamma.c
+ M /trunk/tests/tli2.c
+ M /trunk/tests/tlngamma.c
+ M /trunk/tests/tlog.c
+ M /trunk/tests/tlog10.c
+ M /trunk/tests/tlog1p.c
+ M /trunk/tests/tlog2.c
+ M /trunk/tests/tlog_ui.c
+ M /trunk/tests/tmin_prec.c
+ M /trunk/tests/tminmax.c
+ M /trunk/tests/tmodf.c
+ M /trunk/tests/tmul.c
+ M /trunk/tests/tmul_2exp.c
+ M /trunk/tests/tmul_d.c
+ M /trunk/tests/tmul_ui.c
+ M /trunk/tests/tnext.c
+ M /trunk/tests/tnrandom.c
+ M /trunk/tests/tnrandom_chisq.c
+ M /trunk/tests/tout_str.c
+ M /trunk/tests/toutimpl.c
+ M /trunk/tests/tpow.c
+ M /trunk/tests/tpow3.c
+ M /trunk/tests/tpow_all.c
+ M /trunk/tests/tpow_z.c
+ M /trunk/tests/tprec_round.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/trandom_deviate.c
+ M /trunk/tests/trec_sqrt.c
+ M /trunk/tests/tremquo.c
+ M /trunk/tests/trint.c
+ M /trunk/tests/trndna.c
+ M /trunk/tests/troot.c
+ M /trunk/tests/trootn_ui.c
+ M /trunk/tests/tsec.c
+ M /trunk/tests/tsech.c
+ M /trunk/tests/tset.c
+ M /trunk/tests/tset_d.c
+ M /trunk/tests/tset_exp.c
+ M /trunk/tests/tset_f.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tset_q.c
+ M /trunk/tests/tset_si.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tset_str.c
+ M /trunk/tests/tset_z.c
+ M /trunk/tests/tset_z_exp.c
+ M /trunk/tests/tsgn.c
+ M /trunk/tests/tsi_op.c
+ M /trunk/tests/tsin.c
+ M /trunk/tests/tsin_cos.c
+ M /trunk/tests/tsinh.c
+ M /trunk/tests/tsinh_cosh.c
+ M /trunk/tests/tsprintf.c
+ M /trunk/tests/tsqr.c
+ M /trunk/tests/tsqrt.c
+ M /trunk/tests/tsqrt_ui.c
+ M /trunk/tests/tstckintc.c
+ M /trunk/tests/tstdint.c
+ M /trunk/tests/tstrtofr.c
+ M /trunk/tests/tsub.c
+ M /trunk/tests/tsub1sp.c
+ M /trunk/tests/tsub_d.c
+ M /trunk/tests/tsub_ui.c
+ M /trunk/tests/tsubnormal.c
+ M /trunk/tests/tsum.c
+ M /trunk/tests/tswap.c
+ M /trunk/tests/ttan.c
+ M /trunk/tests/ttanh.c
+ M /trunk/tests/ttotal_order.c
+ M /trunk/tests/ttrunc.c
+ M /trunk/tests/tui_div.c
+ M /trunk/tests/tui_pow.c
+ M /trunk/tests/tui_sub.c
+ M /trunk/tests/turandom.c
+ M /trunk/tests/tvalist.c
+ M /trunk/tests/tversion.c
+ M /trunk/tests/ty0.c
+ M /trunk/tests/ty1.c
+ M /trunk/tests/tyn.c
+ M /trunk/tests/tzeta.c
+ M /trunk/tests/tzeta_ui.c
+ M /trunk/tools/bench/Makefile.am
+ M /trunk/tools/bench/benchtime.h
+ M /trunk/tools/bench/mpfrbench.c
+ M /trunk/tools/check_mparam.c
+ M /trunk/tools/ck-clz_tab
+ M /trunk/tools/ck-copyright-notice
+ M /trunk/tools/ck-mparam
+ M /trunk/tools/ck-news
+ M /trunk/tools/ck-version-info
+ M /trunk/tools/get_patches.sh
+ M /trunk/tune/Makefile.am
+ M /trunk/tune/bidimensional_sample.c
+ M /trunk/tune/speed.c
+ M /trunk/tune/tuneup.c
+
+Copyright notice update: added 2020 with
+ perl -pi -e 's/ (\d{4}-)?(2019)(?= Free Software)/
+ " ".($1||"$2-").($2+1)/e' **/*(^/)
+under zsh. Removed 2019 from the example in the doc/README.dev file.
+------------------------------------------------------------------------
+r13651 | vlefevre | 2020-01-08 17:52:26 +0000 (Wed, 08 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] + base conversion with the round-trip property using a minimal
+precision, such as the to_chars functions from the C++ standard.
+------------------------------------------------------------------------
+r13650 | vlefevre | 2020-01-08 17:33:44 +0000 (Wed, 08 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13649 | vlefevre | 2020-01-08 17:21:57 +0000 (Wed, 08 Jan 2020) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Formatted output: improved the text concerning the
+empty precision field, i.e. focus on the chosen precision rather
+than the round-trip property (as the rounding mode is not necessarily
+to nearest).
+------------------------------------------------------------------------
+r13648 | vlefevre | 2020-01-08 16:34:16 +0000 (Wed, 08 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Formatted output with %Re (empty precision field):
+added a reference to mpfr_get_str_ndigits.
+------------------------------------------------------------------------
+r13647 | vlefevre | 2020-01-08 16:20:57 +0000 (Wed, 08 Jan 2020) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Simplified the conditions under which trailing zeros
+are kept (the spec_g variable is no longer needed as a consequence).
+------------------------------------------------------------------------
+r13646 | vlefevre | 2020-01-08 15:30:46 +0000 (Wed, 08 Jan 2020) | 3 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Re-added tests changed by r13644 and r13645, but
+with a variable of smaller precision in order to get the same output
+as before.
+------------------------------------------------------------------------
+r13645 | vlefevre | 2020-01-08 14:56:56 +0000 (Wed, 08 Jan 2020) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Updated other two tests (in da_DK locale).
+------------------------------------------------------------------------
+r13644 | zimmerma | 2020-01-08 12:15:52 +0000 (Wed, 08 Jan 2020) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tsprintf.c
+
+fixed tests for new more precise semantics for mpfr_printf ("%Re", x),
+and documented it
+
+------------------------------------------------------------------------
+r13643 | zimmerma | 2020-01-08 10:43:06 +0000 (Wed, 08 Jan 2020) | 3 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] tentative fix so that mpfr_printf ("%.Re", x) prints a number
+ of decimal digits independent from x
+
+------------------------------------------------------------------------
+r13642 | vlefevre | 2019-12-24 03:10:33 +0000 (Tue, 24 Dec 2019) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+ M /trunk/doc/mpfr.texi
+
+[INSTALL,doc/mpfr.texi] Typography.
+------------------------------------------------------------------------
+r13635 | vlefevre | 2019-10-10 13:56:19 +0000 (Thu, 10 Oct 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus: put the old Rule 8 just after Rule 2,
+as the old Rule 3 (now Rule 4) uses it directly (proof updated).
+------------------------------------------------------------------------
+r13634 | vlefevre | 2019-10-10 13:32:57 +0000 (Thu, 10 Oct 2019) | 1 line
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus: simplified the proof of Rule 8.
+------------------------------------------------------------------------
+r13633 | vlefevre | 2019-10-10 13:18:34 +0000 (Thu, 10 Oct 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus Rule 3: missing absolute values in
+the proof.
+------------------------------------------------------------------------
+r13632 | vlefevre | 2019-10-10 13:08:28 +0000 (Thu, 10 Oct 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Actually assume that no underflows nor overflows
+occur for the whole section "Error calculus".
+------------------------------------------------------------------------
+r13631 | vlefevre | 2019-10-10 12:59:33 +0000 (Thu, 10 Oct 2019) | 3 lines
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus Rule 6: corrected it (we need to
+assume no underflows nor overflows) and its proof, and generalized
+it with absolute values (like in the previous rules).
+------------------------------------------------------------------------
+r13630 | vlefevre | 2019-10-07 09:17:23 +0000 (Mon, 07 Oct 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus Rule 3: more powerful result and
+much simpler proof.
+------------------------------------------------------------------------
+r13629 | vlefevre | 2019-10-07 08:50:52 +0000 (Mon, 07 Oct 2019) | 3 lines
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Section 2 (Error calculus): When n was a precision,
+replaced it by p as this is the usual notation (see Section 1) and n
+sometimes had a double meaning.
+------------------------------------------------------------------------
+r13628 | vlefevre | 2019-10-04 08:52:53 +0000 (Fri, 04 Oct 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tcmp_ui.c
+
+[tests/tcmp_ui.c] Updated comment: this is a bug in Clang 9.
+------------------------------------------------------------------------
+r13627 | vlefevre | 2019-10-04 08:28:16 +0000 (Fri, 04 Oct 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tcmp_ui.c
+
+[tests/tcmp_ui.c] Added a comment: failure of a test with the
+clang-9 1:9-1 Debian package.
+------------------------------------------------------------------------
+r13626 | vlefevre | 2019-10-01 13:55:09 +0000 (Tue, 01 Oct 2019) | 11 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/doc/README.dev
+ M /trunk/tests/tests.c
+ M /trunk/tests/tget_d.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tset_d.c
+ M /trunk/tests/tsprintf.c
+
+Clean-up concerning the tests of subnormals for double and float.
+ * acinclude.m4: renamed variables
+ mpfr_cv_have_denorms_flt to mpfr_cv_have_subnorm_flt
+ mpfr_cv_have_denorms to mpfr_cv_have_subnorm_dbl
+ and improved messages.
+ * acinclude.m4, tests/tget_flt.c: renamed macro
+ HAVE_DENORMS_FLT to HAVE_SUBNORM_FLT
+ * acinclude.m4, tests/{tests.c,tset_d.c,tsprintf.c}: renamed macro
+ HAVE_DENORMS to HAVE_SUBNORM_DBL
+ * doc/README.dev: updated / completed the corresponding documentation.
+ * tests/tget_d.c: renamed function check_denorms to check_subnorm.
+------------------------------------------------------------------------
+r13625 | vlefevre | 2019-10-01 13:28:37 +0000 (Tue, 01 Oct 2019) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Updated comment about the tests for subnormal numbers.
+------------------------------------------------------------------------
+r13624 | vlefevre | 2019-10-01 13:23:51 +0000 (Tue, 01 Oct 2019) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added a comment about the tests for subnormal numbers.
+------------------------------------------------------------------------
+r13623 | vlefevre | 2019-09-24 11:08:04 +0000 (Tue, 24 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/doc/Makefile.am
+
+[doc/Makefile.am] Added missing texinfo.tex prerequisite.
+------------------------------------------------------------------------
+r13622 | vlefevre | 2019-09-16 08:33:16 +0000 (Mon, 16 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tout_str.c
+ M /trunk/tests/tprintf.c
+
+[tests] Added FIXME comment in tfprintf.c, tout_str.c and tprintf.c:
+The output is not tested (thus coverage data are meaningless).
+------------------------------------------------------------------------
+r13621 | vlefevre | 2019-09-10 12:40:39 +0000 (Tue, 10 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+ M /trunk/src/sub1sp.c
+
+[src/{add1sp.c,sub1sp.c}] Get rid of useless goto's.
+------------------------------------------------------------------------
+r13619 | vlefevre | 2019-09-06 15:17:14 +0000 (Fri, 06 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13618 | vlefevre | 2019-09-06 12:35:10 +0000 (Fri, 06 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/src/hypot.c
+
+[src/hypot.c] Replaced a TODO by a FIXME.
+------------------------------------------------------------------------
+r13617 | vlefevre | 2019-09-06 11:17:11 +0000 (Fri, 06 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/out_str.c
+ M /trunk/tests/tout_str.c
+
+The mpfr_out_str function now accepts bases from -2 to -36, in order to
+follow mpfr_get_str and GMP's mpf_out_str functions.
+------------------------------------------------------------------------
+r13614 | vlefevre | 2019-09-06 01:00:27 +0000 (Fri, 06 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Changed an incorrect use of @xref, which must always
+occur at the beginning of a sentence (use "see @ref{...}" instead).
+------------------------------------------------------------------------
+r13613 | vlefevre | 2019-09-06 00:56:34 +0000 (Fri, 06 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] At the end of "Arithmetic Functions", added a sentence
+referencing the power functions (since x^n is an arithmetic function).
+------------------------------------------------------------------------
+r13612 | vlefevre | 2019-09-05 16:17:35 +0000 (Thu, 05 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Removed the useless "Float ..." index entries.
+------------------------------------------------------------------------
+r13611 | vlefevre | 2019-09-05 16:10:49 +0000 (Thu, 05 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Moved the mpfr_pow class of functions from
+"Arithmetic Functions" to "Transcendental Functions".
+------------------------------------------------------------------------
+r13610 | vlefevre | 2019-09-05 15:40:37 +0000 (Thu, 05 Sep 2019) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Added "Float transcendental functions" to the index
+for consistency ("transcendental functions" implies floating point,
+but the user should expect to find it with the other index terms
+starting with "Float").
+------------------------------------------------------------------------
+r13609 | vlefevre | 2019-09-05 15:36:08 +0000 (Thu, 05 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Renamed "Basic Arithmetic Functions" to just
+"Arithmetic Functions".
+------------------------------------------------------------------------
+r13608 | vlefevre | 2019-09-05 14:15:10 +0000 (Thu, 05 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Transcendental functions: added a sentence to the
+important note (about cases theoretically very hard to round).
+------------------------------------------------------------------------
+r13607 | vlefevre | 2019-09-05 13:57:21 +0000 (Thu, 05 Sep 2019) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Renamed Section "Special Functions" to
+"Transcendental Functions" (as after changes in r13605 and r13606,
+it now contains only the transcendental functions), and slightly
+rewrote its important note.
+------------------------------------------------------------------------
+r13606 | vlefevre | 2019-09-05 13:44:16 +0000 (Thu, 05 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Moved mpfr_free_cache, mpfr_free_cache2, mpfr_free_pool
+and mpfr_mp_memory_cleanup from "Special Functions" to a new section
+"Memory Handling Functions".
+------------------------------------------------------------------------
+r13605 | vlefevre | 2019-09-05 13:23:26 +0000 (Thu, 05 Sep 2019) | 7 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi]
+ * Moved mpfr_fac_ui, mpfr_fma, mpfr_fms, mpfr_fmma, mpfr_fmms,
+ mpfr_hypot, mpfr_sum and mpfr_dot from "Special Functions" to
+ "Basic Arithmetic Functions" (as these are functions based on
+ +, -, *, / and roots).
+ * Added a FIXME for mpfr_pow: does this function really belong
+ to "Basic Arithmetic Functions"?
+------------------------------------------------------------------------
+r13604 | vlefevre | 2019-09-05 12:56:52 +0000 (Thu, 05 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Improved warning about huge precisions.
+------------------------------------------------------------------------
+r13603 | vlefevre | 2019-09-05 10:21:34 +0000 (Thu, 05 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] For the --enable-assert=full test, also test the flags
+(like what has been done for mpfr_add1sp and mpfr_sub1sp).
+------------------------------------------------------------------------
+r13602 | vlefevre | 2019-09-05 10:02:14 +0000 (Thu, 05 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] For the --enable-assert=full test, improved output of
+ternary value and flags, like in r13582 for mpfr_add1sp.
+------------------------------------------------------------------------
+r13601 | vlefevre | 2019-09-05 09:58:32 +0000 (Thu, 05 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] Cosmetic change (consistent ordering).
+------------------------------------------------------------------------
+r13600 | zimmerma | 2019-09-04 15:29:19 +0000 (Wed, 04 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+ M /trunk/tests/tsub1sp.c
+
+[tests/tsub1sp.c] added non-regression test for bug in mpfr_sub1sp2n
+[src/sub1sp.c] fixed that bug
+
+------------------------------------------------------------------------
+r13599 | vlefevre | 2019-09-04 12:38:10 +0000 (Wed, 04 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed MPFR_C_LONG_DOUBLE_FORMAT macro for MS-Windows.
+------------------------------------------------------------------------
+r13598 | vlefevre | 2019-09-04 12:23:27 +0000 (Wed, 04 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] More details about mpfr_add and mpfr_sub.
+------------------------------------------------------------------------
+r13597 | zimmerma | 2019-09-04 12:07:07 +0000 (Wed, 04 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] mention that mpfr_sub was also improved for 128 bits
+
+------------------------------------------------------------------------
+r13596 | zimmerma | 2019-09-04 11:52:11 +0000 (Wed, 04 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] coverage improved to 98.6% on x86_64
+
+------------------------------------------------------------------------
+r13595 | zimmerma | 2019-09-04 11:35:35 +0000 (Wed, 04 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] improve coverage
+
+------------------------------------------------------------------------
+r13594 | vlefevre | 2019-09-04 11:33:24 +0000 (Wed, 04 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed MPFR_C_LONG_DOUBLE_FORMAT macro: the patch had
+a spurious ";" at the end of conftest.c, which made its compilation
+fail with -pedantic -Werror (using gcc or clang).
+------------------------------------------------------------------------
+r13593 | zimmerma | 2019-09-04 11:22:26 +0000 (Wed, 04 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] rewrote mpfr_sub1sp2n (inspired from mpfr_sub1sp1n)
+
+------------------------------------------------------------------------
+r13592 | vlefevre | 2019-09-04 10:59:18 +0000 (Wed, 04 Sep 2019) | 4 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Updated MPFR_C_LONG_DOUBLE_FORMAT to support compilation
+with GCC's and clang's LTO (-flto). This new test is inspired by the one
+used by GMP for the double type.
+Thanks to Paul Mulders for a preliminary version of the patch for MPFR.
+------------------------------------------------------------------------
+r13590 | zimmerma | 2019-09-03 16:16:53 +0000 (Tue, 03 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] added new function mpfr_sub1sp2n for p = 2*GMP_NUMB_BITS
+ (still to be tested)
+
+------------------------------------------------------------------------
+r13589 | vlefevre | 2019-09-03 14:39:35 +0000 (Tue, 03 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] bug20190903:
+ * Fixed the second test for GMP_NUMB_BITS != 64.
+ * Updated comments.
+------------------------------------------------------------------------
+r13588 | zimmerma | 2019-09-03 14:02:27 +0000 (Tue, 03 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] improved comment
+
+------------------------------------------------------------------------
+r13587 | vlefevre | 2019-09-03 14:00:33 +0000 (Tue, 03 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] mpfr_add1sp2n: improved a comment.
+------------------------------------------------------------------------
+r13586 | vlefevre | 2019-09-03 13:52:48 +0000 (Tue, 03 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] Fixed the bug.
+------------------------------------------------------------------------
+r13585 | vlefevre | 2019-09-03 13:35:47 +0000 (Tue, 03 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] bug20190903: do the second test in MPFR_RNDU too.
+------------------------------------------------------------------------
+r13584 | vlefevre | 2019-09-03 13:31:08 +0000 (Tue, 03 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] bug20190903: in the second test, check the mpfr_t
+value, the ternary value and the flags, in order to get a failure
+even without "--enable-assert=full".
+------------------------------------------------------------------------
+r13583 | vlefevre | 2019-09-03 13:11:52 +0000 (Tue, 03 Sep 2019) | 6 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] When testing mpfr_add, use a wrapper mpfr_add_cf
+that calls mpfr_clear_flags first, so that if --enable-assert=full
+is used, the flags can be better checked too (and automatically).
+Now tadd1sp outputs with --enable-assert=full, as wanted:
+ add1 : ternary = -1, flags = inexact (8)
+ add1sp: ternary = 0, flags = none (0)
+------------------------------------------------------------------------
+r13582 | vlefevre | 2019-09-03 13:02:07 +0000 (Tue, 03 Sep 2019) | 5 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+ M /trunk/src/exceptions.c
+ M /trunk/src/mpfr-impl.h
+
+[src]
+ * exceptions.c: define flags_fout if MPFR_WANT_ASSERT >= 2, i.e. with
+ --enable-assert=full (for better flags output in add1sp.c, etc.).
+ * mpfr-impl.h: declare flags_fout if MPFR_WANT_ASSERT >= 2.
+ * add1sp.c: improve output of ternary value and flags.
+------------------------------------------------------------------------
+r13581 | vlefevre | 2019-09-03 12:40:56 +0000 (Tue, 03 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] Updated comments of bug20190903.
+------------------------------------------------------------------------
+r13580 | vlefevre | 2019-09-03 12:37:47 +0000 (Tue, 03 Sep 2019) | 8 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] Added a test that triggers a bug in mpfr_add1sp2n
+(corresponding to the FIXME), yielding a failure with
+"--enable-assert=full".
+Note 1: The computed values are equal (with MPFR_RNDN), but one gets
+ Inexact sp = 0 | Inexact = -1
+ Flags sp = 10 | Flags = 10
+Note 2: The fact that the flags do not match the ternary value in the
+error message is due to a missing mpfr_clear_flags in the test.
+------------------------------------------------------------------------
+r13579 | vlefevre | 2019-09-03 12:23:35 +0000 (Tue, 03 Sep 2019) | 6 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] mpfr_add1sp2n:
+ * Code refactoring, eliminating the unnecessary goto's.
+ * In the d >= 2 * GMP_NUMB_BITS case, use a single test for rb and sb.
+ * Improved code consistency.
+ * Added a FIXME about suspicious code. → Find a failing test and fix
+ the code, or explain the code if it is correct.
+------------------------------------------------------------------------
+r13578 | zimmerma | 2019-09-03 11:51:41 +0000 (Tue, 03 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] fix for bug20190903
+
+------------------------------------------------------------------------
+r13577 | vlefevre | 2019-09-03 11:28:22 +0000 (Tue, 03 Sep 2019) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] Corrected a comment.
+------------------------------------------------------------------------
+r13576 | vlefevre | 2019-09-03 10:30:10 +0000 (Tue, 03 Sep 2019) | 3 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] More random tests in the special precisions
+GMP_NUMB_BITS and 2 * GMP_NUMB_BITS (but they don't trigger
+the bug due to r13574).
+------------------------------------------------------------------------
+r13575 | vlefevre | 2019-09-03 10:25:41 +0000 (Tue, 03 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] Added testcase for bug due to r13574 (found with
+the other test programs, using --enable-assert=full).
+------------------------------------------------------------------------
+r13574 | zimmerma | 2019-09-03 09:20:19 +0000 (Tue, 03 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] added mpfr_add1sp2n for 128-bit precision (with 64-bit limb)
+
+------------------------------------------------------------------------
+r13573 | zimmerma | 2019-09-02 15:48:13 +0000 (Mon, 02 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp1_extracted.c
+
+[src/sub1sp1_extracted.c] replace hard-coded bounds by emin/emax
+
+------------------------------------------------------------------------
+r13572 | zimmerma | 2019-09-02 15:10:45 +0000 (Mon, 02 Sep 2019) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/sub1sp.c
+ A /trunk/src/sub1sp1_extracted.c
+
+added sub1sp1_extracted.c (not ready yet)
+
+------------------------------------------------------------------------
+r13571 | zimmerma | 2019-08-30 13:26:54 +0000 (Fri, 30 Aug 2019) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp1_extracted.c
+ M /trunk/src/mul_1_extracted.c
+
+added github source for Jianyang Pan formal proof
+
+------------------------------------------------------------------------
+r13570 | vlefevre | 2019-08-21 10:22:25 +0000 (Wed, 21 Aug 2019) | 7 lines
+Changed paths:
+ M /trunk/tests/mpfr-test.h
+
+[tests/mpfr-test.h] At the end, with GCC, undef volatile if defined.
+Explanations:
+ With GCC, a macro "volatile" can be defined to test some special code
+ in mpfr-impl.h (code for compilers that define such a macro), but the
+ volatile keyword is necessary in some tests to avoid some GCC bugs.
+ Thus we need to undef this macro (if defined). We do that at the end,
+ so that mpfr-impl.h (included earlier) is not affected by this undef.
+------------------------------------------------------------------------
+r13569 | vlefevre | 2019-08-21 08:57:50 +0000 (Wed, 21 Aug 2019) | 5 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Updated a test with a non-canonical encoding:
+ * More meaningful name ("noncanonical" instead of "coverage").
+ * Output details in case of failure.
+ * Avoid GCC bug 91226: wrong propagation of non-canonical _Decimal64
+ and _Decimal128 constant (BID only).
+------------------------------------------------------------------------
+r13568 | vlefevre | 2019-08-20 13:58:15 +0000 (Tue, 20 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update concerning the "decimal-point character".
+------------------------------------------------------------------------
+r13567 | vlefevre | 2019-08-20 13:44:16 +0000 (Tue, 20 Aug 2019) | 5 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Changed "decimal point" to "decimal-point character",
+which is the term used in the ISO C standard. This is better as this
+character is also used with non-decimal bases: "decimal-point" is
+just the name of this character (as initially defined for base 10)
+and does not imply a number written in decimal.
+------------------------------------------------------------------------
+r13566 | vlefevre | 2019-08-20 13:02:52 +0000 (Tue, 20 Aug 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Compatibility With MPF: added an item on the difference
+of the output format between mpf_out_str and mpfr_out_str.
+------------------------------------------------------------------------
+r13565 | vlefevre | 2019-08-20 11:06:03 +0000 (Tue, 20 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Rewrote and completed the mpfr_out_str description.
+------------------------------------------------------------------------
+r13564 | vlefevre | 2019-08-20 09:39:53 +0000 (Tue, 20 Aug 2019) | 13 lines
+Changed paths:
+ M /trunk/src/out_str.c
+
+[src/out_str.c] Fixed bug in mpfr_out_str: When the exponent of the
+converted value is 0, it was not output, contrary to what is described
+in the MPFR manual. Note that this does not change the value of the
+printed string, so that this has no effect on applications that just
+re-read the value (with MPFR or another code).
+This was regarded as a bug rather than an error in the documentation,
+thus the output now looks more similar to what printf with %e yields;
+the GMP function mpf_out_str also outputs the exponent 0.
+Short discussion:
+ https://sympa.inria.fr/sympa/arc/mpfr/2019-08/msg00012.html
+
+Note: The tests still pass, as this function is currently not really
+tested.
+------------------------------------------------------------------------
+r13563 | vlefevre | 2019-08-14 17:01:18 +0000 (Wed, 14 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] Update/corrections about MinGW and __USE_MINGW_ANSI_STDIO.
+------------------------------------------------------------------------
+r13562 | vlefevre | 2019-08-14 15:43:30 +0000 (Wed, 14 Aug 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] When building with MinGW, output a line about it:
+MinGW32 / MinGW64, and the __USE_MINGW_ANSI_STDIO definition.
+------------------------------------------------------------------------
+r13561 | vlefevre | 2019-08-14 15:37:46 +0000 (Wed, 14 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Moved a definition under the #if where it is used.
+------------------------------------------------------------------------
+r13560 | zimmerma | 2019-08-14 07:38:12 +0000 (Wed, 14 Aug 2019) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+
+improve INSTALL (feedback from sisyphus <sisyphus359@gmail.com>)
+
+------------------------------------------------------------------------
+r13559 | vlefevre | 2019-08-12 13:39:50 +0000 (Mon, 12 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Added a FIXME for mpfr_out_str about the exponent 0.
+------------------------------------------------------------------------
+r13558 | vlefevre | 2019-08-12 13:32:58 +0000 (Mon, 12 Aug 2019) | 10 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] About mpfr_get_str / mpfr_out_str:
+ * In the mpfr_get_str description, changed argument "b" to "base" for
+ consistency with similar functions (now, only mpfr_get_str_ndigits
+ has b as this looks better in the formula). Also added a link to
+ mpfr_get_str_ndigits.
+ * In the mpfr_out_str description, replaced the ambiguous and even
+ incorrect sentence "enough digits so that op can be read back
+ exactly" (issues with trailing zeros and with the directed rounding
+ modes) by text similar to the one in the mpfr_get_str description
+ (keeping the reference to mpfr_get_str).
+------------------------------------------------------------------------
+r13557 | vlefevre | 2019-08-12 12:40:32 +0000 (Mon, 12 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/src/out_str.c
+
+[src/out_str.c] Coding style (e is not a boolean).
+------------------------------------------------------------------------
+r13556 | vlefevre | 2019-08-09 13:52:29 +0000 (Fri, 09 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+[tests/tout_str.c] Use mpfr_print_rnd_mode in a message.
+------------------------------------------------------------------------
+r13555 | vlefevre | 2019-08-09 13:49:28 +0000 (Fri, 09 Aug 2019) | 3 lines
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+[tests/tout_str.c] Code simplification: a test from r1888 on a
+random value was unnecessary (the log message of r1888 did not
+even correspond to the change).
+------------------------------------------------------------------------
+r13554 | vlefevre | 2019-08-09 13:37:48 +0000 (Fri, 09 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+[tests/tout_str.c] GNU coding style.
+------------------------------------------------------------------------
+r13553 | vlefevre | 2019-08-09 13:34:16 +0000 (Fri, 09 Aug 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+[tests/tout_str.c] Added missing newline characters in the output
+after calls to mpfr_out_str.
+------------------------------------------------------------------------
+r13552 | vlefevre | 2019-08-09 13:29:36 +0000 (Fri, 09 Aug 2019) | 5 lines
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+[tests/tout_str.c] By default, output the results to a file instead of
+/dev/null (this was already done only if opening /dev/null failed), so
+that they can be checked later. Fixed 2 issues at the same time:
+ * Do not close stdout (when an argument was provided).
+ * Remove the file at the end.
+------------------------------------------------------------------------
+r13551 | vlefevre | 2019-08-09 13:11:38 +0000 (Fri, 09 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] GNU coding style.
+------------------------------------------------------------------------
+r13550 | vlefevre | 2019-08-09 13:09:57 +0000 (Fri, 09 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] Added a comment about the use of perror.
+------------------------------------------------------------------------
+r13549 | vlefevre | 2019-08-09 13:06:47 +0000 (Fri, 09 Aug 2019) | 4 lines
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] Also check fclose failure when the file has been opened
+for writing (typically an error in case the buffer cannot be written to
+the file). Call perror after all fopen/src_fopen/fclose failures to get
+the reason of the failure.
+------------------------------------------------------------------------
+r13548 | vlefevre | 2019-08-09 12:45:21 +0000 (Fri, 09 Aug 2019) | 4 lines
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] In case of failure of fopen or src_fopen, write the
+error message on stderr (as one should do for errors not directly
+related to the tests, such as memory allocation and I/O errors).
+Also improved the error messages and made them consistent.
+------------------------------------------------------------------------
+r13547 | vlefevre | 2019-08-06 12:47:52 +0000 (Tue, 06 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13546 | vlefevre | 2019-08-05 13:50:20 +0000 (Mon, 05 Aug 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Improved consistency with @item.
+------------------------------------------------------------------------
+r13545 | vlefevre | 2019-08-02 13:17:10 +0000 (Fri, 02 Aug 2019) | 3 lines
+Changed paths:
+ M /trunk/Makefile.am
+ M /trunk/doc/Makefile.am
+ M /trunk/src/Makefile.am
+ M /trunk/tests/Makefile.am
+ M /trunk/tools/bench/Makefile.am
+ M /trunk/tune/Makefile.am
+
+For Makefile.am and each one in SUBDIRS, added the .POSIX target to
+select the POSIX behavior (since we do not require GNU "make").
+See: https://sympa.inria.fr/sympa/arc/mpfr/2019-08/msg00005.html
+------------------------------------------------------------------------
+r13544 | vlefevre | 2019-08-02 08:22:52 +0000 (Fri, 02 Aug 2019) | 2 lines
+Changed paths:
+ M /trunk/tools/get_patches.sh
+
+[tools/get_patches.sh] Fixed change in r13543 (the contents of PATCHES
+should still be written as a list of words separated by a space).
+------------------------------------------------------------------------
+r13543 | vlefevre | 2019-08-02 08:15:24 +0000 (Fri, 02 Aug 2019) | 9 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/tools/get_patches.sh
+
+Fixed src/get_patches.c generation that was changed in r13542.
+ * src/Makefile.am, tools/get_patches.sh: since get_patches.sh is
+ no longer run from $(top_srcdir), the PATCHES absolute pathname
+ now needs to be passed in argument.
+ * src/Makefile.am: fixed the get_patches.c rule (the automatic
+ variable $< was used with the meaning "first prerequisite" of
+ GNU Make; an "exit 1" was missing, so that a failure did not
+ abort "make" immediately).
+ * tools/get_patches.sh: detect errors with "set -e".
+------------------------------------------------------------------------
+r13542 | vlefevre | 2019-07-31 15:55:00 +0000 (Wed, 31 Jul 2019) | 7 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] Define get_patches.c as a built source to avoid a
+non-portable make rule ("/" character in target), causing an error
+in FreeBSD with its "make" command. This change should be OK as the
+get_patches.sh script that generates get_patches.c is very simple
+and portable. As a consequence, put get_patches.c in CLEANFILES.
+See:
+ https://sympa.inria.fr/sympa/arc/mpfr/2019-07/msg00003.html
+------------------------------------------------------------------------
+r13541 | vlefevre | 2019-07-31 15:28:01 +0000 (Wed, 31 Jul 2019) | 4 lines
+Changed paths:
+ M /trunk/Makefile.am
+
+[Makefile.am] Fixed dist-hook for ck-mparam, which was run from a
+read-only directory with "make distcheck" while a temporary file
+is created in the current directory, yielding a failure (ck-mparam
+has been run in dist-hook since r12533 on 2018-04-03).
+------------------------------------------------------------------------
+r13540 | vlefevre | 2019-07-31 15:23:57 +0000 (Wed, 31 Jul 2019) | 4 lines
+Changed paths:
+ M /trunk/tools/ck-mparam
+
+[tools/ck-mparam] Updated comment to warn that the source tree that is
+checked is the one that contains this script, not the one corresponding
+to the current working directory (the rule for the other scripts in the
+tools directory is currently different).
+------------------------------------------------------------------------
+r13539 | vlefevre | 2019-07-31 15:06:10 +0000 (Wed, 31 Jul 2019) | 5 lines
+Changed paths:
+ M /trunk/tools/ck-mparam
+
+[tools/ck-mparam] This script can now be run from any directory (which
+must still be writable). This change has been done to be able to run
+it from the build directory, as if it is run via "make distcheck" and
+a dist-hook rule, then neither the top-level directory nor the tools
+directory is writable.
+------------------------------------------------------------------------
+r13537 | vlefevre | 2019-07-23 10:55:43 +0000 (Tue, 23 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Updated comment (only the x86 and x86_64 targets
+are affected).
+------------------------------------------------------------------------
+r13536 | vlefevre | 2019-07-23 06:55:53 +0000 (Tue, 23 Jul 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Improved a comment.
+------------------------------------------------------------------------
+r13535 | vlefevre | 2019-07-22 14:08:50 +0000 (Mon, 22 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Avoid GCC bug 91226: wrong propagation of
+non-canonical _Decimal64 constant.
+------------------------------------------------------------------------
+r13534 | vlefevre | 2019-07-22 12:57:55 +0000 (Mon, 22 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] In decimal64_to_string, log the memory representation
+of the _Decimal64 argument.
+------------------------------------------------------------------------
+r13533 | vlefevre | 2019-07-22 12:47:56 +0000 (Mon, 22 Jul 2019) | 3 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] In decimal64_to_string, log the various fields of the
+_Decimal64 argument whose memory data is regarded as a double (as this
+is the current implementation of this function).
+------------------------------------------------------------------------
+r13532 | vlefevre | 2019-07-22 10:36:28 +0000 (Mon, 22 Jul 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] More output details in the noncanonical test.
+------------------------------------------------------------------------
+r13531 | vlefevre | 2019-07-22 10:29:09 +0000 (Mon, 22 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Improved the noncanonical test, but this does not
+solve the failure with gcc-snapshot.
+------------------------------------------------------------------------
+r13530 | vlefevre | 2019-07-22 10:16:00 +0000 (Mon, 22 Jul 2019) | 3 lines
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] More meaningful name of a test with a
+non-canonical encoding and more details (fails with Debian's
+gcc-snapshot 10.0.0 20190718, trunk revision 273586).
+------------------------------------------------------------------------
+r13528 | vlefevre | 2019-07-12 15:58:07 +0000 (Fri, 12 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] "To make a release": mention -Wsuggest-attribute=...
+options (but mpfr.h first needs some macros like __MPFR_SENTINEL_ATTR).
+------------------------------------------------------------------------
+r13527 | vlefevre | 2019-07-12 13:31:46 +0000 (Fri, 12 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+Renamed MPFR_CONST_ATTR macro to MPFR_CONST_FUNCTION_ATTR in order to be
+similar to the MPFR_{PURE,HOT,COLD}_FUNCTION_ATTR macro names.
+------------------------------------------------------------------------
+r13526 | vlefevre | 2019-07-10 09:15:09 +0000 (Wed, 10 Jul 2019) | 5 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update concerning the MPFR manual:
+ * Updated information about the papersize issues (should be fixed,
+ but manual checking is recommended).
+ * Detailed English typography.
+ * Removed mention of the old texinfo bug 33329 (Debian bug 583558).
+------------------------------------------------------------------------
+r13524 | vlefevre | 2019-07-08 11:08:18 +0000 (Mon, 08 Jul 2019) | 1 line
+Changed paths:
+ M /trunk/codespell.exclude
+ M /trunk/codespell.ignore
+
+[codespell.*] Update for codespell 1.15.0.
+------------------------------------------------------------------------
+r13522 | vlefevre | 2019-07-08 11:03:43 +0000 (Mon, 08 Jul 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/src/free_cache.c
+ M /trunk/src/mpfr-gmp.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr.h
+
+Fixed spelling mistakes found by codespell 1.15.0.
+------------------------------------------------------------------------
+r13519 | vlefevre | 2019-07-06 19:55:37 +0000 (Sat, 06 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added missing "const" qualifier to "char *" in a test;
+needed with GCC's "-Wwrite-strings -Werror".
+------------------------------------------------------------------------
+r13517 | vlefevre | 2019-07-02 12:13:56 +0000 (Tue, 02 Jul 2019) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] MPFR_GROUP_* macros / mpfr_group_t structure: when
+MPFR_GROUP_STATIC_SIZE is 0 (for testing), use a flexible array member
+(ISO C99) instead of a zero-length array (GNU extension, forbidden in
+ISO C).
+------------------------------------------------------------------------
+r13515 | vlefevre | 2019-07-02 11:06:33 +0000 (Tue, 02 Jul 2019) | 3 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+ M /trunk/tests/tfpif.c
+ M /trunk/tests/tmul_2exp.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/trint.c
+ M /trunk/tests/tsprintf.c
+ M /trunk/tests/tsum.c
+ M /trunk/tests/turandom.c
+
+[tests/*.c] Added missing "const" qualifier to "char *" when this
+involves string literals (detected by using GCC's -Wwrite-strings
+option, via the default -Wdiscarded-qualifiers warning).
+------------------------------------------------------------------------
+r13514 | vlefevre | 2019-07-01 15:40:11 +0000 (Mon, 01 Jul 2019) | 4 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+[acinclude.m4,configure.ac] MPFR_C_LONG_DOUBLE_FORMAT: also detect
+clang's LTO.
+Note: no longer use $FGREP (see r13513) as its status is unclear on
+non-POSIX systems (though very probably available when $EGREP is).
+------------------------------------------------------------------------
+r13513 | vlefevre | 2019-07-01 14:12:10 +0000 (Mon, 01 Jul 2019) | 5 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+[acinclude.m4,configure.ac] For MPFR_C_LONG_DOUBLE_FORMAT, when the
+format is unknown and it is detected that LTO has been used, output
+"recognition prevented by LTO".
+Note: at the same time, since AC_PROG_FGREP was needed, replaced
+$EGREP by $FGREP when applicable.
+------------------------------------------------------------------------
+r13512 | vlefevre | 2019-07-01 13:44:51 +0000 (Mon, 01 Jul 2019) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] MPFR_C_LONG_DOUBLE_FORMAT: improved comment and added a
+warning saying that this does not work with GCC's LTO (gcc -flto ...).
+------------------------------------------------------------------------
+r13511 | zimmerma | 2019-06-07 12:42:41 +0000 (Fri, 07 Jun 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] simplified code of sub1sp1 for bx = cx
+
+------------------------------------------------------------------------
+r13510 | vlefevre | 2019-06-06 12:43:33 +0000 (Thu, 06 Jun 2019) | 3 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] About r13506-13509 and optimization: added a comment
+about Clang after some tests (without giving details, as in practice,
+this is more complex... but this is the general idea).
+------------------------------------------------------------------------
+r13509 | zimmerma | 2019-06-06 12:23:42 +0000 (Thu, 06 Jun 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed typo
+
+------------------------------------------------------------------------
+r13508 | vlefevre | 2019-06-06 12:12:11 +0000 (Thu, 06 Jun 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Added reference to GCC PR30315 about a misoptimization
+on x86/x86_64 (see r13506 and r13507).
+------------------------------------------------------------------------
+r13507 | vlefevre | 2019-06-06 10:51:57 +0000 (Thu, 06 Jun 2019) | 3 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Completed r13506: added MPFR_ASSERTD to justify the
+new code and give more information to the compiler; added comments
+about this optimization issue.
+------------------------------------------------------------------------
+r13506 | zimmerma | 2019-06-06 10:14:04 +0000 (Thu, 06 Jun 2019) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] small speedup (following discussion with Félix Breton)
+
+------------------------------------------------------------------------
+r13498 | vlefevre | 2019-06-01 14:22:53 +0000 (Sat, 01 Jun 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added a note about MPFR_DISABLE_IEEE_FLOATS.
+------------------------------------------------------------------------
+r13497 | vlefevre | 2019-06-01 13:57:48 +0000 (Sat, 01 Jun 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated MPFR_DISABLE_IEEE_FLOATS description.
+------------------------------------------------------------------------
+r13496 | vlefevre | 2019-06-01 13:54:08 +0000 (Sat, 01 Jun 2019) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Undefine HAVE_LDOUBLE_IS_DOUBLE & HAVE_LDOUBLE_IEEE_*
+macros if MPFR_DISABLE_IEEE_FLOATS is defined, as the goal is to test
+code not relying on IEEE floats.
+------------------------------------------------------------------------
+r13495 | vlefevre | 2019-05-24 13:17:50 +0000 (Fri, 24 May 2019) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Code simplification with the generic
+LONGDOUBLE_NAN_ACTION macro (the WANT_LONGDOUBLE_VOLATILE macro is not
+needed as used only once, thus removed). Improved the related comment.
+------------------------------------------------------------------------
+r13494 | vlefevre | 2019-05-24 08:33:50 +0000 (Fri, 24 May 2019) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/volatile.c
+
+[src] Instead of including <float.h> in volatile.c (r13493), do that
+unconditionally in mpfr-impl.h to make sure that macro definitions
+in this header file are always correct: some definitions depend on
+various macros from <float.h>, such as FLT_RADIX and DBL_MANT_DIG.
+------------------------------------------------------------------------
+r13493 | zimmerma | 2019-05-24 07:35:03 +0000 (Fri, 24 May 2019) | 3 lines
+Changed paths:
+ M /trunk/src/volatile.c
+
+applied patch from #21762
+(https://gforge.inria.fr/tracker/?func=detail&atid=619&aid=21762&group_id=136)
+
+------------------------------------------------------------------------
+r13492 | vlefevre | 2019-05-15 13:53:23 +0000 (Wed, 15 May 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added another URL on undefined behavior.
+------------------------------------------------------------------------
+r13488 | vlefevre | 2019-04-30 17:06:09 +0000 (Tue, 30 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Note that -static-libasan does not work with MPFR.
+------------------------------------------------------------------------
+r13486 | vlefevre | 2019-04-30 15:13:32 +0000 (Tue, 30 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update about the use of GCC's "-fsanitize=address".
+------------------------------------------------------------------------
+r13485 | zimmerma | 2019-04-30 13:49:59 +0000 (Tue, 30 Apr 2019) | 3 lines
+Changed paths:
+ M /trunk/src/zeta.c
+
+[src/zeta.c] fixed out-of-bound read reported by Thomas Bailleux
+
+Note: This bug was introduced in r12066.
+------------------------------------------------------------------------
+r13484 | vlefevre | 2019-04-29 13:29:12 +0000 (Mon, 29 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/tools/ck-version-info
+
+[tools/ck-version-info] Minor corrections in a comment.
+------------------------------------------------------------------------
+r13483 | vlefevre | 2019-04-29 13:26:29 +0000 (Mon, 29 Apr 2019) | 3 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update about the VERSION file:
+ * Added a paragraph on the meaning of the "-dev" suffix.
+ * Removed a confusing and useless "-dev" in an example.
+------------------------------------------------------------------------
+r13482 | vlefevre | 2019-04-29 13:17:34 +0000 (Mon, 29 Apr 2019) | 4 lines
+Changed paths:
+ M /trunk/tools/ck-news
+
+[tools/ck-news] Changed the condition of the test for FIXME or TODO:
+Previously it was disabled only for -dev versions. Now it is enabled
+only for releases and release candidates. This will allow snapshots,
+for which the NEWS file may still contain a FIXME or TODO.
+------------------------------------------------------------------------
+r13481 | vlefevre | 2019-04-29 13:11:11 +0000 (Mon, 29 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/tools/ck-version-info
+
+[tools/ck-version-info] Corrected check. Added explanations in comments.
+------------------------------------------------------------------------
+r13480 | vlefevre | 2019-04-29 12:44:01 +0000 (Mon, 29 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/tools/ck-version-info
+
+[tools/ck-version-info] Better error message if $vinfo is not defined.
+------------------------------------------------------------------------
+r13479 | vlefevre | 2019-04-29 12:38:40 +0000 (Mon, 29 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] Added a comment.
+------------------------------------------------------------------------
+r13477 | vlefevre | 2019-04-25 12:26:27 +0000 (Thu, 25 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13475 | vlefevre | 2019-04-25 10:55:11 +0000 (Thu, 25 Apr 2019) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the list of rounding modes in the description
+of the mpfr_print_rnd_mode function. Choose the same order as in the
+"Rounding Modes" section in "MPFR Basics".
+------------------------------------------------------------------------
+r13474 | vlefevre | 2019-04-25 10:53:38 +0000 (Thu, 25 Apr 2019) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Lists of rounding modes: also check with the
+"Rounding Modes" section in "MPFR Basics".
+------------------------------------------------------------------------
+r13473 | vlefevre | 2019-04-25 10:35:45 +0000 (Thu, 25 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/src/print_rnd_mode.c
+
+[src/print_rnd_mode.c] Added a comment to remember to update the manual.
+------------------------------------------------------------------------
+r13472 | vlefevre | 2019-04-25 10:34:31 +0000 (Thu, 25 Apr 2019) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Check that the lists of rounding modes in
+src/print_rnd_mode.c and doc/mpfr.texi are identical.
+------------------------------------------------------------------------
+r13471 | vlefevre | 2019-04-25 10:05:47 +0000 (Thu, 25 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] Added a blank line (grouping of function declarations).
+------------------------------------------------------------------------
+r13470 | vlefevre | 2019-04-25 10:04:25 +0000 (Thu, 25 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/TODO
+ M /trunk/src/mpfr.h
+ M /trunk/src/vasprintf.c
+
+Added support for GCC's returns_nonnull attribute (with GCC 4.9+).
+------------------------------------------------------------------------
+r13469 | vlefevre | 2019-04-25 09:31:55 +0000 (Thu, 25 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Update about GCC's nonnull and returns_nonnull attributes.
+------------------------------------------------------------------------
+r13467 | vlefevre | 2019-04-16 08:11:02 +0000 (Tue, 16 Apr 2019) | 5 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/vasprintf.c
+
+New macro MPFR_FALLTHROUGH to avoid -Wimplicit-fallthrough warnings
+with GCC 7+. This macro also makes the code more readable by bringing
+the attention on an unusual fallthrough in a switch case.
+ * src/mpfr-impl.h: define this macro.
+ * src/vasprintf.c: use this macro in a case of fallthrough.
+------------------------------------------------------------------------
+r13466 | vlefevre | 2019-04-15 12:27:49 +0000 (Mon, 15 Apr 2019) | 8 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tsprintf.c
+
+[src/vasprintf.c] Minor bug fix: when an integer is to be read for
+ the field width or precision, regard strings like "17*" as invalid
+ instead of regarding it as "*" (ignoring the integer that precedes,
+ except in case of overflow). In C's printf, such an invalid string
+ yields undefined behavior, but in MPFR, we normally print the
+ invalid format specifier as a literal string in such a case.
+ Bug detected with -Wimplicit-fallthrough from GCC 7+.
+[tests/tsprintf.c] Added non-regression test.
+------------------------------------------------------------------------
+r13464 | vlefevre | 2019-04-02 09:36:47 +0000 (Tue, 02 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated --enable-logging description.
+------------------------------------------------------------------------
+r13463 | vlefevre | 2019-04-02 09:33:07 +0000 (Tue, 02 Apr 2019) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] When logging support is requested, run a test to check
+that code with nested functions and the 'cleanup' attribute can be
+compiled, as these features are needed.
+------------------------------------------------------------------------
+r13462 | vlefevre | 2019-04-02 09:07:39 +0000 (Tue, 02 Apr 2019) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] AC_ARG_ENABLE(float128,...): updated comment and
+description.
+------------------------------------------------------------------------
+r13461 | vlefevre | 2019-04-02 08:56:21 +0000 (Tue, 02 Apr 2019) | 5 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated comment for AC_ARG_ENABLE(decimal-float,...).
+ * Removed information about very old GCC versions.
+ * _Decimal128 is considered too, in addition to _Decimal64.
+ * No longer just a GCC extension, but part of ISO/IEC TS 18661.
+ * Added a FIXME for new options about _Decimal64 and _Decimal128.
+------------------------------------------------------------------------
+r13460 | vlefevre | 2019-04-02 08:43:30 +0000 (Tue, 02 Apr 2019) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Cleanup: moved some AC_ARG_ENABLE's where they should be.
+------------------------------------------------------------------------
+r13459 | vlefevre | 2019-03-29 16:27:57 +0000 (Fri, 29 Mar 2019) | 8 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c]
+ * Corrected FIXME by modifying the assertion. The failure could occur
+ only when mpfr_intmax_t has the same size as int (which is the case
+ when long = int and either intmax_t and long long are not available
+ or intmax_t = long = int), and only when INT_MIN is provided as a
+ field width argument.
+ * Related to that, updated a test to improve optimization.
+ * Added comments.
+------------------------------------------------------------------------
+r13458 | vlefevre | 2019-03-29 15:20:48 +0000 (Fri, 29 Mar 2019) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Added a FIXME: tsprintf yields an assertion failure
+with sizeof(mpfr_intmax_t) = 4 (which was not tested until now).
+------------------------------------------------------------------------
+r13457 | vlefevre | 2019-03-29 14:39:22 +0000 (Fri, 29 Mar 2019) | 32 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/doc/README.dev
+ M /trunk/src/fits_intmax.c
+ M /trunk/src/fits_uintmax.c
+ M /trunk/src/get_sj.c
+ M /trunk/src/get_uj.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tstdint.c
+ M /trunk/tests/tversion.c
+
+Cleanup / fixes related to intmax_t, mpfr_intmax_t, etc.
+
+The issues were:
+ * The build of the tests (make check) could fail with CFLAGS implying
+ "-std=c90 -Werror=format", i.e. if intmax_t was available but the
+ use of the "j" printf length modifier made the compilation fail
+ (its unconditional use was incorrect anyway).
+ * MPFR_INTMAX_MAX had definitions in both mpfr-impl.h & mpfr-intmax.h,
+ with inconsistent usage.
+
+Detailed changes:
+ * acinclude.m4: removed the definition of MPFR_PRINTF_MAXLM, which
+ could be incorrect (large numbers were not tested to select its
+ value); in the MPFR_FUNC_GMP_PRINTF_SPEC macro, check sprintf()
+ in addition to gmp_sprintf() as it is now also used in the tests;
+ updated some comments and messages.
+ * src/mpfr-impl.h: removed the MPFR_*INTMAX* definitions; they had
+ been added due to
+ https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582698
+ with -ansi -pedantic-errors, but this issue was fixed in GCC 4.8
+ (released 6 years ago), so that they are no longer needed.
+ * src/mpfr-intmax.h: completed the definitions; mpfr_intmax_t is now
+ the largest integer type available and fully working (in particular
+ with printf), thus it may be smaller than intmax_t.
+ * doc/README.dev: updated the description of mpfr_intmax_t, etc.
+ * tests/tversion.c: output sizeof(mpfr_intmax_t) too.
+ * Various .c files in src and tests related to (u)intmax_t: use
+ INTMAX_MAX instead of MPFR_INTMAX_MAX, etc. as Debian bug 582698
+ (mentioned above) no longer occurs and mpfr_intmax_t may be smaller
+ than intmax_t; use the "j" printf length modifier instead of
+ MPFR_PRINTF_MAXLM, and protect it with "#ifndef NPRINTF_J"
+ (only the tests are concerned, so that this is not an issue).
+------------------------------------------------------------------------
+r13456 | vlefevre | 2019-03-28 17:19:00 +0000 (Thu, 28 Mar 2019) | 2 lines
+Changed paths:
+ M /trunk/src/urandomb.c
+
+[src/urandomb.c] Removed the FIXME: this is a bug in GMP or in Clang's
+memory sanitizer.
+------------------------------------------------------------------------
+r13455 | vlefevre | 2019-03-28 16:56:46 +0000 (Thu, 28 Mar 2019) | 2 lines
+Changed paths:
+ M /trunk/src/urandomb.c
+
+[src/urandomb.c] Added a FIXME (use-of-uninitialized-value with
+Clang's memory sanitizer).
+------------------------------------------------------------------------
+r13452 | vlefevre | 2019-03-13 12:51:51 +0000 (Wed, 13 Mar 2019) | 1 line
+Changed paths:
+ M /trunk/src/printf.c
+
+[src/printf.c] Removed unused definitions.
+------------------------------------------------------------------------
+r13451 | vlefevre | 2019-03-01 13:12:20 +0000 (Fri, 01 Mar 2019) | 6 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update about coverage:
+ * Mention not to enable optimizations.
+ * Replaced "-fprofile-arcs -ftest-coverage" by "--coverage", as
+ this is what is used by the tools/coverage script (note: this
+ is a synonym when compiling, but also allows the right options
+ to be used when linking, thus might be better in doubt).
+------------------------------------------------------------------------
+r13446 | vlefevre | 2019-02-04 14:17:56 +0000 (Mon, 04 Feb 2019) | 1 line
+Changed paths:
+ M /trunk/tests/tcmp_d.c
+ M /trunk/tests/tcmp_ld.c
+ M /trunk/tests/td_div.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tset_float128.c
+
+[tests] Use MPFR_DBL_* macros when necessary.
+------------------------------------------------------------------------
+r13445 | vlefevre | 2019-02-04 13:57:49 +0000 (Mon, 04 Feb 2019) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] For consistency, use "[ch]" instead of "{c,h}".
+------------------------------------------------------------------------
+r13444 | vlefevre | 2019-02-04 13:55:47 +0000 (Mon, 04 Feb 2019) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Detect use of DBL_* macros instead of MPFR_DBL_* ones.
+------------------------------------------------------------------------
+r13443 | vlefevre | 2019-02-04 13:47:14 +0000 (Mon, 04 Feb 2019) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Improved message about division by zero.
+------------------------------------------------------------------------
+r13442 | vlefevre | 2019-02-04 13:39:17 +0000 (Mon, 04 Feb 2019) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/tools/mpfrlint
+
+[doc/README.dev] Improved description of MPFR_ERRDIVZERO.
+[tools/mpfrlint] Added a comment about division by zero.
+------------------------------------------------------------------------
+r13441 | vlefevre | 2019-02-04 13:23:37 +0000 (Mon, 04 Feb 2019) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Check that native FP division by zero is not used.
+------------------------------------------------------------------------
+r13429 | vlefevre | 2019-01-31 15:09:00 +0000 (Thu, 31 Jan 2019) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
[src/Makefile.am] In check-exported-symbols, replaced grep by $(GREP)
as usual and like in check-gmp-symbols.
-(merged changeset 13429 from the trunk)
------------------------------------------------------------------------
-r13424 | vlefevre | 2019-01-30 12:45:13 +0000 (Wed, 30 Jan 2019) | 2 lines
+r13423 | vlefevre | 2019-01-30 09:49:35 +0000 (Wed, 30 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/configure.ac
+ M /trunk/configure.ac
[configure.ac] Updated comment about default options in CFLAGS for GCC.
-(merged changeset r13423 from the trunk)
------------------------------------------------------------------------
-r13422 | vlefevre | 2019-01-30 09:26:44 +0000 (Wed, 30 Jan 2019) | 8 lines
+r13421 | vlefevre | 2019-01-30 09:19:01 +0000 (Wed, 30 Jan 2019) | 7 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/INSTALL
- M /branches/4.0/NEWS
- M /branches/4.0/configure.ac
+ M /trunk/INSTALL
+ M /trunk/NEWS
+ M /trunk/configure.ac
Update about CC / CFLAGS settings from GMP (__GMP_CC / __GMP_CFLAGS).
* configure.ac: remove -pedantic unconditionally; since r7044, it was
@@ -47,1423 +4391,3704 @@ Update about CC / CFLAGS settings from GMP (__GMP_CC / __GMP_CFLAGS).
* NEWS: added a line about this change.
* INSTALL: updated the note about CC / CFLAGS, removing the obsolete
reference to GMP 4.3.0 at the same time.
-(merged changeset r13421 from the trunk)
------------------------------------------------------------------------
-r13418 | vlefevre | 2019-01-27 23:08:51 +0000 (Sun, 27 Jan 2019) | 1 line
+r13420 | vlefevre | 2019-01-28 01:31:22 +0000 (Mon, 28 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/tools/announce-text
-ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
+[tools/announce-text] Corrected subject for Release Candidate > 1.
------------------------------------------------------------------------
-r13417 | vlefevre | 2019-01-27 23:01:21 +0000 (Sun, 27 Jan 2019) | 1 line
+r13415 | vlefevre | 2019-01-25 14:31:46 +0000 (Fri, 25 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/ChangeLog
-Updated version to 4.0.2-rc2.
+ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC svn log -rHEAD:0 -v".
------------------------------------------------------------------------
-r13416 | vlefevre | 2019-01-27 18:30:16 +0000 (Sun, 27 Jan 2019) | 38 lines
+r13414 | vlefevre | 2019-01-25 12:58:24 +0000 (Fri, 25 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/NEWS
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/src/mpfr-impl.h
- M /branches/4.0/src/mpfr-thread.h
- M /branches/4.0/tests
- M /branches/4.0/tests/tversion.c
+ M /trunk/NEWS
-Shared cache: cleanup and various improvements / corrections.
- * acinclude.m4:
- - test $enable_shared_cache instead of $mpfr_want_shared_cache;
- - check ISO C11 thread support and/or POSIX thread support
- only when necessary;
- - when checking support for POSIX threads (pthread), also check
- that pthread_rwlock_t is supported, as it is needed by MPFR
- and conditionally defined in glibc's bits/pthreadtypes.h (via
- <pthread.h>);
- - with POSIX threads, also set CC="$PTHREAD_CC" as documented by
- ax_pthread (autoconf-archive). This is not guaranteed to work,
- but according to the ax_pthread.m4 source, in the cases where
- "$PTHREAD_CC" != "$CC", not setting it will probably not work
- either;
- - handle --enable-shared-cache early in MPFR_CONFIGS, because
- the use of POSIX threads (pthread) may need to change CC,
- CFLAGS, and LIBS (thus affecting other tests);
- - removed the now useless MPFR_CHECK_SHARED_CACHE function.
- * configure.ac: no longer set the mpfr_want_shared_cache variable,
- as enable_shared_cache (now used) already has the same usage.
- * acinclude.m4, configure.ac: moved the compatibility test of the
- configure options even earlier, from acinclude.m4 to configure.ac,
- just after the code that defines them. Also added an associated
- AC_MSG_CHECKING message for better clarity.
- * src/mpfr-impl.h: added a comment about the cache-related types,
- which depend on the locking methods.
- * src/mpfr-thread.h: fixed the lock macros:
- - in case of failure, one must abort, otherwise this would
- generally be undefined behavior;
- - added missing "do {} while (0)" (currently not mandatory).
- * tests/tversion.c: update concerning the shared cache, to be
- consistent with the other mpfr_buildopt_*_p features:
- - check that mpfr_buildopt_sharedcache_p() and
- MPFR_WANT_SHARED_CACHE match;
- - for the output of the value, test mpfr_buildopt_sharedcache_p()
- instead of the macro.
- * NEWS: update.
-(merged changesets r13032,13390-13396,13410,13412 from the trunk)
-------------------------------------------------------------------------
-r13409 | vlefevre | 2019-01-25 02:00:06 +0000 (Fri, 25 Jan 2019) | 6 lines
-Changed paths:
- M /branches/4.0
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/tests
- M /branches/4.0/tests/trint.c
+[NEWS] Update about shared caches.
+------------------------------------------------------------------------
+r13413 | vlefevre | 2019-01-25 12:55:31 +0000 (Fri, 25 Jan 2019) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Added: "Shared caches: cleanup."
+------------------------------------------------------------------------
+r13412 | vlefevre | 2019-01-25 12:52:54 +0000 (Fri, 25 Jan 2019) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-thread.h
+
+[src/mpfr-thread.h] Fixed the lock macros:
+ * in case of failure, one must abort, otherwise this would generally
+ be undefined behavior;
+ * added missing "do {} while (0)" (currently not mandatory).
+------------------------------------------------------------------------
+r13411 | vlefevre | 2019-01-25 12:01:18 +0000 (Fri, 25 Jan 2019) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Updated a comment about MPFR_DECL_INIT_CACHE and
+the shared cache.
+------------------------------------------------------------------------
+r13410 | vlefevre | 2019-01-25 11:48:40 +0000 (Fri, 25 Jan 2019) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Avoid a warning with the pthread_rwlock_t test,
+as it is an error with -Werror.
+------------------------------------------------------------------------
+r13408 | vlefevre | 2019-01-25 00:52:54 +0000 (Fri, 25 Jan 2019) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed another C++ compatibility issue detected by
+the -Werror=c++-compat GCC option (it led the "long double" format
+to be unknown).
+------------------------------------------------------------------------
+r13407 | vlefevre | 2019-01-24 23:21:20 +0000 (Thu, 24 Jan 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/trint.c
+
+[tests/trint.c] Fixed C++ compatibility issue (arithmetic on enum)
+detected by the -Werror=c++-compat GCC option.
+------------------------------------------------------------------------
+r13406 | vlefevre | 2019-01-23 14:11:26 +0000 (Wed, 23 Jan 2019) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
[configure.ac] By default (i.e. if CFLAGS is not already set), if
the compiler is GCC not in C++ mode, add the -Wc++-compat warning
since we expect the code to compile with a C++ compiler.
-[acinclude.m4,tests/trint.c] Fixed C++ compatibility issues detected
-thanks to this option used with -Werror.
-(merged changesets r13406-13408 from the trunk)
------------------------------------------------------------------------
-r13402 | vlefevre | 2019-01-13 15:39:13 +0000 (Sun, 13 Jan 2019) | 2 lines
+r13401 | vlefevre | 2019-01-13 15:38:22 +0000 (Sun, 13 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tcheck.c
+ M /trunk/tests/tcheck.c
[tests/tcheck.c] Corrected meaningless error message.
-(merged changeset r13401 from the trunk)
------------------------------------------------------------------------
-r13400 | vlefevre | 2019-01-13 01:15:11 +0000 (Sun, 13 Jan 2019) | 3 lines
+r13397 | vlefevre | 2019-01-13 00:13:15 +0000 (Sun, 13 Jan 2019) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tversion.c
+ M /trunk/doc/mpfr.texi
-[tests/tversion.c] Decimal formats: output the encoding type (DPD/BID).
-(merged changeset r12776 from the trunk, and as a consequence,
-completed the merge of r13003)
+[doc/mpfr.texi] Minor correction for non-tex versions.
+Thanks to Trevor Spiteri for the bug report.
------------------------------------------------------------------------
-r13399 | vlefevre | 2019-01-13 00:17:11 +0000 (Sun, 13 Jan 2019) | 1 line
+r13396 | vlefevre | 2019-01-09 14:12:12 +0000 (Wed, 09 Jan 2019) | 3 lines
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
-Updated version to 4.0.2-dev.
+Moved the compatibility test of the configure options even earlier, from
+acinclude.m4 to configure.ac, just after the code that defines them.
+Also added an associated AC_MSG_CHECKING message for better clarity.
------------------------------------------------------------------------
-r13398 | vlefevre | 2019-01-13 00:15:31 +0000 (Sun, 13 Jan 2019) | 3 lines
+r13395 | vlefevre | 2019-01-09 14:01:33 +0000 (Wed, 09 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/acinclude.m4
-[doc/mpfr.texi] Minor correction for non-tex versions.
-Thanks to Trevor Spiteri for the bug report.
-(merged changeset r13397 from the trunk)
+[acinclude.m4] Simplified a message.
------------------------------------------------------------------------
-r13387 | vlefevre | 2019-01-08 13:43:12 +0000 (Tue, 08 Jan 2019) | 1 line
+r13394 | vlefevre | 2019-01-09 13:58:07 +0000 (Wed, 09 Jan 2019) | 2 lines
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/tests/tversion.c
-ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
+[tests/tversion.c] When the shared cache is enabled, also output the
+lock method (this information has been lost in r13032).
+------------------------------------------------------------------------
+r13393 | vlefevre | 2019-01-09 13:51:05 +0000 (Wed, 09 Jan 2019) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] When checking support for POSIX threads (pthread), also
+check that pthread_rwlock_t is supported, as it is needed by MPFR and
+conditionally defined in glibc's bits/pthreadtypes.h (via <pthread.h>).
------------------------------------------------------------------------
-r13386 | vlefevre | 2019-01-08 13:30:18 +0000 (Tue, 08 Jan 2019) | 3 lines
+r13392 | vlefevre | 2019-01-09 12:56:20 +0000 (Wed, 09 Jan 2019) | 20 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tstrtofr.c
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+
+Cleaned up configure code related to threading and the shared cache.
+ * acinclude.m4:
+ - detect incompatibilities between configure options at the
+ beginning of MPFR_CONFIGS, forcing enable_thread_safe to
+ "no" or "yes" when necessary, so that the subsequent code
+ can rely on that;
+ - check ISO C11 thread support and/or POSIX thread support
+ only when necessary;
+ - handle --enable-shared-cache early in MPFR_CONFIGS, because
+ the use of POSIX threads (pthread) may need to change CC,
+ CFLAGS, and LIBS (thus affecting other tests);
+ - test $enable_shared_cache instead of $mpfr_want_shared_cache;
+ - removed the now useless MPFR_CHECK_SHARED_CACHE function.
+ * configure.ac: no longer set the mpfr_want_shared_cache variable,
+ as enable_shared_cache (now used) already has the same usage.
+Note: currently,
+ ./configure --enable-shared-cache CFLAGS="-std=c99"
+still succeeds and still makes the compilation fail. This seems to
+be due to a limitation of AX_PTHREAD, which just tests linking, not
+compilation.
+------------------------------------------------------------------------
+r13391 | vlefevre | 2019-01-09 11:38:46 +0000 (Wed, 09 Jan 2019) | 5 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] In MPFR_CHECK_SHARED_CACHE (used when the shared cache
+was requested), also set CC="$PTHREAD_CC" as documented by ax_pthread
+(autoconf-archive). This is not guaranteed to work, but according to
+the ax_pthread.m4 source, in the cases where "$PTHREAD_CC" != "$CC",
+not setting it will probably not work either.
+------------------------------------------------------------------------
+r13390 | vlefevre | 2019-01-09 10:20:54 +0000 (Wed, 09 Jan 2019) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a comment about the cache-related types, which
+depend on the locking methods.
+------------------------------------------------------------------------
+r13385 | vlefevre | 2019-01-08 13:29:14 +0000 (Tue, 08 Jan 2019) | 2 lines
+Changed paths:
+ M /trunk/tests/tstrtofr.c
[tests/tstrtofr.c] Updated comment about GCC bug 86554: now fixed in
the GCC trunk.
-(merged changeset r13385 from the trunk)
------------------------------------------------------------------------
-r13384 | vlefevre | 2019-01-07 16:11:57 +0000 (Mon, 07 Jan 2019) | 3 lines
+r13383 | vlefevre | 2019-01-07 16:10:18 +0000 (Mon, 07 Jan 2019) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/Makefile.am
+ M /trunk/tests/Makefile.am
[tests/Makefile.am] Replaced "env -u DISPLAY" by "env DISPLAY=''" as
the -u option is not supported by NetBSD.
-(merged changeset r13383 from the trunk)
------------------------------------------------------------------------
-r13382 | vlefevre | 2019-01-07 15:22:38 +0000 (Mon, 07 Jan 2019) | 1 line
+r13380 | vlefevre | 2019-01-07 15:17:11 +0000 (Mon, 07 Jan 2019) | 4 lines
Changed paths:
- M /branches/4.0/ChangeLog
-
-ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
-------------------------------------------------------------------------
-r13381 | vlefevre | 2019-01-07 15:17:51 +0000 (Mon, 07 Jan 2019) | 4 lines
-Changed paths:
- M /branches/4.0
- M /branches/4.0/COPYING
- M /branches/4.0/COPYING.LESSER
+ M /trunk/COPYING
+ M /trunk/COPYING.LESSER
Updated files:
* COPYING from https://www.gnu.org/licenses/gpl-3.0.txt
* COPYING.LESSER from https://www.gnu.org/licenses/lgpl-3.0.txt
These are URL updates and cosmetic changes.
------------------------------------------------------------------------
-r13379 | vlefevre | 2019-01-07 14:32:20 +0000 (Mon, 07 Jan 2019) | 4 lines
+r13378 | vlefevre | 2019-01-07 14:26:23 +0000 (Mon, 07 Jan 2019) | 4 lines
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/ChangeLog
ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC0 svn log -rHEAD:0 -v".
-Note: For r5400, this changes an incorrect update done via r13373 back
+Note: For r5400, this changes an incorrect update done via r13372 back
to the old log message, as the URL in this log message here describes
a change in one of the files.
------------------------------------------------------------------------
-r13377 | vlefevre | 2019-01-07 14:06:05 +0000 (Mon, 07 Jan 2019) | 2 lines
+r13376 | vlefevre | 2019-01-07 14:05:06 +0000 (Mon, 07 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/README.dev
+ M /trunk/doc/README.dev
[doc/README.dev] Updated some URL's (http → https).
-(merged changeset r13376 from the trunk)
------------------------------------------------------------------------
-r13375 | vlefevre | 2019-01-07 13:57:16 +0000 (Mon, 07 Jan 2019) | 1 line
+r13374 | vlefevre | 2019-01-07 13:56:16 +0000 (Mon, 07 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0/doc/texinfo.tex
+ M /trunk/doc/texinfo.tex
[doc/texinfo.tex] Update to 2018-02-12.17 with "autoreconf -i -f".
------------------------------------------------------------------------
-r13373 | vlefevre | 2019-01-07 13:53:20 +0000 (Mon, 07 Jan 2019) | 3 lines
-Changed paths:
- M /branches/4.0/BUGS
- M /branches/4.0/COPYING
- M /branches/4.0/ChangeLog
- M /branches/4.0/INSTALL
- M /branches/4.0/NEWS
- M /branches/4.0/README
- M /branches/4.0/TODO
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/FAQ.html
- M /branches/4.0/doc/README.dev
- M /branches/4.0/doc/faq.xsl
- M /branches/4.0/doc/fdl.texi
- M /branches/4.0/examples/can_round.c
- M /branches/4.0/examples/divworst.c
- M /branches/4.0/examples/rndo-add.c
- M /branches/4.0/examples/sample.c
- M /branches/4.0/examples/version.c
- M /branches/4.0/src/abort_prec_max.c
- M /branches/4.0/src/acos.c
- M /branches/4.0/src/acosh.c
- M /branches/4.0/src/add.c
- M /branches/4.0/src/add1.c
- M /branches/4.0/src/add1sp.c
- M /branches/4.0/src/add_d.c
- M /branches/4.0/src/add_ui.c
- M /branches/4.0/src/agm.c
- M /branches/4.0/src/ai.c
- M /branches/4.0/src/amd/amdfam10/mparam.h
- M /branches/4.0/src/amd/athlon/mparam.h
- M /branches/4.0/src/amd/k8/mparam.h
- M /branches/4.0/src/arm/mparam.h
- M /branches/4.0/src/asin.c
- M /branches/4.0/src/asinh.c
- M /branches/4.0/src/atan.c
- M /branches/4.0/src/atan2.c
- M /branches/4.0/src/atanh.c
- M /branches/4.0/src/bernoulli.c
- M /branches/4.0/src/beta.c
- M /branches/4.0/src/buildopt.c
- M /branches/4.0/src/cache.c
- M /branches/4.0/src/cbrt.c
- M /branches/4.0/src/check.c
- M /branches/4.0/src/clear.c
- M /branches/4.0/src/clears.c
- M /branches/4.0/src/cmp.c
- M /branches/4.0/src/cmp2.c
- M /branches/4.0/src/cmp_abs.c
- M /branches/4.0/src/cmp_d.c
- M /branches/4.0/src/cmp_ld.c
- M /branches/4.0/src/cmp_si.c
- M /branches/4.0/src/cmp_ui.c
- M /branches/4.0/src/comparisons.c
- M /branches/4.0/src/const_catalan.c
- M /branches/4.0/src/const_euler.c
- M /branches/4.0/src/const_log2.c
- M /branches/4.0/src/const_pi.c
- M /branches/4.0/src/constant.c
- M /branches/4.0/src/copysign.c
- M /branches/4.0/src/cos.c
- M /branches/4.0/src/cosh.c
- M /branches/4.0/src/cot.c
- M /branches/4.0/src/coth.c
- M /branches/4.0/src/csc.c
- M /branches/4.0/src/csch.c
- M /branches/4.0/src/d_div.c
- M /branches/4.0/src/d_sub.c
- M /branches/4.0/src/digamma.c
- M /branches/4.0/src/dim.c
- M /branches/4.0/src/div.c
- M /branches/4.0/src/div_2exp.c
- M /branches/4.0/src/div_2si.c
- M /branches/4.0/src/div_2ui.c
- M /branches/4.0/src/div_d.c
- M /branches/4.0/src/div_ui.c
- M /branches/4.0/src/dump.c
- M /branches/4.0/src/eint.c
- M /branches/4.0/src/eq.c
- M /branches/4.0/src/erandom.c
- M /branches/4.0/src/erf.c
- M /branches/4.0/src/erfc.c
- M /branches/4.0/src/exceptions.c
- M /branches/4.0/src/exp.c
- M /branches/4.0/src/exp10.c
- M /branches/4.0/src/exp2.c
- M /branches/4.0/src/exp3.c
- M /branches/4.0/src/exp_2.c
- M /branches/4.0/src/expm1.c
- M /branches/4.0/src/extract.c
- M /branches/4.0/src/factorial.c
- M /branches/4.0/src/fits_intmax.c
- M /branches/4.0/src/fits_s.h
- M /branches/4.0/src/fits_sint.c
- M /branches/4.0/src/fits_slong.c
- M /branches/4.0/src/fits_sshort.c
- M /branches/4.0/src/fits_u.h
- M /branches/4.0/src/fits_uint.c
- M /branches/4.0/src/fits_uintmax.c
- M /branches/4.0/src/fits_ulong.c
- M /branches/4.0/src/fits_ushort.c
- M /branches/4.0/src/fma.c
- M /branches/4.0/src/fmma.c
- M /branches/4.0/src/fms.c
- M /branches/4.0/src/fpif.c
- M /branches/4.0/src/frac.c
- M /branches/4.0/src/free_cache.c
- M /branches/4.0/src/frexp.c
- M /branches/4.0/src/gamma.c
- M /branches/4.0/src/gamma_inc.c
- M /branches/4.0/src/gammaonethird.c
- M /branches/4.0/src/gen_inverse.h
- M /branches/4.0/src/generic/coverage/mparam.h
- M /branches/4.0/src/generic/mparam.h
- M /branches/4.0/src/get_d.c
- M /branches/4.0/src/get_d64.c
- M /branches/4.0/src/get_exp.c
- M /branches/4.0/src/get_f.c
- M /branches/4.0/src/get_float128.c
- M /branches/4.0/src/get_flt.c
- M /branches/4.0/src/get_ld.c
- M /branches/4.0/src/get_q.c
- M /branches/4.0/src/get_si.c
- M /branches/4.0/src/get_sj.c
- M /branches/4.0/src/get_str.c
- M /branches/4.0/src/get_ui.c
- M /branches/4.0/src/get_uj.c
- M /branches/4.0/src/get_z.c
- M /branches/4.0/src/get_z_exp.c
- M /branches/4.0/src/gmp_op.c
- M /branches/4.0/src/grandom.c
- M /branches/4.0/src/hppa/mparam.h
- M /branches/4.0/src/hypot.c
- M /branches/4.0/src/ia64/mparam.h
- M /branches/4.0/src/ieee_floats.h
- M /branches/4.0/src/init.c
- M /branches/4.0/src/init2.c
- M /branches/4.0/src/inits.c
- M /branches/4.0/src/inits2.c
- M /branches/4.0/src/inp_str.c
- M /branches/4.0/src/int_ceil_log2.c
- M /branches/4.0/src/invert_limb.h
- M /branches/4.0/src/invsqrt_limb.h
- M /branches/4.0/src/isinf.c
- M /branches/4.0/src/isinteger.c
- M /branches/4.0/src/isnan.c
- M /branches/4.0/src/isnum.c
- M /branches/4.0/src/isqrt.c
- M /branches/4.0/src/isregular.c
- M /branches/4.0/src/iszero.c
- M /branches/4.0/src/jn.c
- M /branches/4.0/src/jyn_asympt.c
- M /branches/4.0/src/li2.c
- M /branches/4.0/src/lngamma.c
- M /branches/4.0/src/log.c
- M /branches/4.0/src/log10.c
- M /branches/4.0/src/log1p.c
- M /branches/4.0/src/log2.c
- M /branches/4.0/src/log_ui.c
- M /branches/4.0/src/logging.c
- M /branches/4.0/src/min_prec.c
- M /branches/4.0/src/minmax.c
- M /branches/4.0/src/mips/mparam.h
- M /branches/4.0/src/modf.c
- M /branches/4.0/src/mp_clz_tab.c
- M /branches/4.0/src/mparam_h.in
- M /branches/4.0/src/mpf2mpfr.h
- M /branches/4.0/src/mpfr-cvers.h
- M /branches/4.0/src/mpfr-gmp.c
- M /branches/4.0/src/mpfr-gmp.h
- M /branches/4.0/src/mpfr-impl.h
- M /branches/4.0/src/mpfr-intmax.h
- M /branches/4.0/src/mpfr-longlong.h
- M /branches/4.0/src/mpfr-mini-gmp.c
- M /branches/4.0/src/mpfr-mini-gmp.h
- M /branches/4.0/src/mpfr-sassert.h
- M /branches/4.0/src/mpfr-thread.h
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/mpn_exp.c
- M /branches/4.0/src/mul.c
- M /branches/4.0/src/mul_2exp.c
- M /branches/4.0/src/mul_2si.c
- M /branches/4.0/src/mul_2ui.c
- M /branches/4.0/src/mul_d.c
- M /branches/4.0/src/mul_ui.c
- M /branches/4.0/src/mulders.c
- M /branches/4.0/src/neg.c
- M /branches/4.0/src/next.c
- M /branches/4.0/src/nrandom.c
- M /branches/4.0/src/odd_p.c
- M /branches/4.0/src/out_str.c
- M /branches/4.0/src/pool.c
- M /branches/4.0/src/pow.c
- M /branches/4.0/src/pow_si.c
- M /branches/4.0/src/pow_ui.c
- M /branches/4.0/src/pow_z.c
- M /branches/4.0/src/powerof2.c
- M /branches/4.0/src/powerpc32/mparam.h
- M /branches/4.0/src/powerpc64/mparam.h
- M /branches/4.0/src/print_raw.c
- M /branches/4.0/src/print_rnd_mode.c
- M /branches/4.0/src/printf.c
- M /branches/4.0/src/random_deviate.c
- M /branches/4.0/src/random_deviate.h
- M /branches/4.0/src/rec_sqrt.c
- M /branches/4.0/src/reldiff.c
- M /branches/4.0/src/rem1.c
- M /branches/4.0/src/rint.c
- M /branches/4.0/src/rndna.c
- M /branches/4.0/src/root.c
- M /branches/4.0/src/round_near_x.c
- M /branches/4.0/src/round_p.c
- M /branches/4.0/src/round_prec.c
- M /branches/4.0/src/round_raw_generic.c
- M /branches/4.0/src/scale2.c
- M /branches/4.0/src/sec.c
- M /branches/4.0/src/sech.c
- M /branches/4.0/src/set.c
- M /branches/4.0/src/set_d.c
- M /branches/4.0/src/set_d64.c
- M /branches/4.0/src/set_dfl_prec.c
- M /branches/4.0/src/set_exp.c
- M /branches/4.0/src/set_f.c
- M /branches/4.0/src/set_float128.c
- M /branches/4.0/src/set_flt.c
- M /branches/4.0/src/set_inf.c
- M /branches/4.0/src/set_ld.c
- M /branches/4.0/src/set_nan.c
- M /branches/4.0/src/set_prc_raw.c
- M /branches/4.0/src/set_prec.c
- M /branches/4.0/src/set_q.c
- M /branches/4.0/src/set_rnd.c
- M /branches/4.0/src/set_si.c
- M /branches/4.0/src/set_si_2exp.c
- M /branches/4.0/src/set_sj.c
- M /branches/4.0/src/set_str.c
- M /branches/4.0/src/set_str_raw.c
- M /branches/4.0/src/set_ui.c
- M /branches/4.0/src/set_ui_2exp.c
- M /branches/4.0/src/set_uj.c
- M /branches/4.0/src/set_z.c
- M /branches/4.0/src/set_z_exp.c
- M /branches/4.0/src/set_zero.c
- M /branches/4.0/src/setmax.c
- M /branches/4.0/src/setmin.c
- M /branches/4.0/src/setsign.c
- M /branches/4.0/src/sgn.c
- M /branches/4.0/src/si_op.c
- M /branches/4.0/src/signbit.c
- M /branches/4.0/src/sin.c
- M /branches/4.0/src/sin_cos.c
- M /branches/4.0/src/sinh.c
- M /branches/4.0/src/sinh_cosh.c
- M /branches/4.0/src/sparc64/mparam.h
- M /branches/4.0/src/sqr.c
- M /branches/4.0/src/sqrt.c
- M /branches/4.0/src/sqrt_ui.c
- M /branches/4.0/src/stack_interface.c
- M /branches/4.0/src/strtofr.c
- M /branches/4.0/src/sub.c
- M /branches/4.0/src/sub1.c
- M /branches/4.0/src/sub1sp.c
- M /branches/4.0/src/sub_d.c
- M /branches/4.0/src/sub_ui.c
- M /branches/4.0/src/subnormal.c
- M /branches/4.0/src/sum.c
- M /branches/4.0/src/swap.c
- M /branches/4.0/src/tan.c
- M /branches/4.0/src/tanh.c
- M /branches/4.0/src/ubf.c
- M /branches/4.0/src/uceil_exp2.c
- M /branches/4.0/src/uceil_log2.c
- M /branches/4.0/src/ufloor_log2.c
- M /branches/4.0/src/ui_div.c
- M /branches/4.0/src/ui_pow.c
- M /branches/4.0/src/ui_pow_ui.c
- M /branches/4.0/src/ui_sub.c
- M /branches/4.0/src/urandom.c
- M /branches/4.0/src/urandomb.c
- M /branches/4.0/src/vasprintf.c
- M /branches/4.0/src/version.c
- M /branches/4.0/src/volatile.c
- M /branches/4.0/src/x86/core2/mparam.h
- M /branches/4.0/src/x86/mparam.h
- M /branches/4.0/src/x86_64/core2/mparam.h
- M /branches/4.0/src/x86_64/corei5/mparam.h
- M /branches/4.0/src/x86_64/pentium4/mparam.h
- M /branches/4.0/src/yn.c
- M /branches/4.0/src/zeta.c
- M /branches/4.0/src/zeta_ui.c
- M /branches/4.0/tests/Makefile.am
- M /branches/4.0/tests/cmp_str.c
- M /branches/4.0/tests/data/digamma
- M /branches/4.0/tests/data/li2
- M /branches/4.0/tests/memory.c
- M /branches/4.0/tests/mpf_compat.c
- M /branches/4.0/tests/mpf_compat.h
- M /branches/4.0/tests/mpfr-test.h
- M /branches/4.0/tests/mpfr_compat.c
- M /branches/4.0/tests/random2.c
- M /branches/4.0/tests/reuse.c
- M /branches/4.0/tests/rnd_mode.c
- M /branches/4.0/tests/tabort_defalloc1.c
- M /branches/4.0/tests/tabort_defalloc2.c
- M /branches/4.0/tests/tabort_prec_max.c
- M /branches/4.0/tests/tabs.c
- M /branches/4.0/tests/tacos.c
- M /branches/4.0/tests/tacosh.c
- M /branches/4.0/tests/tadd.c
- M /branches/4.0/tests/tadd1sp.c
- M /branches/4.0/tests/tadd_d.c
- M /branches/4.0/tests/tadd_ui.c
- M /branches/4.0/tests/tagm.c
- M /branches/4.0/tests/tai.c
- M /branches/4.0/tests/talloc-cache.c
- M /branches/4.0/tests/talloc.c
- M /branches/4.0/tests/tasin.c
- M /branches/4.0/tests/tasinh.c
- M /branches/4.0/tests/tassert.c
- M /branches/4.0/tests/tatan.c
- M /branches/4.0/tests/tatanh.c
- M /branches/4.0/tests/taway.c
- M /branches/4.0/tests/tbeta.c
- M /branches/4.0/tests/tbuildopt.c
- M /branches/4.0/tests/tcan_round.c
- M /branches/4.0/tests/tcbrt.c
- M /branches/4.0/tests/tcheck.c
- M /branches/4.0/tests/tcmp.c
- M /branches/4.0/tests/tcmp2.c
- M /branches/4.0/tests/tcmp_d.c
- M /branches/4.0/tests/tcmp_ld.c
- M /branches/4.0/tests/tcmp_ui.c
- M /branches/4.0/tests/tcmpabs.c
- M /branches/4.0/tests/tcomparisons.c
- M /branches/4.0/tests/tconst_catalan.c
- M /branches/4.0/tests/tconst_euler.c
- M /branches/4.0/tests/tconst_log2.c
- M /branches/4.0/tests/tconst_pi.c
- M /branches/4.0/tests/tcopysign.c
- M /branches/4.0/tests/tcos.c
- M /branches/4.0/tests/tcosh.c
- M /branches/4.0/tests/tcot.c
- M /branches/4.0/tests/tcoth.c
- M /branches/4.0/tests/tcsc.c
- M /branches/4.0/tests/tcsch.c
- M /branches/4.0/tests/td_div.c
- M /branches/4.0/tests/td_sub.c
- M /branches/4.0/tests/tdigamma.c
- M /branches/4.0/tests/tdim.c
- M /branches/4.0/tests/tdiv.c
- M /branches/4.0/tests/tdiv_d.c
- M /branches/4.0/tests/tdiv_ui.c
- M /branches/4.0/tests/teint.c
- M /branches/4.0/tests/teq.c
- M /branches/4.0/tests/terandom.c
- M /branches/4.0/tests/terandom_chisq.c
- M /branches/4.0/tests/terf.c
- M /branches/4.0/tests/tests.c
- M /branches/4.0/tests/texceptions.c
- M /branches/4.0/tests/texp.c
- M /branches/4.0/tests/texp10.c
- M /branches/4.0/tests/texp2.c
- M /branches/4.0/tests/texpm1.c
- M /branches/4.0/tests/tfactorial.c
- M /branches/4.0/tests/tfits.c
- M /branches/4.0/tests/tfma.c
- M /branches/4.0/tests/tfmma.c
- M /branches/4.0/tests/tfmod.c
- M /branches/4.0/tests/tfms.c
- M /branches/4.0/tests/tfpif.c
- M /branches/4.0/tests/tfprintf.c
- M /branches/4.0/tests/tfrac.c
- M /branches/4.0/tests/tfrexp.c
- M /branches/4.0/tests/tgamma.c
- M /branches/4.0/tests/tgamma_inc.c
- M /branches/4.0/tests/tgeneric.c
- M /branches/4.0/tests/tgeneric_ui.c
- M /branches/4.0/tests/tget_d.c
- M /branches/4.0/tests/tget_d_2exp.c
- M /branches/4.0/tests/tget_f.c
- M /branches/4.0/tests/tget_flt.c
- M /branches/4.0/tests/tget_ld_2exp.c
- M /branches/4.0/tests/tget_q.c
- M /branches/4.0/tests/tget_set_d64.c
- M /branches/4.0/tests/tget_sj.c
- M /branches/4.0/tests/tget_str.c
- M /branches/4.0/tests/tget_z.c
- M /branches/4.0/tests/tgmpop.c
- M /branches/4.0/tests/tgrandom.c
- M /branches/4.0/tests/thyperbolic.c
- M /branches/4.0/tests/thypot.c
- M /branches/4.0/tests/tinits.c
- M /branches/4.0/tests/tinp_str.c
- M /branches/4.0/tests/tinternals.c
- M /branches/4.0/tests/tisnan.c
- M /branches/4.0/tests/tisqrt.c
- M /branches/4.0/tests/tj0.c
- M /branches/4.0/tests/tj1.c
- M /branches/4.0/tests/tjn.c
- M /branches/4.0/tests/tl2b.c
- M /branches/4.0/tests/tlgamma.c
- M /branches/4.0/tests/tli2.c
- M /branches/4.0/tests/tlngamma.c
- M /branches/4.0/tests/tlog.c
- M /branches/4.0/tests/tlog10.c
- M /branches/4.0/tests/tlog1p.c
- M /branches/4.0/tests/tlog2.c
- M /branches/4.0/tests/tlog_ui.c
- M /branches/4.0/tests/tmin_prec.c
- M /branches/4.0/tests/tminmax.c
- M /branches/4.0/tests/tmodf.c
- M /branches/4.0/tests/tmul.c
- M /branches/4.0/tests/tmul_2exp.c
- M /branches/4.0/tests/tmul_d.c
- M /branches/4.0/tests/tmul_ui.c
- M /branches/4.0/tests/tnext.c
- M /branches/4.0/tests/tnrandom.c
- M /branches/4.0/tests/tnrandom_chisq.c
- M /branches/4.0/tests/tout_str.c
- M /branches/4.0/tests/toutimpl.c
- M /branches/4.0/tests/tpow.c
- M /branches/4.0/tests/tpow3.c
- M /branches/4.0/tests/tpow_all.c
- M /branches/4.0/tests/tpow_z.c
- M /branches/4.0/tests/tprintf.c
- M /branches/4.0/tests/trandom.c
- M /branches/4.0/tests/trandom_deviate.c
- M /branches/4.0/tests/trec_sqrt.c
- M /branches/4.0/tests/tremquo.c
- M /branches/4.0/tests/trint.c
- M /branches/4.0/tests/trndna.c
- M /branches/4.0/tests/troot.c
- M /branches/4.0/tests/trootn_ui.c
- M /branches/4.0/tests/tround_prec.c
- M /branches/4.0/tests/tsec.c
- M /branches/4.0/tests/tsech.c
- M /branches/4.0/tests/tset.c
- M /branches/4.0/tests/tset_d.c
- M /branches/4.0/tests/tset_exp.c
- M /branches/4.0/tests/tset_f.c
- M /branches/4.0/tests/tset_float128.c
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tests/tset_q.c
- M /branches/4.0/tests/tset_si.c
- M /branches/4.0/tests/tset_sj.c
- M /branches/4.0/tests/tset_str.c
- M /branches/4.0/tests/tset_z.c
- M /branches/4.0/tests/tset_z_exp.c
- M /branches/4.0/tests/tsgn.c
- M /branches/4.0/tests/tsi_op.c
- M /branches/4.0/tests/tsin.c
- M /branches/4.0/tests/tsin_cos.c
- M /branches/4.0/tests/tsinh.c
- M /branches/4.0/tests/tsinh_cosh.c
- M /branches/4.0/tests/tsprintf.c
- M /branches/4.0/tests/tsqr.c
- M /branches/4.0/tests/tsqrt.c
- M /branches/4.0/tests/tsqrt_ui.c
- M /branches/4.0/tests/tstckintc.c
- M /branches/4.0/tests/tstdint.c
- M /branches/4.0/tests/tstrtofr.c
- M /branches/4.0/tests/tsub.c
- M /branches/4.0/tests/tsub1sp.c
- M /branches/4.0/tests/tsub_d.c
- M /branches/4.0/tests/tsub_ui.c
- M /branches/4.0/tests/tsubnormal.c
- M /branches/4.0/tests/tsum.c
- M /branches/4.0/tests/tswap.c
- M /branches/4.0/tests/ttan.c
- M /branches/4.0/tests/ttanh.c
- M /branches/4.0/tests/ttrunc.c
- M /branches/4.0/tests/tui_div.c
- M /branches/4.0/tests/tui_pow.c
- M /branches/4.0/tests/tui_sub.c
- M /branches/4.0/tests/turandom.c
- M /branches/4.0/tests/tvalist.c
- M /branches/4.0/tests/tversion.c
- M /branches/4.0/tests/ty0.c
- M /branches/4.0/tests/ty1.c
- M /branches/4.0/tests/tyn.c
- M /branches/4.0/tests/tzeta.c
- M /branches/4.0/tests/tzeta_ui.c
- M /branches/4.0/tools/bench/benchtime.h
- M /branches/4.0/tools/bench/mpfrbench.c
- M /branches/4.0/tools/get_patches.sh
- M /branches/4.0/tools/mbench/generate.c
- M /branches/4.0/tools/mbench/mfv5-arprec.cc
- M /branches/4.0/tools/mbench/mfv5-cln.cc
- M /branches/4.0/tools/mbench/mfv5-crlibm.cc
- M /branches/4.0/tools/mbench/mfv5-libc.cc
- M /branches/4.0/tools/mbench/mfv5-lidia.cc
- M /branches/4.0/tools/mbench/mfv5-mpf.cc
- M /branches/4.0/tools/mbench/mfv5-mpfr.cc
- M /branches/4.0/tools/mbench/mfv5-ntl.cc
- M /branches/4.0/tools/mbench/mfv5-pari.cc
- M /branches/4.0/tools/mbench/mfv5-void.cc
- M /branches/4.0/tools/mbench/mfv5.cc
- M /branches/4.0/tools/mbench/mfv5.h
- M /branches/4.0/tools/mbench/mpfr-gfx.c
- M /branches/4.0/tools/mbench/mpfr-v4.c
- M /branches/4.0/tools/mbench/mpfr-v6.c
- M /branches/4.0/tools/mbench/timp.h
- M /branches/4.0/tools/timings-mpfr.c
- M /branches/4.0/tune/bidimensional_sample.c
- M /branches/4.0/tune/speed.c
- M /branches/4.0/tune/tuneup.c
+r13372 | vlefevre | 2019-01-07 13:49:57 +0000 (Mon, 07 Jan 2019) | 3 lines
+Changed paths:
+ M /trunk/BUGS
+ M /trunk/COPYING
+ M /trunk/ChangeLog
+ M /trunk/INSTALL
+ M /trunk/NEWS
+ M /trunk/README
+ M /trunk/TODO
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/FAQ.html
+ M /trunk/doc/README.dev
+ M /trunk/doc/faq.xsl
+ M /trunk/doc/fdl.texi
+ M /trunk/examples/can_round.c
+ M /trunk/examples/divworst.c
+ M /trunk/examples/rndo-add.c
+ M /trunk/examples/sample.c
+ M /trunk/examples/threads.c
+ M /trunk/examples/version.c
+ M /trunk/src/abort_prec_max.c
+ M /trunk/src/acos.c
+ M /trunk/src/acosh.c
+ M /trunk/src/add.c
+ M /trunk/src/add1.c
+ M /trunk/src/add1sp.c
+ M /trunk/src/add1sp1_extracted.c
+ M /trunk/src/add_d.c
+ M /trunk/src/add_ui.c
+ M /trunk/src/agm.c
+ M /trunk/src/ai.c
+ M /trunk/src/amd/mparam.h
+ M /trunk/src/arm/mparam.h
+ M /trunk/src/asin.c
+ M /trunk/src/asinh.c
+ M /trunk/src/atan.c
+ M /trunk/src/atan2.c
+ M /trunk/src/atanh.c
+ M /trunk/src/bernoulli.c
+ M /trunk/src/beta.c
+ M /trunk/src/buildopt.c
+ M /trunk/src/cache.c
+ M /trunk/src/cbrt.c
+ M /trunk/src/check.c
+ M /trunk/src/clear.c
+ M /trunk/src/clears.c
+ M /trunk/src/cmp.c
+ M /trunk/src/cmp2.c
+ M /trunk/src/cmp_abs.c
+ M /trunk/src/cmp_d.c
+ M /trunk/src/cmp_ld.c
+ M /trunk/src/cmp_si.c
+ M /trunk/src/cmp_ui.c
+ M /trunk/src/comparisons.c
+ M /trunk/src/const_catalan.c
+ M /trunk/src/const_euler.c
+ M /trunk/src/const_log2.c
+ M /trunk/src/const_pi.c
+ M /trunk/src/constant.c
+ M /trunk/src/copysign.c
+ M /trunk/src/cos.c
+ M /trunk/src/cosh.c
+ M /trunk/src/cot.c
+ M /trunk/src/coth.c
+ M /trunk/src/csc.c
+ M /trunk/src/csch.c
+ M /trunk/src/d_div.c
+ M /trunk/src/d_sub.c
+ M /trunk/src/digamma.c
+ M /trunk/src/dim.c
+ M /trunk/src/div.c
+ M /trunk/src/div_2exp.c
+ M /trunk/src/div_2si.c
+ M /trunk/src/div_2ui.c
+ M /trunk/src/div_d.c
+ M /trunk/src/div_ui.c
+ M /trunk/src/dot.c
+ M /trunk/src/dump.c
+ M /trunk/src/eint.c
+ M /trunk/src/eq.c
+ M /trunk/src/erandom.c
+ M /trunk/src/erf.c
+ M /trunk/src/erfc.c
+ M /trunk/src/exceptions.c
+ M /trunk/src/exp.c
+ M /trunk/src/exp10.c
+ M /trunk/src/exp2.c
+ M /trunk/src/exp3.c
+ M /trunk/src/exp_2.c
+ M /trunk/src/expm1.c
+ M /trunk/src/extract.c
+ M /trunk/src/factorial.c
+ M /trunk/src/fits_intmax.c
+ M /trunk/src/fits_s.h
+ M /trunk/src/fits_sint.c
+ M /trunk/src/fits_slong.c
+ M /trunk/src/fits_sshort.c
+ M /trunk/src/fits_u.h
+ M /trunk/src/fits_uint.c
+ M /trunk/src/fits_uintmax.c
+ M /trunk/src/fits_ulong.c
+ M /trunk/src/fits_ushort.c
+ M /trunk/src/fma.c
+ M /trunk/src/fmma.c
+ M /trunk/src/fms.c
+ M /trunk/src/fpif.c
+ M /trunk/src/frac.c
+ M /trunk/src/free_cache.c
+ M /trunk/src/frexp.c
+ M /trunk/src/gamma.c
+ M /trunk/src/gamma_inc.c
+ M /trunk/src/gammaonethird.c
+ M /trunk/src/gen_inverse.h
+ M /trunk/src/generic/coverage/mparam.h
+ M /trunk/src/generic/mparam.h
+ M /trunk/src/get_d.c
+ M /trunk/src/get_d128.c
+ M /trunk/src/get_d64.c
+ M /trunk/src/get_exp.c
+ M /trunk/src/get_f.c
+ M /trunk/src/get_float128.c
+ M /trunk/src/get_flt.c
+ M /trunk/src/get_ld.c
+ M /trunk/src/get_q.c
+ M /trunk/src/get_si.c
+ M /trunk/src/get_sj.c
+ M /trunk/src/get_str.c
+ M /trunk/src/get_ui.c
+ M /trunk/src/get_uj.c
+ M /trunk/src/get_z.c
+ M /trunk/src/get_z_exp.c
+ M /trunk/src/gmp_op.c
+ M /trunk/src/grandom.c
+ M /trunk/src/hypot.c
+ M /trunk/src/ieee_floats.h
+ M /trunk/src/init.c
+ M /trunk/src/init2.c
+ M /trunk/src/inits.c
+ M /trunk/src/inits2.c
+ M /trunk/src/inp_str.c
+ M /trunk/src/int_ceil_log2.c
+ M /trunk/src/invert_limb.h
+ M /trunk/src/invsqrt_limb.h
+ M /trunk/src/isinf.c
+ M /trunk/src/isinteger.c
+ M /trunk/src/isnan.c
+ M /trunk/src/isnum.c
+ M /trunk/src/isqrt.c
+ M /trunk/src/isregular.c
+ M /trunk/src/iszero.c
+ M /trunk/src/jn.c
+ M /trunk/src/jyn_asympt.c
+ M /trunk/src/li2.c
+ M /trunk/src/lngamma.c
+ M /trunk/src/log.c
+ M /trunk/src/log10.c
+ M /trunk/src/log1p.c
+ M /trunk/src/log2.c
+ M /trunk/src/log_ui.c
+ M /trunk/src/logging.c
+ M /trunk/src/min_prec.c
+ M /trunk/src/minmax.c
+ M /trunk/src/mips/mparam.h
+ M /trunk/src/modf.c
+ M /trunk/src/mp_clz_tab.c
+ M /trunk/src/mparam_h.in
+ M /trunk/src/mpf2mpfr.h
+ M /trunk/src/mpfr-cvers.h
+ M /trunk/src/mpfr-gmp.c
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+ M /trunk/src/mpfr-longlong.h
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/mpfr-mini-gmp.h
+ M /trunk/src/mpfr-sassert.h
+ M /trunk/src/mpfr-thread.h
+ M /trunk/src/mpfr.h
+ M /trunk/src/mpn_exp.c
+ M /trunk/src/mul.c
+ M /trunk/src/mul_1_extracted.c
+ M /trunk/src/mul_2exp.c
+ M /trunk/src/mul_2si.c
+ M /trunk/src/mul_2ui.c
+ M /trunk/src/mul_d.c
+ M /trunk/src/mul_ui.c
+ M /trunk/src/mulders.c
+ M /trunk/src/nbits_ulong.c
+ M /trunk/src/neg.c
+ M /trunk/src/next.c
+ M /trunk/src/nrandom.c
+ M /trunk/src/odd_p.c
+ M /trunk/src/out_str.c
+ M /trunk/src/pool.c
+ M /trunk/src/pow.c
+ M /trunk/src/pow_si.c
+ M /trunk/src/pow_ui.c
+ M /trunk/src/pow_z.c
+ M /trunk/src/powerof2.c
+ M /trunk/src/powerpc64/mparam.h
+ M /trunk/src/print_raw.c
+ M /trunk/src/print_rnd_mode.c
+ M /trunk/src/printf.c
+ M /trunk/src/random_deviate.c
+ M /trunk/src/random_deviate.h
+ M /trunk/src/rec_sqrt.c
+ M /trunk/src/reldiff.c
+ M /trunk/src/rem1.c
+ M /trunk/src/rint.c
+ M /trunk/src/rndna.c
+ M /trunk/src/root.c
+ M /trunk/src/round_near_x.c
+ M /trunk/src/round_p.c
+ M /trunk/src/round_prec.c
+ M /trunk/src/round_raw_generic.c
+ M /trunk/src/scale2.c
+ M /trunk/src/sec.c
+ M /trunk/src/sech.c
+ M /trunk/src/set.c
+ M /trunk/src/set_d.c
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+ M /trunk/src/set_dfl_prec.c
+ M /trunk/src/set_exp.c
+ M /trunk/src/set_f.c
+ M /trunk/src/set_float128.c
+ M /trunk/src/set_flt.c
+ M /trunk/src/set_inf.c
+ M /trunk/src/set_ld.c
+ M /trunk/src/set_nan.c
+ M /trunk/src/set_prc_raw.c
+ M /trunk/src/set_prec.c
+ M /trunk/src/set_q.c
+ M /trunk/src/set_rnd.c
+ M /trunk/src/set_si.c
+ M /trunk/src/set_si_2exp.c
+ M /trunk/src/set_sj.c
+ M /trunk/src/set_str.c
+ M /trunk/src/set_str_raw.c
+ M /trunk/src/set_ui.c
+ M /trunk/src/set_ui_2exp.c
+ M /trunk/src/set_uj.c
+ M /trunk/src/set_z.c
+ M /trunk/src/set_z_exp.c
+ M /trunk/src/set_zero.c
+ M /trunk/src/setmax.c
+ M /trunk/src/setmin.c
+ M /trunk/src/setsign.c
+ M /trunk/src/sgn.c
+ M /trunk/src/si_op.c
+ M /trunk/src/signbit.c
+ M /trunk/src/sin.c
+ M /trunk/src/sin_cos.c
+ M /trunk/src/sinh.c
+ M /trunk/src/sinh_cosh.c
+ M /trunk/src/sparc64/mparam.h
+ M /trunk/src/sqr.c
+ M /trunk/src/sqrt.c
+ M /trunk/src/sqrt_ui.c
+ M /trunk/src/stack_interface.c
+ M /trunk/src/strtofr.c
+ M /trunk/src/sub.c
+ M /trunk/src/sub1.c
+ M /trunk/src/sub1sp.c
+ M /trunk/src/sub_d.c
+ M /trunk/src/sub_ui.c
+ M /trunk/src/subnormal.c
+ M /trunk/src/sum.c
+ M /trunk/src/swap.c
+ M /trunk/src/tan.c
+ M /trunk/src/tanh.c
+ M /trunk/src/total_order.c
+ M /trunk/src/ubf.c
+ M /trunk/src/uceil_exp2.c
+ M /trunk/src/uceil_log2.c
+ M /trunk/src/ufloor_log2.c
+ M /trunk/src/ui_div.c
+ M /trunk/src/ui_pow.c
+ M /trunk/src/ui_pow_ui.c
+ M /trunk/src/ui_sub.c
+ M /trunk/src/urandom.c
+ M /trunk/src/urandomb.c
+ M /trunk/src/vasprintf.c
+ M /trunk/src/version.c
+ M /trunk/src/volatile.c
+ M /trunk/src/x86/mparam.h
+ M /trunk/src/x86_64/core2/mparam.h
+ M /trunk/src/x86_64/mparam.h
+ M /trunk/src/yn.c
+ M /trunk/src/zeta.c
+ M /trunk/src/zeta_ui.c
+ M /trunk/tests/Makefile.am
+ M /trunk/tests/cmp_str.c
+ M /trunk/tests/data/digamma
+ M /trunk/tests/data/li2
+ M /trunk/tests/memory.c
+ M /trunk/tests/mpf_compat.c
+ M /trunk/tests/mpf_compat.h
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/mpfr_compat.c
+ M /trunk/tests/random2.c
+ M /trunk/tests/reuse.c
+ M /trunk/tests/rnd_mode.c
+ M /trunk/tests/tabort_defalloc1.c
+ M /trunk/tests/tabort_defalloc2.c
+ M /trunk/tests/tabort_prec_max.c
+ M /trunk/tests/tabs.c
+ M /trunk/tests/tacos.c
+ M /trunk/tests/tacosh.c
+ M /trunk/tests/tadd.c
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tadd_d.c
+ M /trunk/tests/tadd_ui.c
+ M /trunk/tests/tagm.c
+ M /trunk/tests/tai.c
+ M /trunk/tests/talloc-cache.c
+ M /trunk/tests/talloc.c
+ M /trunk/tests/tasin.c
+ M /trunk/tests/tasinh.c
+ M /trunk/tests/tassert.c
+ M /trunk/tests/tatan.c
+ M /trunk/tests/tatanh.c
+ M /trunk/tests/taway.c
+ M /trunk/tests/tbeta.c
+ M /trunk/tests/tbuildopt.c
+ M /trunk/tests/tcan_round.c
+ M /trunk/tests/tcbrt.c
+ M /trunk/tests/tcheck.c
+ M /trunk/tests/tcmp.c
+ M /trunk/tests/tcmp2.c
+ M /trunk/tests/tcmp_d.c
+ M /trunk/tests/tcmp_ld.c
+ M /trunk/tests/tcmp_ui.c
+ M /trunk/tests/tcmpabs.c
+ M /trunk/tests/tcomparisons.c
+ M /trunk/tests/tconst_catalan.c
+ M /trunk/tests/tconst_euler.c
+ M /trunk/tests/tconst_log2.c
+ M /trunk/tests/tconst_pi.c
+ M /trunk/tests/tcopysign.c
+ M /trunk/tests/tcos.c
+ M /trunk/tests/tcosh.c
+ M /trunk/tests/tcot.c
+ M /trunk/tests/tcoth.c
+ M /trunk/tests/tcsc.c
+ M /trunk/tests/tcsch.c
+ M /trunk/tests/td_div.c
+ M /trunk/tests/td_sub.c
+ M /trunk/tests/tdigamma.c
+ M /trunk/tests/tdim.c
+ M /trunk/tests/tdiv.c
+ M /trunk/tests/tdiv_d.c
+ M /trunk/tests/tdiv_ui.c
+ M /trunk/tests/tdot.c
+ M /trunk/tests/teint.c
+ M /trunk/tests/teq.c
+ M /trunk/tests/terandom.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/terf.c
+ M /trunk/tests/tests.c
+ M /trunk/tests/texceptions.c
+ M /trunk/tests/texp.c
+ M /trunk/tests/texp10.c
+ M /trunk/tests/texp2.c
+ M /trunk/tests/texpm1.c
+ M /trunk/tests/tfactorial.c
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tfma.c
+ M /trunk/tests/tfmma.c
+ M /trunk/tests/tfmod.c
+ M /trunk/tests/tfms.c
+ M /trunk/tests/tfpif.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tfrac.c
+ M /trunk/tests/tfrexp.c
+ M /trunk/tests/tgamma.c
+ M /trunk/tests/tgamma_inc.c
+ M /trunk/tests/tgeneric.c
+ M /trunk/tests/tgeneric_ui.c
+ M /trunk/tests/tget_d.c
+ M /trunk/tests/tget_d_2exp.c
+ M /trunk/tests/tget_f.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tget_q.c
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tget_str.c
+ M /trunk/tests/tget_z.c
+ M /trunk/tests/tgmpop.c
+ M /trunk/tests/tgrandom.c
+ M /trunk/tests/thyperbolic.c
+ M /trunk/tests/thypot.c
+ M /trunk/tests/tinits.c
+ M /trunk/tests/tinp_str.c
+ M /trunk/tests/tinternals.c
+ M /trunk/tests/tisnan.c
+ M /trunk/tests/tisqrt.c
+ M /trunk/tests/tj0.c
+ M /trunk/tests/tj1.c
+ M /trunk/tests/tjn.c
+ M /trunk/tests/tl2b.c
+ M /trunk/tests/tlgamma.c
+ M /trunk/tests/tli2.c
+ M /trunk/tests/tlngamma.c
+ M /trunk/tests/tlog.c
+ M /trunk/tests/tlog10.c
+ M /trunk/tests/tlog1p.c
+ M /trunk/tests/tlog2.c
+ M /trunk/tests/tlog_ui.c
+ M /trunk/tests/tmin_prec.c
+ M /trunk/tests/tminmax.c
+ M /trunk/tests/tmodf.c
+ M /trunk/tests/tmul.c
+ M /trunk/tests/tmul_2exp.c
+ M /trunk/tests/tmul_d.c
+ M /trunk/tests/tmul_ui.c
+ M /trunk/tests/tnext.c
+ M /trunk/tests/tnrandom.c
+ M /trunk/tests/tnrandom_chisq.c
+ M /trunk/tests/tout_str.c
+ M /trunk/tests/toutimpl.c
+ M /trunk/tests/tpow.c
+ M /trunk/tests/tpow3.c
+ M /trunk/tests/tpow_all.c
+ M /trunk/tests/tpow_z.c
+ M /trunk/tests/tprec_round.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/trandom_deviate.c
+ M /trunk/tests/trec_sqrt.c
+ M /trunk/tests/tremquo.c
+ M /trunk/tests/trint.c
+ M /trunk/tests/trndna.c
+ M /trunk/tests/troot.c
+ M /trunk/tests/trootn_ui.c
+ M /trunk/tests/tsec.c
+ M /trunk/tests/tsech.c
+ M /trunk/tests/tset.c
+ M /trunk/tests/tset_d.c
+ M /trunk/tests/tset_exp.c
+ M /trunk/tests/tset_f.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tset_q.c
+ M /trunk/tests/tset_si.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tset_str.c
+ M /trunk/tests/tset_z.c
+ M /trunk/tests/tset_z_exp.c
+ M /trunk/tests/tsgn.c
+ M /trunk/tests/tsi_op.c
+ M /trunk/tests/tsin.c
+ M /trunk/tests/tsin_cos.c
+ M /trunk/tests/tsinh.c
+ M /trunk/tests/tsinh_cosh.c
+ M /trunk/tests/tsprintf.c
+ M /trunk/tests/tsqr.c
+ M /trunk/tests/tsqrt.c
+ M /trunk/tests/tsqrt_ui.c
+ M /trunk/tests/tstckintc.c
+ M /trunk/tests/tstdint.c
+ M /trunk/tests/tstrtofr.c
+ M /trunk/tests/tsub.c
+ M /trunk/tests/tsub1sp.c
+ M /trunk/tests/tsub_d.c
+ M /trunk/tests/tsub_ui.c
+ M /trunk/tests/tsubnormal.c
+ M /trunk/tests/tsum.c
+ M /trunk/tests/tswap.c
+ M /trunk/tests/ttan.c
+ M /trunk/tests/ttanh.c
+ M /trunk/tests/ttotal_order.c
+ M /trunk/tests/ttrunc.c
+ M /trunk/tests/tui_div.c
+ M /trunk/tests/tui_pow.c
+ M /trunk/tests/tui_sub.c
+ M /trunk/tests/turandom.c
+ M /trunk/tests/tvalist.c
+ M /trunk/tests/tversion.c
+ M /trunk/tests/ty0.c
+ M /trunk/tests/ty1.c
+ M /trunk/tests/tyn.c
+ M /trunk/tests/tzeta.c
+ M /trunk/tests/tzeta_ui.c
+ M /trunk/tools/bench/benchtime.h
+ M /trunk/tools/bench/mpfrbench.c
+ M /trunk/tools/check_mparam.c
+ M /trunk/tools/get_patches.sh
+ M /trunk/tools/mbench/generate.c
+ M /trunk/tools/mbench/mfv5-arprec.cc
+ M /trunk/tools/mbench/mfv5-cln.cc
+ M /trunk/tools/mbench/mfv5-crlibm.cc
+ M /trunk/tools/mbench/mfv5-libc.cc
+ M /trunk/tools/mbench/mfv5-lidia.cc
+ M /trunk/tools/mbench/mfv5-mpf.cc
+ M /trunk/tools/mbench/mfv5-mpfr.cc
+ M /trunk/tools/mbench/mfv5-ntl.cc
+ M /trunk/tools/mbench/mfv5-pari.cc
+ M /trunk/tools/mbench/mfv5-void.cc
+ M /trunk/tools/mbench/mfv5.cc
+ M /trunk/tools/mbench/mfv5.h
+ M /trunk/tools/mbench/mpfr-gfx.c
+ M /trunk/tools/mbench/mpfr-v4.c
+ M /trunk/tools/mbench/mpfr-v6.c
+ M /trunk/tools/mbench/timp.h
+ M /trunk/tools/timings-mpfr.c
+ M /trunk/tune/bidimensional_sample.c
+ M /trunk/tune/speed.c
+ M /trunk/tune/tuneup.c
Updated the www.gnu.org URL's (http → https) on all the files with:
perl -pi -e 's,http://www.gnu.org/,https://www.gnu.org/,g' **/*(.)
under zsh.
------------------------------------------------------------------------
-r13371 | vlefevre | 2019-01-07 13:35:33 +0000 (Mon, 07 Jan 2019) | 1 line
+r13365 | vlefevre | 2019-01-07 01:11:12 +0000 (Mon, 07 Jan 2019) | 3 lines
Changed paths:
- M /branches/4.0/src/Makefile.am
+ M /trunk/tests/tstrtofr.c
-[src/Makefile.am] Updated libmpfr_la_LDFLAGS for MPFR 4.0.2.
+[tests/tstrtofr.c] Updated comment about GCC bug 86554: the MPFR build
+is still affected with the latest gcc-snapshot version (20190102-1)
+when using --with-gmp-build=... together with --enable-assert.
------------------------------------------------------------------------
-r13370 | vlefevre | 2019-01-07 13:22:53 +0000 (Mon, 07 Jan 2019) | 1 line
+r13364 | vlefevre | 2019-01-04 13:49:39 +0000 (Fri, 04 Jan 2019) | 2 lines
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/tests/tstrtofr.c
-Updated version to 4.0.2-rc1.
+[tests/tstrtofr.c] Added a comment about GCC bug 86554: the MPFR build
+seems no longer affected by recent gcc-snapshot versions.
------------------------------------------------------------------------
-r13366 | vlefevre | 2019-01-07 09:39:52 +0000 (Mon, 07 Jan 2019) | 14 lines
+r13361 | vlefevre | 2019-01-01 21:17:19 +0000 (Tue, 01 Jan 2019) | 1 line
Changed paths:
- M /branches/4.0/src/strtofr.c
- M /branches/4.0/tests/tstrtofr.c
+ M /trunk/doc/mpfr.texi
-[src/strtofr.c] Fixed various issues. In particular, the error analysis
- with associated code was incorrect (due to the bad correction r8384
- of a past bug, later really fixed in r11056). Also adapted the code
- to work with small-size limbs.
-[tests/tstrtofr.c] Added tests, including random tests. In particular,
- some part of the code was tested only on hard-to-round cases, meaning
- that some potential issues could not be detected (intermediate results
- were thrown out due to the next Ziv iteration). Moreover, in case of
- failure of some particular test, output the probable cause of this
- failure (GCC bug 86554) with a workaround.
-(merged changesets associated with these files r12566-13306,13364-13365
-from the trunk)
-Note: There may still remain issues with mpfr_strtofr, to be checked
-later. At least, the tests do not fail.
+[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r13363 | vlefevre | 2019-01-04 12:11:10 +0000 (Fri, 04 Jan 2019) | 3 lines
+r13359 | vlefevre | 2019-01-01 20:56:06 +0000 (Tue, 01 Jan 2019) | 4 lines
Changed paths:
- M /branches/4.0/src/mpfr-impl.h
+ M /trunk/BUGS
+ M /trunk/INSTALL
+ M /trunk/Makefile.am
+ M /trunk/NEWS
+ M /trunk/README
+ M /trunk/TODO
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/FAQ.html
+ M /trunk/doc/Makefile.am
+ M /trunk/doc/README.dev
+ M /trunk/doc/check-typography
+ M /trunk/doc/faq.xsl
+ M /trunk/doc/mpfr.texi
+ M /trunk/examples/can_round.c
+ M /trunk/examples/divworst.c
+ M /trunk/examples/rndo-add.c
+ M /trunk/examples/sample.c
+ M /trunk/examples/threads.c
+ M /trunk/examples/version.c
+ M /trunk/src/Makefile.am
+ M /trunk/src/abort_prec_max.c
+ M /trunk/src/acos.c
+ M /trunk/src/acosh.c
+ M /trunk/src/add.c
+ M /trunk/src/add1.c
+ M /trunk/src/add1sp.c
+ M /trunk/src/add1sp1_extracted.c
+ M /trunk/src/add_d.c
+ M /trunk/src/add_ui.c
+ M /trunk/src/agm.c
+ M /trunk/src/ai.c
+ M /trunk/src/amd/mparam.h
+ M /trunk/src/arm/mparam.h
+ M /trunk/src/asin.c
+ M /trunk/src/asinh.c
+ M /trunk/src/atan.c
+ M /trunk/src/atan2.c
+ M /trunk/src/atanh.c
+ M /trunk/src/bernoulli.c
+ M /trunk/src/beta.c
+ M /trunk/src/buildopt.c
+ M /trunk/src/cache.c
+ M /trunk/src/cbrt.c
+ M /trunk/src/check.c
+ M /trunk/src/clear.c
+ M /trunk/src/clears.c
+ M /trunk/src/cmp.c
+ M /trunk/src/cmp2.c
+ M /trunk/src/cmp_abs.c
+ M /trunk/src/cmp_d.c
+ M /trunk/src/cmp_ld.c
+ M /trunk/src/cmp_si.c
+ M /trunk/src/cmp_ui.c
+ M /trunk/src/comparisons.c
+ M /trunk/src/const_catalan.c
+ M /trunk/src/const_euler.c
+ M /trunk/src/const_log2.c
+ M /trunk/src/const_pi.c
+ M /trunk/src/constant.c
+ M /trunk/src/copysign.c
+ M /trunk/src/cos.c
+ M /trunk/src/cosh.c
+ M /trunk/src/cot.c
+ M /trunk/src/coth.c
+ M /trunk/src/csc.c
+ M /trunk/src/csch.c
+ M /trunk/src/d_div.c
+ M /trunk/src/d_sub.c
+ M /trunk/src/digamma.c
+ M /trunk/src/dim.c
+ M /trunk/src/div.c
+ M /trunk/src/div_2exp.c
+ M /trunk/src/div_2si.c
+ M /trunk/src/div_2ui.c
+ M /trunk/src/div_d.c
+ M /trunk/src/div_ui.c
+ M /trunk/src/dot.c
+ M /trunk/src/dump.c
+ M /trunk/src/eint.c
+ M /trunk/src/eq.c
+ M /trunk/src/erandom.c
+ M /trunk/src/erf.c
+ M /trunk/src/erfc.c
+ M /trunk/src/exceptions.c
+ M /trunk/src/exp.c
+ M /trunk/src/exp10.c
+ M /trunk/src/exp2.c
+ M /trunk/src/exp3.c
+ M /trunk/src/exp_2.c
+ M /trunk/src/expm1.c
+ M /trunk/src/extract.c
+ M /trunk/src/factorial.c
+ M /trunk/src/fits_intmax.c
+ M /trunk/src/fits_s.h
+ M /trunk/src/fits_sint.c
+ M /trunk/src/fits_slong.c
+ M /trunk/src/fits_sshort.c
+ M /trunk/src/fits_u.h
+ M /trunk/src/fits_uint.c
+ M /trunk/src/fits_uintmax.c
+ M /trunk/src/fits_ulong.c
+ M /trunk/src/fits_ushort.c
+ M /trunk/src/fma.c
+ M /trunk/src/fmma.c
+ M /trunk/src/fms.c
+ M /trunk/src/fpif.c
+ M /trunk/src/frac.c
+ M /trunk/src/free_cache.c
+ M /trunk/src/frexp.c
+ M /trunk/src/gamma.c
+ M /trunk/src/gamma_inc.c
+ M /trunk/src/gammaonethird.c
+ M /trunk/src/gen_inverse.h
+ M /trunk/src/generic/coverage/mparam.h
+ M /trunk/src/generic/mparam.h
+ M /trunk/src/get_d.c
+ M /trunk/src/get_d128.c
+ M /trunk/src/get_d64.c
+ M /trunk/src/get_exp.c
+ M /trunk/src/get_f.c
+ M /trunk/src/get_float128.c
+ M /trunk/src/get_flt.c
+ M /trunk/src/get_ld.c
+ M /trunk/src/get_q.c
+ M /trunk/src/get_si.c
+ M /trunk/src/get_sj.c
+ M /trunk/src/get_str.c
+ M /trunk/src/get_ui.c
+ M /trunk/src/get_uj.c
+ M /trunk/src/get_z.c
+ M /trunk/src/get_z_exp.c
+ M /trunk/src/gmp_op.c
+ M /trunk/src/grandom.c
+ M /trunk/src/hypot.c
+ M /trunk/src/ieee_floats.h
+ M /trunk/src/init.c
+ M /trunk/src/init2.c
+ M /trunk/src/inits.c
+ M /trunk/src/inits2.c
+ M /trunk/src/inp_str.c
+ M /trunk/src/int_ceil_log2.c
+ M /trunk/src/invert_limb.h
+ M /trunk/src/invsqrt_limb.h
+ M /trunk/src/isinf.c
+ M /trunk/src/isinteger.c
+ M /trunk/src/isnan.c
+ M /trunk/src/isnum.c
+ M /trunk/src/isqrt.c
+ M /trunk/src/isregular.c
+ M /trunk/src/iszero.c
+ M /trunk/src/jn.c
+ M /trunk/src/jyn_asympt.c
+ M /trunk/src/li2.c
+ M /trunk/src/lngamma.c
+ M /trunk/src/log.c
+ M /trunk/src/log10.c
+ M /trunk/src/log1p.c
+ M /trunk/src/log2.c
+ M /trunk/src/log_ui.c
+ M /trunk/src/logging.c
+ M /trunk/src/min_prec.c
+ M /trunk/src/minmax.c
+ M /trunk/src/mips/mparam.h
+ M /trunk/src/modf.c
+ M /trunk/src/mp_clz_tab.c
+ M /trunk/src/mparam_h.in
+ M /trunk/src/mpf2mpfr.h
+ M /trunk/src/mpfr-cvers.h
+ M /trunk/src/mpfr-gmp.c
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+ M /trunk/src/mpfr-longlong.h
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/mpfr-mini-gmp.h
+ M /trunk/src/mpfr-sassert.h
+ M /trunk/src/mpfr-thread.h
+ M /trunk/src/mpfr.h
+ M /trunk/src/mpn_exp.c
+ M /trunk/src/mul.c
+ M /trunk/src/mul_1_extracted.c
+ M /trunk/src/mul_2exp.c
+ M /trunk/src/mul_2si.c
+ M /trunk/src/mul_2ui.c
+ M /trunk/src/mul_d.c
+ M /trunk/src/mul_ui.c
+ M /trunk/src/mulders.c
+ M /trunk/src/nbits_ulong.c
+ M /trunk/src/neg.c
+ M /trunk/src/next.c
+ M /trunk/src/nrandom.c
+ M /trunk/src/odd_p.c
+ M /trunk/src/out_str.c
+ M /trunk/src/pool.c
+ M /trunk/src/pow.c
+ M /trunk/src/pow_si.c
+ M /trunk/src/pow_ui.c
+ M /trunk/src/pow_z.c
+ M /trunk/src/powerof2.c
+ M /trunk/src/powerpc64/mparam.h
+ M /trunk/src/print_raw.c
+ M /trunk/src/print_rnd_mode.c
+ M /trunk/src/printf.c
+ M /trunk/src/random_deviate.c
+ M /trunk/src/random_deviate.h
+ M /trunk/src/rec_sqrt.c
+ M /trunk/src/reldiff.c
+ M /trunk/src/rem1.c
+ M /trunk/src/rint.c
+ M /trunk/src/rndna.c
+ M /trunk/src/root.c
+ M /trunk/src/round_near_x.c
+ M /trunk/src/round_p.c
+ M /trunk/src/round_prec.c
+ M /trunk/src/round_raw_generic.c
+ M /trunk/src/scale2.c
+ M /trunk/src/sec.c
+ M /trunk/src/sech.c
+ M /trunk/src/set.c
+ M /trunk/src/set_d.c
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+ M /trunk/src/set_dfl_prec.c
+ M /trunk/src/set_exp.c
+ M /trunk/src/set_f.c
+ M /trunk/src/set_float128.c
+ M /trunk/src/set_flt.c
+ M /trunk/src/set_inf.c
+ M /trunk/src/set_ld.c
+ M /trunk/src/set_nan.c
+ M /trunk/src/set_prc_raw.c
+ M /trunk/src/set_prec.c
+ M /trunk/src/set_q.c
+ M /trunk/src/set_rnd.c
+ M /trunk/src/set_si.c
+ M /trunk/src/set_si_2exp.c
+ M /trunk/src/set_sj.c
+ M /trunk/src/set_str.c
+ M /trunk/src/set_str_raw.c
+ M /trunk/src/set_ui.c
+ M /trunk/src/set_ui_2exp.c
+ M /trunk/src/set_uj.c
+ M /trunk/src/set_z.c
+ M /trunk/src/set_z_exp.c
+ M /trunk/src/set_zero.c
+ M /trunk/src/setmax.c
+ M /trunk/src/setmin.c
+ M /trunk/src/setsign.c
+ M /trunk/src/sgn.c
+ M /trunk/src/si_op.c
+ M /trunk/src/signbit.c
+ M /trunk/src/sin.c
+ M /trunk/src/sin_cos.c
+ M /trunk/src/sinh.c
+ M /trunk/src/sinh_cosh.c
+ M /trunk/src/sparc64/mparam.h
+ M /trunk/src/sqr.c
+ M /trunk/src/sqrt.c
+ M /trunk/src/sqrt_ui.c
+ M /trunk/src/stack_interface.c
+ M /trunk/src/strtofr.c
+ M /trunk/src/sub.c
+ M /trunk/src/sub1.c
+ M /trunk/src/sub1sp.c
+ M /trunk/src/sub_d.c
+ M /trunk/src/sub_ui.c
+ M /trunk/src/subnormal.c
+ M /trunk/src/sum.c
+ M /trunk/src/swap.c
+ M /trunk/src/tan.c
+ M /trunk/src/tanh.c
+ M /trunk/src/total_order.c
+ M /trunk/src/ubf.c
+ M /trunk/src/uceil_exp2.c
+ M /trunk/src/uceil_log2.c
+ M /trunk/src/ufloor_log2.c
+ M /trunk/src/ui_div.c
+ M /trunk/src/ui_pow.c
+ M /trunk/src/ui_pow_ui.c
+ M /trunk/src/ui_sub.c
+ M /trunk/src/urandom.c
+ M /trunk/src/urandomb.c
+ M /trunk/src/vasprintf.c
+ M /trunk/src/version.c
+ M /trunk/src/volatile.c
+ M /trunk/src/x86/mparam.h
+ M /trunk/src/x86_64/core2/mparam.h
+ M /trunk/src/x86_64/mparam.h
+ M /trunk/src/yn.c
+ M /trunk/src/zeta.c
+ M /trunk/src/zeta_ui.c
+ M /trunk/tests/Makefile.am
+ M /trunk/tests/cmp_str.c
+ M /trunk/tests/data/digamma
+ M /trunk/tests/data/li2
+ M /trunk/tests/memory.c
+ M /trunk/tests/mpf_compat.c
+ M /trunk/tests/mpf_compat.h
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/mpfr_compat.c
+ M /trunk/tests/random2.c
+ M /trunk/tests/reuse.c
+ M /trunk/tests/rnd_mode.c
+ M /trunk/tests/tabort_defalloc1.c
+ M /trunk/tests/tabort_defalloc2.c
+ M /trunk/tests/tabort_prec_max.c
+ M /trunk/tests/tabs.c
+ M /trunk/tests/tacos.c
+ M /trunk/tests/tacosh.c
+ M /trunk/tests/tadd.c
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tadd_d.c
+ M /trunk/tests/tadd_ui.c
+ M /trunk/tests/tagm.c
+ M /trunk/tests/tai.c
+ M /trunk/tests/talloc-cache.c
+ M /trunk/tests/talloc.c
+ M /trunk/tests/tasin.c
+ M /trunk/tests/tasinh.c
+ M /trunk/tests/tassert.c
+ M /trunk/tests/tatan.c
+ M /trunk/tests/tatanh.c
+ M /trunk/tests/taway.c
+ M /trunk/tests/tbeta.c
+ M /trunk/tests/tbuildopt.c
+ M /trunk/tests/tcan_round.c
+ M /trunk/tests/tcbrt.c
+ M /trunk/tests/tcheck.c
+ M /trunk/tests/tcmp.c
+ M /trunk/tests/tcmp2.c
+ M /trunk/tests/tcmp_d.c
+ M /trunk/tests/tcmp_ld.c
+ M /trunk/tests/tcmp_ui.c
+ M /trunk/tests/tcmpabs.c
+ M /trunk/tests/tcomparisons.c
+ M /trunk/tests/tconst_catalan.c
+ M /trunk/tests/tconst_euler.c
+ M /trunk/tests/tconst_log2.c
+ M /trunk/tests/tconst_pi.c
+ M /trunk/tests/tcopysign.c
+ M /trunk/tests/tcos.c
+ M /trunk/tests/tcosh.c
+ M /trunk/tests/tcot.c
+ M /trunk/tests/tcoth.c
+ M /trunk/tests/tcsc.c
+ M /trunk/tests/tcsch.c
+ M /trunk/tests/td_div.c
+ M /trunk/tests/td_sub.c
+ M /trunk/tests/tdigamma.c
+ M /trunk/tests/tdim.c
+ M /trunk/tests/tdiv.c
+ M /trunk/tests/tdiv_d.c
+ M /trunk/tests/tdiv_ui.c
+ M /trunk/tests/tdot.c
+ M /trunk/tests/teint.c
+ M /trunk/tests/teq.c
+ M /trunk/tests/terandom.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/terf.c
+ M /trunk/tests/tests.c
+ M /trunk/tests/texceptions.c
+ M /trunk/tests/texp.c
+ M /trunk/tests/texp10.c
+ M /trunk/tests/texp2.c
+ M /trunk/tests/texpm1.c
+ M /trunk/tests/tfactorial.c
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tfma.c
+ M /trunk/tests/tfmma.c
+ M /trunk/tests/tfmod.c
+ M /trunk/tests/tfms.c
+ M /trunk/tests/tfpif.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tfrac.c
+ M /trunk/tests/tfrexp.c
+ M /trunk/tests/tgamma.c
+ M /trunk/tests/tgamma_inc.c
+ M /trunk/tests/tgeneric.c
+ M /trunk/tests/tgeneric_ui.c
+ M /trunk/tests/tget_d.c
+ M /trunk/tests/tget_d_2exp.c
+ M /trunk/tests/tget_f.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tget_q.c
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tget_str.c
+ M /trunk/tests/tget_z.c
+ M /trunk/tests/tgmpop.c
+ M /trunk/tests/tgrandom.c
+ M /trunk/tests/thyperbolic.c
+ M /trunk/tests/thypot.c
+ M /trunk/tests/tinits.c
+ M /trunk/tests/tinp_str.c
+ M /trunk/tests/tinternals.c
+ M /trunk/tests/tisnan.c
+ M /trunk/tests/tisqrt.c
+ M /trunk/tests/tj0.c
+ M /trunk/tests/tj1.c
+ M /trunk/tests/tjn.c
+ M /trunk/tests/tl2b.c
+ M /trunk/tests/tlgamma.c
+ M /trunk/tests/tli2.c
+ M /trunk/tests/tlngamma.c
+ M /trunk/tests/tlog.c
+ M /trunk/tests/tlog10.c
+ M /trunk/tests/tlog1p.c
+ M /trunk/tests/tlog2.c
+ M /trunk/tests/tlog_ui.c
+ M /trunk/tests/tmin_prec.c
+ M /trunk/tests/tminmax.c
+ M /trunk/tests/tmodf.c
+ M /trunk/tests/tmul.c
+ M /trunk/tests/tmul_2exp.c
+ M /trunk/tests/tmul_d.c
+ M /trunk/tests/tmul_ui.c
+ M /trunk/tests/tnext.c
+ M /trunk/tests/tnrandom.c
+ M /trunk/tests/tnrandom_chisq.c
+ M /trunk/tests/tout_str.c
+ M /trunk/tests/toutimpl.c
+ M /trunk/tests/tpow.c
+ M /trunk/tests/tpow3.c
+ M /trunk/tests/tpow_all.c
+ M /trunk/tests/tpow_z.c
+ M /trunk/tests/tprec_round.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/trandom_deviate.c
+ M /trunk/tests/trec_sqrt.c
+ M /trunk/tests/tremquo.c
+ M /trunk/tests/trint.c
+ M /trunk/tests/trndna.c
+ M /trunk/tests/troot.c
+ M /trunk/tests/trootn_ui.c
+ M /trunk/tests/tsec.c
+ M /trunk/tests/tsech.c
+ M /trunk/tests/tset.c
+ M /trunk/tests/tset_d.c
+ M /trunk/tests/tset_exp.c
+ M /trunk/tests/tset_f.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tset_q.c
+ M /trunk/tests/tset_si.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tset_str.c
+ M /trunk/tests/tset_z.c
+ M /trunk/tests/tset_z_exp.c
+ M /trunk/tests/tsgn.c
+ M /trunk/tests/tsi_op.c
+ M /trunk/tests/tsin.c
+ M /trunk/tests/tsin_cos.c
+ M /trunk/tests/tsinh.c
+ M /trunk/tests/tsinh_cosh.c
+ M /trunk/tests/tsprintf.c
+ M /trunk/tests/tsqr.c
+ M /trunk/tests/tsqrt.c
+ M /trunk/tests/tsqrt_ui.c
+ M /trunk/tests/tstckintc.c
+ M /trunk/tests/tstdint.c
+ M /trunk/tests/tstrtofr.c
+ M /trunk/tests/tsub.c
+ M /trunk/tests/tsub1sp.c
+ M /trunk/tests/tsub_d.c
+ M /trunk/tests/tsub_ui.c
+ M /trunk/tests/tsubnormal.c
+ M /trunk/tests/tsum.c
+ M /trunk/tests/tswap.c
+ M /trunk/tests/ttan.c
+ M /trunk/tests/ttanh.c
+ M /trunk/tests/ttotal_order.c
+ M /trunk/tests/ttrunc.c
+ M /trunk/tests/tui_div.c
+ M /trunk/tests/tui_pow.c
+ M /trunk/tests/tui_sub.c
+ M /trunk/tests/turandom.c
+ M /trunk/tests/tvalist.c
+ M /trunk/tests/tversion.c
+ M /trunk/tests/ty0.c
+ M /trunk/tests/ty1.c
+ M /trunk/tests/tyn.c
+ M /trunk/tests/tzeta.c
+ M /trunk/tests/tzeta_ui.c
+ M /trunk/tools/bench/Makefile.am
+ M /trunk/tools/bench/benchtime.h
+ M /trunk/tools/bench/mpfrbench.c
+ M /trunk/tools/check_mparam.c
+ M /trunk/tools/ck-clz_tab
+ M /trunk/tools/ck-copyright-notice
+ M /trunk/tools/ck-mparam
+ M /trunk/tools/ck-news
+ M /trunk/tools/ck-version-info
+ M /trunk/tools/get_patches.sh
+ M /trunk/tune/Makefile.am
+ M /trunk/tune/bidimensional_sample.c
+ M /trunk/tune/speed.c
+ M /trunk/tune/tuneup.c
-[src/mpfr-impl.h] Added a comment with a warning concerning the meaning
-of MPFR_EXP_FSPEC (corresponding to the merge of mpfr-impl.h r13299
-from the trunk; the other part of this commit with be merged later).
+Copyright notice update: added 2019 with
+ perl -pi -e 's/ (\d{4}-)?(2018)(?= Free Software)/
+ " ".($1||"$2-").($2+1)/e' **/*(^/)
+under zsh. Removed 2018 from the example in the doc/README.dev file.
------------------------------------------------------------------------
-r13362 | vlefevre | 2019-01-01 21:18:11 +0000 (Tue, 01 Jan 2019) | 1 line
+r13356 | vlefevre | 2018-12-31 03:36:15 +0000 (Mon, 31 Dec 2018) | 2 lines
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/tests/tfmma.c
-[doc/mpfr.texi] Updated the month.
+[tests/tfmma.c] Added double_rounding test to trigger errors before
+the fix in mpfr_set_1_2 (set.c r13347).
------------------------------------------------------------------------
-r13360 | vlefevre | 2019-01-01 21:02:47 +0000 (Tue, 01 Jan 2019) | 4 lines
-Changed paths:
- M /branches/4.0/BUGS
- M /branches/4.0/INSTALL
- M /branches/4.0/Makefile.am
- M /branches/4.0/NEWS
- M /branches/4.0/README
- M /branches/4.0/TODO
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/FAQ.html
- M /branches/4.0/doc/Makefile.am
- M /branches/4.0/doc/README.dev
- M /branches/4.0/doc/check-typography
- M /branches/4.0/doc/faq.xsl
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/examples/can_round.c
- M /branches/4.0/examples/divworst.c
- M /branches/4.0/examples/rndo-add.c
- M /branches/4.0/examples/sample.c
- M /branches/4.0/examples/version.c
- M /branches/4.0/src/Makefile.am
- M /branches/4.0/src/abort_prec_max.c
- M /branches/4.0/src/acos.c
- M /branches/4.0/src/acosh.c
- M /branches/4.0/src/add.c
- M /branches/4.0/src/add1.c
- M /branches/4.0/src/add1sp.c
- M /branches/4.0/src/add_d.c
- M /branches/4.0/src/add_ui.c
- M /branches/4.0/src/agm.c
- M /branches/4.0/src/ai.c
- M /branches/4.0/src/amd/amdfam10/mparam.h
- M /branches/4.0/src/amd/athlon/mparam.h
- M /branches/4.0/src/amd/k8/mparam.h
- M /branches/4.0/src/arm/mparam.h
- M /branches/4.0/src/asin.c
- M /branches/4.0/src/asinh.c
- M /branches/4.0/src/atan.c
- M /branches/4.0/src/atan2.c
- M /branches/4.0/src/atanh.c
- M /branches/4.0/src/bernoulli.c
- M /branches/4.0/src/beta.c
- M /branches/4.0/src/buildopt.c
- M /branches/4.0/src/cache.c
- M /branches/4.0/src/cbrt.c
- M /branches/4.0/src/check.c
- M /branches/4.0/src/clear.c
- M /branches/4.0/src/clears.c
- M /branches/4.0/src/cmp.c
- M /branches/4.0/src/cmp2.c
- M /branches/4.0/src/cmp_abs.c
- M /branches/4.0/src/cmp_d.c
- M /branches/4.0/src/cmp_ld.c
- M /branches/4.0/src/cmp_si.c
- M /branches/4.0/src/cmp_ui.c
- M /branches/4.0/src/comparisons.c
- M /branches/4.0/src/const_catalan.c
- M /branches/4.0/src/const_euler.c
- M /branches/4.0/src/const_log2.c
- M /branches/4.0/src/const_pi.c
- M /branches/4.0/src/constant.c
- M /branches/4.0/src/copysign.c
- M /branches/4.0/src/cos.c
- M /branches/4.0/src/cosh.c
- M /branches/4.0/src/cot.c
- M /branches/4.0/src/coth.c
- M /branches/4.0/src/csc.c
- M /branches/4.0/src/csch.c
- M /branches/4.0/src/d_div.c
- M /branches/4.0/src/d_sub.c
- M /branches/4.0/src/digamma.c
- M /branches/4.0/src/dim.c
- M /branches/4.0/src/div.c
- M /branches/4.0/src/div_2exp.c
- M /branches/4.0/src/div_2si.c
- M /branches/4.0/src/div_2ui.c
- M /branches/4.0/src/div_d.c
- M /branches/4.0/src/div_ui.c
- M /branches/4.0/src/dump.c
- M /branches/4.0/src/eint.c
- M /branches/4.0/src/eq.c
- M /branches/4.0/src/erandom.c
- M /branches/4.0/src/erf.c
- M /branches/4.0/src/erfc.c
- M /branches/4.0/src/exceptions.c
- M /branches/4.0/src/exp.c
- M /branches/4.0/src/exp10.c
- M /branches/4.0/src/exp2.c
- M /branches/4.0/src/exp3.c
- M /branches/4.0/src/exp_2.c
- M /branches/4.0/src/expm1.c
- M /branches/4.0/src/extract.c
- M /branches/4.0/src/factorial.c
- M /branches/4.0/src/fits_intmax.c
- M /branches/4.0/src/fits_s.h
- M /branches/4.0/src/fits_sint.c
- M /branches/4.0/src/fits_slong.c
- M /branches/4.0/src/fits_sshort.c
- M /branches/4.0/src/fits_u.h
- M /branches/4.0/src/fits_uint.c
- M /branches/4.0/src/fits_uintmax.c
- M /branches/4.0/src/fits_ulong.c
- M /branches/4.0/src/fits_ushort.c
- M /branches/4.0/src/fma.c
- M /branches/4.0/src/fmma.c
- M /branches/4.0/src/fms.c
- M /branches/4.0/src/fpif.c
- M /branches/4.0/src/frac.c
- M /branches/4.0/src/free_cache.c
- M /branches/4.0/src/frexp.c
- M /branches/4.0/src/gamma.c
- M /branches/4.0/src/gamma_inc.c
- M /branches/4.0/src/gammaonethird.c
- M /branches/4.0/src/gen_inverse.h
- M /branches/4.0/src/generic/coverage/mparam.h
- M /branches/4.0/src/generic/mparam.h
- M /branches/4.0/src/get_d.c
- M /branches/4.0/src/get_d64.c
- M /branches/4.0/src/get_exp.c
- M /branches/4.0/src/get_f.c
- M /branches/4.0/src/get_float128.c
- M /branches/4.0/src/get_flt.c
- M /branches/4.0/src/get_ld.c
- M /branches/4.0/src/get_q.c
- M /branches/4.0/src/get_si.c
- M /branches/4.0/src/get_sj.c
- M /branches/4.0/src/get_str.c
- M /branches/4.0/src/get_ui.c
- M /branches/4.0/src/get_uj.c
- M /branches/4.0/src/get_z.c
- M /branches/4.0/src/get_z_exp.c
- M /branches/4.0/src/gmp_op.c
- M /branches/4.0/src/grandom.c
- M /branches/4.0/src/hppa/mparam.h
- M /branches/4.0/src/hypot.c
- M /branches/4.0/src/ia64/mparam.h
- M /branches/4.0/src/ieee_floats.h
- M /branches/4.0/src/init.c
- M /branches/4.0/src/init2.c
- M /branches/4.0/src/inits.c
- M /branches/4.0/src/inits2.c
- M /branches/4.0/src/inp_str.c
- M /branches/4.0/src/int_ceil_log2.c
- M /branches/4.0/src/invert_limb.h
- M /branches/4.0/src/invsqrt_limb.h
- M /branches/4.0/src/isinf.c
- M /branches/4.0/src/isinteger.c
- M /branches/4.0/src/isnan.c
- M /branches/4.0/src/isnum.c
- M /branches/4.0/src/isqrt.c
- M /branches/4.0/src/isregular.c
- M /branches/4.0/src/iszero.c
- M /branches/4.0/src/jn.c
- M /branches/4.0/src/jyn_asympt.c
- M /branches/4.0/src/li2.c
- M /branches/4.0/src/lngamma.c
- M /branches/4.0/src/log.c
- M /branches/4.0/src/log10.c
- M /branches/4.0/src/log1p.c
- M /branches/4.0/src/log2.c
- M /branches/4.0/src/log_ui.c
- M /branches/4.0/src/logging.c
- M /branches/4.0/src/min_prec.c
- M /branches/4.0/src/minmax.c
- M /branches/4.0/src/mips/mparam.h
- M /branches/4.0/src/modf.c
- M /branches/4.0/src/mp_clz_tab.c
- M /branches/4.0/src/mparam_h.in
- M /branches/4.0/src/mpf2mpfr.h
- M /branches/4.0/src/mpfr-cvers.h
- M /branches/4.0/src/mpfr-gmp.c
- M /branches/4.0/src/mpfr-gmp.h
- M /branches/4.0/src/mpfr-impl.h
- M /branches/4.0/src/mpfr-intmax.h
- M /branches/4.0/src/mpfr-longlong.h
- M /branches/4.0/src/mpfr-mini-gmp.c
- M /branches/4.0/src/mpfr-mini-gmp.h
- M /branches/4.0/src/mpfr-sassert.h
- M /branches/4.0/src/mpfr-thread.h
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/mpn_exp.c
- M /branches/4.0/src/mul.c
- M /branches/4.0/src/mul_2exp.c
- M /branches/4.0/src/mul_2si.c
- M /branches/4.0/src/mul_2ui.c
- M /branches/4.0/src/mul_d.c
- M /branches/4.0/src/mul_ui.c
- M /branches/4.0/src/mulders.c
- M /branches/4.0/src/neg.c
- M /branches/4.0/src/next.c
- M /branches/4.0/src/nrandom.c
- M /branches/4.0/src/odd_p.c
- M /branches/4.0/src/out_str.c
- M /branches/4.0/src/pool.c
- M /branches/4.0/src/pow.c
- M /branches/4.0/src/pow_si.c
- M /branches/4.0/src/pow_ui.c
- M /branches/4.0/src/pow_z.c
- M /branches/4.0/src/powerof2.c
- M /branches/4.0/src/powerpc32/mparam.h
- M /branches/4.0/src/powerpc64/mparam.h
- M /branches/4.0/src/print_raw.c
- M /branches/4.0/src/print_rnd_mode.c
- M /branches/4.0/src/printf.c
- M /branches/4.0/src/random_deviate.c
- M /branches/4.0/src/random_deviate.h
- M /branches/4.0/src/rec_sqrt.c
- M /branches/4.0/src/reldiff.c
- M /branches/4.0/src/rem1.c
- M /branches/4.0/src/rint.c
- M /branches/4.0/src/rndna.c
- M /branches/4.0/src/root.c
- M /branches/4.0/src/round_near_x.c
- M /branches/4.0/src/round_p.c
- M /branches/4.0/src/round_prec.c
- M /branches/4.0/src/round_raw_generic.c
- M /branches/4.0/src/scale2.c
- M /branches/4.0/src/sec.c
- M /branches/4.0/src/sech.c
- M /branches/4.0/src/set.c
- M /branches/4.0/src/set_d.c
- M /branches/4.0/src/set_d64.c
- M /branches/4.0/src/set_dfl_prec.c
- M /branches/4.0/src/set_exp.c
- M /branches/4.0/src/set_f.c
- M /branches/4.0/src/set_float128.c
- M /branches/4.0/src/set_flt.c
- M /branches/4.0/src/set_inf.c
- M /branches/4.0/src/set_ld.c
- M /branches/4.0/src/set_nan.c
- M /branches/4.0/src/set_prc_raw.c
- M /branches/4.0/src/set_prec.c
- M /branches/4.0/src/set_q.c
- M /branches/4.0/src/set_rnd.c
- M /branches/4.0/src/set_si.c
- M /branches/4.0/src/set_si_2exp.c
- M /branches/4.0/src/set_sj.c
- M /branches/4.0/src/set_str.c
- M /branches/4.0/src/set_str_raw.c
- M /branches/4.0/src/set_ui.c
- M /branches/4.0/src/set_ui_2exp.c
- M /branches/4.0/src/set_uj.c
- M /branches/4.0/src/set_z.c
- M /branches/4.0/src/set_z_exp.c
- M /branches/4.0/src/set_zero.c
- M /branches/4.0/src/setmax.c
- M /branches/4.0/src/setmin.c
- M /branches/4.0/src/setsign.c
- M /branches/4.0/src/sgn.c
- M /branches/4.0/src/si_op.c
- M /branches/4.0/src/signbit.c
- M /branches/4.0/src/sin.c
- M /branches/4.0/src/sin_cos.c
- M /branches/4.0/src/sinh.c
- M /branches/4.0/src/sinh_cosh.c
- M /branches/4.0/src/sparc64/mparam.h
- M /branches/4.0/src/sqr.c
- M /branches/4.0/src/sqrt.c
- M /branches/4.0/src/sqrt_ui.c
- M /branches/4.0/src/stack_interface.c
- M /branches/4.0/src/strtofr.c
- M /branches/4.0/src/sub.c
- M /branches/4.0/src/sub1.c
- M /branches/4.0/src/sub1sp.c
- M /branches/4.0/src/sub_d.c
- M /branches/4.0/src/sub_ui.c
- M /branches/4.0/src/subnormal.c
- M /branches/4.0/src/sum.c
- M /branches/4.0/src/swap.c
- M /branches/4.0/src/tan.c
- M /branches/4.0/src/tanh.c
- M /branches/4.0/src/ubf.c
- M /branches/4.0/src/uceil_exp2.c
- M /branches/4.0/src/uceil_log2.c
- M /branches/4.0/src/ufloor_log2.c
- M /branches/4.0/src/ui_div.c
- M /branches/4.0/src/ui_pow.c
- M /branches/4.0/src/ui_pow_ui.c
- M /branches/4.0/src/ui_sub.c
- M /branches/4.0/src/urandom.c
- M /branches/4.0/src/urandomb.c
- M /branches/4.0/src/vasprintf.c
- M /branches/4.0/src/version.c
- M /branches/4.0/src/volatile.c
- M /branches/4.0/src/x86/core2/mparam.h
- M /branches/4.0/src/x86/mparam.h
- M /branches/4.0/src/x86_64/core2/mparam.h
- M /branches/4.0/src/x86_64/corei5/mparam.h
- M /branches/4.0/src/x86_64/pentium4/mparam.h
- M /branches/4.0/src/yn.c
- M /branches/4.0/src/zeta.c
- M /branches/4.0/src/zeta_ui.c
- M /branches/4.0/tests/Makefile.am
- M /branches/4.0/tests/cmp_str.c
- M /branches/4.0/tests/data/digamma
- M /branches/4.0/tests/data/li2
- M /branches/4.0/tests/memory.c
- M /branches/4.0/tests/mpf_compat.c
- M /branches/4.0/tests/mpf_compat.h
- M /branches/4.0/tests/mpfr-test.h
- M /branches/4.0/tests/mpfr_compat.c
- M /branches/4.0/tests/random2.c
- M /branches/4.0/tests/reuse.c
- M /branches/4.0/tests/rnd_mode.c
- M /branches/4.0/tests/tabort_defalloc1.c
- M /branches/4.0/tests/tabort_defalloc2.c
- M /branches/4.0/tests/tabort_prec_max.c
- M /branches/4.0/tests/tabs.c
- M /branches/4.0/tests/tacos.c
- M /branches/4.0/tests/tacosh.c
- M /branches/4.0/tests/tadd.c
- M /branches/4.0/tests/tadd1sp.c
- M /branches/4.0/tests/tadd_d.c
- M /branches/4.0/tests/tadd_ui.c
- M /branches/4.0/tests/tagm.c
- M /branches/4.0/tests/tai.c
- M /branches/4.0/tests/talloc-cache.c
- M /branches/4.0/tests/talloc.c
- M /branches/4.0/tests/tasin.c
- M /branches/4.0/tests/tasinh.c
- M /branches/4.0/tests/tassert.c
- M /branches/4.0/tests/tatan.c
- M /branches/4.0/tests/tatanh.c
- M /branches/4.0/tests/taway.c
- M /branches/4.0/tests/tbeta.c
- M /branches/4.0/tests/tbuildopt.c
- M /branches/4.0/tests/tcan_round.c
- M /branches/4.0/tests/tcbrt.c
- M /branches/4.0/tests/tcheck.c
- M /branches/4.0/tests/tcmp.c
- M /branches/4.0/tests/tcmp2.c
- M /branches/4.0/tests/tcmp_d.c
- M /branches/4.0/tests/tcmp_ld.c
- M /branches/4.0/tests/tcmp_ui.c
- M /branches/4.0/tests/tcmpabs.c
- M /branches/4.0/tests/tcomparisons.c
- M /branches/4.0/tests/tconst_catalan.c
- M /branches/4.0/tests/tconst_euler.c
- M /branches/4.0/tests/tconst_log2.c
- M /branches/4.0/tests/tconst_pi.c
- M /branches/4.0/tests/tcopysign.c
- M /branches/4.0/tests/tcos.c
- M /branches/4.0/tests/tcosh.c
- M /branches/4.0/tests/tcot.c
- M /branches/4.0/tests/tcoth.c
- M /branches/4.0/tests/tcsc.c
- M /branches/4.0/tests/tcsch.c
- M /branches/4.0/tests/td_div.c
- M /branches/4.0/tests/td_sub.c
- M /branches/4.0/tests/tdigamma.c
- M /branches/4.0/tests/tdim.c
- M /branches/4.0/tests/tdiv.c
- M /branches/4.0/tests/tdiv_d.c
- M /branches/4.0/tests/tdiv_ui.c
- M /branches/4.0/tests/teint.c
- M /branches/4.0/tests/teq.c
- M /branches/4.0/tests/terandom.c
- M /branches/4.0/tests/terandom_chisq.c
- M /branches/4.0/tests/terf.c
- M /branches/4.0/tests/tests.c
- M /branches/4.0/tests/texceptions.c
- M /branches/4.0/tests/texp.c
- M /branches/4.0/tests/texp10.c
- M /branches/4.0/tests/texp2.c
- M /branches/4.0/tests/texpm1.c
- M /branches/4.0/tests/tfactorial.c
- M /branches/4.0/tests/tfits.c
- M /branches/4.0/tests/tfma.c
- M /branches/4.0/tests/tfmma.c
- M /branches/4.0/tests/tfmod.c
- M /branches/4.0/tests/tfms.c
- M /branches/4.0/tests/tfpif.c
- M /branches/4.0/tests/tfprintf.c
- M /branches/4.0/tests/tfrac.c
- M /branches/4.0/tests/tfrexp.c
- M /branches/4.0/tests/tgamma.c
- M /branches/4.0/tests/tgamma_inc.c
- M /branches/4.0/tests/tgeneric.c
- M /branches/4.0/tests/tgeneric_ui.c
- M /branches/4.0/tests/tget_d.c
- M /branches/4.0/tests/tget_d_2exp.c
- M /branches/4.0/tests/tget_f.c
- M /branches/4.0/tests/tget_flt.c
- M /branches/4.0/tests/tget_ld_2exp.c
- M /branches/4.0/tests/tget_q.c
- M /branches/4.0/tests/tget_set_d64.c
- M /branches/4.0/tests/tget_sj.c
- M /branches/4.0/tests/tget_str.c
- M /branches/4.0/tests/tget_z.c
- M /branches/4.0/tests/tgmpop.c
- M /branches/4.0/tests/tgrandom.c
- M /branches/4.0/tests/thyperbolic.c
- M /branches/4.0/tests/thypot.c
- M /branches/4.0/tests/tinits.c
- M /branches/4.0/tests/tinp_str.c
- M /branches/4.0/tests/tinternals.c
- M /branches/4.0/tests/tisnan.c
- M /branches/4.0/tests/tisqrt.c
- M /branches/4.0/tests/tj0.c
- M /branches/4.0/tests/tj1.c
- M /branches/4.0/tests/tjn.c
- M /branches/4.0/tests/tl2b.c
- M /branches/4.0/tests/tlgamma.c
- M /branches/4.0/tests/tli2.c
- M /branches/4.0/tests/tlngamma.c
- M /branches/4.0/tests/tlog.c
- M /branches/4.0/tests/tlog10.c
- M /branches/4.0/tests/tlog1p.c
- M /branches/4.0/tests/tlog2.c
- M /branches/4.0/tests/tlog_ui.c
- M /branches/4.0/tests/tmin_prec.c
- M /branches/4.0/tests/tminmax.c
- M /branches/4.0/tests/tmodf.c
- M /branches/4.0/tests/tmul.c
- M /branches/4.0/tests/tmul_2exp.c
- M /branches/4.0/tests/tmul_d.c
- M /branches/4.0/tests/tmul_ui.c
- M /branches/4.0/tests/tnext.c
- M /branches/4.0/tests/tnrandom.c
- M /branches/4.0/tests/tnrandom_chisq.c
- M /branches/4.0/tests/tout_str.c
- M /branches/4.0/tests/toutimpl.c
- M /branches/4.0/tests/tpow.c
- M /branches/4.0/tests/tpow3.c
- M /branches/4.0/tests/tpow_all.c
- M /branches/4.0/tests/tpow_z.c
- M /branches/4.0/tests/tprintf.c
- M /branches/4.0/tests/trandom.c
- M /branches/4.0/tests/trandom_deviate.c
- M /branches/4.0/tests/trec_sqrt.c
- M /branches/4.0/tests/tremquo.c
- M /branches/4.0/tests/trint.c
- M /branches/4.0/tests/trndna.c
- M /branches/4.0/tests/troot.c
- M /branches/4.0/tests/trootn_ui.c
- M /branches/4.0/tests/tround_prec.c
- M /branches/4.0/tests/tsec.c
- M /branches/4.0/tests/tsech.c
- M /branches/4.0/tests/tset.c
- M /branches/4.0/tests/tset_d.c
- M /branches/4.0/tests/tset_exp.c
- M /branches/4.0/tests/tset_f.c
- M /branches/4.0/tests/tset_float128.c
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tests/tset_q.c
- M /branches/4.0/tests/tset_si.c
- M /branches/4.0/tests/tset_sj.c
- M /branches/4.0/tests/tset_str.c
- M /branches/4.0/tests/tset_z.c
- M /branches/4.0/tests/tset_z_exp.c
- M /branches/4.0/tests/tsgn.c
- M /branches/4.0/tests/tsi_op.c
- M /branches/4.0/tests/tsin.c
- M /branches/4.0/tests/tsin_cos.c
- M /branches/4.0/tests/tsinh.c
- M /branches/4.0/tests/tsinh_cosh.c
- M /branches/4.0/tests/tsprintf.c
- M /branches/4.0/tests/tsqr.c
- M /branches/4.0/tests/tsqrt.c
- M /branches/4.0/tests/tsqrt_ui.c
- M /branches/4.0/tests/tstckintc.c
- M /branches/4.0/tests/tstdint.c
- M /branches/4.0/tests/tstrtofr.c
- M /branches/4.0/tests/tsub.c
- M /branches/4.0/tests/tsub1sp.c
- M /branches/4.0/tests/tsub_d.c
- M /branches/4.0/tests/tsub_ui.c
- M /branches/4.0/tests/tsubnormal.c
- M /branches/4.0/tests/tsum.c
- M /branches/4.0/tests/tswap.c
- M /branches/4.0/tests/ttan.c
- M /branches/4.0/tests/ttanh.c
- M /branches/4.0/tests/ttrunc.c
- M /branches/4.0/tests/tui_div.c
- M /branches/4.0/tests/tui_pow.c
- M /branches/4.0/tests/tui_sub.c
- M /branches/4.0/tests/turandom.c
- M /branches/4.0/tests/tvalist.c
- M /branches/4.0/tests/tversion.c
- M /branches/4.0/tests/ty0.c
- M /branches/4.0/tests/ty1.c
- M /branches/4.0/tests/tyn.c
- M /branches/4.0/tests/tzeta.c
- M /branches/4.0/tests/tzeta_ui.c
- M /branches/4.0/tools/bench/Makefile.am
- M /branches/4.0/tools/bench/benchtime.h
- M /branches/4.0/tools/bench/mpfrbench.c
- M /branches/4.0/tools/ck-clz_tab
- M /branches/4.0/tools/ck-copyright-notice
- M /branches/4.0/tools/ck-news
- M /branches/4.0/tools/ck-version-info
- M /branches/4.0/tools/get_patches.sh
- M /branches/4.0/tune/Makefile.am
- M /branches/4.0/tune/bidimensional_sample.c
- M /branches/4.0/tune/speed.c
- M /branches/4.0/tune/tuneup.c
+r13355 | vlefevre | 2018-12-31 02:31:17 +0000 (Mon, 31 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/set.c
-Copyright notice update: added 2019 with
- perl -pi -e 's/ (\d{4}-)?(2018)(?= Free Software)/
- " ".($1||"$2-").($2+1)/e' **/*(^/)
-under zsh. Removed 2018 from the example in the doc/README.dev file.
+[src/set.c] In mpfr_set_1_2, evaluate MPFR_PREC(s) just once.
+------------------------------------------------------------------------
+r13354 | vlefevre | 2018-12-31 02:19:23 +0000 (Mon, 31 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/set.c
+
+[src/set.c] Clarified the mpfr_set_1_2 description.
+------------------------------------------------------------------------
+r13353 | vlefevre | 2018-12-31 02:14:55 +0000 (Mon, 31 Dec 2018) | 4 lines
+Changed paths:
+ M /trunk/src/set.c
+
+[src/set.c] For mpfr_set_1_2, corrected the comments and simplified the
+generic algorithm (there is no need to distinguish the rounding modes,
+except for the double-rounding test, and this simplification avoids the
+non-portable inex | inex2).
+------------------------------------------------------------------------
+r13351 | vlefevre | 2018-12-20 13:49:07 +0000 (Thu, 20 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] Removed "#define GMP_LIMB_BITS 8": it is not used by
+mini-gmp.h and yields a failure when building mini-gmp.c (which has
+its own definition of GMP_LIMB_BITS, equivalent but not identical).
+------------------------------------------------------------------------
+r13350 | vlefevre | 2018-12-20 13:43:57 +0000 (Thu, 20 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Support mini-gmp with reduced limb size, in the case
+GMP_NUMB_BITS is not defined: guess GMP_NUMB_BITS from the size of
+mp_limb_t instead of the size of unsigned long.
+------------------------------------------------------------------------
+r13349 | vlefevre | 2018-12-20 13:29:33 +0000 (Thu, 20 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] Correction to avoid a "conflicting types for 'mp_limb_t'"
+error.
+------------------------------------------------------------------------
+r13348 | zimmerma | 2018-12-14 15:23:15 +0000 (Fri, 14 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] added note about using mini-gmp (development version) with
+ reduced limb size
+
+------------------------------------------------------------------------
+r13347 | zimmerma | 2018-12-14 14:39:48 +0000 (Fri, 14 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/src/set.c
+ M /trunk/tests/tset.c
+
+[src/set.c] fixed double-rounding bug in mpfr_set_1_2
+[tests/tset.c] added corresponding tests
+
+------------------------------------------------------------------------
+r13346 | zimmerma | 2018-12-14 13:40:16 +0000 (Fri, 14 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tset.c
+
+[tests/tset.c] added a test of test_set_1_2(), which currently fails
+
+------------------------------------------------------------------------
+r13345 | zimmerma | 2018-12-14 12:30:08 +0000 (Fri, 14 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tcan_round.c
+
+[tests/tcan_round.c] disabled tests that don't agree with mpfr_can_round documentation
+
+------------------------------------------------------------------------
+r13344 | vlefevre | 2018-12-13 16:28:03 +0000 (Thu, 13 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Updated a comment about ISO C vs POSIX for snprintf.
+------------------------------------------------------------------------
+r13343 | vlefevre | 2018-12-13 16:18:49 +0000 (Thu, 13 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Updated a comment about ISO C vs POSIX for snprintf.
+------------------------------------------------------------------------
+r13342 | vlefevre | 2018-12-13 09:51:29 +0000 (Thu, 13 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Added item: new functions mpfr_cmp_uj and mpfr_cmp_sj.
+------------------------------------------------------------------------
+r13341 | vlefevre | 2018-12-13 09:47:45 +0000 (Thu, 13 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Removed obsolete "check again coverage" from 2007.
+------------------------------------------------------------------------
+r13340 | zimmerma | 2018-12-13 09:15:46 +0000 (Thu, 13 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqr.c
+
+[src/sqr.c] fixed same issue as in r13338 and r13339
+
+------------------------------------------------------------------------
+r13339 | zimmerma | 2018-12-13 09:01:38 +0000 (Thu, 13 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] fixed bug in mpfr_mul() when sizeof(mp_limb_t) < sizeof(mpfr_exp_t)
+ (same issue as in r13338)
+
+------------------------------------------------------------------------
+r13338 | vlefevre | 2018-12-12 13:00:23 +0000 (Wed, 12 Dec 2018) | 5 lines
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] For MPFR_WANT_ASSERT >= 2: minor changes in the code;
+corrected a comment (even with mp_limb_t >= mpfr_exp_t, there was an
+issue: the expression b1 - 1 + cc was computed in unsigned arithmetic,
+then converted to mpfr_exp_t, with an implementation-defined result
+when -1 was expected, i.e. with b1 = cc = 0).
+------------------------------------------------------------------------
+r13337 | vlefevre | 2018-12-12 12:30:25 +0000 (Wed, 12 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] Corrected a typo in a comment.
+------------------------------------------------------------------------
+r13336 | vlefevre | 2018-12-12 12:24:03 +0000 (Wed, 12 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] Fixed error message with MPFR_WANT_ASSERT >= 2.
+------------------------------------------------------------------------
+r13335 | vlefevre | 2018-12-11 17:51:23 +0000 (Tue, 11 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] For count_leading_zeros (MPFR_LONG_WITHIN_LIMB
+not defined), no longer assume GMP_NUMB_BITS <= 32.
+------------------------------------------------------------------------
+r13334 | vlefevre | 2018-12-11 17:33:53 +0000 (Tue, 11 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] Fixed count_leading_zeros (avoid undefined behavior
+on shift counts, which must be nonnegative and smaller than the width
+of the type of the shifted value).
+------------------------------------------------------------------------
+r13333 | zimmerma | 2018-12-11 17:01:47 +0000 (Tue, 11 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] fixed reference routine mpfr_mul3() when sizeof(limb) < sizeof(exp)
+
+------------------------------------------------------------------------
+r13332 | zimmerma | 2018-12-11 15:39:46 +0000 (Tue, 11 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] fixed count_leading_zeros for mini-gmp with 32-bit limb
+
+------------------------------------------------------------------------
+r13331 | zimmerma | 2018-12-10 14:08:16 +0000 (Mon, 10 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] added remark about random functions
+
+------------------------------------------------------------------------
+r13329 | zimmerma | 2018-12-10 08:49:56 +0000 (Mon, 10 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] fixed test_20151023 (was giving an error with micro-gmp-8
+and GMP_CHECK_RANDOMIZE=1544431052619574)
+
+------------------------------------------------------------------------
+r13328 | vlefevre | 2018-12-10 00:44:18 +0000 (Mon, 10 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Added a test for some avoidable use of gmp_printf.
+------------------------------------------------------------------------
+r13327 | vlefevre | 2018-12-07 17:58:36 +0000 (Fri, 07 Dec 2018) | 4 lines
+Changed paths:
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/tcan_round.c
+ M /trunk/tests/tests.c
+
+[tests]
+ * mpfr-test.h, tests.c: added n_trace function to output a mpn.
+ * tcan_round.c: use n_trace instead of gmp_printf ("%NX\n",...),
+ which is not available with mini-gmp.
+------------------------------------------------------------------------
+r13326 | vlefevre | 2018-12-06 08:13:09 +0000 (Thu, 06 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tcan_round.c
+
+[tests/tcan_round.c] Corrected all the error messages for mini-gmp.
+------------------------------------------------------------------------
+r13325 | vlefevre | 2018-12-06 08:11:06 +0000 (Thu, 06 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tcan_round.c
+
+[tests/tcan_round.c] Corrected error message for mini-gmp.
+------------------------------------------------------------------------
+r13324 | vlefevre | 2018-12-05 20:01:26 +0000 (Wed, 05 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tpow_z.c
+
+[tests/tpow_z.c] Another fix and minor improvements.
+------------------------------------------------------------------------
+r13323 | vlefevre | 2018-12-05 19:57:36 +0000 (Wed, 05 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tpow_z.c
+
+[tests/tpow_z.c] Fixed a test (midpoint case) that was failing
+with micro-gmp-8 and GMP_CHECK_RANDOMIZE=1544033327230569.
+------------------------------------------------------------------------
+r13322 | vlefevre | 2018-12-05 17:43:28 +0000 (Wed, 05 Dec 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tpow_z.c
+
+[tests/tpow_z.c] Fixed a test for MPFR_RNDF: do not check the ternary
+value (a failure was occurring with --with-mini-gmp=.../micro-gmp/8
+and GMP_CHECK_RANDOMIZE=1544025040809270).
+------------------------------------------------------------------------
+r13321 | vlefevre | 2018-12-05 17:41:33 +0000 (Wed, 05 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tpow_z.c
+
+[tests/tpow_z.c] Improved error message.
+------------------------------------------------------------------------
+r13320 | vlefevre | 2018-12-05 17:39:25 +0000 (Wed, 05 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] Added missing "void" in function prototype.
------------------------------------------------------------------------
-r13357 | vlefevre | 2018-12-31 11:11:10 +0000 (Mon, 31 Dec 2018) | 8 lines
+r13319 | vlefevre | 2018-12-05 11:42:02 +0000 (Wed, 05 Dec 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/set.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tfmma.c
- M /branches/4.0/tests/tset.c
+ M /trunk/configure.ac
-[src/set.c] Fixed double-rounding bug in the internal function
- mpfr_set_1_2 (and simplified the generic algorithm, avoiding
- the non-portable inex | inex2).
-[tests/tset.c] Added corresponding tests.
-[tests/tfmma.c] Added tests as this bug was affecting mpfr_fmma
- (note: mpfr_set_1_2 is also called in mpfr_fma, but the buggy
- code could not be executed in this case).
-(merged changesets r13346-13347,13353-13356 from the trunk)
+[configure.ac] When building against mini-gmp, check the availability of
+lrand48, in particular because it is not part of the ISO C standard.
------------------------------------------------------------------------
-r13330 | vlefevre | 2018-12-10 09:24:24 +0000 (Mon, 10 Dec 2018) | 2 lines
+r13318 | zimmerma | 2018-12-05 09:26:09 +0000 (Wed, 05 Dec 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tdiv.c
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] put back unconditional assert from r13316 (removed by error)
-[tests/tdiv.c] fixed test_20151023 (random number must not be 0).
-(merged changeset r13329 from the trunk)
------------------------------------------------------------------------
-r13310 | vlefevre | 2018-11-29 07:48:54 +0000 (Thu, 29 Nov 2018) | 5 lines
+r13317 | zimmerma | 2018-12-05 09:23:00 +0000 (Wed, 05 Dec 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/Makefile.am
- M /branches/4.0/tests/tversion.c
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] improved random_limb (the low bits of lrand48 are bad)
+ and fixed gmp_urandomm_ui
+
+------------------------------------------------------------------------
+r13316 | vlefevre | 2018-12-05 08:29:54 +0000 (Wed, 05 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] gmp_urandomm_ui: added a MPFR_ASSERTN
+unconditionally, as n == 0 is always forbidden.
+------------------------------------------------------------------------
+r13315 | zimmerma | 2018-12-05 08:03:17 +0000 (Wed, 05 Dec 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] the static assert introduced in r13313 makes the
+ compilation fail for 8-bit limbs, while the code
+ was valid for n <= 256 in that case
+
+------------------------------------------------------------------------
+r13314 | vlefevre | 2018-12-04 18:05:26 +0000 (Tue, 04 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] Fixed types.
+------------------------------------------------------------------------
+r13313 | vlefevre | 2018-12-04 17:58:34 +0000 (Tue, 04 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] Added a static assertion to make sure that
+the MPFR_ASSERTD added in r13312 is valid.
+------------------------------------------------------------------------
+r13312 | zimmerma | 2018-12-04 17:00:35 +0000 (Tue, 04 Dec 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] gmp_urandomm_ui did not generate uniform values
+
+------------------------------------------------------------------------
+r13311 | vlefevre | 2018-12-03 16:30:10 +0000 (Mon, 03 Dec 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d.c
+
+[src/set_d.c] Improved comment.
+------------------------------------------------------------------------
+r13309 | vlefevre | 2018-11-29 01:26:10 +0000 (Thu, 29 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/tests/Makefile.am
+
+[tests/Makefile.am] About r13308, added references to the bugs.
+------------------------------------------------------------------------
+r13308 | vlefevre | 2018-11-29 01:24:39 +0000 (Thu, 29 Nov 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/Makefile.am
[tests/Makefile.am] Unset DISPLAY as it is not needed and it can yield
error messages when running the tests with LOG_COMPILER=wine (for builds
with MinGW).
-[tests/tversion.c] Updated a comment about this issue.
-(merged changesets r13305,13307-13309 from the trunk)
------------------------------------------------------------------------
-r13301 | vlefevre | 2018-11-27 13:17:11 +0000 (Tue, 27 Nov 2018) | 2 lines
+r13307 | vlefevre | 2018-11-29 01:05:47 +0000 (Thu, 29 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Updated a comment about an output issue with MinGW,
+with the test run under Wine (which is really the cause of the issue).
+------------------------------------------------------------------------
+r13306 | vlefevre | 2018-11-28 15:13:12 +0000 (Wed, 28 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] In case of failure of some particular test, output
+the probable cause of this failure (GCC bug 86554) with a workaround.
+------------------------------------------------------------------------
+r13305 | vlefevre | 2018-11-27 17:39:11 +0000 (Tue, 27 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Updated a comment about a printf issue with MinGW.
+------------------------------------------------------------------------
+r13304 | vlefevre | 2018-11-27 16:51:17 +0000 (Tue, 27 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Added a FIXME about the error analysis (info that was
+part of the FIXME resolved in r13303 and inadvertently dropped).
+------------------------------------------------------------------------
+r13303 | vlefevre | 2018-11-27 15:15:13 +0000 (Tue, 27 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Resolved a FIXME; tstrtofr no longer fails due to
+bug20181127 with 8-bit limbs (micro-gmp/8).
+------------------------------------------------------------------------
+r13302 | vlefevre | 2018-11-27 15:05:17 +0000 (Tue, 27 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Added bug20181127 (test found with random_tests),
+which fails with 8-bit limbs (micro-gmp/8).
+------------------------------------------------------------------------
+r13299 | vlefevre | 2018-11-27 11:47:39 +0000 (Tue, 27 Nov 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/tests/tstrtofr.c
+
+[src/mpfr-impl.h] Added a comment with a warning concerning the
+ meaning of MPFR_EXP_FSPEC.
+[tests/tstrtofr.c] Fixed a MPFR_EXP_FSPEC related bug in a test
+ for _MPFR_EXP_FORMAT <= 2, e.g. with -D_MPFR_PREC_FORMAT=2.
+------------------------------------------------------------------------
+r13298 | vlefevre | 2018-11-27 11:30:56 +0000 (Tue, 27 Nov 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tdiv.c
+ M /trunk/tests/tdiv.c
-[tests/tdiv.c] Fixed test_20151023().
-(merged changesets r13149,13151,13298 from the trunk)
+[tests/tdiv.c] Fixed bad format string for an error message, detected
+with -D_MPFR_PREC_FORMAT=2 (using -Werror...).
------------------------------------------------------------------------
-r13297 | vlefevre | 2018-11-26 13:24:37 +0000 (Mon, 26 Nov 2018) | 2 lines
+r13296 | vlefevre | 2018-11-26 13:15:45 +0000 (Mon, 26 Nov 2018) | 2 lines
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tset_str.c
+ M /trunk/tests/tget_str.c
+ M /trunk/tests/tset_str.c
-[tests/tset_str.c] Added bug20180908() test.
-(merged changesets r13164,13296 from the trunk, for the tests directory)
+[tests] Moved bug20180908() from tget_str.c to tset_str.c since it tests
+mpfr_set_str() only. This test was introduced in r13164.
------------------------------------------------------------------------
-r13294 | vlefevre | 2018-11-23 10:34:21 +0000 (Fri, 23 Nov 2018) | 1 line
+r13295 | vlefevre | 2018-11-23 10:43:13 +0000 (Fri, 23 Nov 2018) | 1 line
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/TODO
+
+[TODO] + More UBF functions.
+------------------------------------------------------------------------
+r13293 | vlefevre | 2018-11-23 10:33:33 +0000 (Fri, 23 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r13284 | vlefevre | 2018-11-22 15:36:13 +0000 (Thu, 22 Nov 2018) | 4 lines
+r13292 | vlefevre | 2018-11-23 09:32:39 +0000 (Fri, 23 Nov 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/NEWS
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/get_str.c
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Changed some unsigned long to unsigned int.
+------------------------------------------------------------------------
+r13291 | vlefevre | 2018-11-23 09:22:30 +0000 (Fri, 23 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Some cleanup in parsed_string_to_mpfr. Avoid a potential
+integer overflow in very high precision if mp_size_t < mpfr_prec_t.
+------------------------------------------------------------------------
+r13290 | vlefevre | 2018-11-22 22:20:51 +0000 (Thu, 22 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Updated FIXME, due to new tests added to
+tests/tstrtofr.c in r13278-13279,13286-13288.
+------------------------------------------------------------------------
+r13289 | vlefevre | 2018-11-22 21:58:40 +0000 (Thu, 22 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/nbits_ulong.c
+
+[src/nbits_ulong.c] Added missing initialization from r13269
+when MPFR_LONG_WITHIN_LIMB is not defined.
+------------------------------------------------------------------------
+r13288 | vlefevre | 2018-11-22 21:52:00 +0000 (Thu, 22 Nov 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Resolved the FIXME and fixed the issue related to
+the old mpfr_get_str description (see r13283).
+Note: with the later fix r13289, a test still fails with 8-bit limbs
+(incorrect exponent, possibly corresponding to the FIXME just before
+"exp = GMP_NUMB_BITS - count;" in src/strtofr.c).
+------------------------------------------------------------------------
+r13287 | vlefevre | 2018-11-22 16:29:01 +0000 (Thu, 22 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Added comments, including a FIXME.
+------------------------------------------------------------------------
+r13286 | vlefevre | 2018-11-22 16:14:59 +0000 (Thu, 22 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Resolved the FIXME for the random tests, and
+increased the number of tests to trigger a failure.
+------------------------------------------------------------------------
+r13283 | vlefevre | 2018-11-22 15:29:37 +0000 (Thu, 22 Nov 2018) | 3 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/get_str.c
MPFR manual: corrected/completed the mpfr_get_str description in order
to follow the historical behavior and GMP's mpf_get_str function.
(Discussion in the Trier meeting.)
-(merged changeset r13283 from the trunk, with a correction in NEWS)
-------------------------------------------------------------------------
-r13277 | vlefevre | 2018-11-20 08:17:39 +0000 (Tue, 20 Nov 2018) | 1 line
-Changed paths:
- M /branches/4.0
- M /branches/4.0/src/amd/amdfam10/mparam.h
- M /branches/4.0/src/amd/k8/mparam.h
- M /branches/4.0/src/arm/mparam.h
- M /branches/4.0/src/generic/coverage/mparam.h
- M /branches/4.0/src/hppa/mparam.h
- M /branches/4.0/src/ia64/mparam.h
- M /branches/4.0/src/mips/mparam.h
- M /branches/4.0/src/powerpc64/mparam.h
- M /branches/4.0/src/sparc64/mparam.h
- M /branches/4.0/src/x86/core2/mparam.h
- M /branches/4.0/src/x86/mparam.h
- M /branches/4.0/src/x86_64/core2/mparam.h
- M /branches/4.0/src/x86_64/corei5/mparam.h
+------------------------------------------------------------------------
+r13282 | vlefevre | 2018-11-22 15:09:31 +0000 (Thu, 22 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/get_str.c
+
+[src/get_str.c] Code style.
+------------------------------------------------------------------------
+r13281 | vlefevre | 2018-11-22 09:27:09 +0000 (Thu, 22 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update about issues with mixing signed/unsigned types.
+------------------------------------------------------------------------
+r13280 | vlefevre | 2018-11-22 09:01:58 +0000 (Thu, 22 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added a note about the disallowed conversions between
+function pointers and other kinds of pointers (including to void *).
+------------------------------------------------------------------------
+r13279 | vlefevre | 2018-11-20 16:51:12 +0000 (Tue, 20 Nov 2018) | 4 lines
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Added a FIXME, which explains the current failure.
+But there is currently an inconsistency in mpfr_get_str, whose digits
+are not specified:
+ https://sympa.inria.fr/sympa/arc/mpfr/2018-11/msg00021.html
+------------------------------------------------------------------------
+r13278 | vlefevre | 2018-11-20 16:17:15 +0000 (Tue, 20 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Added random tests, which currently fail.
+------------------------------------------------------------------------
+r13276 | vlefevre | 2018-11-19 15:23:59 +0000 (Mon, 19 Nov 2018) | 3 lines
+Changed paths:
+ M /trunk/src/round_prec.c
+
+[src/round_prec.c] mpfr_can_round_raw: improved the code structure about
+rnd1 and rnd2, making clear that they are not changed several times;
+avoid the use of cc with 2 different meanings in the same code path.
+------------------------------------------------------------------------
+r13275 | zimmerma | 2018-11-17 09:47:41 +0000 (Sat, 17 Nov 2018) | 3 lines
+Changed paths:
+ M /trunk/src/round_prec.c
+
+[src/round_prec.c] fixed bug in mpfr_can_round when rnd2=RNDF, rnd1 is a
+ directed rounding, and the input is exact
+
+------------------------------------------------------------------------
+r13274 | vlefevre | 2018-11-16 15:06:27 +0000 (Fri, 16 Nov 2018) | 5 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: updated a FIXME comment.
+In short, the current tstrtofr.c tests seem to always be hard-to-round
+cases. The consequence is that some parts of the code are run, but not
+completely tested, because for these cases, some intermediate results,
+potentially incorrect, are thrown out due to the next Ziv iteration!
+------------------------------------------------------------------------
+r13273 | vlefevre | 2018-11-16 14:48:33 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: minor changes.
+------------------------------------------------------------------------
+r13272 | vlefevre | 2018-11-16 14:31:59 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: added log messages.
+------------------------------------------------------------------------
+r13271 | vlefevre | 2018-11-16 13:23:29 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Minor change to use MPFR_ASSERTD.
+------------------------------------------------------------------------
+r13270 | vlefevre | 2018-11-16 13:15:57 +0000 (Fri, 16 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/int_ceil_log2.c
+ M /trunk/src/mpfr-impl.h
+
+[src/{int_ceil_log2.c,mpfr-impl.h}] Consistent postcondition for
+MPFR_INT_CEIL_LOG2 and __gmpfr_int_ceil_log2 (result >= 0).
+------------------------------------------------------------------------
+r13269 | vlefevre | 2018-11-16 13:13:52 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/nbits_ulong.c
+
+[src/nbits_ulong.c] Code refactoring. Added {pre,post}condition.
+------------------------------------------------------------------------
+r13268 | vlefevre | 2018-11-16 12:50:13 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: removed an incorrect cast.
+------------------------------------------------------------------------
+r13267 | vlefevre | 2018-11-16 12:17:36 +0000 (Fri, 16 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: updated a FIXME comment (again,
+another issue).
+------------------------------------------------------------------------
+r13266 | vlefevre | 2018-11-16 12:09:24 +0000 (Fri, 16 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: updated a FIXME comment (there
+is another issue to solve first).
+------------------------------------------------------------------------
+r13265 | vlefevre | 2018-11-16 11:48:20 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/amd/mparam.h
+ M /trunk/src/arm/mparam.h
+ M /trunk/src/generic/coverage/mparam.h
+ M /trunk/src/mips/mparam.h
+ M /trunk/src/powerpc64/mparam.h
+ M /trunk/src/sparc64/mparam.h
+ M /trunk/src/x86/mparam.h
+ M /trunk/src/x86_64/core2/mparam.h
+ M /trunk/src/x86_64/mparam.h
Removed trailing whitespace.
------------------------------------------------------------------------
-r13252 | vlefevre | 2018-10-18 17:57:10 +0000 (Thu, 18 Oct 2018) | 3 lines
+r13264 | vlefevre | 2018-11-16 10:26:36 +0000 (Fri, 16 Nov 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/mpfr-longlong.h
+ M /trunk/src/strtofr.c
-[src/mpfr-longlong.h] Fix obsolete ARC asm constraints; see patch posted
-on <https://sympa.inria.fr/sympa/arc/mpfr/2018-10/msg00010.html>.
-(merged changeset r13251 from the trunk)
+[src/strtofr.c] parsed_string_to_mpfr: updated a comment (useless code
+in this function or incomplete tests).
------------------------------------------------------------------------
-r13245 | vlefevre | 2018-10-08 12:50:55 +0000 (Mon, 08 Oct 2018) | 2 lines
+r13263 | vlefevre | 2018-11-16 10:10:30 +0000 (Fri, 16 Nov 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/codespell.ignore
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/rndna.c
+
+Avoid GCC's -Wcast-align warnings with 8-bit limbs (a correct alignment
+is ensured by the code itself, and GCC cannot check just from a cast).
+------------------------------------------------------------------------
+r13262 | vlefevre | 2018-11-16 08:24:25 +0000 (Fri, 16 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: updated comments.
+------------------------------------------------------------------------
+r13261 | vlefevre | 2018-11-15 17:17:13 +0000 (Thu, 15 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: more code review, with minor
+changes and corrections + a FIXME.
+------------------------------------------------------------------------
+r13260 | vlefevre | 2018-11-15 11:35:55 +0000 (Thu, 15 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Typo.
+------------------------------------------------------------------------
+r13259 | vlefevre | 2018-11-15 10:22:47 +0000 (Thu, 15 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Fixed an allocation bug for GMP_NUMB_BITS = 8.
+------------------------------------------------------------------------
+r13258 | vlefevre | 2018-11-15 10:13:22 +0000 (Thu, 15 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Updated a comment: the issue with mpn_set_str found
+in 2013-12 (see r8722) was actually an error in the GMP manual.
+------------------------------------------------------------------------
+r13257 | vlefevre | 2018-11-15 10:02:17 +0000 (Thu, 15 Nov 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] parsed_string_to_mpfr: improved an assertion; comments.
+------------------------------------------------------------------------
+r13256 | zimmerma | 2018-11-15 09:43:43 +0000 (Thu, 15 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tcan_round.c
+
+[tests/tcan_round.c] fixed some TODOs, which exposes a bug
+
+------------------------------------------------------------------------
+r13255 | vlefevre | 2018-11-15 09:33:02 +0000 (Thu, 15 Nov 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Near the beginning of parsed_string_to_mpfr: corrected
+comments; added an assertion; minor change of a test.
+------------------------------------------------------------------------
+r13253 | zimmerma | 2018-11-10 08:25:31 +0000 (Sat, 10 Nov 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mulders.c
+ M /trunk/tune/tuneup.c
+
+[src/mulders.c] fixed issue with --enable-gmp-internals
+[tune/tuneup.c] likewise
+(see https://sympa.inria.fr/sympa/arc/mpfr/2018-11/msg00015.html)
+
+------------------------------------------------------------------------
+r13251 | zimmerma | 2018-10-18 09:03:52 +0000 (Thu, 18 Oct 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-longlong.h
+
+[src/mpfr-longlong.h] applied patch from https://sympa.inria.fr/sympa/arc/mpfr/2018-10/msg00010.html
+
+------------------------------------------------------------------------
+r13244 | vlefevre | 2018-10-07 10:36:45 +0000 (Sun, 07 Oct 2018) | 1 line
+Changed paths:
+ M /trunk/codespell.ignore
[codespell.ignore] Also ignore "ue" (codespell 1.14).
-(merged changeset r13244 from the trunk)
------------------------------------------------------------------------
-r13187 | vlefevre | 2018-09-13 13:06:47 +0000 (Thu, 13 Sep 2018) | 2 lines
+r13237 | vlefevre | 2018-10-01 15:36:47 +0000 (Mon, 01 Oct 2018) | 6 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tdiv_ui.c
+ M /trunk/configure.ac
+ M /trunk/src/Makefile.am
+
+[configure.ac,src/Makefile.am] About the --with-mini-gmp support, since
+there are some advantages with the new code, one will probably not go
+back. Thus removed the references to the Automake 1.15 bug and to the
+old code. Also removed the mini_gmp_path=. workaround needed with the
+old code (even with Automake 1.16), which had been added in r13217.
+Also slightly improved the setup for mini-gmp.
+------------------------------------------------------------------------
+r13236 | vlefevre | 2018-10-01 13:54:04 +0000 (Mon, 01 Oct 2018) | 1 line
+Changed paths:
+ M /trunk/doc/with-mini-gmp.patch
+
+[doc/with-mini-gmp.patch] Updated comment.
+------------------------------------------------------------------------
+r13235 | vlefevre | 2018-10-01 13:51:10 +0000 (Mon, 01 Oct 2018) | 8 lines
+Changed paths:
+ M /trunk/configure.ac
+ M /trunk/src/Makefile.am
+
+[configure.ac,src/Makefile.am] Avoid a "make" failure due to a bug in
+Automake 1.15 automatic dependency tracking: instead of using mini-gmp
+directly in an external directory with a $(mini_gmp_path) variable in
+src/Makefile.am, make the configure script add symbolic links to the
+mini-gmp sources in the build directory, and use these symbolic links
+for the MPFR build (as if they were plain files).
+Tested under various conditions: static and shared; separate source and
+build directories; changing the mini-gmp version without "make clean".
+------------------------------------------------------------------------
+r13233 | vlefevre | 2018-09-28 08:17:28 +0000 (Fri, 28 Sep 2018) | 6 lines
+Changed paths:
+ A /trunk/doc/with-mini-gmp.patch
+
+Added doc/with-mini-gmp.patch file (for the developers):
+Modifications to configure.ac and src/Makefile.am that had been done
+for --with-mini-gmp support. This is kept for the reference, as changes
+may be needed as a workaround to a bug fixed in GNU Automake 1.16, and
+other future changes might break things (to remember what was working
+at this time).
+------------------------------------------------------------------------
+r13230 | vlefevre | 2018-09-20 11:12:22 +0000 (Thu, 20 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[doc/mini-gmp] Update.
+------------------------------------------------------------------------
+r13229 | vlefevre | 2018-09-19 12:55:56 +0000 (Wed, 19 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/Makefile.am
+ M /trunk/configure.ac
+
+[Makefile.am] Distribute the doc/mini-gmp file.
+[configure.ac] For --with-mini-gmp, say:
+ "(experimental, please read doc/mini-gmp file)"
+------------------------------------------------------------------------
+r13228 | vlefevre | 2018-09-19 12:47:03 +0000 (Wed, 19 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] Added nodist_ for mini-gmp.{c,h} so that these files
+(not part of MPFR) are not put in the tarballs by "make dist".
+------------------------------------------------------------------------
+r13227 | vlefevre | 2018-09-19 12:17:20 +0000 (Wed, 19 Sep 2018) | 4 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/configure.ac
+ M /trunk/doc/mini-gmp
+
+Removed --enable-mini-gmp configure option.
+ * NEWS: say that it is replaced by --with-mini-gmp.
+ * configure.ac: --enable-mini-gmp removed.
+ * doc/mini-gmp: update.
+------------------------------------------------------------------------
+r13226 | vlefevre | 2018-09-19 11:50:17 +0000 (Wed, 19 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] Missing #else (from r13156).
+------------------------------------------------------------------------
+r13225 | vlefevre | 2018-09-19 11:36:03 +0000 (Wed, 19 Sep 2018) | 5 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] When using --with-mini-gmp, define GMP_NUMB_BITS if this
+macro is not already defined in mini-gmp.h (this is done a bit like
+with --enable-mini-gmp, but the handling in this option is buggy as
+GMP_NUMB_BITS is defined with AC_DEFINE_UNQUOTED unconditionally,
+though is most cases the contents of the macros are the same).
+------------------------------------------------------------------------
+r13224 | vlefevre | 2018-09-19 10:59:02 +0000 (Wed, 19 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Do not split "Setup GMP detection". When building
+MPFR against mini-gmp, do not run any "Setup GMP detection" test
+(in particular, no longer check gmp.h, as it is useless).
+------------------------------------------------------------------------
+r13223 | vlefevre | 2018-09-19 10:44:08 +0000 (Wed, 19 Sep 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.h
+
+[src/mpfr-mini-gmp.h] Removed incorrect GMP_NUMB_BITS macro definition,
+and this macro needs to be usable in preprocessor tests, and sizeof and
+types are not available at this level. GMP_NUMB_BITS must be defined by
+mini-gmp.h, by the configure script, or by the user.
+------------------------------------------------------------------------
+r13222 | vlefevre | 2018-09-19 00:21:16 +0000 (Wed, 19 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Update due to r13221.
+------------------------------------------------------------------------
+r13221 | vlefevre | 2018-09-18 13:59:54 +0000 (Tue, 18 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/Makefile.am
+
+[tests/Makefile.am] Run tversion at the beginning of the tests,
+then show its output and svnversion's output too.
+------------------------------------------------------------------------
+r13220 | vlefevre | 2018-09-18 08:10:40 +0000 (Tue, 18 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.h
+
+[src/mpfr-mini-gmp.h] Added a FIXME (failure with a mini-gmp that
+does not define GMP_NUMB_BITS, such as the official one).
+------------------------------------------------------------------------
+r13219 | vlefevre | 2018-09-18 01:47:06 +0000 (Tue, 18 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/random2.c
+
+[tests/random2.c] Avoid undefined behavior on shift count.
+------------------------------------------------------------------------
+r13218 | vlefevre | 2018-09-18 01:45:39 +0000 (Tue, 18 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Fixed MPFR_LIMB_MASK() macro.
+------------------------------------------------------------------------
+r13217 | vlefevre | 2018-09-18 01:17:52 +0000 (Tue, 18 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Avoid a configure failure with automatic dependency
+tracking when --with-mini-gmp is not used (bug in Automake?).
+------------------------------------------------------------------------
+r13216 | vlefevre | 2018-09-18 00:00:24 +0000 (Tue, 18 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] + Mini-gmp support via the --with-mini-gmp configure option.
+------------------------------------------------------------------------
+r13214 | vlefevre | 2018-09-17 23:55:55 +0000 (Mon, 17 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk
+ M /trunk/configure.ac
+ M /trunk/doc/mini-gmp
+ M /trunk/src/Makefile.am
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr.h
+
+Merged the with-mini-gmp branch into the trunk: new --with-mini-gmp
+configure option to build MPFR against mini-gmp (instead of GMP).
+------------------------------------------------------------------------
+r13211 | vlefevre | 2018-09-17 15:01:51 +0000 (Mon, 17 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mul_ui.c
+
+[src/mul_ui.c] Better code organization (with the MPFR_RET at the right
+place). Corrected indentation after #else.
+------------------------------------------------------------------------
+r13210 | zimmerma | 2018-09-17 14:40:01 +0000 (Mon, 17 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/mul_ui.c
+
+[src/mpfr-mini-gmp.c] added #if 0 ... #endif for mpz_dump (unused)
+[src/mul_ui.c] fixed compiler warning for limb < long
+
+------------------------------------------------------------------------
+r13207 | vlefevre | 2018-09-17 10:08:51 +0000 (Mon, 17 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/random2.c
+
+[tests/random2.c] Fix for 8-bit limb.
+------------------------------------------------------------------------
+r13205 | vlefevre | 2018-09-17 09:17:18 +0000 (Mon, 17 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Define only one buffer in test_version().
+------------------------------------------------------------------------
+r13204 | vlefevre | 2018-09-17 09:14:21 +0000 (Mon, 17 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/random2.c
+
+[tests/random2.c] Improved code by using MPFR_LIMB_* macros.
+------------------------------------------------------------------------
+r13203 | vlefevre | 2018-09-17 09:04:58 +0000 (Mon, 17 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Improved MPFR_LIMB_* macros for mp_limb_t < int
+(e.g. 16-bit or 8-bit limb), as in such a case, integer promotion
+transforms mp_limb_t to int.
+------------------------------------------------------------------------
+r13202 | zimmerma | 2018-09-17 07:56:07 +0000 (Mon, 17 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] fixed compiler warning
+
+------------------------------------------------------------------------
+r13200 | vlefevre | 2018-09-14 21:46:06 +0000 (Fri, 14 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_si.c
+
+[src/get_si.c] Code refactoring/simplification like what has been
+done for get_ui.c in r13185, fixing also an integer overflow when
+MPFR_LONG_WITHIN_LIMB is not defined.
+------------------------------------------------------------------------
+r13199 | vlefevre | 2018-09-14 15:28:12 +0000 (Fri, 14 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/random2.c
+
+[tests/random2.c] Fix for 16-bit limb.
+------------------------------------------------------------------------
+r13198 | vlefevre | 2018-09-14 15:19:38 +0000 (Fri, 14 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/add1.c
+
+[src/add1.c] Fix for 16-bit limb.
+------------------------------------------------------------------------
+r13197 | vlefevre | 2018-09-14 15:04:09 +0000 (Fri, 14 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] Fixed bug in add_ssaaaa / sub_ddmmss from r13081.
+------------------------------------------------------------------------
+r13194 | vlefevre | 2018-09-14 13:03:24 +0000 (Fri, 14 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] Moved a comment in a better place.
+------------------------------------------------------------------------
+r13191 | vlefevre | 2018-09-14 11:19:31 +0000 (Fri, 14 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Typo.
+------------------------------------------------------------------------
+r13189 | vlefevre | 2018-09-14 11:13:50 +0000 (Fri, 14 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated comments about configure options for mini-gmp.
+------------------------------------------------------------------------
+r13188 | zimmerma | 2018-09-13 16:27:28 +0000 (Thu, 13 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsin.c
+
+[tests/tsin.c] reduce REDUCE_EMAX with mini-gmp
+
+------------------------------------------------------------------------
+r13186 | vlefevre | 2018-09-13 13:03:53 +0000 (Thu, 13 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/get_ui.c
+
+[src/get_ui.c] Added assertions.
+------------------------------------------------------------------------
+r13185 | vlefevre | 2018-09-13 13:01:05 +0000 (Thu, 13 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/get_ui.c
+
+[src/get_ui.c] Code refactoring/simplification.
+------------------------------------------------------------------------
+r13184 | vlefevre | 2018-09-13 11:04:50 +0000 (Thu, 13 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/sin_cos.c
+
+[src/sin_cos.c] Added assertions protecting against buffer overflow.
+------------------------------------------------------------------------
+r13183 | zimmerma | 2018-09-13 08:46:01 +0000 (Thu, 13 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sin_cos.c
+
+[src/sin_cos.c] fix for small limb size
+
+------------------------------------------------------------------------
+r13182 | vlefevre | 2018-09-12 14:32:42 +0000 (Wed, 12 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.h
+
+[src/mpfr-mini-gmp.h] Fix: Since gmp_version is not defined in mini-gmp,
+we must not declare it (otherwise one would get a link failure instead
+of a compilation failure if gmp_version is used by mistake).
+------------------------------------------------------------------------
+r13181 | vlefevre | 2018-09-12 14:28:03 +0000 (Wed, 12 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Improved change in r13179 for mini-gmp.
+------------------------------------------------------------------------
+r13180 | vlefevre | 2018-09-12 13:39:57 +0000 (Wed, 12 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Do not check for CC and CFLAGS in gmp.h if mini-gmp is
+used, i.e. if --enable-mini-gmp (current option) or --with-mini-gmp
+(future option) is given.
+------------------------------------------------------------------------
+r13179 | zimmerma | 2018-09-12 13:32:33 +0000 (Wed, 12 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] libgmp is not defined with mini-gmp (issue found with -O0)
+
+------------------------------------------------------------------------
+r13178 | vlefevre | 2018-09-12 12:48:50 +0000 (Wed, 12 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.h
+
+[src/mpfr-mini-gmp.h] Removed #include lines as mpfr-mini-gmp.h is
+included only in mpfr-impl.h, which already does these #include's.
+------------------------------------------------------------------------
+r13177 | vlefevre | 2018-09-12 12:21:53 +0000 (Wed, 12 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Check that MPFR_HAVE_GMP_IMPL and MPFR_USE_MINI_GMP
+are not both defined.
+------------------------------------------------------------------------
+r13176 | vlefevre | 2018-09-12 12:19:21 +0000 (Wed, 12 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] Removed #include "mpfr-mini-gmp.h" as this include
+is already done in mpfr-impl.h (in both cases, when MPFR_USE_MINI_GMP is
+defined).
+------------------------------------------------------------------------
+r13175 | vlefevre | 2018-09-12 12:11:04 +0000 (Wed, 12 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/rec_sqrt.c
+
+[src/rec_sqrt.c] Replaced "if (GMP_NUMB_BITS >= 16)" by a preprocessor
+test "#if GMP_NUMB_BITS >= 16" like earlier. Use static assertions.
+------------------------------------------------------------------------
+r13174 | vlefevre | 2018-09-12 10:43:22 +0000 (Wed, 12 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/rec_sqrt.c
+
+[src/rec_sqrt.c] Fixed types for 8-bit limb. Removed useless casts.
+------------------------------------------------------------------------
+r13173 | vlefevre | 2018-09-12 10:26:45 +0000 (Wed, 12 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/rec_sqrt.c
+
+[src/rec_sqrt.c] Fixed a type from r13172 (int was obviously too short
+and was yielding a segmentation fault).
+------------------------------------------------------------------------
+r13172 | zimmerma | 2018-09-11 20:59:57 +0000 (Tue, 11 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/rec_sqrt.c
+
+[src/rec_sqrt.c] fixed for 8-bit limb
+
+------------------------------------------------------------------------
+r13171 | zimmerma | 2018-09-11 12:01:25 +0000 (Tue, 11 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tcan_round.c
+
+[tests/tcan_round.c] fixed test for small value of GMP_NUMB_BITS
+
+------------------------------------------------------------------------
+r13170 | zimmerma | 2018-09-11 10:45:39 +0000 (Tue, 11 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] fixed r13168: in case exact=0, mpn_rshift was not done
+
+------------------------------------------------------------------------
+r13169 | zimmerma | 2018-09-11 09:37:07 +0000 (Tue, 11 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] modified test_sqrt1n() so that it passes with 8-bit limbs
+
+------------------------------------------------------------------------
+r13168 | vlefevre | 2018-09-11 09:00:21 +0000 (Tue, 11 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Replaced "exact &=" by "exact = exact &&" as usual.
+------------------------------------------------------------------------
+r13167 | zimmerma | 2018-09-11 08:49:53 +0000 (Tue, 11 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] fix for 8-bit limb
+
+------------------------------------------------------------------------
+r13166 | zimmerma | 2018-09-11 07:39:16 +0000 (Tue, 11 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] added comment
+
+------------------------------------------------------------------------
+r13165 | vlefevre | 2018-09-10 23:50:38 +0000 (Mon, 10 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r13164 | zimmerma | 2018-09-10 19:17:57 +0000 (Mon, 10 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+ M /trunk/tests/tget_str.c
+
+[src/strtofr.c] fix from r13163 was incorrect
+[tests/tget_str.c] added a testcase, and fixed an error message
+
+------------------------------------------------------------------------
+r13163 | zimmerma | 2018-09-08 17:00:40 +0000 (Sat, 08 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] resolved a FIXME
+
+------------------------------------------------------------------------
+r13162 | zimmerma | 2018-09-08 14:02:13 +0000 (Sat, 08 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv_ui.c
[tests/tdiv_ui.c] fixed corner_cases() test
-(merged changeset r13162 from the trunk)
+
+------------------------------------------------------------------------
+r13161 | zimmerma | 2018-09-08 11:39:54 +0000 (Sat, 08 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/int_ceil_log2.c
+
+[src/int_ceil_log2.c] fixed __gmpfr_int_ceil_log2 for limb < long
+
+------------------------------------------------------------------------
+r13160 | zimmerma | 2018-09-07 20:26:15 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/random2.c
+
+[tests/random2.c] fixed mpfr_random2 for GMP_NUMB_BITS <> 64
+
+------------------------------------------------------------------------
+r13159 | zimmerma | 2018-09-07 19:16:34 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] fixed another compiler warning
+
+------------------------------------------------------------------------
+r13158 | zimmerma | 2018-09-07 19:14:29 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_ui.c
+
+[src/get_ui.c] fixed compiler warning
+
+------------------------------------------------------------------------
+r13157 | zimmerma | 2018-09-07 17:12:46 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/rec_sqrt.c
+ M /trunk/src/set_d.c
+
+some fixes for 8-bit limb support
+
+------------------------------------------------------------------------
+r13156 | zimmerma | 2018-09-07 15:17:37 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/constant.c
+ M /trunk/src/get_d64.c
+ M /trunk/src/get_ld.c
+ M /trunk/src/get_str.c
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/mpfr-mini-gmp.h
+ M /trunk/src/rec_sqrt.c
+ M /trunk/src/set_d.c
+ M /trunk/src/set_d64.c
+ M /trunk/src/set_ld.c
+
+adapt to 8-bit limbs (work in progress)
+
+------------------------------------------------------------------------
+r13155 | zimmerma | 2018-09-07 11:59:57 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tl2b.c
+
+[tests/tl2b.c] extend to 8-bit limb
+
+------------------------------------------------------------------------
+r13154 | zimmerma | 2018-09-07 11:49:13 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] fix for 8-bit limb
+
+------------------------------------------------------------------------
+r13153 | vlefevre | 2018-09-07 09:23:57 +0000 (Fri, 07 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Added @tie{} (normal non-breakable space) at various
+places to avoid unwanted line breaking.
+------------------------------------------------------------------------
+r13152 | vlefevre | 2018-09-07 08:45:54 +0000 (Fri, 07 Sep 2018) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] mpfr_rootn_ui, mpfr_root: changed k to n in order to
+match IEEE 754-2008. Also improved the description of mpfr_rootn_ui,
+mentioning the P754/D2.41 draft of the next IEEE 754 standard because
+IEEE 754-2008 is incomplete.
+------------------------------------------------------------------------
+r13151 | vlefevre | 2018-09-06 10:44:48 +0000 (Thu, 06 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] !mpfr_equal_p is better than mpfr_cmp.
+------------------------------------------------------------------------
+r13150 | zimmerma | 2018-09-06 07:56:44 +0000 (Thu, 06 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/rint.c
+
+[src/rint.c] fixed bug with 16-bit limb
+ (found by trint with GMP_CHECK_RANDOMIZE=1536206745598891)
+
+------------------------------------------------------------------------
+r13149 | zimmerma | 2018-09-06 07:33:45 +0000 (Thu, 06 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] fixed test_20151023()
+
+------------------------------------------------------------------------
+r13148 | vlefevre | 2018-09-06 07:15:25 +0000 (Thu, 06 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/get_d64.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/ui_div.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r13147 | vlefevre | 2018-09-06 06:46:40 +0000 (Thu, 06 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] Removed incorrect and useless assertions (manl
+has exactly 32 bits, thus a shift count of 32 bits is invalid,
+but also useless).
+------------------------------------------------------------------------
+r13146 | zimmerma | 2018-09-05 16:17:58 +0000 (Wed, 05 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] fixed (hopefully definitively) for 16-bit limb
+
+------------------------------------------------------------------------
+r13145 | vlefevre | 2018-09-05 15:53:50 +0000 (Wed, 05 Sep 2018) | 4 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] 2 fixes concerning rp[]:
+ * If GMP_NUMB_BITS >= 64, there is a shift of 32 bits, thus one
+ uses mp_limb_t (> 32 bits) instead of unsigned int.
+ * Otherwise use unsigned long as an unsigned int might be on 16 bits.
+------------------------------------------------------------------------
+r13144 | vlefevre | 2018-09-05 15:26:46 +0000 (Wed, 05 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Indentation.
+------------------------------------------------------------------------
+r13143 | vlefevre | 2018-09-05 15:23:00 +0000 (Wed, 05 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/exp_2.c
+ A /trunk/src/nbits_ulong.c
+
+[src] Moved mpfr_nbits_ulong to its own file "nbits_ulong.c".
+------------------------------------------------------------------------
+r13142 | vlefevre | 2018-09-05 15:17:56 +0000 (Wed, 05 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/pow_si.c
+
+[src/pow_si.c] MPFR_NEED_LONGLONG_H is still needed.
+------------------------------------------------------------------------
+r13141 | vlefevre | 2018-09-05 14:56:48 +0000 (Wed, 05 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Removed xxx suffix added in r13139 (by mistake?).
+------------------------------------------------------------------------
+r13140 | zimmerma | 2018-09-05 14:30:57 +0000 (Wed, 05 Sep 2018) | 4 lines
+Changed paths:
+ M /trunk/src/exp_2.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/pow_si.c
+
+[src/exp_2.c] export (internally) nbits_ulong (renamed to mpfr_nbits_ulong)
+[src/mpfr-impl.h] added prototype for mpfr_nbits_ulong
+[src/pow_si.c] fixed for 16-bit limb
+
+------------------------------------------------------------------------
+r13139 | zimmerma | 2018-09-05 13:18:11 +0000 (Wed, 05 Sep 2018) | 4 lines
+Changed paths:
+ M /trunk/src/get_d64.c
+ M /trunk/src/set_d64.c
+ M /trunk/tests/tget_set_d64.c
+
+[src/get_d64.c] fixed for 16-bit limb
+[src/set_d64.c] likewise
+[tests/tget_set_d64.c] improved error message
+
+------------------------------------------------------------------------
+r13137 | vlefevre | 2018-09-05 11:52:06 +0000 (Wed, 05 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] In the case GMP_NUMB_BITS == 16, cast to unsigned long
+instead of unsigned int since shift counts can be up to 16 and an int
+might be on 16 bits only.
+------------------------------------------------------------------------
+r13136 | zimmerma | 2018-09-05 10:36:30 +0000 (Wed, 05 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] when denorm=16, a 32-bit shift on an unsigned int is undefined
+
+------------------------------------------------------------------------
+r13135 | zimmerma | 2018-09-05 10:20:36 +0000 (Wed, 05 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/exp_2.c
+ M /trunk/tests/texp.c
+
+[src/exp_2.c] fix for 16-bit limb
+[tests/texp.c] improve error message
+
+------------------------------------------------------------------------
+r13134 | zimmerma | 2018-09-05 08:25:33 +0000 (Wed, 05 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/tests/terandom_chisq.c
+
+[src/mpfr-mini-gmp.c] fixed gmp_urandomb_ui for 16-bit limb, added mpz_dump
+[tests/terandom_chisq.c] more details in case of error
+
+------------------------------------------------------------------------
+r13133 | zimmerma | 2018-09-05 07:11:49 +0000 (Wed, 05 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] fixed typo
+
+------------------------------------------------------------------------
+r13132 | vlefevre | 2018-09-04 17:29:15 +0000 (Tue, 04 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tset_z_exp.c
+
+[tests/tset_z_exp.c] Avoid a GCC bug.
+------------------------------------------------------------------------
+r13131 | vlefevre | 2018-09-04 16:41:18 +0000 (Tue, 04 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tset_z_exp.c
+
+[tests/tset_z_exp.c] Attempt to fix randexp, but GCC complains.
+------------------------------------------------------------------------
+r13130 | vlefevre | 2018-09-04 16:06:38 +0000 (Tue, 04 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpn_exp.c
+
+[src/mpn_exp.c] Avoid useless "while" in nbits_mpfr_exp_t.
+------------------------------------------------------------------------
+r13129 | zimmerma | 2018-09-04 15:27:36 +0000 (Tue, 04 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tset_ld.c
+
+[tests/tset_ld.c] give more digits in case of error
+[tests/tget_ld_2exp.c] added one test (currently fails for 16-bit limb)
+
+------------------------------------------------------------------------
+r13128 | zimmerma | 2018-09-04 15:20:19 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] partial fix for 16-bit limb (typo + nice bug!)
+
+------------------------------------------------------------------------
+r13127 | zimmerma | 2018-09-04 14:50:57 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tset_z_exp.c
+
+[tests/tset_z_exp.c] fixed infinite loop in test code for limb < mpfr_exp_t
+
+------------------------------------------------------------------------
+r13126 | zimmerma | 2018-09-04 14:33:27 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpn_exp.c
+
+[src/mpn_exp.c] adapt to bitsize(mpfr_exp_t) > GMP_NUMB_BITS
+
+------------------------------------------------------------------------
+r13125 | vlefevre | 2018-09-04 14:19:31 +0000 (Tue, 04 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/div.c
+
+[src/div.c] Code simplification.
------------------------------------------------------------------------
-r13010 | vlefevre | 2018-08-22 13:52:40 +0000 (Wed, 22 Aug 2018) | 3 lines
+r13124 | vlefevre | 2018-09-04 14:14:39 +0000 (Tue, 04 Sep 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tversion.c
+ M /trunk/src/round_prec.c
+
+[src/round_prec.c] MPFR_LIMB is actually useless now...
+------------------------------------------------------------------------
+r13123 | vlefevre | 2018-09-04 14:11:39 +0000 (Tue, 04 Sep 2018) | 1 line
+Changed paths:
+ M /trunk/src/round_prec.c
+
+[src/round_prec.c] Code style and potential correction for 16-bit limb.
+------------------------------------------------------------------------
+r13122 | vlefevre | 2018-09-04 14:06:25 +0000 (Tue, 04 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sqrt_ui.c
+
+[src/sqrt_ui.c] Moved MPFR_SAVE_EXPO_FREE after mpfr_sqrt because
+the uu argument may be out of range and there is no guarantee that
+mpfr_sqrt can handle that. Improved consistency; code refactoring.
+------------------------------------------------------------------------
+r13121 | zimmerma | 2018-09-04 13:33:35 +0000 (Tue, 04 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/round_prec.c
+ M /trunk/tests/tcan_round.c
+
+[src/round_prec.c] fixed for 16-bit limb
+[tests/tcan_round.c] improve error message
+
+------------------------------------------------------------------------
+r13120 | zimmerma | 2018-09-04 13:33:02 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqrt_ui.c
+
+[src/sqrt_ui.c] fixed for 16-bit limb
+
+------------------------------------------------------------------------
+r13119 | vlefevre | 2018-09-04 10:44:33 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_si.c
+
+[src/get_si.c] Make sure that a left shift is done on an unsigned type
+(as a left shift on a 0 of signed type was not specified by C90).
+------------------------------------------------------------------------
+r13118 | zimmerma | 2018-09-04 09:21:29 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div.c
+
+[src/div.c] fix for 16-bit limbs, and added comments
+
+------------------------------------------------------------------------
+r13117 | zimmerma | 2018-09-04 09:13:50 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/rint.c
+
+[src/rint.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13116 | zimmerma | 2018-09-04 09:12:07 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] more detailed error message
+
+------------------------------------------------------------------------
+r13115 | zimmerma | 2018-09-04 09:10:34 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_si.c
+
+[src/get_si.c] forgot cast when long > limb
+
+------------------------------------------------------------------------
+r13114 | zimmerma | 2018-09-04 09:10:11 +0000 (Tue, 04 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_ui.c
+
+[src/get_ui.c] forgot cast when long > limb
+
+------------------------------------------------------------------------
+r13113 | zimmerma | 2018-09-03 19:35:31 +0000 (Mon, 03 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/odd_p.c
+
+[src/odd_p.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13112 | zimmerma | 2018-09-03 19:19:20 +0000 (Mon, 03 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tbeta.c
+
+[tests/tbeta.c] exit at the first error
+
+------------------------------------------------------------------------
+r13111 | zimmerma | 2018-09-03 15:52:18 +0000 (Mon, 03 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_si.c
+ M /trunk/src/get_ui.c
+
+[src/get_si.c] adapt to 16-bit limbs
+[src/get_ui.c] likewise
+
+------------------------------------------------------------------------
+r13110 | zimmerma | 2018-09-03 14:05:11 +0000 (Mon, 03 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/cmp_si.c
+ M /trunk/src/cmp_ui.c
+
+[src/cmp_si.c] adapt for reduced exponent range for 16-bit limbs
+[src/cmp_ui.c] likewise
+
+------------------------------------------------------------------------
+r13109 | vlefevre | 2018-09-03 13:32:24 +0000 (Mon, 03 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/tests/mpfr-test.h
+
+[tests/mpfr-test.h] If MPFR_TESTS_ABORT is defined, replace exit(1) by
+ abort(), thus with a core dump.
+[doc/README.dev] Document MPFR_TESTS_ABORT.
+------------------------------------------------------------------------
+r13108 | zimmerma | 2018-09-03 13:17:45 +0000 (Mon, 03 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mul_ui.c
+ M /trunk/tests/tgeneric.c
+
+[tests/tgeneric.c] revert 13107 (abort might lose some data in open files)
+[src/mul_ui.c] fixed for 16-bit limb and reduced exponent range
+
+------------------------------------------------------------------------
+r13107 | zimmerma | 2018-09-03 12:38:10 +0000 (Mon, 03 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tgeneric.c
+
+[tests/tgeneric.c] replace exit(1) by abort() to allow debugging with gdb
+
+------------------------------------------------------------------------
+r13106 | zimmerma | 2018-09-03 12:09:07 +0000 (Mon, 03 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/isinteger.c
+
+[src/isinteger.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13105 | zimmerma | 2018-09-03 08:35:17 +0000 (Mon, 03 Sep 2018) | 3 lines
+Changed paths:
+ M /trunk/src/cmp_si.c
+ M /trunk/src/cmp_ui.c
+
+[src/cmp_si.c] fixed error for 16-bit limb
+[src/cmp_ui.c] adapted to 16-bit limb
+
+------------------------------------------------------------------------
+r13104 | zimmerma | 2018-09-01 08:15:20 +0000 (Sat, 01 Sep 2018) | 2 lines
+Changed paths:
+ M /trunk/src/cmp_si.c
+
+[src/cmp_si.c] adapt for 16-bit limb
+
+------------------------------------------------------------------------
+r13103 | zimmerma | 2018-08-31 19:22:05 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mul_ui.c
+
+[src/mul_ui.c] adapt for 16-bit limb
+
+------------------------------------------------------------------------
+r13102 | vlefevre | 2018-08-31 15:43:48 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] Fixed potential undefined behavior (when mp_limb_t
+is defined as an unsigned short) with MPFR_LIMB_LSHIFT.
+------------------------------------------------------------------------
+r13101 | vlefevre | 2018-08-31 15:40:23 +0000 (Fri, 31 Aug 2018) | 4 lines
+Changed paths:
+ M /trunk/src/add1.c
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Define MPFR_LIMB_LSHIFT(x,c) macro to do a left shift,
+making sure that the shifted argument is unsigned (needed due to the
+integer promotion rules when mp_limb_t is defined as an unsigned short).
+[src/add1.c] Fixed potential undefined behavior with MPFR_LIMB_LSHIFT.
+------------------------------------------------------------------------
+r13100 | vlefevre | 2018-08-31 15:12:20 +0000 (Fri, 31 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Corrected a comment and added a warning.
+------------------------------------------------------------------------
+r13099 | zimmerma | 2018-08-31 14:57:31 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] fix MPFR_INT_CEIL_LOG2 for 16-bit limb
+
+------------------------------------------------------------------------
+r13098 | zimmerma | 2018-08-31 14:47:05 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_si_2exp.c
+
+[src/set_si_2exp.c] support 16-bit limbs
+
+------------------------------------------------------------------------
+r13097 | vlefevre | 2018-08-31 14:35:07 +0000 (Fri, 31 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_ui_2exp.c
+
+[src/set_ui_2exp.c] Code formatting. Removed a FIXME (done in r13078).
+------------------------------------------------------------------------
+r13096 | zimmerma | 2018-08-31 14:32:09 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] missing cast
+
+------------------------------------------------------------------------
+r13095 | zimmerma | 2018-08-31 14:13:52 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tgeneric.c
+ M /trunk/tests/tmul.c
+
+removed TEST_FLAGS stuff
+
+------------------------------------------------------------------------
+r13094 | vlefevre | 2018-08-31 12:14:37 +0000 (Fri, 31 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] More correction about the MPFR_TESTS_TIMEOUT macro.
+------------------------------------------------------------------------
+r13093 | vlefevre | 2018-08-31 12:09:03 +0000 (Fri, 31 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Clarification about MPFR_TESTS_TIMEOUT.
+------------------------------------------------------------------------
+r13092 | vlefevre | 2018-08-31 11:57:08 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Reverted r13090: this was already mentioned at the
+right place (do not mix up macros and environment variables).
+------------------------------------------------------------------------
+r13091 | zimmerma | 2018-08-31 11:54:51 +0000 (Fri, 31 Aug 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mul.c
+ M /trunk/src/ui_div.c
+
+[src/mpfr-gmp.h] added missing udiv_qrnnd for 16-bit limb
+[src/mul.c] fixed for 16-bit limb
+[src/ui_div.c] likewise
+
+------------------------------------------------------------------------
+r13090 | zimmerma | 2018-08-31 11:37:01 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[README.dev] mention that MPFR_TESTS_TIMEOUT only works with --enable-tests-timeout
+
+------------------------------------------------------------------------
+r13089 | vlefevre | 2018-08-31 11:06:40 +0000 (Fri, 31 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Fix for MS Windows.
+------------------------------------------------------------------------
+r13088 | vlefevre | 2018-08-31 10:43:50 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Make sure that MPFR_LONG_WITHIN_LIMB is defined if
+__GMP_SHORT_LIMB is not defined, as required by the current code.
+------------------------------------------------------------------------
+r13087 | vlefevre | 2018-08-31 10:22:40 +0000 (Fri, 31 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] Untabified.
+------------------------------------------------------------------------
+r13086 | zimmerma | 2018-08-31 09:48:01 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] fixed wrong #ifdef
+
+------------------------------------------------------------------------
+r13085 | zimmerma | 2018-08-31 09:39:36 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[src/mpfr-mini-gmp.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13084 | zimmerma | 2018-08-31 09:29:16 +0000 (Fri, 31 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/add1.c
+ M /trunk/tests/tadd.c
+
+[src/add1.c] fix for 16-bit limb
+[tests/tadd.c] more output in case of error
+
+------------------------------------------------------------------------
+r13083 | zimmerma | 2018-08-31 08:11:01 +0000 (Fri, 31 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1.c
+
+[src/add1.c] fixed compiler warning
+
+------------------------------------------------------------------------
+r13082 | zimmerma | 2018-08-31 08:07:00 +0000 (Fri, 31 Aug 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/sub1sp.c
+
+[src/mpfr-gmp.h] removed leftover debug statement
+[src/mpfr-impl.h] added MPFR_LIMB macro
+[src/sub1sp.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13081 | zimmerma | 2018-08-30 12:07:56 +0000 (Thu, 30 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-gmp.h] more changes for 16-bit limb
+[src/mpfr-impl.h] mpfr-longlong.h should not be used for limb < long
+
+------------------------------------------------------------------------
+r13080 | zimmerma | 2018-08-30 10:56:29 +0000 (Thu, 30 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[mpfr-gmp.h] added comment
+
+------------------------------------------------------------------------
+r13079 | zimmerma | 2018-08-30 08:21:22 +0000 (Thu, 30 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-mini-gmp.c
+
+[mpfr-mini-gmp.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13078 | zimmerma | 2018-08-30 08:09:21 +0000 (Thu, 30 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_ui_2exp.c
+
+[src/set_ui_2exp.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13077 | zimmerma | 2018-08-29 15:41:21 +0000 (Wed, 29 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/round_p.c
+
+[src/round_p.c] gmp_fprintf is not defined in mini-gmp
+
+------------------------------------------------------------------------
+r13076 | zimmerma | 2018-08-29 15:28:35 +0000 (Wed, 29 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tadd.c
+
+[tests/tadd.c] fix for 16-bit limb
+
+------------------------------------------------------------------------
+r13075 | zimmerma | 2018-08-29 15:21:38 +0000 (Wed, 29 Aug 2018) | 6 lines
+Changed paths:
+ M /trunk/src/add1.c
+
+[src/add1.c] revert previous commit since it does not remove the warning:
+add1.c: In function ‘mpfr_add1’:
+add1.c:407:30: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context]
+ if (difs && (cprev << (GMP_NUMB_BITS - difs)))
+ ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
+
+------------------------------------------------------------------------
+r13074 | zimmerma | 2018-08-29 15:18:45 +0000 (Wed, 29 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1.c
+
+[src/add1.c] fixed compiler warning (with gcc 8.2.0)
+
+------------------------------------------------------------------------
+r13073 | vlefevre | 2018-08-29 10:30:11 +0000 (Wed, 29 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] Added a comment about a spurious failure
+with MPFR_RNDF if RND_LOOP_NO_RNDF were not used.
+------------------------------------------------------------------------
+r13072 | vlefevre | 2018-08-28 21:25:46 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsinh.c
+
+[tests/tsinh.c] Fixed test introduced in r13047.
+------------------------------------------------------------------------
+r13071 | vlefevre | 2018-08-28 21:06:22 +0000 (Tue, 28 Aug 2018) | 4 lines
+Changed paths:
+ M /trunk/src/add_ui.c
+ M /trunk/src/sub_ui.c
+ M /trunk/src/ui_sub.c
+
+[src/{add_ui.c,sub_ui.c,ui_sub.c}] Fixed the bug introduced in r13066
+for the cases where MPFR_LONG_WITHIN_LIMB is defined (make sure that a
+significand allocated in the stack is not freed before the associated
+mpfr_t object).
+------------------------------------------------------------------------
+r13070 | vlefevre | 2018-08-28 20:41:10 +0000 (Tue, 28 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Extend the exponent range in the case where
+MPFR_LONG_WITHIN_LIMB is not defined, resolving the FIXME.
+Note: a test was already there in tdiv_ui via the generic tests.
+------------------------------------------------------------------------
+r13069 | vlefevre | 2018-08-28 20:32:34 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] Disabled rnd=MPFR_RNDF in a loop as this now fails.
+------------------------------------------------------------------------
+r13068 | vlefevre | 2018-08-28 20:29:42 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] Corrected an error message.
+------------------------------------------------------------------------
+r13067 | vlefevre | 2018-08-28 20:26:21 +0000 (Tue, 28 Aug 2018) | 4 lines
+Changed paths:
+ M /trunk/src/div.c
+ M /trunk/src/div_ui.c
+
+[src/div.c] Avoid an infinite recursion when MPFR_LONG_WITHIN_LIMB
+is not defined (mpfr_div calls mpfr_div_ui, which calls mpfr_div).
+[src/div_ui.c] Made the preprocessor test on MPFR_LONG_WITHIN_LIMB
+consistent with the ones in the other .c files.
+------------------------------------------------------------------------
+r13066 | vlefevre | 2018-08-28 20:10:44 +0000 (Tue, 28 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/add_ui.c
+ M /trunk/src/sub_ui.c
+ M /trunk/src/ui_sub.c
+
+[src/{add_ui.c,sub_ui.c,ui_sub.c}] Fixed the cases where
+MPFR_LONG_WITHIN_LIMB is not defined (regression in the
+latest changes). Also avoid unused variables.
+------------------------------------------------------------------------
+r13065 | vlefevre | 2018-08-28 19:44:37 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsubnormal.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r13064 | vlefevre | 2018-08-28 18:25:05 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/ui_sub.c
+
+[src/ui_sub.c] Extend the exponent range early enough.
+------------------------------------------------------------------------
+r13063 | vlefevre | 2018-08-28 18:23:38 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/add_ui.c
+
+[src/add_ui.c] Extend the exponent range early enough.
+------------------------------------------------------------------------
+r13062 | vlefevre | 2018-08-28 17:39:32 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub_ui.c
+
+[src/sub_ui.c] Extend the exponent range early enough.
+------------------------------------------------------------------------
+r13061 | zimmerma | 2018-08-28 14:44:47 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] adapt to GMP_NUMB_BITS=16
+
+------------------------------------------------------------------------
+r13060 | vlefevre | 2018-08-28 14:41:23 +0000 (Tue, 28 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Added a FIXME.
+------------------------------------------------------------------------
+r13059 | zimmerma | 2018-08-28 14:30:57 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] adapt to GMP_NUMB_BITS=16
+
+------------------------------------------------------------------------
+r13058 | zimmerma | 2018-08-28 14:23:10 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d.c
+
+[src/set_d.c] adapt to GMP_NUMB_BITS=16 (not yet tested)
+
+------------------------------------------------------------------------
+r13057 | zimmerma | 2018-08-28 14:02:06 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/exp_2.c
+
+[src/exp_2.c] removed a static assertion (duplicate with MPFR_LONG_WITHIN_LIMB)
+
+------------------------------------------------------------------------
+r13056 | zimmerma | 2018-08-28 14:01:28 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/init2.c
+
+[src/init2.c] split a static assertion in two
+
+------------------------------------------------------------------------
+r13055 | zimmerma | 2018-08-28 14:01:02 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] allow GMP_NUMB_BITS=16 (experimental, do not use!)
+
+------------------------------------------------------------------------
+r13054 | zimmerma | 2018-08-28 14:00:09 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d.c
+
+[src/set_d.c] make it easier to extend to GMP_NUMB_BITS<32
+
+------------------------------------------------------------------------
+r13053 | zimmerma | 2018-08-28 13:48:47 +0000 (Tue, 28 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] read GMP_NUMB_BITS from mini-gmp.h when available
+ (otherwise assume mp_limb_t == unsigned long)
+
+------------------------------------------------------------------------
+r13052 | zimmerma | 2018-08-28 13:28:08 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/ui_sub.c
+
+[src/ui_sub.c] make code work for limb < long
+
+------------------------------------------------------------------------
+r13051 | zimmerma | 2018-08-28 13:26:28 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub_ui.c
+
+[src/sub_ui.c] make code work for limb < long
+
+------------------------------------------------------------------------
+r13050 | zimmerma | 2018-08-28 13:24:07 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] make code work for limb < long
+
+------------------------------------------------------------------------
+r13049 | zimmerma | 2018-08-28 13:18:16 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add_ui.c
+
+[src/add_ui.c] make code work for limb < long
+
+------------------------------------------------------------------------
+r13048 | zimmerma | 2018-08-28 13:01:48 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mini-gmp
+
+[mini-gmp] update
+
+------------------------------------------------------------------------
+r13047 | zimmerma | 2018-08-28 12:44:48 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsinh.c
+
+[tests/tsinh.c] improve coverage
+
+------------------------------------------------------------------------
+r13046 | zimmerma | 2018-08-28 08:05:06 +0000 (Tue, 28 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsubnormal.c
+
+[tests/tsubnormal.c] improve coverage
+
+------------------------------------------------------------------------
+r13045 | vlefevre | 2018-08-27 15:45:32 +0000 (Mon, 27 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Added a FIXME about cp vs tp.
+------------------------------------------------------------------------
+r13044 | zimmerma | 2018-08-27 15:18:25 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tmul.c
+
+[tests/tmul.c] improve coverage
+
+------------------------------------------------------------------------
+r13043 | vlefevre | 2018-08-27 15:03:05 +0000 (Mon, 27 Aug 2018) | 5 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Avoid bad usage of tp in the generic code:
+ * In the case d == 1, two branches were inconsistent: tp not defined
+ at the same level, with one shadowing the other one.
+ * In the case 2 <= d < p, tp was reused with a different meanings;
+ renamed the second one to cp, as this is MPFR_MANT(c).
+------------------------------------------------------------------------
+r13042 | vlefevre | 2018-08-27 14:41:32 +0000 (Mon, 27 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Re-added/updated FIXME about the long backward goto's.
+------------------------------------------------------------------------
+r13041 | vlefevre | 2018-08-27 13:11:02 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+ M /trunk/src/mul.c
+
+[src/{add1sp.c,mul.c}] Updated the condition to use the formally
+extracted code and added a corresponding comment.
+------------------------------------------------------------------------
+r13040 | zimmerma | 2018-08-27 13:06:17 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/const_log2.c
+
+[src/const_log2.c] further improve coverage
+
+------------------------------------------------------------------------
+r13039 | vlefevre | 2018-08-27 12:51:11 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/cache.c
+
+[src/cache.c] Improved variable names (→ dprec for the precision of dest
+and cprec for the precision of the cache) and added/updated comments.
+------------------------------------------------------------------------
+r13038 | vlefevre | 2018-08-27 12:32:49 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/cache.c
+
+[src/cache.c] Reverted r13036 as what matters is the target precision,
+which can be very small.
+------------------------------------------------------------------------
+r13037 | zimmerma | 2018-08-27 12:23:42 +0000 (Mon, 27 Aug 2018) | 5 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+ M /trunk/src/add1sp1_extracted.c
+ M /trunk/src/mul.c
+ M /trunk/src/mul_1_extracted.c
+
+[src/add1sp1_extracted.c] replaced extracted code by new for MPFR_PREC_BITS=64
+[src/mul_1_extracted.c] likewise
+[src/add1sp.c] changed condition to use the formally extracted code
+[src/mul.c] likewise (but code is still not yet activated here)
+
+------------------------------------------------------------------------
+r13036 | vlefevre | 2018-08-27 12:20:47 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/cache.c
+
+[src/cache.c] Comment: In practice, the "overflow handler" of
+MPFR_RNDRAW_GEN should never be called.
+------------------------------------------------------------------------
+r13035 | zimmerma | 2018-08-27 12:19:51 +0000 (Mon, 27 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/const_log2.c
+ M /trunk/tests/tconst_log2.c
+
+[src/const_log2.c] avoid hard-coded values
+[tests/tconst_log2.c] improve coverage
+
+------------------------------------------------------------------------
+r13034 | vlefevre | 2018-08-27 12:12:48 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/cache.c
+
+[src/cache.c] Replaced a test + mpfr_overflow by a MPFR_ASSERTD since
+the cached value (in extended exponent range) cannot overflow.
+------------------------------------------------------------------------
+r13033 | zimmerma | 2018-08-27 11:31:15 +0000 (Mon, 27 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/const_euler.c
+ M /trunk/tests/tconst_euler.c
+
+[src/const_euler.c] better choice of (initial) working precision
+[tests/tconst_euler.c] added coverage test
+
+------------------------------------------------------------------------
+r13032 | vlefevre | 2018-08-27 11:24:10 +0000 (Mon, 27 Aug 2018) | 6 lines
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Update concerning the shared cache, to be consistent
+with the other mpfr_buildopt_*_p features:
+ * check that mpfr_buildopt_sharedcache_p() and MPFR_WANT_SHARED_CACHE
+ match;
+ * for the output of the value, test mpfr_buildopt_sharedcache_p()
+ instead of the macro.
+------------------------------------------------------------------------
+r13031 | zimmerma | 2018-08-27 11:11:42 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tconst_catalan.c
+
+[tests/tconst_catalan.c] improve coverage
+
+------------------------------------------------------------------------
+r13030 | zimmerma | 2018-08-27 09:38:52 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tbuildopt.c
+
+[tests/tbuildopt.c] added check of mpfr_buildopt_sharedcache_p()
+
+------------------------------------------------------------------------
+r13028 | vlefevre | 2018-08-27 08:57:23 +0000 (Mon, 27 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r13027 | zimmerma | 2018-08-27 08:45:41 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed even rule for p=1
+
+------------------------------------------------------------------------
+r13026 | vlefevre | 2018-08-27 01:42:20 +0000 (Mon, 27 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Mention WG14/N2270 (proposed maybe_unused attribute),
+which could be useful to avoid MPFR_DBGRES.
+------------------------------------------------------------------------
+r13024 | zimmerma | 2018-08-24 15:44:10 +0000 (Fri, 24 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] finished simplifying the mpfr_sub1sp code
+
+------------------------------------------------------------------------
+r13023 | zimmerma | 2018-08-24 14:53:32 +0000 (Fri, 24 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] simplified the computation of sbb
+
+------------------------------------------------------------------------
+r13022 | zimmerma | 2018-08-24 14:45:06 +0000 (Fri, 24 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] full rewrite of mpfr_sub1sp (work in progress)
+
+------------------------------------------------------------------------
+r13020 | vlefevre | 2018-08-23 14:31:16 +0000 (Thu, 23 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Output "Enable formally proven code" info.
+------------------------------------------------------------------------
+r13019 | vlefevre | 2018-08-23 14:26:09 +0000 (Thu, 23 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Describe MPFR_WANT_PROVEN_CODE.
+------------------------------------------------------------------------
+r13018 | vlefevre | 2018-08-23 14:24:23 +0000 (Thu, 23 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+ M /trunk/src/add1sp.c
+ M /trunk/src/mul.c
+
+Renamed WANT_PROVEN_CODE to MPFR_WANT_PROVEN_CODE for consistency with
+the other WANT macros (and to avoid potential clashes with foreign .h
+files).
+------------------------------------------------------------------------
+r13017 | vlefevre | 2018-08-23 11:08:47 +0000 (Thu, 23 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] For some tests, ignore extracted files (proven code).
+------------------------------------------------------------------------
+r13016 | zimmerma | 2018-08-23 10:03:52 +0000 (Thu, 23 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/AUTHORS
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/mul.c
+
+the mpfr_mul_1 extracted code is not proven yet
+
+------------------------------------------------------------------------
+r13015 | vlefevre | 2018-08-23 09:57:09 +0000 (Thu, 23 Aug 2018) | 6 lines
+Changed paths:
+ M /trunk/configure.ac
+ M /trunk/src/add1sp.c
+ M /trunk/src/mul.c
+
+For --enable-formally-proven-code, instead of requiring a check of the
+type sizes in configure, just enable the proven code only if the types
+have the sizes expected by this code.
+ * configure.ac: removed the FIXME.
+ * src/add1sp.c, src/mul.c: updated the #if test that enables the
+ proven code (add1sp1_extracted.c and mul_1_extracted.c).
+------------------------------------------------------------------------
+r13014 | vlefevre | 2018-08-23 09:23:21 +0000 (Thu, 23 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated FIXME for --enable-formally-proven-code
+(many failures with -m32 due to assumptions on type sizes).
+------------------------------------------------------------------------
+r13013 | vlefevre | 2018-08-23 08:54:16 +0000 (Thu, 23 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Added a FIXME for --enable-formally-proven-code.
+------------------------------------------------------------------------
+r13012 | vlefevre | 2018-08-23 08:39:47 +0000 (Thu, 23 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Updated message for --enable-formally-proven-code.
+------------------------------------------------------------------------
+r13011 | zimmerma | 2018-08-23 07:31:06 +0000 (Thu, 23 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/AUTHORS
+ M /trunk/NEWS
+ M /trunk/configure.ac
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/Makefile.am
+ M /trunk/src/add1sp.c
+ A /trunk/src/add1sp1_extracted.c
+ M /trunk/src/mul.c
+ A /trunk/src/mul_1_extracted.c
+
+added configure option --enable-formally-proven-code and corresponding code
+
+------------------------------------------------------------------------
+r13009 | vlefevre | 2018-08-22 12:52:28 +0000 (Wed, 22 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus: swap Rule 4 and Rule 5.
+------------------------------------------------------------------------
+r13008 | vlefevre | 2018-08-22 12:49:45 +0000 (Wed, 22 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Ulp calculus Rule 4: make the proof much simpler.
+------------------------------------------------------------------------
+r13007 | vlefevre | 2018-08-22 12:27:42 +0000 (Wed, 22 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.tex] Error calculus: implicitly assume x ≠ 0 in ulp.
+------------------------------------------------------------------------
+r13006 | vlefevre | 2018-08-22 09:31:21 +0000 (Wed, 22 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Updated a FIXME.
+------------------------------------------------------------------------
+r13005 | vlefevre | 2018-08-22 09:23:04 +0000 (Wed, 22 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Removed a comment that brings nothing and is not
+really correct (this is not a "flag").
+------------------------------------------------------------------------
+r13004 | zimmerma | 2018-08-22 07:47:38 +0000 (Wed, 22 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tgeneric.c
+ M /trunk/tests/tmul.c
+
+[tests/mpfr-test.h] added macro TEST_FLAGS (debug use only)
+
+------------------------------------------------------------------------
+r13003 | vlefevre | 2018-08-22 03:01:16 +0000 (Wed, 22 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tversion.c
[tests/tversion.c] Portability corrections related to the use of the
preprocessor / code robustness.
-(merged changeset r13003 from the trunk)
------------------------------------------------------------------------
-r12999 | vlefevre | 2018-08-21 13:18:23 +0000 (Tue, 21 Aug 2018) | 2 lines
+r13002 | zimmerma | 2018-08-21 15:36:29 +0000 (Tue, 21 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] revert mpfr_sub1sp to the version of revision 12241
+
+------------------------------------------------------------------------
+r13001 | zimmerma | 2018-08-21 14:39:43 +0000 (Tue, 21 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed bug20180813
+
+------------------------------------------------------------------------
+r13000 | zimmerma | 2018-08-21 13:50:13 +0000 (Tue, 21 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub1sp.c
+
+[tests/tsub1sp.c] improved comment about bug20180813()
+
+------------------------------------------------------------------------
+r12998 | vlefevre | 2018-08-21 13:04:44 +0000 (Tue, 21 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r12997 | zimmerma | 2018-08-21 11:01:14 +0000 (Tue, 21 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub1sp.c
+
+[tests/tsub1sp.c] added a test for a bug in mpfr_sub1sp (to be fixed)
+
+------------------------------------------------------------------------
+r12996 | vlefevre | 2018-08-20 15:33:12 +0000 (Mon, 20 Aug 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tsub1sp.c
+ M /trunk/doc/mpfr.texi
-[tests/tsub1sp.c] Added a test by merging r12997 from the trunk, and
-modified the comment to say that the bug is only in the trunk.
+[doc/mpfr.texi] Replaced "Section ``Rounding''" by "@ref{Rounding}".
------------------------------------------------------------------------
-r12994 | vlefevre | 2018-08-20 07:44:49 +0000 (Mon, 20 Aug 2018) | 3 lines
+r12995 | zimmerma | 2018-08-20 14:52:54 +0000 (Mon, 20 Aug 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/mpfr-impl.h
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] renamed Section "Rounding Modes" to "Rounding"
+
+------------------------------------------------------------------------
+r12991 | vlefevre | 2018-08-18 10:03:58 +0000 (Sat, 18 Aug 2018) | 5 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/tests/memory.c
+
+Avoid a pointer-to-int-cast warning with GCC (e.g. under 32-bit Linux)
+by casting pointers to uintptr_t before the cast to mpfr_uintmax_t.
+ * acinclude.m4: use AC_TYPE_UINTPTR_T to define uintptr_t if
+ not available.
+ * tests/memory.c: added casts to uintptr_t.
+------------------------------------------------------------------------
+r12990 | vlefevre | 2018-08-16 14:37:13 +0000 (Thu, 16 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/src/invert_limb.h
+ M /trunk/src/invsqrt_limb.h
+
+Code robustness in macro definitions.
+------------------------------------------------------------------------
+r12989 | vlefevre | 2018-08-16 14:29:34 +0000 (Thu, 16 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqr.c
+
+[src/sqr.c] Changed a variable name to avoid confusion with the function
+parameter of the same name, which has a different type.
+------------------------------------------------------------------------
+r12988 | vlefevre | 2018-08-16 14:16:36 +0000 (Thu, 16 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
[src/mpfr-impl.h] Added a cast to mp_bitcnt_t in order to fix potential
integer overflow in MPFR_MPZ_SIZEINBASE2.
-(merged changeset r12988 from the trunk)
------------------------------------------------------------------------
-r12993 | vlefevre | 2018-08-20 07:40:42 +0000 (Mon, 20 Aug 2018) | 4 lines
+r12987 | vlefevre | 2018-08-16 13:54:13 +0000 (Thu, 16 Aug 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tcan_round.c
+ M /trunk/src/round_raw_generic.c
+
+[src/round_raw_generic.c] Type consistency.
+------------------------------------------------------------------------
+r12986 | vlefevre | 2018-08-16 13:52:02 +0000 (Thu, 16 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/bernoulli.c
+ M /trunk/src/jn.c
+ M /trunk/src/mpfr-impl.h
+
+Added MPFR_INC_PREC definition (similar to MPFR_ADD_PREC) and replaced
+some MPFR_ADD_PREC occurrences by MPFR_INC_PREC. In src/bernoulli.c,
+replaced += by MPFR_INC_PREC to detect overflow.
+------------------------------------------------------------------------
+r12985 | vlefevre | 2018-08-11 00:51:13 +0000 (Sat, 11 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/tools/build-patch
+
+Replaced "TZ=UTC" by "TZ=UTC0" for portability.
+------------------------------------------------------------------------
+r12984 | vlefevre | 2018-08-06 13:01:51 +0000 (Mon, 06 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/src/round_raw_generic.c
+
+[src/round_raw_generic.c] Avoid a useless variable. This should
+also avoid warnings with Windows ICC, reported at:
+ https://sympa.inria.fr/sympa/arc/mpfr/2018-08/msg00002.html
+------------------------------------------------------------------------
+r12983 | vlefevre | 2018-08-06 12:35:06 +0000 (Mon, 06 Aug 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tcan_round.c
[tests/tcan_round.c] Added missing casts for printf (error messages).
Bug detected under MS Windows, where size_t > unsigned long. See:
https://sympa.inria.fr/sympa/arc/mpfr/2018-08/msg00002.html
-(merged changeset r12983 from the trunk)
------------------------------------------------------------------------
-r12992 | vlefevre | 2018-08-20 06:47:44 +0000 (Mon, 20 Aug 2018) | 22 lines
+r12982 | vlefevre | 2018-08-06 12:17:55 +0000 (Mon, 06 Aug 2018) | 4 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/mpfr-longlong.h
- M /branches/4.0/tools/mpfrlint
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] Improved the conditions for test_20170105().
+In particular, the new preprocessor test can avoid spurious warnings
+on large shifts (false positives) with MS Windows. See:
+ https://sympa.inria.fr/sympa/arc/mpfr/2018-08/msg00002.html
+------------------------------------------------------------------------
+r12981 | vlefevre | 2018-08-06 12:00:28 +0000 (Mon, 06 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] More details about intmax_t, mpfr_intmax_t, etc.
+------------------------------------------------------------------------
+r12980 | vlefevre | 2018-08-06 10:41:26 +0000 (Mon, 06 Aug 2018) | 4 lines
+Changed paths:
+ M /trunk/tests/memory.c
+
+[tests/memory.c] To print a size_t or a pointer in error messages,
+cast to mpfr_uintmax_t (largest integer type available) instead of
+unsigned long, which may be too short (e.g. under MS Windows).
+See: https://sympa.inria.fr/sympa/arc/mpfr/2018-08/msg00002.html
+------------------------------------------------------------------------
+r12979 | vlefevre | 2018-08-06 10:29:14 +0000 (Mon, 06 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-intmax.h
+
+[src/mpfr-intmax.h] Define MPFR_INTMAX_FSPEC macro: length modifier
+for printf corresponding to mpfr_intmax_t and mpfr_uintmax_t.
+------------------------------------------------------------------------
+r12978 | vlefevre | 2018-08-06 02:04:14 +0000 (Mon, 06 Aug 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated/added links about coding standards and C.
+------------------------------------------------------------------------
+r12977 | vlefevre | 2018-08-05 21:26:21 +0000 (Sun, 05 Aug 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Updated a comment: more details about __GMP_DECLSPEC,
+in particular those found in GMP's longlong.h file.
+------------------------------------------------------------------------
+r12976 | vlefevre | 2018-08-05 16:03:33 +0000 (Sun, 05 Aug 2018) | 19 lines
+Changed paths:
+ M /trunk/src/mpfr-longlong.h
-[tools/mpfrlint] Check that __GMP_DECLSPEC is not used by MPFR.
[src/mpfr-longlong.h] Replaced __GMP_DECLSPEC by __MPFR_DECLSPEC.
Otherwise, with Windows DLL, __GMP_DECLSPEC is replaced by
@@ -1483,86 +8108,195 @@ only without the GMP build).
See:
https://sympa.inria.fr/sympa/arc/mpfr/2018-08/msg00000.html
https://sympa.inria.fr/sympa/arc/mpfr/2018-08/msg00001.html
-
-(merged changesets r12975-12977 from the trunk)
------------------------------------------------------------------------
-r12969 | vlefevre | 2018-07-31 09:01:08 +0000 (Tue, 31 Jul 2018) | 3 lines
+r12975 | vlefevre | 2018-08-05 15:59:29 +0000 (Sun, 05 Aug 2018) | 1 line
Changed paths:
- M /branches/4.0/tests/tversion.c
+ M /trunk/tools/mpfrlint
-[tests/tversion.c] Updated comment about missing output from the
-first printf with i586-mingw32msvc-gcc -D__USE_MINGW_ANSI_STDIO
-and run under Wine (issue not reproducible).
+[tools/mpfrlint] Check that __GMP_DECLSPEC is not used by MPFR.
------------------------------------------------------------------------
-r12968 | vlefevre | 2018-07-30 16:31:52 +0000 (Mon, 30 Jul 2018) | 2 lines
+r12970 | vlefevre | 2018-07-31 10:58:39 +0000 (Tue, 31 Jul 2018) | 4 lines
Changed paths:
- M /branches/4.0/tests/tversion.c
+ M /trunk
+ M /trunk/tests/tversion.c
[tests/tversion.c] Try to detect missing output from the first printf
-with i586-mingw32msvc-gcc -D__USE_MINGW_ANSI_STDIO and run under Wine.
+that occurred once with i586-mingw32msvc-gcc -D__USE_MINGW_ANSI_STDIO
+and run under Wine.
+(merged changesets r12968-12969 from the 4.0 branch)
------------------------------------------------------------------------
-r12967 | vlefevre | 2018-07-30 13:43:03 +0000 (Mon, 30 Jul 2018) | 5 lines
+r12964 | vlefevre | 2018-07-27 16:24:08 +0000 (Fri, 27 Jul 2018) | 4 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/src/vasprintf.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tsprintf.c
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/tests/tsprintf.c
[acinclude.m4,configure.ac] Check the support of the group flag for
native integers, which is a Single UNIX Specification extension.
+[tests/tsprintf.c] Test the group flag with the P length modifier only
+ when supported, since the implementation relies on this support.
+------------------------------------------------------------------------
+r12963 | vlefevre | 2018-07-27 14:41:02 +0000 (Fri, 27 Jul 2018) | 8 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tsprintf.c
+
+[src/vasprintf.c] Fixed bug with the P length modifier (mpfr_prec_t):
+ a '0' flag was always added when calling gmp_asprintf. This bug
+ wasn't detected under Linux because the case for which it was
+ occurring (left space padding without a precision and without a
+ '0' flag) was not tested. With Wine, tsprintf was failing because
+ of a bug in the stdio library: the '0' flag added by mistake should
+ have been ignored in some test with a precision, but it wasn't.
+[tests/tsprintf.c] Added a test that made a failure occur under Linux.
+------------------------------------------------------------------------
+r12962 | vlefevre | 2018-07-27 12:46:39 +0000 (Fri, 27 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added 2 other tests with the P length modifier.
+------------------------------------------------------------------------
+r12961 | vlefevre | 2018-07-27 12:37:46 +0000 (Fri, 27 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tsprintf.c
+
[src/vasprintf.c] Fixed bug with the P length modifier (mpfr_prec_t).
-[tests/tsprintf.c] Added testcases.
-(merged changesets r12958-12959,12961-12964 from the trunk)
+[tests/tsprintf.c] Corrected/added tests with the P length modifier.
------------------------------------------------------------------------
-r12966 | vlefevre | 2018-07-30 13:34:14 +0000 (Mon, 30 Jul 2018) | 3 lines
+r12960 | vlefevre | 2018-07-26 11:33:54 +0000 (Thu, 26 Jul 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/vasprintf.c
+ M /trunk/src/vasprintf.c
-[src/vasprintf.c] Bug fix: in case of some errors (via "goto error;"),
-va_end wasn't called, yielding undefined behavior.
-(reverse-merged r12965; merged changesets r12955,12957 from the trunk)
+[src/vasprintf.c] Fixed various overflow and close-to-overflow issues.
+Those with the P length modifier (mpfr_prec_t) will be fixed later.
+------------------------------------------------------------------------
+r12959 | vlefevre | 2018-07-26 11:29:36 +0000 (Thu, 26 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Another failure with the P length modifier.
+------------------------------------------------------------------------
+r12958 | vlefevre | 2018-07-26 11:06:35 +0000 (Thu, 26 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added tests with the P length modifier (mpfr_prec_t),
+yielding mode failures.
------------------------------------------------------------------------
-r12965 | vlefevre | 2018-07-30 09:32:15 +0000 (Mon, 30 Jul 2018) | 3 lines
+r12957 | vlefevre | 2018-07-26 10:12:47 +0000 (Thu, 26 Jul 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/vasprintf.c
+ M /trunk/src/vasprintf.c
[src/vasprintf.c] Fixed "store to null pointer" and free of bad pointer
in case of error.
-(merged part of changeset r12957 from the trunk)
------------------------------------------------------------------------
-r12950 | vlefevre | 2018-07-23 08:17:05 +0000 (Mon, 23 Jul 2018) | 8 lines
+r12956 | vlefevre | 2018-07-26 10:03:13 +0000 (Thu, 26 Jul 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/erf.c
- M /branches/4.0/tests
- M /branches/4.0/tests/terf.c
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added a test that yields a "store to null pointer",
+detected by UBsan.
+------------------------------------------------------------------------
+r12955 | vlefevre | 2018-07-25 14:04:12 +0000 (Wed, 25 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Bug fix: in case of some errors (via "goto error;"),
+va_end wasn't called, yielding undefined behavior.
+------------------------------------------------------------------------
+r12951 | vlefevre | 2018-07-23 08:21:11 +0000 (Mon, 23 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests
+
+[tests] Added tget_set_d128 to svn:ignore property.
+------------------------------------------------------------------------
+r12949 | vlefevre | 2018-07-23 00:54:17 +0000 (Mon, 23 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/erf.c
+
+[src/erf.c] More security about tauk.
+------------------------------------------------------------------------
+r12948 | vlefevre | 2018-07-23 00:09:44 +0000 (Mon, 23 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/erf.c
+
+[src/erf.c] Removed a meaningless cast.
+------------------------------------------------------------------------
+r12947 | zimmerma | 2018-07-22 21:31:59 +0000 (Sun, 22 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/erf.c
+
+[src/erf.c] replaced double's by mpfr_t to fix bug reported by Naoki Shibata
-[src/erf.c] In the computation of an error bound, replaced some
- double's (which could overflow) by mpfr_t to fix bug reported
- by Naoki Shibata:
+------------------------------------------------------------------------
+r12946 | vlefevre | 2018-07-22 20:39:00 +0000 (Sun, 22 Jul 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/terf.c
+
+[tests/terf.c] Added a testcase for bug reported by Naoki Shibata:
https://sympa.inria.fr/sympa/arc/mpfr/2018-07/msg00028.html
-[tests/terf.c] Added a testcase for this bug. Increased the number
- of generic tests in order to reproduce the bug there too with the
- default seed.
-(merged changesets r12946-12949 from the trunk)
-------------------------------------------------------------------------
-r12938 | vlefevre | 2018-07-19 00:01:28 +0000 (Thu, 19 Jul 2018) | 11 lines
-Changed paths:
- M /branches/4.0
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/README.dev
- M /branches/4.0/src/buildopt.c
- M /branches/4.0/src/free_cache.c
- M /branches/4.0/src/mpfr-impl.h
- M /branches/4.0/src/mpfr-thread.h
- M /branches/4.0/tests
- M /branches/4.0/tests/tconst_pi.c
- M /branches/4.0/tests/tversion.c
+(uceil_log2.c:40: MPFR assertion failed: exp < 1023).
+Increased the number of generic tests in order to reproduce the bug
+there too with the default seed.
+------------------------------------------------------------------------
+r12945 | vlefevre | 2018-07-21 01:13:20 +0000 (Sat, 21 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/subnormal.c
+
+[src/subnormal.c] C89 compatibility.
+------------------------------------------------------------------------
+r12944 | zimmerma | 2018-07-21 00:55:29 +0000 (Sat, 21 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/subnormal.c
+ M /trunk/tests/tsubnormal.c
+
+[src/subnormal.c] experimental support for RNDNA
+
+------------------------------------------------------------------------
+r12943 | vlefevre | 2018-07-20 13:09:20 +0000 (Fri, 20 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/Makefile.am
+ A /trunk/examples/threads.c
+
+Added examples/threads.c (and updated Makefile.am): multithreading test
+to detect scaling issues with MPFR.
+------------------------------------------------------------------------
+r12942 | vlefevre | 2018-07-19 09:46:48 +0000 (Thu, 19 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Updated a FIXME.
+------------------------------------------------------------------------
+r12941 | vlefevre | 2018-07-19 08:32:21 +0000 (Thu, 19 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] More FIXME's.
+------------------------------------------------------------------------
+r12940 | vlefevre | 2018-07-19 07:44:54 +0000 (Thu, 19 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Reindentation.
+------------------------------------------------------------------------
+r12939 | vlefevre | 2018-07-19 07:35:06 +0000 (Thu, 19 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Added a FIXME for MPFR_PREC_ARG handling.
+------------------------------------------------------------------------
+r12937 | vlefevre | 2018-07-18 23:59:09 +0000 (Wed, 18 Jul 2018) | 10 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/README.dev
+ M /trunk/src/buildopt.c
+ M /trunk/src/free_cache.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-thread.h
+ M /trunk/tests/tconst_pi.c
+ M /trunk/tests/tversion.c
Shared caches: fix and minor changes.
* Fixed detection and use of C11 thread support: the C11 header is
@@ -1574,72 +8308,354 @@ Shared caches: fix and minor changes.
* doc/README.dev: documented 4 macros for shared caches.
* tests/tversion.c: output MPFR_WANT_SHARED_CACHE and
MPFR_THREAD_LOCK_METHOD information.
-(merged changeset r12937 from the trunk)
------------------------------------------------------------------------
-r12936 | vlefevre | 2018-07-18 23:17:03 +0000 (Wed, 18 Jul 2018) | 4 lines
+r12935 | vlefevre | 2018-07-18 23:15:14 +0000 (Wed, 18 Jul 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tconst_pi.c
+ M /trunk/tests/tconst_pi.c
[tests/tconst_pi.c] Removed an incorrect assertion, as the #else would
be applicable when WANT_SHARED_CACHE is defined but not HAVE_PTHREAD
(which may occur when MPFR_HAVE_C11_LOCK is defined).
-(merged changeset r12935 from the trunk)
------------------------------------------------------------------------
-r12923 | vlefevre | 2018-07-13 10:31:07 +0000 (Fri, 13 Jul 2018) | 4 lines
+r12934 | vlefevre | 2018-07-18 13:33:13 +0000 (Wed, 18 Jul 2018) | 2 lines
Changed paths:
- M /branches/4.0/acinclude.m4
+ M /trunk/src/vasprintf.c
-[acinclude.m4] Fixed the __float128 detection for NetBSD: Optimization
-made the "undefined reference" error disappear, so that __float128 was
-misdetected as being supported. Also updated the message.
-Note: this change is similar to the r12921-12922 ones in the trunk.
+[src/vasprintf.c] Fixed type in partition_number to be consistent with
+the end of the function.
------------------------------------------------------------------------
-r12918 | vlefevre | 2018-07-12 15:05:07 +0000 (Thu, 12 Jul 2018) | 1 line
+r12933 | vlefevre | 2018-07-16 14:17:55 +0000 (Mon, 16 Jul 2018) | 2 lines
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/src/vasprintf.c
-[NEWS] Update for GNU MPFR 4.0.2.
+[src/vasprintf.c] Added 2 FIXME and removed an incorrect MPFR_ASSERTN
+(which came from r5236).
------------------------------------------------------------------------
-r12917 | vlefevre | 2018-07-12 15:04:17 +0000 (Thu, 12 Jul 2018) | 6 lines
+r12932 | vlefevre | 2018-07-16 13:56:39 +0000 (Mon, 16 Jul 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/tests/tsprintf.c
-[doc/mpfr.texi] In Section "Nomenclature and Types":
- * rewrote the paragraph defining "floating-point number",
- avoiding ambiguities;
- * removed all the @noindent, whose purpose is unclear;
- * defined regular numbers and exponents.
-(merged changesets r12906-12908 from the trunk)
+[tests/tsprintf.c] Added other tests to check_length_overflow, which
+would trigger other bugs in src/vasprintf.c (e.g. when removing the
+other failing tests).
------------------------------------------------------------------------
-r12916 | vlefevre | 2018-07-12 14:32:51 +0000 (Thu, 12 Jul 2018) | 7 lines
+r12931 | vlefevre | 2018-07-16 13:33:33 +0000 (Mon, 16 Jul 2018) | 4 lines
Changed paths:
- M /branches/4.0/acinclude.m4
+ M /trunk/tests/tsprintf.c
-[acinclude.m4] For the __float128 detection, changed AC_COMPILE_IFELSE
-to AC_LINK_IFELSE since an error may occur only at link time, such as
-under NetBSD:
+[tests/tsprintf.c] Added check_length_overflow to check the behavior of
+mpfr_snprintf on a large number of output characters (> INT_MAX) with
+size = 0. This test is actually done only if INT_MAX == 2147483647 and
+currently fails in such a case.
+------------------------------------------------------------------------
+r12930 | vlefevre | 2018-07-16 13:22:58 +0000 (Mon, 16 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Updated comment about overflow on the number of output
+characters, taking into account the latest ISO C and POSIX standards.
+------------------------------------------------------------------------
+r12929 | vlefevre | 2018-07-16 12:45:59 +0000 (Mon, 16 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Updated a comment.
+------------------------------------------------------------------------
+r12928 | vlefevre | 2018-07-13 14:43:40 +0000 (Fri, 13 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Simplified mpfr_get_str_wrapper.
+------------------------------------------------------------------------
+r12927 | vlefevre | 2018-07-13 13:38:08 +0000 (Fri, 13 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Added a log message.
+------------------------------------------------------------------------
+r12926 | vlefevre | 2018-07-13 13:15:01 +0000 (Fri, 13 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a FIXME: _Decimal128 code and _MPFR_IEEE_FLOATS
+(which is about binary IEEE-754 floating point) should be unrelated.
+------------------------------------------------------------------------
+r12925 | vlefevre | 2018-07-13 12:28:36 +0000 (Fri, 13 Jul 2018) | 8 lines
+Changed paths:
+ M /trunk/src/get_d64.c
+
+[src/get_d64.c]
+ * Added FIXME's for get_decimal64_nan and get_decimal64_inf internal
+ functions: possible issue with _MPFR_IEEE_FLOATS code, which also
+ seems more complex than the generic code.
+ * Simplified get_decimal64_zero internal function to generate a
+ decimal zero directly instead of using the fact that a binary64
+ zero is also the encoding of a decimal zero (and assuming that
+ double = binary64 with perfect endianness matching).
+------------------------------------------------------------------------
+r12922 | vlefevre | 2018-07-13 10:28:16 +0000 (Fri, 13 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Updated message about the _Float128 support, since
+this is not just about the compiler.
+------------------------------------------------------------------------
+r12921 | vlefevre | 2018-07-13 10:20:28 +0000 (Fri, 13 Jul 2018) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed the _Float128 / __float128 detection for NetBSD:
+Optimization made the "undefined reference" error disappear, so that
+__float128 was misdetected as being supported.
+------------------------------------------------------------------------
+r12915 | vlefevre | 2018-07-12 14:27:50 +0000 (Thu, 12 Jul 2018) | 5 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] For the _Float128 / __float128 detection, changed
+AC_COMPILE_IFELSE to AC_LINK_IFELSE since an error may occur only
+at link time, such as under NetBSD:
https://mail-index.netbsd.org/pkgsrc-users/2018/02/02/msg026220.html
https://mail-index.netbsd.org/pkgsrc-users/2018/02/05/msg026238.html
-Note: this change is similar to the r12915 one in the trunk, except
-that we do not try to detect _Float128 in the 4.0 branch.
------------------------------------------------------------------------
-r12914 | vlefevre | 2018-07-12 12:32:16 +0000 (Thu, 12 Jul 2018) | 5 lines
+r12913 | vlefevre | 2018-07-12 12:28:58 +0000 (Thu, 12 Jul 2018) | 4 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/Makefile.am
+ M /trunk/src/Makefile.am
[src/Makefile.am] Corrected check-exported-symbols to avoid a failure
when the default .SHELLFLAGS value is '-ec' (POSIX) instead of '-c'
(GNU Make, which is not in POSIX-conforming mode by default).
Bug found on FreeBSD 11.1 (Compile Farm @ HouseGordon.com).
-(merged changeset r12913 from the trunk)
------------------------------------------------------------------------
-r12909 | vlefevre | 2018-07-10 11:51:56 +0000 (Tue, 10 Jul 2018) | 22 lines
+r12912 | vlefevre | 2018-07-11 08:39:58 +0000 (Wed, 11 Jul 2018) | 2 lines
Changed paths:
- M /branches/4.0/src/vasprintf.c
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] In buffer_sandwich, simplified the handling of the
+trailing zero (avoid memset and a useless assignment).
+------------------------------------------------------------------------
+r12908 | vlefevre | 2018-07-09 14:05:45 +0000 (Mon, 09 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] More changes to Section "Nomenclature and Types";
+in particular, defined regular numbers and exponents.
+------------------------------------------------------------------------
+r12907 | vlefevre | 2018-07-09 13:39:14 +0000 (Mon, 09 Jul 2018) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] In Section "Nomenclature and Types", removed all the
+@noindent, whose purpose is unclear (if one needs something special,
+an itemized list would be better, or possibly @deffn).
+------------------------------------------------------------------------
+r12906 | vlefevre | 2018-07-09 13:30:02 +0000 (Mon, 09 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Rewrote the paragraph defining "floating-point number"
+in Section "Nomenclature and Types", avoiding ambiguities.
+------------------------------------------------------------------------
+r12903 | vlefevre | 2018-07-06 14:01:06 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tprintf.c
+
+[tests/tprintf.c] Grrr... again a copy-paste error. Now OK.
+------------------------------------------------------------------------
+r12902 | vlefevre | 2018-07-06 13:58:49 +0000 (Fri, 06 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tsprintf.c
+
+[tests/{tprintf.c,tsprintf.c}] Corrected the tests added in r12898,
+but tprintf still fails.
+------------------------------------------------------------------------
+r12901 | vlefevre | 2018-07-06 13:53:26 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Corrected the latest tests.
+------------------------------------------------------------------------
+r12900 | vlefevre | 2018-07-06 13:51:41 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added tests (failure on "%09.3Rg" for 1000).
+------------------------------------------------------------------------
+r12899 | vlefevre | 2018-07-06 13:45:00 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Corrected comments.
+------------------------------------------------------------------------
+r12898 | vlefevre | 2018-07-06 13:41:37 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tsprintf.c
+
+[tests/{tprintf.c,tsprintf.c}] Added tests (both programs fail).
+------------------------------------------------------------------------
+r12896 | vlefevre | 2018-07-06 13:26:15 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r12895 | vlefevre | 2018-07-06 13:25:43 +0000 (Fri, 06 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Corrected comments and coding style.
+------------------------------------------------------------------------
+r12894 | vlefevre | 2018-07-06 13:17:40 +0000 (Fri, 06 Jul 2018) | 8 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Resolve the FIXME.
+ * Renamed ip_trailing_zeros to ip_trailing_digits, since when
+ spec.size == 0, these can be any digits.
+ * Simplified the buffer_sandwich function since it can be called
+ only when spec.size != 0, in which case tz (= ip_trailing_digits)
+ is either 0 or 1 (a trailing zero must be added only when rounding
+ to the next power of ten in the %f case).
+ * Corrected/removed/added comments.
+------------------------------------------------------------------------
+r12893 | vlefevre | 2018-07-06 11:49:12 +0000 (Fri, 06 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tsprintf.c
+
+[tests/{tprintf.c,tsprintf.c}] Added tests with powers of ten in all
+rounding modes and powers of ten + 0.5 in rounding to nearest.
+------------------------------------------------------------------------
+r12889 | zimmerma | 2018-07-05 07:22:01 +0000 (Thu, 05 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] typo in Fredrik's name
+
+------------------------------------------------------------------------
+r12888 | zimmerma | 2018-07-05 07:19:35 +0000 (Thu, 05 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/AUTHORS
+
+[AUTHORS] typo in Fredrik's name
+
+------------------------------------------------------------------------
+r12887 | vlefevre | 2018-07-04 15:14:21 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tprintf.c
+
+[tests/tprintf.c] Added a TODO (for the FIXME in src/vasprintf.c).
+------------------------------------------------------------------------
+r12886 | vlefevre | 2018-07-04 15:04:00 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Updated the FIXME comment.
+------------------------------------------------------------------------
+r12885 | vlefevre | 2018-07-04 14:38:04 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Added a FIXME comment about an incorrect comment.
+------------------------------------------------------------------------
+r12884 | vlefevre | 2018-07-04 14:30:16 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Added log messages in buffer_sandwich.
+------------------------------------------------------------------------
+r12883 | vlefevre | 2018-07-04 14:20:29 +0000 (Wed, 04 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added more tests of the form 10^i - 1/2
+(like in tprintf.c).
+------------------------------------------------------------------------
+r12882 | vlefevre | 2018-07-04 14:00:08 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tprintf.c
+
+[tests/tprintf.c] Added more tests of the form 10^i - 1/2.
+------------------------------------------------------------------------
+r12881 | vlefevre | 2018-07-04 13:40:12 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Added test_locale() test based on the tprintf.c one.
+------------------------------------------------------------------------
+r12880 | vlefevre | 2018-07-04 13:36:32 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tprintf.c
+
+[tests/tprintf.c] Minor correction.
+------------------------------------------------------------------------
+r12879 | vlefevre | 2018-07-04 13:27:49 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tprintf.c
+
+[tests/tprintf.c] More test_locale() cleanup.
+------------------------------------------------------------------------
+r12878 | vlefevre | 2018-07-04 13:11:01 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] English usage in a comment.
+------------------------------------------------------------------------
+r12877 | vlefevre | 2018-07-04 12:57:47 +0000 (Wed, 04 Jul 2018) | 4 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] Renamed mpfr_get_str_aux to mpfr_get_str_wrapper
+in order to avoid a confusion with the mpfr_get_str_aux function
+from get_str.c (moreover, this is really a wrapper, which is the
+reverse of an aux function).
+------------------------------------------------------------------------
+r12876 | vlefevre | 2018-07-04 12:35:45 +0000 (Wed, 04 Jul 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] locale_da_DK() cleanup.
+------------------------------------------------------------------------
+r12875 | zimmerma | 2018-07-04 12:32:17 +0000 (Wed, 04 Jul 2018) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] partly revert commit 12873
+
+------------------------------------------------------------------------
+r12874 | vlefevre | 2018-07-04 12:20:43 +0000 (Wed, 04 Jul 2018) | 4 lines
+Changed paths:
+ M /trunk/tests/tprintf.c
+
+[tests/tprintf.c] test_locale() cleanup.
+ * Conditional #include <locale.h> with the other header inclusions.
+ * Completed a #if (to be like in tsprintf.c).
+ * Moved a global variable as local to test_locale().
+------------------------------------------------------------------------
+r12873 | zimmerma | 2018-07-04 12:09:44 +0000 (Wed, 04 Jul 2018) | 3 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tprintf.c
+
+[src/vasprintf.c] replaced overflow tests by assertions
+[tests/tprintf.c] improve test coverage
+
+------------------------------------------------------------------------
+r12870 | vlefevre | 2018-07-04 08:50:32 +0000 (Wed, 04 Jul 2018) | 3 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tsprintf.c
+
+Added MPFR_CHECK_LOCALES environment variable for the tests (to be
+used by developers): when set, terminate with an error if locales
+cannot be tested.
+------------------------------------------------------------------------
+r12869 | vlefevre | 2018-07-04 01:23:27 +0000 (Wed, 04 Jul 2018) | 19 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
[src/vasprintf.c] Fixed several bugs in buffer_sandwich, which could
yield memory corruption with non-default memory allocators and other
@@ -1660,298 +8676,2227 @@ function of the current GMP memory allocator. By default, this size is
ignored, but it may matter if the memory allocators have been changed
with the mp_set_memory_functions GMP function, in which case a possible
consequence could be memory corruption.
+------------------------------------------------------------------------
+r12868 | zimmerma | 2018-07-03 15:34:40 +0000 (Tue, 03 Jul 2018) | 3 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tprintf.c
+
+[src/vasprintf.c] added an assertion
+[tests/tprintf.c] added two tests (one currently fails)
+
+------------------------------------------------------------------------
+r12864 | vlefevre | 2018-06-26 18:22:17 +0000 (Tue, 26 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/vasprintf.c
+
+[src/vasprintf.c] C90 compatibility.
+------------------------------------------------------------------------
+r12863 | zimmerma | 2018-06-26 15:16:17 +0000 (Tue, 26 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] fixed another test
+
+------------------------------------------------------------------------
+r12862 | zimmerma | 2018-06-26 15:15:06 +0000 (Tue, 26 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] fixed test
+
+------------------------------------------------------------------------
+r12861 | zimmerma | 2018-06-26 13:20:49 +0000 (Tue, 26 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tprintf.c
+
+[src/vasprintf.c] improve coverage
-Note: This corresponds to r12869 from the trunk. Other changes in the
-trunk (dead code removal...) have not been applied.
------------------------------------------------------------------------
-r12904 | vlefevre | 2018-07-06 14:36:05 +0000 (Fri, 06 Jul 2018) | 2 lines
+r12860 | zimmerma | 2018-06-26 11:37:44 +0000 (Tue, 26 Jun 2018) | 2 lines
Changed paths:
- M /branches/4.0/tests/tprintf.c
- M /branches/4.0/tests/tsprintf.c
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] improve coverage
-[tests/{tprintf.c,tsprintf.c}] Merged the latest tests from the trunk
-(r12562:12903).
------------------------------------------------------------------------
-r12897 | vlefevre | 2018-07-06 13:27:41 +0000 (Fri, 06 Jul 2018) | 1 line
+r12859 | zimmerma | 2018-06-26 10:58:03 +0000 (Tue, 26 Jun 2018) | 2 lines
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] improve coverage
+
+------------------------------------------------------------------------
+r12858 | zimmerma | 2018-06-25 13:42:59 +0000 (Mon, 25 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tgamma_inc.c
+
+[tests/tgamma_inc.c] improve coverage
+
+------------------------------------------------------------------------
+r12857 | zimmerma | 2018-06-25 10:48:05 +0000 (Mon, 25 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tgamma_inc.c
+
+[tests/tgamma_inc.c] added coverage test
+
+------------------------------------------------------------------------
+r12856 | zimmerma | 2018-06-25 10:13:29 +0000 (Mon, 25 Jun 2018) | 4 lines
+Changed paths:
+ M /trunk/src/gamma.c
+ M /trunk/src/gamma_inc.c
+ M /trunk/tests/tgamma_inc.c
+
+[src/gamma.c] added comment
+[src/gamma_inc.c] fixed bug for gamma_inc(-Inf, 0)
+[tests/tgamma_inc.c] added coverage tests
+
+------------------------------------------------------------------------
+r12855 | vlefevre | 2018-06-23 10:40:02 +0000 (Sat, 23 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Do not do specific CFLAGS settings for MS-Windows ICC.
+See <https://sympa.inria.fr/sympa/arc/mpfr/2018-06/msg00027.html>.
+------------------------------------------------------------------------
+r12854 | vlefevre | 2018-06-23 06:04:53 +0000 (Sat, 23 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Spelling in a comment.
+------------------------------------------------------------------------
+r12853 | vlefevre | 2018-06-23 00:43:45 +0000 (Sat, 23 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Fixed change in r12847.
+------------------------------------------------------------------------
+r12852 | vlefevre | 2018-06-23 00:23:10 +0000 (Sat, 23 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] Improved a test.
+------------------------------------------------------------------------
+r12851 | vlefevre | 2018-06-23 00:20:00 +0000 (Sat, 23 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Replaced d != d by DOUBLE_ISNAN (d).
+------------------------------------------------------------------------
+r12850 | vlefevre | 2018-06-23 00:17:09 +0000 (Sat, 23 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r12890 | vlefevre | 2018-07-06 07:21:18 +0000 (Fri, 06 Jul 2018) | 2 lines
+r12849 | vlefevre | 2018-06-23 00:15:33 +0000 (Sat, 23 Jun 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/AUTHORS
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
-[AUTHORS,doc/mpfr.texi] Typo in Fredrik's name.
-(merged changesets r12888-12889 from the trunk)
+[tests/tget_set_{d64,d128}.c] When MPFR_ERRDIVZERO is defined,
+disable tests that can trigger a FP exception DIVBYZERO or INVALID
+(issue detected with -DMPFR_TESTS_FPE_DIV -DMPFR_ERRDIVZERO).
------------------------------------------------------------------------
-r12872 | vlefevre | 2018-07-04 12:04:26 +0000 (Wed, 04 Jul 2018) | 5 lines
+r12848 | vlefevre | 2018-06-22 21:44:41 +0000 (Fri, 22 Jun 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/README.dev
- M /branches/4.0/tests
- M /branches/4.0/tests/tprintf.c
- M /branches/4.0/tests/tsprintf.c
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Improved a comment about union ieee_decimal128.
+------------------------------------------------------------------------
+r12847 | vlefevre | 2018-06-22 21:41:53 +0000 (Fri, 22 Jun 2018) | 4 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/set_d128.c
+ M /trunk/tests/tget_set_d128.c
+
+Do not assume that the bit-field ordering for _Decimal128 is necessarily
+little endian or big endian (this is more than the usual endianness
+issue). If this cannot be detected, instead of failing or assuming a
+possibly wrong default, switch to the portable code.
+------------------------------------------------------------------------
+r12846 | zimmerma | 2018-06-22 15:36:25 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/TODO
+ M /trunk/doc/mpfr.texi
+
+added mpfr_get_decimal128 and mpfr_set_decimal128 to the manual
-Added MPFR_CHECK_LOCALES environment variable for the tests (to be
-used by developers): when set, terminate with an error if locales
-cannot be tested.
-(merged changeset r12870 from the trunk; merging tests/tprintf.c r12861
-was needed first)
------------------------------------------------------------------------
-r12793 | vlefevre | 2018-06-20 12:17:11 +0000 (Wed, 20 Jun 2018) | 2 lines
+r12845 | zimmerma | 2018-06-22 15:04:33 +0000 (Fri, 22 Jun 2018) | 2 lines
Changed paths:
- M /branches/4.0/tests/tget_set_d64.c
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] test some random 16-byte inputs
-[tests/tget_set_d64.c] Tests on powers of 10: test negative numbers too.
-(merged part of changeset r12792 from the trunk)
------------------------------------------------------------------------
-r12786 | vlefevre | 2018-06-19 13:10:42 +0000 (Tue, 19 Jun 2018) | 5 lines
+r12844 | zimmerma | 2018-06-22 15:00:37 +0000 (Fri, 22 Jun 2018) | 2 lines
Changed paths:
- M /branches/4.0/src/set_d64.c
- M /branches/4.0/tests/tget_set_d64.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] test random inputs
-[src/set_d64.c] Fixed ternary value, which was always 0. This is done by
- using mpfr_strtofr instead of mpfr_set_str (merged part of changeset
- r12783 from the trunk).
-[tests/tget_set_d64.c] Added tests on powers of 10, checking the ternary
- value in particular (merged part of changeset r12782 from the trunk).
------------------------------------------------------------------------
-r12785 | vlefevre | 2018-06-19 12:55:53 +0000 (Tue, 19 Jun 2018) | 5 lines
+r12843 | zimmerma | 2018-06-22 14:39:39 +0000 (Fri, 22 Jun 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tstckintc.c
+ M /trunk/acinclude.m4
+ M /trunk/src/mpfr-impl.h
+
+[acinclude.m4] added configure test to determine the encoding of _Decimal128 (little or big endian)
+
+------------------------------------------------------------------------
+r12842 | zimmerma | 2018-06-22 14:01:06 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] added standard suffixes
+
+------------------------------------------------------------------------
+r12841 | zimmerma | 2018-06-22 13:56:17 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] fixed a test
+
+------------------------------------------------------------------------
+r12840 | zimmerma | 2018-06-22 13:13:55 +0000 (Fri, 22 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] removed TODO (done), added comment
+[tests/tget_set_d128.c] removed TODO (done)
+
+------------------------------------------------------------------------
+r12839 | zimmerma | 2018-06-22 13:11:53 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] added comment (like for set_d128.c)
+
+------------------------------------------------------------------------
+r12838 | zimmerma | 2018-06-22 12:44:16 +0000 (Fri, 22 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_d128.c
+ M /trunk/src/get_d64.c
+
+[src/get_d64.c] improve comment
+[src/get_d128.c] likewise
+
+------------------------------------------------------------------------
+r12837 | zimmerma | 2018-06-22 12:38:26 +0000 (Fri, 22 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+ M /trunk/tests/tget_set_d64.c
+
+[src/set_d64.c] also deal with non-canonical BID encoding
+[tests/tget_set_d64.c] added test with non-canonical BID encoding
+
+------------------------------------------------------------------------
+r12836 | vlefevre | 2018-06-22 12:19:47 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/get_d128.c
+
+[src/get_d128.c] Bug fix (buffer overflow detected by AddressSanitizer).
+------------------------------------------------------------------------
+r12835 | vlefevre | 2018-06-22 12:10:52 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_d128.c
+ M /trunk/src/set_d128.c
+
+[src] Moved the FIXME comment from set_d128.c to get_d128.c since the
+bug occurs in mpfr_get_decimal128 according to the AddressSanitizer.
+------------------------------------------------------------------------
+r12834 | vlefevre | 2018-06-22 12:08:14 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Updated FIXME comment.
+------------------------------------------------------------------------
+r12833 | vlefevre | 2018-06-22 11:52:45 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqrt.c
+
+[src/sqrt.c] Replaced a umul_ppmm by umul_hi, and removed an unused
+variable as a consequence.
+------------------------------------------------------------------------
+r12832 | vlefevre | 2018-06-22 11:42:30 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] Code improvement (like r12809 and r12828 in set_d128.c).
+------------------------------------------------------------------------
+r12831 | vlefevre | 2018-06-22 11:35:36 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] Removed unused variable for
+HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE (PowerPC).
+------------------------------------------------------------------------
+r12830 | vlefevre | 2018-06-22 11:33:33 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/invsqrt_limb.h
+
+[src/invsqrt_limb.h] Avoid a "variable ‘_l’ set but not used" warning
+on some platforms, such as powerpc64le-unknown-linux-gnu.
+------------------------------------------------------------------------
+r12829 | vlefevre | 2018-06-22 11:28:46 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/invert_limb.h
+
+[src/invert_limb.h] Avoid a "variable ‘_l’ set but not used" warning
+on some platforms, such as powerpc64le-unknown-linux-gnu.
+------------------------------------------------------------------------
+r12828 | vlefevre | 2018-06-22 11:19:27 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Avoid "unused variable" warnings on platforms with DPD.
+------------------------------------------------------------------------
+r12827 | vlefevre | 2018-06-22 11:11:02 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] About union ieee_double_decimal64: removed an
+incorrect comment and added a TODO.
+------------------------------------------------------------------------
+r12826 | vlefevre | 2018-06-22 11:08:20 +0000 (Fri, 22 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/set_d128.c
+ M /trunk/tests/tget_set_d128.c
+
+Changed union ieee_double_decimal128 to union ieee_decimal128 since this
+has nothing to do with double (unlike union ieee_double_decimal64). Also
+refactored code for this union definition.
+------------------------------------------------------------------------
+r12825 | vlefevre | 2018-06-22 10:50:47 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Updated TODO for DPD.
+------------------------------------------------------------------------
+r12824 | vlefevre | 2018-06-22 10:47:16 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added TODO for DPD (better structure definition).
+------------------------------------------------------------------------
+r12823 | vlefevre | 2018-06-22 10:42:20 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Execute BID code only with BID.
+------------------------------------------------------------------------
+r12822 | vlefevre | 2018-06-22 10:35:07 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Simplification and better portability.
+------------------------------------------------------------------------
+r12821 | zimmerma | 2018-06-22 10:25:16 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] added coverage tests for non-canonical BID encodings
+
+------------------------------------------------------------------------
+r12820 | zimmerma | 2018-06-22 10:00:40 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] improve last commit
+
+------------------------------------------------------------------------
+r12819 | zimmerma | 2018-06-22 09:56:32 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] improved a comment
+
+------------------------------------------------------------------------
+r12818 | vlefevre | 2018-06-22 09:26:00 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Re-added "while (...)" erroneously removed in r12817.
+------------------------------------------------------------------------
+r12817 | zimmerma | 2018-06-22 09:14:07 +0000 (Fri, 22 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] added comment
+[src/set_d128.c] likewise
+
+------------------------------------------------------------------------
+r12816 | zimmerma | 2018-06-22 09:00:47 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] avoid variable conflict for DPD
+
+------------------------------------------------------------------------
+r12815 | zimmerma | 2018-06-22 08:54:53 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] implement for DFD encoding
+
+------------------------------------------------------------------------
+r12814 | zimmerma | 2018-06-22 08:54:08 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] added comment and space
+
+------------------------------------------------------------------------
+r12813 | vlefevre | 2018-06-22 02:25:39 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Added a FIXME (stack-buffer-overflow).
+------------------------------------------------------------------------
+r12812 | vlefevre | 2018-06-22 01:57:01 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Corrected r12811.
+------------------------------------------------------------------------
+r12811 | vlefevre | 2018-06-22 01:09:21 +0000 (Fri, 22 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] _MPFR_IEEE_FLOATS code for BID: correctly support
+the decoded significand >= 10^34 cases (non-canonical encodings),
+which must be zero.
+------------------------------------------------------------------------
+r12810 | vlefevre | 2018-06-22 00:49:07 +0000 (Fri, 22 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/{tget_set_d64.c,tget_set_d128.c}] TODO: Also test non-canonical
+encodings.
+------------------------------------------------------------------------
+r12809 | vlefevre | 2018-06-22 00:31:33 +0000 (Fri, 22 Jun 2018) | 5 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c]
+ * Enable the _MPFR_IEEE_FLOATS code only for GMP_NUMB_BITS == 32 or 64
+ (as the other values are not supported by this code).
+ * Bug fix for GMP_NUMB_BITS == 32 (→ tget_set_d128 no longer fails).
+ * Added an assertion corresponding to a comment.
+------------------------------------------------------------------------
+r12808 | vlefevre | 2018-06-22 00:21:38 +0000 (Fri, 22 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Fit on 80 columns.
+------------------------------------------------------------------------
+r12807 | vlefevre | 2018-06-21 21:47:12 +0000 (Thu, 21 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Updated a title comment (→ Decimal support).
+------------------------------------------------------------------------
+r12806 | vlefevre | 2018-06-21 21:45:01 +0000 (Thu, 21 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Corrected a comment.
+------------------------------------------------------------------------
+r12805 | zimmerma | 2018-06-21 19:26:13 +0000 (Thu, 21 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] added comments
+
+------------------------------------------------------------------------
+r12804 | zimmerma | 2018-06-21 19:15:09 +0000 (Thu, 21 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] remove debug stuff
+
+------------------------------------------------------------------------
+r12803 | zimmerma | 2018-06-21 19:13:17 +0000 (Thu, 21 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] assume little-endian double implies little-endian decimal128
+
+------------------------------------------------------------------------
+r12802 | vlefevre | 2018-06-21 17:59:46 +0000 (Thu, 21 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] FIXME for _Decimal128.
+------------------------------------------------------------------------
+r12801 | zimmerma | 2018-06-21 13:41:55 +0000 (Thu, 21 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/set_d128.c
+ M /trunk/tests/tget_set_d128.c
+
+[src/set_d128.c] (partly) implement the _MPFR_IEEE_FLOATS case (BID only so far)
+[tests/tget_set_d128.c] added more tests
+
+------------------------------------------------------------------------
+r12800 | zimmerma | 2018-06-21 13:20:19 +0000 (Thu, 21 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] added comments
+
+------------------------------------------------------------------------
+r12799 | zimmerma | 2018-06-21 06:31:29 +0000 (Thu, 21 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_d128.c
+
+[src/get_d128.c] removed useless comment
+
+------------------------------------------------------------------------
+r12798 | zimmerma | 2018-06-20 17:01:09 +0000 (Wed, 20 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_d128.c
+ M /trunk/tests/tget_set_d128.c
+
+[src/get_d128.c] avoid using doubles
+[tests/tget_set_d128.c] improve test coverage
+
+------------------------------------------------------------------------
+r12797 | zimmerma | 2018-06-20 14:53:41 +0000 (Wed, 20 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] improve test coverage
+
+------------------------------------------------------------------------
+r12796 | zimmerma | 2018-06-20 14:44:52 +0000 (Wed, 20 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] improve coverage
+
+------------------------------------------------------------------------
+r12795 | zimmerma | 2018-06-20 14:10:04 +0000 (Wed, 20 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ A /trunk/src/get_d128.c
+ M /trunk/src/mpfr.h
+ M /trunk/tests/tget_set_d128.c
+
+added mpfr_get_decimal128 (still experimental)
+
+------------------------------------------------------------------------
+r12794 | zimmerma | 2018-06-20 14:08:37 +0000 (Wed, 20 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_d64.c
+
+[get_d64.c] added comments and simplified code
+
+------------------------------------------------------------------------
+r12792 | vlefevre | 2018-06-20 09:08:16 +0000 (Wed, 20 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/{tget_set_d64.c,tget_set_d128.c}] Tests on powers of 10:
+test negative numbers too.
+------------------------------------------------------------------------
+r12791 | vlefevre | 2018-06-19 23:20:12 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added a note about FP constants and native FP.
+------------------------------------------------------------------------
+r12790 | vlefevre | 2018-06-19 16:28:21 +0000 (Tue, 19 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Check that preprocessing directives have no spaces
+before.
+------------------------------------------------------------------------
+r12789 | vlefevre | 2018-06-19 16:18:01 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Modified a comment.
+------------------------------------------------------------------------
+r12788 | vlefevre | 2018-06-19 15:12:40 +0000 (Tue, 19 Jun 2018) | 6 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Avoid double, which is unreliable with GCC
+in non-standard mode (see GCC bug 323 and the discussion in
+GCC bug 85957). But the failure in tget_set_d128 probably came from
+the fact that (_Decimal128) 0.1 is not 1/10 exactly (the double 0.1
+has about a 17-digit precision only, while _Decimal128 has more);
+this test now passes.
+------------------------------------------------------------------------
+r12787 | vlefevre | 2018-06-19 14:52:37 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Simplified code and added assertions.
+------------------------------------------------------------------------
+r12784 | vlefevre | 2018-06-19 12:53:11 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d64.c
+
+[src/set_d64.c] Added a log message (like in set_d128.c).
+------------------------------------------------------------------------
+r12783 | vlefevre | 2018-06-19 12:47:28 +0000 (Tue, 19 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+
+[src/{set_d64.c,set_d128.c}] Bug fix: use mpfr_strtofr instead of
+mpfr_set_str to get the ternary value.
+------------------------------------------------------------------------
+r12782 | vlefevre | 2018-06-19 12:38:35 +0000 (Tue, 19 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/{tget_set_d64.c,tget_set_d128.c}] Added tests on powers of 10.
+ * tget_set_d64 fails on negative due to a bad ternary value.
+ * tget_set_d128 fails on negative due to bad value, etc.
+------------------------------------------------------------------------
+r12781 | vlefevre | 2018-06-19 11:47:27 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Test the flags too.
+------------------------------------------------------------------------
+r12780 | vlefevre | 2018-06-19 11:43:53 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Test more values.
+------------------------------------------------------------------------
+r12779 | vlefevre | 2018-06-19 11:38:05 +0000 (Tue, 19 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Converting an integer into _Decimal128 is better
+than converting a double into _Decimal128.
+------------------------------------------------------------------------
+r12778 | vlefevre | 2018-06-19 11:33:14 +0000 (Tue, 19 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Simplified the test, avoiding a bug in ICC 15
+at the same time (1.0D was regarded as 0).
+------------------------------------------------------------------------
+r12777 | vlefevre | 2018-06-19 11:29:13 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Fixed indentation.
+------------------------------------------------------------------------
+r12776 | vlefevre | 2018-06-19 11:17:02 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Decimal formats: output the encoding type (DPD/BID).
+------------------------------------------------------------------------
+r12775 | vlefevre | 2018-06-19 11:03:01 +0000 (Tue, 19 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Changed _GMP_IEEE_FLOATS to _MPFR_IEEE_FLOATS as per
+r10958 (in set_d128.c, currently in a comment due to r12772).
+------------------------------------------------------------------------
+r12774 | vlefevre | 2018-06-19 10:58:40 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Added a log message.
+------------------------------------------------------------------------
+r12773 | vlefevre | 2018-06-19 10:51:33 +0000 (Tue, 19 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+
+[tests/tget_set_d128.c] Added an informative error message.
+------------------------------------------------------------------------
+r12772 | vlefevre | 2018-06-19 10:05:06 +0000 (Tue, 19 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Disable the _GMP_IEEE_FLOATS code, which is not
+complete yet and makes the compilation fail.
+------------------------------------------------------------------------
+r12771 | vlefevre | 2018-06-13 15:31:23 +0000 (Wed, 13 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Corrected year in copyright notice.
+------------------------------------------------------------------------
+r12770 | vlefevre | 2018-06-13 15:30:02 +0000 (Wed, 13 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_d128.c
+
+[src/set_d128.c] Minor improvements.
+------------------------------------------------------------------------
+r12769 | zimmerma | 2018-06-13 10:33:51 +0000 (Wed, 13 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tget_set_d128.c
+ M /trunk/tests/tget_set_d64.c
+
+[tests/tget_set_d64.c] added -v option to get verbose output
+[tests/tget_set_d128.c] likewise
+
+------------------------------------------------------------------------
+r12768 | vlefevre | 2018-06-13 10:06:15 +0000 (Wed, 13 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] Missing "r".
+------------------------------------------------------------------------
+r12767 | zimmerma | 2018-06-13 08:45:56 +0000 (Wed, 13 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] update for mpfr_set_decimal128
+
+------------------------------------------------------------------------
+r12766 | zimmerma | 2018-06-13 07:10:29 +0000 (Wed, 13 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mpfr.h
+ A /trunk/src/set_d128.c
+ M /trunk/src/set_d64.c
+ M /trunk/tests/Makefile.am
+ A /trunk/tests/tget_set_d128.c
+
+added mpfr_set_decimal128 (work in progress, not yet fully tested)
+
+------------------------------------------------------------------------
+r12765 | zimmerma | 2018-06-08 16:16:55 +0000 (Fri, 08 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/coverage
+
+[tools/coverage] added branch coverage
+
+------------------------------------------------------------------------
+r12764 | vlefevre | 2018-06-07 12:17:31 +0000 (Thu, 07 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Moved some computations on the exponents earlier
+since they may yield an early overflow or underflow, and computing
+the division by b^e would be useless in such a case.
+------------------------------------------------------------------------
+r12763 | vlefevre | 2018-06-07 11:21:46 +0000 (Thu, 07 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Added a MPFR_ASSERTD and a FIXME on things that don't
+make much sense in the error analysis (still trying to understand…).
+------------------------------------------------------------------------
+r12762 | zimmerma | 2018-06-07 09:34:22 +0000 (Thu, 07 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/const_pi.c
+
+[src/const_pi.c] missing reference about Brent-Salamin
+
+------------------------------------------------------------------------
+r12761 | zimmerma | 2018-06-07 09:31:41 +0000 (Thu, 07 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/algorithms.bib
+ M /trunk/doc/algorithms.tex
+
+[doc/algorithms.bib] added reference
+
+------------------------------------------------------------------------
+r12759 | zimmerma | 2018-06-05 14:37:16 +0000 (Tue, 05 Jun 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tfmma.c
+
+[tests/tfmma.c] improve coverage of the UBF case in mpfr_sub
+ (now coverage of sub.c is 100%)
+
+------------------------------------------------------------------------
+r12758 | vlefevre | 2018-06-05 10:35:04 +0000 (Tue, 05 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/src/sum.c
+
+[src/sum.c] Updated TODO from r12755.
+------------------------------------------------------------------------
+r12757 | zimmerma | 2018-06-05 06:45:12 +0000 (Tue, 05 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fmma.c
+
+[src/fmma.c] now mpfr_fmms calls mpfr_sub for a better coverage
-[tests/tstckintc.c] Avoid false warnings with -Wcast-align=strict from
-GCC 8.1 by adding casts "(long *) (void *)", still allowing checks of
-other alignment requirements (which are not handled by the tstckintc.c
-code).
-(merged changeset r12698 from the trunk)
------------------------------------------------------------------------
-r12760 | vlefevre | 2018-06-06 11:05:33 +0000 (Wed, 06 Jun 2018) | 6 lines
+r12756 | vlefevre | 2018-06-04 15:06:35 +0000 (Mon, 04 Jun 2018) | 1 line
Changed paths:
- M /branches/4.0
- A /branches/4.0/codespell.exclude (from /trunk/codespell.exclude:12754)
- M /branches/4.0/codespell.ignore
- M /branches/4.0/tools/mpfrlint
+ M /trunk/src/sum.c
+
+[src/sum.c] Updated TODO from r12755.
+------------------------------------------------------------------------
+r12755 | vlefevre | 2018-06-04 14:49:50 +0000 (Mon, 04 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sum.c
+
+[src/sum.c] Added a comment with a TODO about potentially dead code on
+some platforms.
+------------------------------------------------------------------------
+r12754 | vlefevre | 2018-06-04 12:18:51 +0000 (Mon, 04 Jun 2018) | 5 lines
+Changed paths:
+ A /trunk/codespell.exclude
+ M /trunk/codespell.ignore
+ M /trunk/tools/mpfrlint
codespell: simplified exceptions.
* Added codespell.exclude file.
* codespell.ignore: removed some words (particular cases).
* tools/mpfrlint: use the codespell.exclude exclude file, and for
the doc directory, replaced -S by an explicit list of files.
-(merged changesets r12486,12497,12753-12754 from the trunk)
------------------------------------------------------------------------
-r12750 | vlefevre | 2018-06-02 22:22:50 +0000 (Sat, 02 Jun 2018) | 4 lines
+r12753 | vlefevre | 2018-06-04 09:27:59 +0000 (Mon, 04 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/codespell.ignore
+
+[codespell.ignore] Also ignore "objext" and "tim" (codespell 1.13).
+------------------------------------------------------------------------
+r12752 | zimmerma | 2018-06-04 08:00:22 +0000 (Mon, 04 Jun 2018) | 5 lines
+Changed paths:
+ M /trunk/src/sub1.c
+ M /trunk/tests/tfmma.c
+
+[src/sub1.c] fixed a bug and solved a FIXME (underflow for UBFs)
+Note: this mostly reverts r12319, r12321, and the remaining FIXME
+from r12327.
+[tests/tfmma.c] added non-regression tests
+
+------------------------------------------------------------------------
+r12751 | vlefevre | 2018-06-02 22:39:37 +0000 (Sat, 02 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Concerning r12738, the safer code can be avoided
+with GCC in ISO C mode (__STRICT_ANSI__).
+------------------------------------------------------------------------
+r12749 | zimmerma | 2018-06-02 18:40:39 +0000 (Sat, 02 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/invert_limb.h
+
+[src/invert_limb.h] fixed two typos reported by Marco Bodrato
+
+------------------------------------------------------------------------
+r12748 | vlefevre | 2018-06-02 00:11:28 +0000 (Sat, 02 Jun 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] For GCC, output __STRICT_ANSI__ when defined.
+------------------------------------------------------------------------
+r12747 | zimmerma | 2018-06-01 12:24:43 +0000 (Fri, 01 Jun 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqrt.c
+
+[src/sqrt.c] fixed/improved comments
+
+------------------------------------------------------------------------
+r12746 | zimmerma | 2018-05-31 21:12:05 +0000 (Thu, 31 May 2018) | 2 lines
+Changed paths:
+ M /trunk/src/invsqrt_limb.h
+
+[src/invsqrt_limb.h] fixed typos in comments
+
+------------------------------------------------------------------------
+r12745 | vlefevre | 2018-05-31 20:09:45 +0000 (Thu, 31 May 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Updated a URL.
+------------------------------------------------------------------------
+r12744 | vlefevre | 2018-05-31 16:04:15 +0000 (Thu, 31 May 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/invert_limb.h
+ M /trunk/src/mpfr-impl.h
-[src/invert_limb.h] fixed two typos reported by Marco Bodrato.
-Note that with the current MPFR code, these typos did not have
-any consequence.
-(merged changeset r12749 from the trunk)
+[src/mpfr-impl.h] Fixed potential compilation failure with _Decimal64,
+detected with r12738.
------------------------------------------------------------------------
-r12743 | vlefevre | 2018-05-31 14:47:16 +0000 (Thu, 31 May 2018) | 1 line
+r12742 | vlefevre | 2018-05-31 14:46:31 +0000 (Thu, 31 May 2018) | 1 line
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/doc/mpfr.texi
[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r12741 | vlefevre | 2018-05-31 14:41:37 +0000 (Thu, 31 May 2018) | 2 lines
+r12740 | vlefevre | 2018-05-31 14:37:04 +0000 (Thu, 31 May 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/AUTHORS
- M /branches/4.0/INSTALL
- M /branches/4.0/doc/algorithms.tex
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/examples/sample.c
- M /branches/4.0/mpfr.pc.in
- M /branches/4.0/tests
- M /branches/4.0/tests/tests.c
- M /branches/4.0/tools/cfarm.sh
- M /branches/4.0/tools/update-version
+ M /trunk/AUTHORS
+ M /trunk/INSTALL
+ M /trunk/doc/algorithms.tex
+ M /trunk/doc/mpfr.texi
+ M /trunk/examples/sample.c
+ M /trunk/mpfr.pc.in
+ M /trunk/tests/tests.c
+ M /trunk/tools/cfarm.sh
+ M /trunk/tools/update-version
Updated mpfr.org URL's to use https (except in ChangeLog and NEWS).
-(marked changeset r12740 as merged from the trunk)
------------------------------------------------------------------------
-r12736 | vlefevre | 2018-05-30 17:45:00 +0000 (Wed, 30 May 2018) | 2 lines
+r12738 | vlefevre | 2018-05-31 00:23:22 +0000 (Thu, 31 May 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tools/announce-text
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] With GCC, select safer code for DOUBLE_ISNAN(x).
+------------------------------------------------------------------------
+r12734 | vlefevre | 2018-05-30 17:38:44 +0000 (Wed, 30 May 2018) | 1 line
+Changed paths:
+ M /trunk/tools/announce-text
[tools/announce-text] http → https (for mpfr.org).
-(merged changeset r12734 from the trunk)
------------------------------------------------------------------------
-r12735 | vlefevre | 2018-05-30 17:44:10 +0000 (Wed, 30 May 2018) | 6 lines
+r12733 | vlefevre | 2018-05-30 15:54:11 +0000 (Wed, 30 May 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/FAQ.html
- M /branches/4.0/doc/faq.xsl
- M /branches/4.0/doc/update-faq
+ M /trunk/doc/FAQ.html
-[doc] Changes due to the https support by mpfr.org.
- * faq.xsl: for the visual.css, use a local URL since libxml2 does not
- support https.
+[doc] Updated FAQ.html with update-faq.
+------------------------------------------------------------------------
+r12732 | vlefevre | 2018-05-30 15:53:47 +0000 (Wed, 30 May 2018) | 4 lines
+Changed paths:
+ M /trunk/doc/faq.xsl
+ M /trunk/doc/update-faq
+
+[doc] Workaround due to the lack of https support in libxml2
+and the fact that mpfr.org now uses https with HSTS.
+ * faq.xsl: for the visual.css, use a local URL.
* update-faq: download visual.css from mpfr.org first.
- * FAQ.html: update with update-faq.
-(merged changesets r12731-12733 from the trunk)
------------------------------------------------------------------------
-r12680 | vlefevre | 2018-04-26 15:33:52 +0000 (Thu, 26 Apr 2018) | 8 lines
+r12731 | vlefevre | 2018-05-30 14:09:36 +0000 (Wed, 30 May 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/inp_str.c
- M /branches/4.0/src/out_str.c
+ M /trunk/doc/update-faq
-[src/{inp_str.c,out_str.c}] For mpfr_inp_str and mpfr_out_str, when
-the stream was a null pointer, it was replaced by stdin and stdout,
-respectively. No longer do that, since:
- * This behavior was useless, not documented, and not consistent
- with other I/O functions.
- * Just in case a null pointer for the stream has a special meaning
- with some C implementation, MPFR was not behaving as documented.
-(merged changesets r12520-12521 from the trunk)
+[doc/update-faq] http → https
------------------------------------------------------------------------
-r12679 | vlefevre | 2018-04-26 15:17:30 +0000 (Thu, 26 Apr 2018) | 6 lines
+r12724 | vlefevre | 2018-05-30 09:27:29 +0000 (Wed, 30 May 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/gmp_op.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tgmpop.c
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a FIXME about DOUBLE_ISNAN and GCC.
+------------------------------------------------------------------------
+r12723 | vlefevre | 2018-05-28 16:34:37 +0000 (Mon, 28 May 2018) | 6 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Continued to review the new error analysis and code.
+Changes:
+ * made the code more SSA-like (avoid a "y += ysize; y -= ysize;");
+ * clarified comments;
+ * use MPFR_LIMB_MSB;
+ * added a FIXME on the error analysis.
+------------------------------------------------------------------------
+r12722 | vlefevre | 2018-05-28 13:54:52 +0000 (Mon, 28 May 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added info about shell portability, and in particular
+about quotes (covering changes in r5659, r6128, r12711 and r12721).
+------------------------------------------------------------------------
+r12721 | vlefevre | 2018-05-28 13:52:00 +0000 (Mon, 28 May 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/ck-clz_tab
+ M /trunk/tools/ck-copyright-notice
+ M /trunk/tools/ck-mparam
+ M /trunk/tools/update-version
+
+[tools/{ck-clz_tab,ck-copyright-notice,ck-mparam,update-version}] Fixed
+non-portable quote nesting in backticks.
+------------------------------------------------------------------------
+r12717 | vlefevre | 2018-05-28 11:05:54 +0000 (Mon, 28 May 2018) | 3 lines
+Changed paths:
+ M /trunk/examples/can_round.c
+ M /trunk/examples/divworst.c
+ M /trunk/examples/rndo-add.c
+ M /trunk/examples/sample.c
+ M /trunk/examples/version.c
+
+[examples] Added "mpfr_free_cache ();" at the end of all programs,
+as this is something that should be done systematically (at least
+to detect memory leaks with valgrind).
+------------------------------------------------------------------------
+r12716 | vlefevre | 2018-05-25 15:25:27 +0000 (Fri, 25 May 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Started to review the new error analysis and code
+(r12705,12706). Minor improvements.
+------------------------------------------------------------------------
+r12715 | vlefevre | 2018-05-25 14:46:42 +0000 (Fri, 25 May 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpn_exp.c
+
+[src/{mpfr-impl.h,mpn_exp.c}] Changed the return type of mpfr_mpn_exp
+from long to int for consistency with the mpfr_mpn_exp code and with
+strtofr.c (which expects an int).
+------------------------------------------------------------------------
+r12714 | vlefevre | 2018-05-25 14:40:40 +0000 (Fri, 25 May 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpn_exp.c
+
+[src/mpn_exp.c] Code cleanup and protection against integer overflow.
+------------------------------------------------------------------------
+r12713 | vlefevre | 2018-05-24 14:35:51 +0000 (Thu, 24 May 2018) | 1 line
+Changed paths:
+ M /trunk/src/hypot.c
+
+[src/hypot.c] Do bitwise operations in unsigned arithmetic.
+------------------------------------------------------------------------
+r12712 | vlefevre | 2018-05-24 14:28:57 +0000 (Thu, 24 May 2018) | 1 line
+Changed paths:
+ M /trunk/src/hypot.c
+
+[src/hypot.c] Added 2 TODO.
+------------------------------------------------------------------------
+r12711 | vlefevre | 2018-05-23 14:34:10 +0000 (Wed, 23 May 2018) | 3 lines
+Changed paths:
+ M /trunk/tools/ck-clz_tab
+ M /trunk/tools/ck-copyright-notice
+
+[tools/{ck-clz_tab,ck-copyright-notice}] Changed the POSIX $(…) to `…`
+for Bourne shell compatibility (as under Solaris 10).
+Note: these scripts are called via dist-hook for "make dist".
+------------------------------------------------------------------------
+r12710 | vlefevre | 2018-05-22 07:41:58 +0000 (Tue, 22 May 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a comment for UBF.
+------------------------------------------------------------------------
+r12709 | vlefevre | 2018-05-22 07:32:18 +0000 (Tue, 22 May 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a comment about UBF and alignment requirements.
+------------------------------------------------------------------------
+r12708 | vlefevre | 2018-05-17 00:42:02 +0000 (Thu, 17 May 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Removed TODO added in r12681, now obsolete.
+------------------------------------------------------------------------
+r12707 | vlefevre | 2018-05-16 15:17:09 +0000 (Wed, 16 May 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r12706 | zimmerma | 2018-05-16 14:43:31 +0000 (Wed, 16 May 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] revisit error analysis in the division case (end)
+
+------------------------------------------------------------------------
+r12705 | zimmerma | 2018-05-15 16:10:08 +0000 (Tue, 15 May 2018) | 3 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] revisit error analysis in the division case (work in progress,
+ not yet finished)
+
+------------------------------------------------------------------------
+r12702 | vlefevre | 2018-05-09 11:21:11 +0000 (Wed, 09 May 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Updated the comment added in r12701.
+------------------------------------------------------------------------
+r12701 | vlefevre | 2018-05-09 11:16:19 +0000 (Wed, 09 May 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Added a comment about the bug fixed in r10697:
+bug20180217 is a non-regression test for this bug.
+------------------------------------------------------------------------
+r12698 | vlefevre | 2018-05-02 15:14:32 +0000 (Wed, 02 May 2018) | 4 lines
+Changed paths:
+ M /trunk/tests/tstckintc.c
+
+[tests/tstckintc.c] Avoid false warnings with -Wcast-align=strict from
+GCC 8.1 by adding casts "(long *) (void *)", still allowing checks of
+other alignment requirements (which are not handled by the tstckintc.c
+code).
+------------------------------------------------------------------------
+r12697 | vlefevre | 2018-05-02 14:16:58 +0000 (Wed, 02 May 2018) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] + Use GCC's nonnull and returns_nonnull attributes.
+------------------------------------------------------------------------
+r12696 | vlefevre | 2018-05-02 12:31:59 +0000 (Wed, 02 May 2018) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added a note on _Decimal64 detection.
+------------------------------------------------------------------------
+r12691 | vlefevre | 2018-04-30 15:24:36 +0000 (Mon, 30 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added info about spelling.
+------------------------------------------------------------------------
+r12690 | vlefevre | 2018-04-30 15:18:16 +0000 (Mon, 30 Apr 2018) | 5 lines
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/src/random_deviate.c
+ M /trunk/tests/teint.c
+ M /trunk/tests/tversion.c
+
+Corrected "runtime" to "run time" (noun) or "run-time" (adjective)
+when it means the time at which the program is run.
+See:
+ https://gcc.gnu.org/codingconventions.html#Spelling
+ https://en.wikipedia.org/wiki/Run_time
+------------------------------------------------------------------------
+r12689 | vlefevre | 2018-04-27 15:39:52 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Potentially unnecessary code: comes from r8384.
+------------------------------------------------------------------------
+r12688 | vlefevre | 2018-04-27 15:20:11 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Updated TODO about potentially unnecessary code.
+------------------------------------------------------------------------
+r12687 | vlefevre | 2018-04-27 15:07:18 +0000 (Fri, 27 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Updated TODO about potentially unnecessary code,
+showing that this code probably increases the error bound (errors
+accumulate instead of compensating without this code).
+------------------------------------------------------------------------
+r12686 | vlefevre | 2018-04-27 11:17:16 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Added a TODO about potentially unnecessary code.
+------------------------------------------------------------------------
+r12685 | vlefevre | 2018-04-27 08:50:28 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Corrected/updated comments and added a log message.
+------------------------------------------------------------------------
+r12684 | vlefevre | 2018-04-27 08:34:58 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Corrected a comment (exp_base and exp_bin description).
+------------------------------------------------------------------------
+r12683 | vlefevre | 2018-04-27 08:22:59 +0000 (Fri, 27 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Added a FIXME: possible bug in very special cases with
+large exponents, 32-bit mpfr_exp_t and very long strings.
+------------------------------------------------------------------------
+r12682 | vlefevre | 2018-04-27 07:40:21 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Added/clarified comments.
+------------------------------------------------------------------------
+r12681 | vlefevre | 2018-04-27 01:36:48 +0000 (Fri, 27 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tstrtofr.c
+
+[tests/tstrtofr.c] Added a TODO related to the bug fixed in r12573.
+------------------------------------------------------------------------
+r12678 | vlefevre | 2018-04-26 15:10:36 +0000 (Thu, 26 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tgmpop.c
+
+[tests/tgmpop.c] Coding style.
+------------------------------------------------------------------------
+r12677 | vlefevre | 2018-04-26 15:07:36 +0000 (Thu, 26 Apr 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/tgmpop.c
-[src/gmp_op.c] Fixed a bug in mpfr_cmp_q on NaN rational: the NaN flag
- was set by mpfr_set_q, but the flags were not restored just after.
[tests/tgmpop.c] For mpfr_cmp_q, improved the test where x is NaN by
- checking all the flags (not just erange) and added a test where y is
- a NaN rational.
-(merged changesets r12343,12677 from the trunk)
+checking all the flags (not just erange) and added a test where y is
+a NaN rational.
+Note: this could be used to detect 2 bugs, fixed in r12343 and r12499,
+respectively.
------------------------------------------------------------------------
-r12675 | vlefevre | 2018-04-26 13:13:57 +0000 (Thu, 26 Apr 2018) | 1 line
+r12676 | vlefevre | 2018-04-26 14:08:10 +0000 (Thu, 26 Apr 2018) | 2 lines
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tcan_round.c
- M /branches/4.0/tests/tconst_pi.c
- M /branches/4.0/tests/tfpif.c
- M /branches/4.0/tests/tgrandom.c
- M /branches/4.0/tests/tpow.c
- M /branches/4.0/tests/ttan.c
+ M /trunk/tests/tcan_round.c
-Merged recent tests from the trunk (r12500-12555,12558,12561).
+[tests/tcan_round.c] Removed a r2 != MPFR_RNDF test and added 3 TODO's
+to support r2 == MPFR_RNDF in some other tests.
------------------------------------------------------------------------
-r12674 | vlefevre | 2018-04-26 12:59:37 +0000 (Thu, 26 Apr 2018) | 5 lines
+r12646 | vlefevre | 2018-04-24 09:46:03 +0000 (Tue, 24 Apr 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/Makefile.am
+ M /trunk/src/mpfr-gmp.h
-[tests/Makefile.am] Update of the "check" rule:
- * Output svnversion info when applicable.
- * Do not echo (complex) commands.
- * Do not output a useless "PASS ..." line at the end.
-(merged changesets r12535-12536 from the trunk)
+[src/mpfr-gmp.h] Clarified a comment (the "if" is part of the code,
+not the English word).
------------------------------------------------------------------------
-r12664 | vlefevre | 2018-04-25 15:06:34 +0000 (Wed, 25 Apr 2018) | 4 lines
+r12645 | zimmerma | 2018-04-24 08:57:53 +0000 (Tue, 24 Apr 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/gmp_op.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tgmpop.c
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] added comment about MPN_FILL
-[src/gmp_op.c] Fixed bug in mpfr_cmp_q when the denominator of the
- mpq_t argument is 0.
-[tests/tgmpop.c] Added tests.
-(merged changesets r12499,12502 from the trunk)
------------------------------------------------------------------------
-r12663 | vlefevre | 2018-04-25 15:00:21 +0000 (Wed, 25 Apr 2018) | 1 line
+r12644 | vlefevre | 2018-04-20 09:17:15 +0000 (Fri, 20 Apr 2018) | 1 line
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/src/out_str.c
+
+[src/out_str.c] Check for integer overflow (here, a minor issue).
+------------------------------------------------------------------------
+r12643 | vlefevre | 2018-04-20 09:10:27 +0000 (Fri, 20 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/out_str.c
+
+[src/out_str.c] Support mpfr_exp_t larger than long (with mpfr_eexp_t).
+------------------------------------------------------------------------
+r12641 | vlefevre | 2018-04-19 15:13:10 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests
+
+[tests] Added tdot to svn:ignore property.
+------------------------------------------------------------------------
+r12640 | vlefevre | 2018-04-19 15:10:52 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tdot.c
+
+[tests/tdot.c] Various improvements.
+------------------------------------------------------------------------
+r12639 | vlefevre | 2018-04-19 14:57:05 +0000 (Thu, 19 Apr 2018) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/dot.c
+
+[doc/mpfr.texi] Note that mpfr_dot does not yet handle intermediate
+underflows either.
+[src/dot.c] Changed an MPFR_ASSERTD to MPFR_ASSERTN since the assertion
+is not satisfied on some user inputs. Minor improvements.
+------------------------------------------------------------------------
+r12638 | vlefevre | 2018-04-19 14:42:21 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Added mpfr_dot.
+------------------------------------------------------------------------
+r12637 | vlefevre | 2018-04-19 14:41:42 +0000 (Thu, 19 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] In the added functions, note that mpfr_dot is incomplete
+and experimental.
+------------------------------------------------------------------------
+r12636 | vlefevre | 2018-04-19 14:31:39 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsum.c
+
+[tests/tsum.c] Code style.
+------------------------------------------------------------------------
+r12635 | vlefevre | 2018-04-19 14:30:19 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r12662 | vlefevre | 2018-04-25 14:45:45 +0000 (Wed, 25 Apr 2018) | 1 line
+r12634 | vlefevre | 2018-04-19 14:29:41 +0000 (Thu, 19 Apr 2018) | 1 line
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tdiv_ui.c
- M /branches/4.0/tests/tfma.c
- M /branches/4.0/tests/tget_str.c
+ M /trunk/tests/tdot.c
-Merged recent tests from the trunk (r12435-12453).
+[tests/tdot.c] Code style.
------------------------------------------------------------------------
-r12642 | vlefevre | 2018-04-19 15:51:55 +0000 (Thu, 19 Apr 2018) | 13 lines
+r12633 | zimmerma | 2018-04-19 14:21:48 +0000 (Thu, 19 Apr 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/get_str.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tget_str.c
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/Makefile.am
+ A /trunk/src/dot.c
+ M /trunk/src/mpfr.h
+ M /trunk/tests/Makefile.am
+ A /trunk/tests/tdot.c
+
+added mpfr_dot
-Fixed an issue with mpfr_get_str: The number 1 of significant digits
-output in the string is now fully supported, i.e.
- * the value 1 can be provided for n (4th argument);
- * if n = 0, then the number of significant digits in the output string
- can now be 1, as already implied by the documentation (but the code
- was increasing it to 2).
-Changes:
- * doc/mpfr.texi: updated mpfr_get_str description to accept n = 1.
- * src/get_str.c: fixed the code as explained above (for n = 0,
- removed the increase to 2, and removed an MPFR_ASSERTN).
- * tests/tget_str.c: added tests.
-(merged changesets from the trunk: r12430 on tests/tget_str.c only;
-r12432,12434,12440)
------------------------------------------------------------------------
-r12632 | vlefevre | 2018-04-19 13:33:00 +0000 (Thu, 19 Apr 2018) | 3 lines
+r12631 | vlefevre | 2018-04-19 13:32:03 +0000 (Thu, 19 Apr 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tget_flt.c
+ M /trunk/tests/tget_flt.c
[tests/tget_flt.c] Correction about the use of mpfr_signbit, in case
the implementation would change.
-(merged changeset r12631 from the trunk)
------------------------------------------------------------------------
-r12630 | vlefevre | 2018-04-19 13:28:19 +0000 (Thu, 19 Apr 2018) | 1 line
+r12628 | vlefevre | 2018-04-19 13:09:19 +0000 (Thu, 19 Apr 2018) | 1 line
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tbuildopt.c
- M /branches/4.0/tests/tfma.c
- M /branches/4.0/tests/tget_flt.c
- M /branches/4.0/tests/tget_q.c
- M /branches/4.0/tests/tget_set_d64.c
- M /branches/4.0/tests/tset_z_exp.c
+ M /trunk/src/sqr.c
-Merged recent tests from the trunk (r12393-12424).
+[src/sqr.c] Minor code improvement.
------------------------------------------------------------------------
-r12629 | vlefevre | 2018-04-19 13:17:34 +0000 (Thu, 19 Apr 2018) | 4 lines
+r12627 | vlefevre | 2018-04-19 12:56:07 +0000 (Thu, 19 Apr 2018) | 1 line
Changed paths:
- M /branches/4.0/src/sqr.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tsqr.c
+ M /trunk/src/sqr.c
-[src/sqr.c] Fixed a bug in mpfr_sqr_1n in a rare case near underflow.
-[tests/tsqr.c] Added tests, including non-regression for above bug
-(manually patched src/sqr.c since r12398 had other, unrelated changes;
-merged changesets r12398-12399 on tests/tsqr.c from the trunk)
+[src/sqr.c] Code formatting.
------------------------------------------------------------------------
-r12624 | vlefevre | 2018-04-19 12:24:18 +0000 (Thu, 19 Apr 2018) | 4 lines
+r12626 | vlefevre | 2018-04-19 12:55:10 +0000 (Thu, 19 Apr 2018) | 1 line
Changed paths:
- M /branches/4.0/src/fma.c
- M /branches/4.0/tests/tfma.c
+ M /trunk/src/sqr.c
+
+[src/sqr.c] Clarified a comment and slightly improved code.
+------------------------------------------------------------------------
+r12625 | vlefevre | 2018-04-19 12:37:50 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/sqr.c
+
+[src/sqr.c] Typo in a comment.
+------------------------------------------------------------------------
+r12623 | vlefevre | 2018-04-19 10:15:25 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Added test_underflow5.
+------------------------------------------------------------------------
+r12622 | vlefevre | 2018-04-19 10:09:44 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Minor correction for test_underflow4.
+------------------------------------------------------------------------
+r12620 | vlefevre | 2018-04-19 07:01:09 +0000 (Thu, 19 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Added a comment.
+------------------------------------------------------------------------
+r12619 | vlefevre | 2018-04-18 23:24:57 +0000 (Wed, 18 Apr 2018) | 6 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Added test_underflow4. This allows to show that the
+bound MAX (MPFR_PREC (z), MPFR_PREC (s) + 1) in fma.c is optimal:
+ * If one subtract 1 from the 1st term MPFR_PREC (z), a failure
+ occurs in test_underflow4.
+ * If one subtract 1 from the 2nd term MPFR_PREC (s) + 1, a failure
+ occurs in test_underflow2.
+------------------------------------------------------------------------
+r12618 | vlefevre | 2018-04-18 15:19:33 +0000 (Wed, 18 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] For the ICC check, also test __INTEL_COMPILER.
+------------------------------------------------------------------------
+r12617 | vlefevre | 2018-04-18 15:15:25 +0000 (Wed, 18 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] Corrected comment for the ICC check (GCC is no longer
+disabled since r5720).
+------------------------------------------------------------------------
+r12616 | zimmerma | 2018-04-18 12:16:49 +0000 (Wed, 18 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/TODO
+ M /trunk/src/mpfr.h
+
+[src/mpfr.h] enable some code that now works with ICC (tested with ICC 14)
+[TODO] removed item
-[src/fma.c] Fixed various bugs related to internal overflows/underflows.
-[tests/tfma.c] Added tests.
-(merged changesets r12393-12405,12583-12623 on these files from the
-trunk)
------------------------------------------------------------------------
-r12581 | vlefevre | 2018-04-11 15:17:16 +0000 (Wed, 11 Apr 2018) | 8 lines
+r12615 | vlefevre | 2018-04-18 11:58:30 +0000 (Wed, 18 Apr 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/terf.c
- M /branches/4.0/tests/tpow.c
- M /branches/4.0/tests/tpow_z.c
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Updated a comment about __ICC.
+------------------------------------------------------------------------
+r12614 | zimmerma | 2018-04-18 11:32:15 +0000 (Wed, 18 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] removed item that we won't implement
+
+------------------------------------------------------------------------
+r12613 | zimmerma | 2018-04-18 11:25:44 +0000 (Wed, 18 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] removed done item (UBF)
+
+------------------------------------------------------------------------
+r12612 | zimmerma | 2018-04-17 19:50:44 +0000 (Tue, 17 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] RNDF is done
+
+------------------------------------------------------------------------
+r12611 | zimmerma | 2018-04-17 19:46:45 +0000 (Tue, 17 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] removed an obsolete item
+
+------------------------------------------------------------------------
+r12610 | zimmerma | 2018-04-17 19:42:39 +0000 (Tue, 17 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] log_ui is done
+
+------------------------------------------------------------------------
+r12609 | vlefevre | 2018-04-17 09:30:16 +0000 (Tue, 17 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Detect the use of mpfr_div_2exp and mpfr_mul_2exp.
+------------------------------------------------------------------------
+r12608 | vlefevre | 2018-04-17 01:57:39 +0000 (Tue, 17 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/reuse.c
+ M /trunk/tests/taway.c
+
+[tests/{reuse.c,taway.c}] Added mpfr_div_2ui and mpfr_mul_2ui.
+Note: si functions are not tested yet.
+------------------------------------------------------------------------
+r12607 | vlefevre | 2018-04-17 01:51:13 +0000 (Tue, 17 Apr 2018) | 4 lines
+Changed paths:
+ M /trunk/src/atan.c
+ M /trunk/src/bernoulli.c
+ M /trunk/src/const_euler.c
+ M /trunk/src/digamma.c
+ M /trunk/src/log_ui.c
+ M /trunk/src/sin_cos.c
+ M /trunk/src/zeta.c
+ M /trunk/tests/tacos.c
+ M /trunk/tests/tacosh.c
+ M /trunk/tests/tadd.c
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tasin.c
+ M /trunk/tests/tatan.c
+ M /trunk/tests/tcmp2.c
+ M /trunk/tests/tcmp_ui.c
+ M /trunk/tests/tconst_catalan.c
+ M /trunk/tests/tdiv.c
+ M /trunk/tests/texceptions.c
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tgamma.c
+ M /trunk/tests/tget_d.c
+ M /trunk/tests/tget_d_2exp.c
+ M /trunk/tests/tget_f.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tget_str.c
+ M /trunk/tests/tget_z.c
+ M /trunk/tests/tmul.c
+ M /trunk/tests/tpow.c
+ M /trunk/tests/tremquo.c
+ M /trunk/tests/trint.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tsqr.c
+ M /trunk/tests/tsqrt.c
+ M /trunk/tests/tsub.c
+ M /trunk/tests/tsub1sp.c
+
+Replaced mpfr_mul_2exp & mpfr_div_2exp by mpfr_mul_2ui & mpfr_div_2ui,
+respectively (for the tests, except in reuse.c and in taway.c).
+Note: As documented, mpfr_mul_2exp & mpfr_div_2exp are only kept for
+compatibility with MPF; mpfr_mul_2ui & mpfr_div_2ui are preferred.
+------------------------------------------------------------------------
+r12606 | vlefevre | 2018-04-16 15:07:16 +0000 (Mon, 16 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] + function to reduce the precision of a variable, with a
+ternary value in input, i.e. taking care of double rounding.
+------------------------------------------------------------------------
+r12605 | vlefevre | 2018-04-16 14:48:20 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] More tests for test_underflow2.
+------------------------------------------------------------------------
+r12604 | vlefevre | 2018-04-16 14:41:06 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Corrected r12603 for test_underflow2.
+------------------------------------------------------------------------
+r12603 | vlefevre | 2018-04-16 14:20:23 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] More tests for test_underflow2.
+------------------------------------------------------------------------
+r12602 | vlefevre | 2018-04-16 13:54:22 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Updated easy case of underflow.
+------------------------------------------------------------------------
+r12601 | vlefevre | 2018-04-16 11:43:32 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Updated a comment for test_underflow2.
+------------------------------------------------------------------------
+r12600 | vlefevre | 2018-04-16 11:37:23 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] In test_underflow2, also test different signs.
+------------------------------------------------------------------------
+r12599 | vlefevre | 2018-04-16 10:36:12 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests
+
+[tests] Updated svn:ignore property.
+------------------------------------------------------------------------
+r12598 | vlefevre | 2018-04-16 09:31:24 +0000 (Mon, 16 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] "To make a release": check also with
+-DMPFR_GROUP_STATIC_SIZE=0 to detect memory leaks.
+------------------------------------------------------------------------
+r12597 | vlefevre | 2018-04-16 09:09:00 +0000 (Mon, 16 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Forgot a MPFR_GROUP_CLEAR.
+------------------------------------------------------------------------
+r12596 | vlefevre | 2018-04-16 09:05:01 +0000 (Mon, 16 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Simplified the underflow case by using UBF in the
+difficult cases, resolving the remaining FIXME's.
+------------------------------------------------------------------------
+r12595 | vlefevre | 2018-04-13 14:44:41 +0000 (Fri, 13 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] More tests for test_overflow3 by adding loops on j and k.
+------------------------------------------------------------------------
+r12594 | vlefevre | 2018-04-13 13:43:49 +0000 (Fri, 13 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Extended test_overflow3 to reversed signs.
+------------------------------------------------------------------------
+r12593 | vlefevre | 2018-04-13 13:29:31 +0000 (Fri, 13 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Do all the overflow/underflow tests in exponent ranges
+[-1024,1024], [MPFR_EMIN_MIN,MPFR_EMAX_MAX], and the default one.
+------------------------------------------------------------------------
+r12592 | vlefevre | 2018-04-13 10:17:33 +0000 (Fri, 13 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-sassert.h
+
+[src/mpfr-sassert.h] Added a comment.
+------------------------------------------------------------------------
+r12591 | vlefevre | 2018-04-12 19:04:45 +0000 (Thu, 12 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Forgot a cast for C++ compatibility.
+------------------------------------------------------------------------
+r12590 | vlefevre | 2018-04-12 14:50:25 +0000 (Thu, 12 Apr 2018) | 4 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Reverted r12588: there should be no alignment issues
+with UBF, since an UBF (__mpfr_ubf_struct) is sometimes regarded as a
+MPFR number (__mpfr_struct) but not the opposite (or this is just back
+to __mpfr_ubf_struct).
+------------------------------------------------------------------------
+r12589 | vlefevre | 2018-04-12 14:17:55 +0000 (Thu, 12 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Simplified the difficult part of the overflow case by
+using UBF (this also fixes corner cases in huge precision).
+------------------------------------------------------------------------
+r12588 | vlefevre | 2018-04-12 13:46:10 +0000 (Thu, 12 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Added a note about alignment constraints for UBF.
+------------------------------------------------------------------------
+r12587 | vlefevre | 2018-04-12 13:34:16 +0000 (Thu, 12 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fma.c
+ M /trunk/tests/tfma.c
+
+[src/fma.c] Fixed sign related bug in overflow case.
+[tests/tfma.c] Added test_overflow5 test for this bug.
+------------------------------------------------------------------------
+r12586 | vlefevre | 2018-04-12 12:52:20 +0000 (Thu, 12 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] In test_overflow4, also test different signs.
+------------------------------------------------------------------------
+r12585 | vlefevre | 2018-04-12 10:27:59 +0000 (Thu, 12 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Correction for the FIXME from r12403 concerning r12396.
+The test added in tests/tfma.c r12584 no longer fails.
+------------------------------------------------------------------------
+r12584 | vlefevre | 2018-04-12 10:21:00 +0000 (Thu, 12 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Added a test that fails. It corresponds to the FIXME
+in src/fma.c about the test on MPFR_GET_EXP (u) - MPFR_GET_EXP (z).
+------------------------------------------------------------------------
+r12583 | vlefevre | 2018-04-12 08:29:47 +0000 (Thu, 12 Apr 2018) | 4 lines
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Removed a redundant test since the second condition of
+the && expression implies the first one.
+Note: This test came from the time when the precision type was unsigned,
+in order to make sure that the result of the subtraction was positive.
+------------------------------------------------------------------------
+r12575 | vlefevre | 2018-04-11 12:40:33 +0000 (Wed, 11 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Output "Generic ABI code" info (MPFR_GENERIC_ABI).
+------------------------------------------------------------------------
+r12574 | vlefevre | 2018-04-11 09:12:00 +0000 (Wed, 11 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] English usage in a comment.
+------------------------------------------------------------------------
+r12573 | zimmerma | 2018-04-11 06:51:30 +0000 (Wed, 11 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] fixed bug in corner cases
+
+------------------------------------------------------------------------
+r12572 | vlefevre | 2018-04-10 15:51:23 +0000 (Tue, 10 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Reverted r12569: this is wrong with a 32-bit ABI.
+------------------------------------------------------------------------
+r12571 | vlefevre | 2018-04-10 13:12:40 +0000 (Tue, 10 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] Added a FIXME.
+------------------------------------------------------------------------
+r12570 | zimmerma | 2018-04-10 12:34:44 +0000 (Tue, 10 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] added more comments
+
+------------------------------------------------------------------------
+r12569 | zimmerma | 2018-04-10 08:31:31 +0000 (Tue, 10 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+ M /trunk/tests/tstrtofr.c
+
+[src/strtofr.c] replaced dead code by an assert
+[tests/tstrtofr.c] fixed bug20170308 and added coverage test
+
+------------------------------------------------------------------------
+r12568 | zimmerma | 2018-04-09 14:49:32 +0000 (Mon, 09 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] removed dead code (and added explanation)
+
+------------------------------------------------------------------------
+r12567 | zimmerma | 2018-04-09 08:02:45 +0000 (Mon, 09 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+
+[src/strtofr.c] completed a comment
+
+------------------------------------------------------------------------
+r12566 | zimmerma | 2018-04-06 16:19:29 +0000 (Fri, 06 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/strtofr.c
+ M /trunk/tests/tstrtofr.c
+
+[src/strtofr.c] added comment
+[tests/tstrtofr.c] improve coverage
+
+------------------------------------------------------------------------
+r12565 | vlefevre | 2018-04-06 15:21:45 +0000 (Fri, 06 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/round_prec.c
+
+[src/round_prec.c] Replaced an incorrect comment by an assertion.
+------------------------------------------------------------------------
+r12564 | vlefevre | 2018-04-06 15:12:54 +0000 (Fri, 06 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/round_raw_generic.c
+
+[src/round_raw_generic.c] Check validity of flag.
+------------------------------------------------------------------------
+r12563 | zimmerma | 2018-04-06 15:11:13 +0000 (Fri, 06 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] now 98.2% of test coverage
+
+------------------------------------------------------------------------
+r12562 | vlefevre | 2018-04-06 15:07:51 +0000 (Fri, 06 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/Makefile.am
+
+[tests/Makefile.am] Tests in lexicographic order.
+------------------------------------------------------------------------
+r12561 | zimmerma | 2018-04-06 15:02:12 +0000 (Fri, 06 Apr 2018) | 4 lines
+Changed paths:
+ M /trunk/src/round_prec.c
+ M /trunk/src/round_raw_generic.c
+ M /trunk/tests/tcan_round.c
+
+[src/round_prec.c] added comments
+[src/round_raw_generic.c] removed dead code
+[tests/tcan_round.c] improve coverage
+
+------------------------------------------------------------------------
+r12560 | zimmerma | 2018-04-06 14:46:04 +0000 (Fri, 06 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/Makefile.am
+ A /trunk/tests/tprec_round.c (from /trunk/tests/tround_prec.c:12559)
+ D /trunk/tests/tround_prec.c
+
+renamed tround_prec.c to tprec_round.c
+
+------------------------------------------------------------------------
+r12559 | zimmerma | 2018-04-06 13:43:27 +0000 (Fri, 06 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/round_prec.c
+
+[src/round_prec.c] removed some dead code (if rnd1 = rnd2 and the case
+ rnd2 = RNDN was already treated, we cannot have rnd1 = RNDN)
+
+------------------------------------------------------------------------
+r12558 | vlefevre | 2018-04-06 10:02:31 +0000 (Fri, 06 Apr 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] Fixed a test:
+ * For this test, unsigned long and mpfr_exp_t must both have at least
+ 64 bits.
+ * Use a hardcoded emax, otherwise the test could fail for mpfr_exp_t
+ larger than 64 bits (one would not have an overflow as expected).
+------------------------------------------------------------------------
+r12557 | vlefevre | 2018-04-06 09:43:31 +0000 (Fri, 06 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] Fixed the code in case the size of the mpfr_exp_t type
+would be larger than 256 bits. This is also semantically better.
+------------------------------------------------------------------------
+r12556 | vlefevre | 2018-04-06 09:40:57 +0000 (Fri, 06 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/tests/mpfr-test.h
+
+Moved the MAX, MIN and ABS macros from tests/mpfr-test.h to
+src/mpfr-impl.h (they can be useful...).
+------------------------------------------------------------------------
+r12555 | vlefevre | 2018-04-06 09:20:56 +0000 (Fri, 06 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] More tests for (-2)^(2^i + 1), not just with i = 256.
+------------------------------------------------------------------------
+r12554 | zimmerma | 2018-04-06 08:57:26 +0000 (Fri, 06 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] modified a test for better coverage
+
+------------------------------------------------------------------------
+r12553 | vlefevre | 2018-04-06 08:47:09 +0000 (Fri, 06 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] Corrected a comment (again).
+------------------------------------------------------------------------
+r12552 | vlefevre | 2018-04-06 08:45:56 +0000 (Fri, 06 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] Corrected a comment.
+------------------------------------------------------------------------
+r12551 | zimmerma | 2018-04-06 08:11:21 +0000 (Fri, 06 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] simplified case x=2^b and y < 0
+
+------------------------------------------------------------------------
+r12550 | vlefevre | 2018-04-05 14:29:38 +0000 (Thu, 05 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] Updated comments.
+------------------------------------------------------------------------
+r12549 | vlefevre | 2018-04-05 14:15:16 +0000 (Thu, 05 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] Reverted r12541 (which yielded a failure in tpow_all),
+re-indented, and added a comment concerning the failing case.
+------------------------------------------------------------------------
+r12548 | zimmerma | 2018-04-05 07:28:05 +0000 (Thu, 05 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/round_prec.c
+ M /trunk/tests/tcan_round.c
+
+[src/round_prec.c] fixed a bug (to be reviewed)
+[tests/tcan_round.c] added coverage tests
+
+------------------------------------------------------------------------
+r12547 | zimmerma | 2018-04-05 06:32:30 +0000 (Thu, 05 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/ttan.c
+
+[tests/ttan.c] improve coverage (and also of round_near_x)
+
+------------------------------------------------------------------------
+r12546 | zimmerma | 2018-04-05 06:01:20 +0000 (Thu, 05 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] fixed typo
+
+------------------------------------------------------------------------
+r12545 | vlefevre | 2018-04-04 16:47:10 +0000 (Wed, 04 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Coverage is specific to x86_64 due to the various #if.
+------------------------------------------------------------------------
+r12544 | vlefevre | 2018-04-04 16:44:54 +0000 (Wed, 04 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] Corrected indentation.
+------------------------------------------------------------------------
+r12543 | zimmerma | 2018-04-04 16:34:31 +0000 (Wed, 04 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] coverage is now 98.1%
+
+------------------------------------------------------------------------
+r12542 | zimmerma | 2018-04-04 16:31:38 +0000 (Wed, 04 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/pow.c
+
+[src/pow.c] added a comment
+
+------------------------------------------------------------------------
+r12541 | zimmerma | 2018-04-04 16:21:33 +0000 (Wed, 04 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/pow.c
+ M /trunk/tests/tpow.c
+
+[src/pow.c] removed some dead code (with comment explaining why)
+[tests/tpow.c] added a test
+
+------------------------------------------------------------------------
+r12540 | zimmerma | 2018-04-04 15:31:32 +0000 (Wed, 04 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/pow.c
+ M /trunk/tests/tpow.c
+
+[src/pow.c] simplify code for prec=1
+[tests/tpow.c] added tests for prec=1
+
+------------------------------------------------------------------------
+r12539 | zimmerma | 2018-04-03 15:28:21 +0000 (Tue, 03 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] added macros for Microsoft compiler
+
+------------------------------------------------------------------------
+r12538 | vlefevre | 2018-04-03 13:25:29 +0000 (Tue, 03 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tools/check_mparam.c
+
+[tools/check_mparam.c] Added a copyright notice.
+------------------------------------------------------------------------
+r12537 | vlefevre | 2018-04-03 13:20:13 +0000 (Tue, 03 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/Makefile.am
+
+[Makefile.am] Added tools/check_mparam.c and tools/ck-mparam
+to EXTRA_DIST since tools/ck-mparam is now run in dist-hook.
+------------------------------------------------------------------------
+r12536 | vlefevre | 2018-04-03 13:09:08 +0000 (Tue, 03 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tests/Makefile.am
+
+[tests/Makefile.am] Do not output a useless "PASS ..." line at the end.
+------------------------------------------------------------------------
+r12535 | vlefevre | 2018-04-03 13:07:14 +0000 (Tue, 03 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/Makefile.am
+
+[tests/Makefile.am] Update of the "check" rule:
+ * Output svnversion info when applicable.
+ * Do not echo "cat tversion.log 2> /dev/null || true".
+------------------------------------------------------------------------
+r12534 | vlefevre | 2018-04-03 11:08:38 +0000 (Tue, 03 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/Makefile.am
+
+[Makefile.am] Added missing comments for dist-hook.
+------------------------------------------------------------------------
+r12533 | vlefevre | 2018-04-03 11:05:23 +0000 (Tue, 03 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/Makefile.am
+
+[Makefile.am] Run ck-mparam in dist-hook (for "make dist").
+------------------------------------------------------------------------
+r12532 | vlefevre | 2018-04-03 11:02:41 +0000 (Tue, 03 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/ck-mparam
+
+[tools/ck-mparam] Commented out the old gcc-specific test since the
+new one is strictly more powerful. No longer depend on gcc.
+------------------------------------------------------------------------
+r12531 | vlefevre | 2018-04-03 10:57:37 +0000 (Tue, 03 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/tools/ck-mparam
+
+[tools/ck-mparam] Also check the mparam.h files with check_mparam.c.
+------------------------------------------------------------------------
+r12530 | vlefevre | 2018-04-03 10:48:34 +0000 (Tue, 03 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/check_mparam.c
+
+[tools/check_mparam.c] C89 compatibility. Return an error code
+(useful for scripts).
+------------------------------------------------------------------------
+r12529 | vlefevre | 2018-04-03 10:45:20 +0000 (Tue, 03 Apr 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/check_mparam.c
+
+[tools/check_mparam.c] A pathname of the mparam.h file can now be
+provided with -DMPARAM='"..."' when compiling.
+------------------------------------------------------------------------
+r12528 | vlefevre | 2018-04-03 10:38:15 +0000 (Tue, 03 Apr 2018) | 3 lines
+Changed paths:
+ D /misc/check_mparam.c
+ A /trunk/tools/check_mparam.c (from /misc/check_mparam.c:12527)
+
+Moved misc/check_mparam.c into trunk/tools: it will be useful for
+"make dist" in order to make sure that all mparam.h files are OK
+before a release.
+------------------------------------------------------------------------
+r12527 | vlefevre | 2018-04-03 10:31:30 +0000 (Tue, 03 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mulders.c
+
+[src/mulders.c] Re-enable the change done in r12382. This is allowed
+after the fix in generic/mparam.h r12525 (this file was hand written
+and did not satisfy the current constraints).
+------------------------------------------------------------------------
+r12525 | zimmerma | 2018-04-03 09:39:30 +0000 (Tue, 03 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/generic/mparam.h
+
+[generic/mparam.h] ensure divhigh_ktab[n] is 0 or < n-1, as now required
+ since commit r12382
+
+------------------------------------------------------------------------
+r12524 | vlefevre | 2018-04-02 23:22:02 +0000 (Mon, 02 Apr 2018) | 1 line
+Changed paths:
+ M /trunk/src/mulders.c
+
+[src/mulders.c] Code style / indentation. Added a comment.
+------------------------------------------------------------------------
+r12523 | vlefevre | 2018-04-02 23:04:08 +0000 (Mon, 02 Apr 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mulders.c
+
+[src/mulders.c] Reverting r12382 because divhigh_ktab[n] == n can
+happen. Note: this probably lacks documentation; moreover, testing
+that these tables satisfy the requirements would be useful.
+------------------------------------------------------------------------
+r12522 | vlefevre | 2018-03-31 01:07:26 +0000 (Sat, 31 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/inp_str.c
+
+[src/inp_str.c] Handle size_t overflow, empty string (after skipping
+spaces), and I/O errors (as opposed to end-of-file).
+------------------------------------------------------------------------
+r12521 | zimmerma | 2018-03-30 12:28:40 +0000 (Fri, 30 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/inp_str.c
+
+[src/inp_str.c] disallow stream=NULL (cf r12520)
+
+------------------------------------------------------------------------
+r12520 | zimmerma | 2018-03-30 09:16:17 +0000 (Fri, 30 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/out_str.c
+
+[src/out_str.c] the behavior on a null stream is unspecified (cf r12519)
+
+------------------------------------------------------------------------
+r12519 | vlefevre | 2018-03-30 08:51:22 +0000 (Fri, 30 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+Reverted r12516: the behavior on a null stream is unspecified.
+------------------------------------------------------------------------
+r12518 | zimmerma | 2018-03-30 07:09:45 +0000 (Fri, 30 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tpow.c
+
+[tests/tpow.c] restrict a test to 64-bit exponent
+
+------------------------------------------------------------------------
+r12517 | zimmerma | 2018-03-29 15:42:09 +0000 (Thu, 29 Mar 2018) | 3 lines
+Changed paths:
+ M /trunk/src/pow.c
+ M /trunk/tests/tpow.c
+
+[src/pow.c] added comment
+[tests/tpow.c] improve coverage
+
+------------------------------------------------------------------------
+r12516 | zimmerma | 2018-03-29 14:18:14 +0000 (Thu, 29 Mar 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/tout_str.c
+
+[tests/tout_str.c] improve coverage (I don't know how to avoid printing to
+ stdout, but since "make check" no longer shows the test
+ outputs, this should be fine). However I don't know how
+ to do the same for mpfr_inp_str...
+
+------------------------------------------------------------------------
+r12515 | zimmerma | 2018-03-29 13:24:17 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tconst_pi.c
+
+[tests/tconst_pi.c] forgotten line in commit 12512
+
+------------------------------------------------------------------------
+r12514 | zimmerma | 2018-03-29 13:17:23 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/grandom.c
+ M /trunk/tests/tgrandom.c
+
+[tests/tgrandom.c] improve coverage
+
+------------------------------------------------------------------------
+r12513 | zimmerma | 2018-03-29 12:54:34 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/grandom.c
+
+[src/grandom.c] improve coverage, and solved a FIXME
+
+------------------------------------------------------------------------
+r12512 | zimmerma | 2018-03-29 12:20:33 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tconst_pi.c
+
+[tests/tconst_pi.c] improve coverage of mpfr_free_cache2
+
+------------------------------------------------------------------------
+r12511 | vlefevre | 2018-03-29 12:01:38 +0000 (Thu, 29 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/src/fpif.c
+
+[src/fpif.c] Reverted another incorrect change done in r12509.
+------------------------------------------------------------------------
+r12510 | vlefevre | 2018-03-29 11:59:48 +0000 (Thu, 29 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/src/fpif.c
+
+[src/fpif.c] Reverted an incorrect change done in r12509.
+------------------------------------------------------------------------
+r12509 | zimmerma | 2018-03-29 10:22:38 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fpif.c
+
+[src/fpif.c] simplify code and improve coverage to 100%
+
+------------------------------------------------------------------------
+r12508 | zimmerma | 2018-03-29 10:04:50 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fpif.c
+
+[src/fpif.c] removed dead code and simplify code
+
+------------------------------------------------------------------------
+r12507 | zimmerma | 2018-03-29 09:38:22 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] improve coverage
+
+------------------------------------------------------------------------
+r12506 | zimmerma | 2018-03-29 08:28:14 +0000 (Thu, 29 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fpif.c
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] improve coverage
+
+------------------------------------------------------------------------
+r12505 | vlefevre | 2018-03-29 08:09:58 +0000 (Thu, 29 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] Really fixed the badData test, completing r12504.
+------------------------------------------------------------------------
+r12504 | vlefevre | 2018-03-29 08:08:58 +0000 (Thu, 29 Mar 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] Fixed a test: for the huge-precision badData case,
+make sure that the data are valid so that we really check that the
+precision does not fit (and not a read error).
+------------------------------------------------------------------------
+r12503 | vlefevre | 2018-03-29 07:26:11 +0000 (Thu, 29 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfpif.c
+
+[tests/tfpif.c] Correction just in case MPFR_PREC_BITS > 64.
+------------------------------------------------------------------------
+r12502 | vlefevre | 2018-03-29 00:02:43 +0000 (Thu, 29 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tgmpop.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r12501 | vlefevre | 2018-03-28 23:57:49 +0000 (Wed, 28 Mar 2018) | 5 lines
+Changed paths:
+ M /trunk/src/fpif.c
+
+[src/fpif.c]
+ * Replaced an incorrect comment from r12500 by a correct assertion.
+ * Fixed a theoretical bug coming from this incorrect comment.
+ * Added a MPFR_ASSERTN assertion to double-check correctness.
+ * Added a comment explaining a ... >= 0x80 test.
+------------------------------------------------------------------------
+r12500 | zimmerma | 2018-03-28 10:35:33 +0000 (Wed, 28 Mar 2018) | 3 lines
+Changed paths:
+ M /trunk/src/fpif.c
+ M /trunk/tests/tfpif.c
+
+[src/fpif.c] removed dead code
+[tests/tfpif.c] improve coverage
+
+------------------------------------------------------------------------
+r12499 | zimmerma | 2018-03-28 09:44:59 +0000 (Wed, 28 Mar 2018) | 3 lines
+Changed paths:
+ M /trunk/src/gmp_op.c
+ M /trunk/tests/tgmpop.c
+
+[src/gmp_op.c] fixed bug in mpfr_cmp_q for den(q)=0
+[tests/tgmpop.c] improve coverage
+
+------------------------------------------------------------------------
+r12498 | vlefevre | 2018-03-24 01:52:02 +0000 (Sat, 24 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Typographic correction (texinfo rule).
+------------------------------------------------------------------------
+r12497 | vlefevre | 2018-03-24 01:48:38 +0000 (Sat, 24 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] For codespell, skip mpfr.t2p (directory created
+in doc by "make pdf").
+------------------------------------------------------------------------
+r12496 | vlefevre | 2018-03-24 01:45:59 +0000 (Sat, 24 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/src/total_order.c
+
+[src/total_order.c] Simplified the code (shorter code).
+------------------------------------------------------------------------
+r12495 | vlefevre | 2018-03-24 01:34:17 +0000 (Sat, 24 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/ttotal_order.c
+
+[tests/ttotal_order.c] Rewrote the tests to test every combination
+of classes of values.
+------------------------------------------------------------------------
+r12494 | vlefevre | 2018-03-24 00:28:27 +0000 (Sat, 24 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/Makefile.am
+ D /trunk/tests/total_order.c
+ A /trunk/tests/ttotal_order.c (from /trunk/tests/total_order.c:12493)
+
+[tests] Renamed total_order.c to ttotal_order.c.
+------------------------------------------------------------------------
+r12493 | vlefevre | 2018-03-23 18:17:37 +0000 (Fri, 23 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/src/total_order.c
+
+[src/total_order.c] Suggest to test the sign bit first.
+------------------------------------------------------------------------
+r12492 | vlefevre | 2018-03-23 18:15:22 +0000 (Fri, 23 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Added mpfr_total_order in "Added Functions".
+------------------------------------------------------------------------
+r12491 | vlefevre | 2018-03-23 18:14:05 +0000 (Fri, 23 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Improved mpfr_total_order description.
+------------------------------------------------------------------------
+r12490 | zimmerma | 2018-03-23 17:42:06 +0000 (Fri, 23 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/TODO
+
+[TODO] totalOrder is done
+
+------------------------------------------------------------------------
+r12489 | zimmerma | 2018-03-23 17:03:58 +0000 (Fri, 23 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/Makefile.am
+ M /trunk/src/mpfr.h
+ A /trunk/src/total_order.c
+ M /trunk/tests/Makefile.am
+ A /trunk/tests/total_order.c
+
+added mpfr_total_order
+
+------------------------------------------------------------------------
+r12488 | vlefevre | 2018-03-23 10:06:33 +0000 (Fri, 23 Mar 2018) | 7 lines
+Changed paths:
+ M /trunk/tests/terf.c
+ M /trunk/tests/tpow.c
+ M /trunk/tests/tpow_z.c
[tests] Removed some useless #include's, in particular all the
unconditional #include <math.h> occurrences.
@@ -1960,320 +10905,2082 @@ provided by ICC 15 (at least), and this solves a compilation failure
in the build of the tests.
Moreover, <math.h> is not required by freestanding implementations,
so that it may be better to avoid it if possible.
-(merged changeset r12488 from the trunk)
------------------------------------------------------------------------
-r12580 | vlefevre | 2018-04-11 14:03:03 +0000 (Wed, 11 Apr 2018) | 3 lines
+r12487 | zimmerma | 2018-03-21 11:02:23 +0000 (Wed, 21 Mar 2018) | 2 lines
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tmul.c
+ M /trunk/TODO
+
+added 2 suggestions from Patrick Pelissier
-[tests] Merged the test from r12348, and replaced MUL_FFT_THRESHOLD
-by its default value 8448 (since the definition of MUL_FFT_THRESHOLD
-has not been moved in the 4.0 branch).
------------------------------------------------------------------------
-r12579 | vlefevre | 2018-04-11 13:54:39 +0000 (Wed, 11 Apr 2018) | 1 line
+r12486 | vlefevre | 2018-03-20 15:33:54 +0000 (Tue, 20 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tagm.c
- M /branches/4.0/tests/tai.c
- M /branches/4.0/tests/tdiv.c
- M /branches/4.0/tests/tgmpop.c
- M /branches/4.0/tests/tmul.c
- M /branches/4.0/tests/tmul_2exp.c
- M /branches/4.0/tests/tsqrt.c
- M /branches/4.0/tests/tsub.c
- M /branches/4.0/tests/tzeta.c
+ M /trunk/tools/mpfrlint
-Merged recent tests from the trunk (r12288-12347).
+[tools/mpfrlint] For codespell, skip all the algorithms.* files.
------------------------------------------------------------------------
-r12578 | vlefevre | 2018-04-11 13:16:15 +0000 (Wed, 11 Apr 2018) | 3 lines
+r12485 | vlefevre | 2018-03-15 11:31:10 +0000 (Thu, 15 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/mul.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tests/tsub1sp.c
+ M /trunk/tools/mpfrlint
-Fixed type errors with -D_MPFR_PREC_FORMAT=2 in CFLAGS and the
---enable-assert=full configure option (signaled by GCC's -Wformat).
-(merged changesets r12301-12302 from the trunk)
+[tools/mpfrlint] Added a comment for the mul/sqr test.
------------------------------------------------------------------------
-r12577 | vlefevre | 2018-04-11 13:06:53 +0000 (Wed, 11 Apr 2018) | 3 lines
+r12484 | vlefevre | 2018-03-15 11:27:38 +0000 (Thu, 15 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests
- M /branches/4.0/tests/tversion.c
+ M /trunk/tools/mpfrlint
-[tests/tversion.c] Output the sizes of long and intmax_t, and
-"Generic ABI code" info (MPFR_GENERIC_ABI).
-(merged changesets r12447,12575 from the trunk)
+[tools/mpfrlint] In the mul/sqr test (r12482), exclude mul.c and sqr.c.
------------------------------------------------------------------------
-r12576 | vlefevre | 2018-04-11 13:02:27 +0000 (Wed, 11 Apr 2018) | 4 lines
+r12483 | zimmerma | 2018-03-15 10:21:18 +0000 (Thu, 15 Mar 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/sub1sp.c
+ M /trunk/src/acosh.c
+ M /trunk/src/asinh.c
+ M /trunk/src/atanh.c
+ M /trunk/src/cos.c
+ M /trunk/src/digamma.c
+ M /trunk/src/erf.c
+ M /trunk/src/erfc.c
+ M /trunk/src/jn.c
+ M /trunk/src/lngamma.c
+ M /trunk/src/mul.c
+ M /trunk/src/pow_ui.c
+ M /trunk/src/pow_z.c
+ M /trunk/src/sin.c
+ M /trunk/src/sqr.c
+ M /trunk/src/ui_pow_ui.c
+ M /trunk/src/yn.c
+
+changed mpfr_mul (a, b, b, ...) into mpfr_sqr (a, b, ...) whenever possible
-[src/sub1sp.c] fixed bug in mpfr_sub1sp1n (corner case when a=c).
-This fixes the failures from r12288.
-(merged changeset r12285 from the trunk; note that the merge for
-the tests directory had already been done via r12288)
------------------------------------------------------------------------
-r12480 | vlefevre | 2018-03-14 10:33:01 +0000 (Wed, 14 Mar 2018) | 2 lines
+r12482 | vlefevre | 2018-03-14 15:59:35 +0000 (Wed, 14 Mar 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/mpfr-impl.h
+ M /trunk/tools/mpfrlint
-[src/mpfr-impl.h] Typo in a comment.
-(merged changeset r12421 from the trunk)
-------------------------------------------------------------------------
-r12475 | vlefevre | 2018-03-09 23:12:04 +0000 (Fri, 09 Mar 2018) | 2 lines
-Changed paths:
- M /branches/4.0
- M /branches/4.0/TODO
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/atan.c
- M /branches/4.0/src/cache.c
- M /branches/4.0/src/fpif.c
- M /branches/4.0/src/get_flt.c
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/sum.c
- M /branches/4.0/tests
- M /branches/4.0/tests/terandom_chisq.c
- M /branches/4.0/tests/tnrandom_chisq.c
+[tools/mpfrlint] Detect mpfr_mul with identical 2nd and 3rd arguments,
+which can be replaced by mpfr_sqr (suggestion by PZ).
+------------------------------------------------------------------------
+r12481 | zimmerma | 2018-03-14 15:06:00 +0000 (Wed, 14 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/src/const_pi.c
+
+[src/const_pi.c] added a reference, and replace mpfr_mul by mpfr_sqr
+
+------------------------------------------------------------------------
+r12478 | vlefevre | 2018-03-10 00:40:13 +0000 (Sat, 10 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] Fixed failure from r12473 when mpfr_prec_t is an int
+(missing casts for sprintf / printf).
+------------------------------------------------------------------------
+r12477 | vlefevre | 2018-03-09 23:58:15 +0000 (Fri, 09 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] C++ compatibility.
+------------------------------------------------------------------------
+r12476 | vlefevre | 2018-03-09 23:17:29 +0000 (Fri, 09 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] Use tests_allocate / tests_free.
+------------------------------------------------------------------------
+r12474 | vlefevre | 2018-03-09 23:10:41 +0000 (Fri, 09 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/TODO
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/atan.c
+ M /trunk/src/cache.c
+ M /trunk/src/fpif.c
+ M /trunk/src/get_flt.c
+ M /trunk/src/mpfr.h
+ M /trunk/src/sum.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/tnrandom_chisq.c
Fixed spelling mistakes found by codespell 1.12.0.
-(merged changeset r12474 from the trunk)
-------------------------------------------------------------------------
-r12470 | vlefevre | 2018-03-08 02:42:59 +0000 (Thu, 08 Mar 2018) | 6 lines
-Changed paths:
- M /branches/4.0
- A /branches/4.0/codespell.ignore (from /trunk/codespell.ignore:12469)
- M /branches/4.0/doc/README.dev
- M /branches/4.0/src/li2.c
- M /branches/4.0/src/mpfr-gmp.h
- M /branches/4.0/src/mpfr-thread.h
- M /branches/4.0/src/vasprintf.c
- M /branches/4.0/tests
- M /branches/4.0/tests/tgmpop.c
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tools/mpfrlint
+------------------------------------------------------------------------
+r12473 | zimmerma | 2018-03-09 16:55:48 +0000 (Fri, 09 Mar 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] added tests for corner cases of mpfr_set_str o mpfr_get_str
+
+------------------------------------------------------------------------
+r12472 | vlefevre | 2018-03-08 11:32:31 +0000 (Thu, 08 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] In EXTRA_DIST, put the mparam.h in alphabetic order.
+------------------------------------------------------------------------
+r12471 | vlefevre | 2018-03-08 11:27:21 +0000 (Thu, 08 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] Updated EXTRA_DIST for amd due to r12387.
+------------------------------------------------------------------------
+r12469 | vlefevre | 2018-03-08 02:33:34 +0000 (Thu, 08 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+ M /trunk/src/li2.c
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-thread.h
+ M /trunk/src/vasprintf.c
+ M /trunk/tests/tgmpop.c
+ M /trunk/tests/tset_ld.c
+
+Fixed spelling mistakes found by codespell 1.11.0.
+------------------------------------------------------------------------
+r12468 | vlefevre | 2018-03-08 02:29:43 +0000 (Thu, 08 Mar 2018) | 1 line
+Changed paths:
+ M /trunk/codespell.ignore
+
+[codespell.ignore] Also ignore "cas".
+------------------------------------------------------------------------
+r12467 | vlefevre | 2018-03-08 02:27:22 +0000 (Thu, 08 Mar 2018) | 4 lines
+Changed paths:
+ A /trunk/codespell.ignore
+ M /trunk/tools/mpfrlint
Added codespell.ignore file with simple words to ignore with codespell
-("cas"; "iff" as used in math; "nd" as the n comes from \n in printf,
-but nd could also be a variable name; "te" as used as a variable name).
+("iff" as used in math; "nd" as the n comes from \n in printf, but nd
+could also be a variable name; "te" as used as a variable name).
Updated tools/mpfrlint to use this file with codespell.
-Fixed spelling mistakes found by codespell 1.11.0.
-(merged changesets r12467-12469 from the trunk)
------------------------------------------------------------------------
-r12465 | vlefevre | 2018-03-05 14:43:39 +0000 (Mon, 05 Mar 2018) | 1 line
+r12466 | vlefevre | 2018-03-05 14:44:44 +0000 (Mon, 05 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/doc/mpfr.texi
[doc/mpfr.texi] Updated the month.
------------------------------------------------------------------------
-r12463 | vlefevre | 2018-03-05 10:46:53 +0000 (Mon, 05 Mar 2018) | 2 lines
+r12464 | zimmerma | 2018-03-05 13:04:37 +0000 (Mon, 05 Mar 2018) | 4 lines
+Changed paths:
+ M /trunk/src/get_str.c
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] added tests for mpfr_get_str_ndigits
+[src/get_str.c] fixed bugs in mpfr_get_str_ndigits for b=2^k (value was 1 too
+ large) and very large p (value was 1 too small)
+
+------------------------------------------------------------------------
+r12462 | vlefevre | 2018-03-05 10:40:43 +0000 (Mon, 05 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/doc/mpfr.texi
[doc/mpfr.texi] Typographic corrections for mpfr_subnormalize.
-(merged changeset r12462 from the trunk)
------------------------------------------------------------------------
-r12431 | vlefevre | 2018-02-23 17:00:13 +0000 (Fri, 23 Feb 2018) | 2 lines
+r12461 | vlefevre | 2018-03-05 10:31:40 +0000 (Mon, 05 Mar 2018) | 2 lines
Changed paths:
- M /branches/4.0/src/get_sj.c
+ M /trunk/NEWS
+ M /trunk/doc/mpfr.texi
-[src/get_sj.c] And now that the incorrect assertions have been removed,
-the condition sh >= 0 needs to be fixed to sh > 0...
+[NEWS] Added mpfr_get_str_ndigits.
+[doc/mpfr.texi] Added mpfr_get_str_ndigits in "Added Functions".
------------------------------------------------------------------------
-r12428 | vlefevre | 2018-02-23 16:24:21 +0000 (Fri, 23 Feb 2018) | 2 lines
+r12460 | vlefevre | 2018-03-05 10:26:34 +0000 (Mon, 05 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0/src/get_sj.c
+ M /trunk/doc/mpfr.texi
-[src/get_sj.c] Removed unnecessary condition sh < GMP_NUMB_BITS, which
-is incorrect with some C implementations. It came from r7047.
+[doc/mpfr.texi] Minor corrections concerning mpfr_get_str.
------------------------------------------------------------------------
-r12288 | vlefevre | 2018-02-17 10:50:29 +0000 (Sat, 17 Feb 2018) | 3 lines
+r12459 | vlefevre | 2018-03-05 10:05:37 +0000 (Mon, 05 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0/tests
- M /branches/4.0/tests/tadd1sp.c
- M /branches/4.0/tests/tfmma.c
- M /branches/4.0/tests/tmul_2exp.c
- M /branches/4.0/tests/tsub.c
- M /branches/4.0/tests/tsub1sp.c
+ M /trunk/src/mpfr.h
-Merged the latest tests from the trunk (r12258-12287).
-tsub and tsub1sp fail (bug fixed in the trunk) with both 32-bit and
-64-bit ABI's, except when MPFR is built with "-DMPFR_GENERIC_ABI".
+[src/mpfr.h] Added a note about a mpfr_prec_t limitation.
------------------------------------------------------------------------
-r12258 | vlefevre | 2018-02-16 02:29:27 +0000 (Fri, 16 Feb 2018) | 3 lines
+r12458 | vlefevre | 2018-03-05 09:59:19 +0000 (Mon, 05 Mar 2018) | 6 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tsub.c
+ M /trunk/src/get_str.c
-[tests/tsub.c] Added bug20180216 test currently failing in the trunk
-in r12257.
-(merged changesets r12256-12257 from the trunk)
+[src/get_str.c] Simplified mpfr_get_str_ndigits (changes from r12455):
+ * MPFR_PREC_BITS is used to exactly do what is wanted.
+ * Removed dead code as currently, mpfr_prec_t <= unsigned long.
+ Note: if in the future we support mpfr_prec_t > unsigned long
+ (e.g. to have a 64-bit precision on MS Windows), the generic code
+ could be retrieved back from r12455.
------------------------------------------------------------------------
-r12247 | vlefevre | 2018-02-15 14:31:18 +0000 (Thu, 15 Feb 2018) | 3 lines
+r12457 | zimmerma | 2018-03-05 09:35:32 +0000 (Mon, 05 Mar 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tsub.c
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/get_str.c
+ M /trunk/src/mpfr.h
+
+[src/get_str.c,src/mpfr.h] mpfr_get_str_digits -> mpfr_get_str_ndigits
+[doc/mpfr.texi] updated documentation of mpfr_get_str
-[tests/tsub.c] Added bug20180215 test currently failing in the trunk
-in r12243.
-(merged changeset r12246 from the trunk)
------------------------------------------------------------------------
-r12224 | vlefevre | 2018-02-13 12:17:25 +0000 (Tue, 13 Feb 2018) | 2 lines
+r12456 | zimmerma | 2018-03-05 09:29:42 +0000 (Mon, 05 Mar 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tadd.c
+ M /trunk/src/get_str.c
+
+[src/get_str.c] fixed FIXME
-[tests/tadd.c] Added 2 tests that were failing in the trunk in r12220.
-(merged changeset r12221 from the trunk)
------------------------------------------------------------------------
-r12216 | vlefevre | 2018-02-08 02:11:23 +0000 (Thu, 08 Feb 2018) | 5 lines
+r12455 | vlefevre | 2018-03-05 09:19:42 +0000 (Mon, 05 Mar 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tfits.c
- M /branches/4.0/tests/tfprintf.c
- M /branches/4.0/tests/tget_set_d64.c
- M /branches/4.0/tests/tget_sj.c
- M /branches/4.0/tests/tprintf.c
- M /branches/4.0/tests/tset_float128.c
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tests/tset_sj.c
- M /branches/4.0/tests/tsprintf.c
- M /branches/4.0/tests/tversion.c
+ M /trunk/src/get_str.c
-[tests]
- * tset_float128.c, tset_ld.c: removed obsolete WITH_FPU_CONTROL
- related code.
- * Added/updated comments about the config.h inclusion.
-(merged changesets r12214-12215 from the trunk)
+[src/get_str.c] Portability corrections in mpfr_get_str_digits.
------------------------------------------------------------------------
-r12213 | vlefevre | 2018-02-07 23:39:15 +0000 (Wed, 07 Feb 2018) | 2 lines
+r12454 | zimmerma | 2018-03-05 08:22:18 +0000 (Mon, 05 Mar 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/INSTALL
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/get_str.c
+ M /trunk/src/mpfr.h
+
+[src/get_str.c] new function mpfr_get_str_digits
+[doc/mpfr.texi] added documentation for mpfr_get_str_digits
-[INSTALL] Updated GMP URL.
-(merged changeset r12212 from the trunk)
------------------------------------------------------------------------
-r12211 | vlefevre | 2018-02-07 23:34:18 +0000 (Wed, 07 Feb 2018) | 1 line
+r12453 | vlefevre | 2018-03-03 01:19:24 +0000 (Sat, 03 Mar 2018) | 2 lines
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/tests/tfma.c
-[NEWS] Update for GNU MPFR 4.0.2.
+[tests/tfma.c] Fixed bug from r12407 with 32-bit long and 64-bit limbs
+(e.g. as under 64-bit MS Windows).
------------------------------------------------------------------------
-r12209 | vlefevre | 2018-02-07 23:31:36 +0000 (Wed, 07 Feb 2018) | 3 lines
+r12452 | vlefevre | 2018-02-26 23:52:34 +0000 (Mon, 26 Feb 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/tools/mpfrlint
+ M /trunk/acinclude.m4
-[doc/mpfr.texi] Corrected minimal GMP version.
-[tools/mpfrlint] Updated test to detect minimal GMP version mismatch.
-(merged changeset r12208 from the trunk)
+[acinclude.m4] Correction for test of the fallback to __float128:
+in the test program, define the variable outside main() in order to
+avoid an error when the -Werror=unused-variable GCC option is used.
------------------------------------------------------------------------
-r12207 | vlefevre | 2018-02-07 23:22:44 +0000 (Wed, 07 Feb 2018) | 3 lines
+r12451 | vlefevre | 2018-02-26 19:17:17 +0000 (Mon, 26 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/INSTALL
- M /branches/4.0/tools/mpfrlint
+ M /trunk/src/get_sj.c
-[INSTALL] Corrected minimal GMP version (thanks to David Edelsohn).
-[tools/mpfrlint] Added a test to detect minimal GMP version mismatch.
-(merged changeset r12206 from the trunk)
+[src/get_sj.c] Avoid an unused variable.
------------------------------------------------------------------------
-r12203 | vlefevre | 2018-02-07 16:18:16 +0000 (Wed, 07 Feb 2018) | 1 line
+r12450 | vlefevre | 2018-02-26 18:00:38 +0000 (Mon, 26 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0/INSTALL
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/doc/README.dev
-Updated version to 4.0.2-dev.
+[doc/README.dev] Updated description of MPFR_WANT_FLOAT128.
------------------------------------------------------------------------
-r12201 | vlefevre | 2018-02-07 12:52:40 +0000 (Wed, 07 Feb 2018) | 1 line
+r12449 | vlefevre | 2018-02-26 17:56:40 +0000 (Mon, 26 Feb 2018) | 2 lines
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/doc/README.dev
-ChangeLog update with "TZ=UTC svn log -rHEAD:0 -v" (in UTF-8 locales).
+[doc/README.dev] Recommend AC_LINK_IFELSE rather than AC_COMPILE_IFELSE
+(see r12448 as an example of an issue with AC_COMPILE_IFELSE).
------------------------------------------------------------------------
-r12200 | vlefevre | 2018-02-07 12:50:31 +0000 (Wed, 07 Feb 2018) | 1 line
+r12448 | vlefevre | 2018-02-26 17:55:14 +0000 (Mon, 26 Feb 2018) | 4 lines
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/acinclude.m4
-Updated version to 4.0.1.
+[acinclude.m4] Fixed a test, which could define MPFR_INTMAX_WITHIN_LIMB
+even when not true (MPFR_STAT_STATIC_ASSERT() was just regarded as a
+function call since the macro was not defined, thus did not yield an
+error).
------------------------------------------------------------------------
-r12199 | vlefevre | 2018-02-07 12:02:41 +0000 (Wed, 07 Feb 2018) | 3 lines
+r12447 | vlefevre | 2018-02-26 17:31:19 +0000 (Mon, 26 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/README.dev
- M /branches/4.0/tools/announce-text
+ M /trunk/tests/tversion.c
+
+[tests/tversion.c] Output the sizes of long and intmax_t.
+------------------------------------------------------------------------
+r12446 | vlefevre | 2018-02-26 16:36:42 +0000 (Mon, 26 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Fixed incorrect test from r12426.
+------------------------------------------------------------------------
+r12445 | vlefevre | 2018-02-26 15:08:10 +0000 (Mon, 26 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/mulders.c
+ M /trunk/tests/tfma.c
+ M /trunk/tune/tuneup.c
+
+Removed trailing spaces.
+------------------------------------------------------------------------
+r12444 | vlefevre | 2018-02-26 12:43:22 +0000 (Mon, 26 Feb 2018) | 18 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/acinclude.m4
+ M /trunk/src/set_float128.c
+
+Updated support for binary128:
+ * __float128 was changed to _Float128 (ISO/IEC TS 18661) in r12391;
+ also changed the suffix of the constants from "q" to "f128".
+ * Use __float128 with the "q" suffix as a fallback in order to avoid
+ regressions with GCC 6- and with C++ mode (g++).
+ As documented in the GCC manual, this is entirely compatible on most
+ platforms where both are supported: _Float128 and __float128 are the
+ same type, and it could be checked that the following prototypes are
+ equivalent (as expected):
+ _Float128 f (__float128)
+ __float128 f (_Float128)
+ The only potential issues would be on hppa and IA-64 HP-UX, where
+ __float128 is an alias for "long double" instead of _Float128, in
+ case the ABI would be different (I have no information about this)
+ and both would be mixed up with software using the MPFR conversion
+ functions for binary128 via __float128 or "long double". The worst
+ thing that could happen is a link error. If the link is accepted,
+ everything should be fine as the representation doesn't change.
+------------------------------------------------------------------------
+r12443 | vlefevre | 2018-02-26 11:41:08 +0000 (Mon, 26 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_float128.c
+
+[src/set_float128.c] Removed a useless #include and corrected a comment.
+------------------------------------------------------------------------
+r12442 | vlefevre | 2018-02-25 01:53:11 +0000 (Sun, 25 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/get_z_exp.c
+
+[src/get_z_exp.c] Portability.
+------------------------------------------------------------------------
+r12441 | vlefevre | 2018-02-25 01:19:07 +0000 (Sun, 25 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] Avoid a compilation error with
+gcc -std=c90 -pedantic -Werror in 32-bit ABI.
+------------------------------------------------------------------------
+r12440 | vlefevre | 2018-02-25 01:02:44 +0000 (Sun, 25 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] Fixed a return type.
+------------------------------------------------------------------------
+r12439 | zimmerma | 2018-02-24 10:02:40 +0000 (Sat, 24 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_z_exp.c
+
+[src/get_z_exp.c] new try for r12437. If that still does not work, we should
+ define macros BITS_PER_EXP_T, BITS_PER_PREC_T, ...
+
+------------------------------------------------------------------------
+r12438 | vlefevre | 2018-02-23 22:13:53 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_z_exp.c
+
+[src/get_z_exp.c] Reverted r12437: the size of mpfr_exp_t is not
+always related to the size of mp_limb_t.
+------------------------------------------------------------------------
+r12437 | zimmerma | 2018-02-23 22:04:30 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_z_exp.c
+
+[src/get_z_exp.c] removed dead code on 64-bit computer
+
+------------------------------------------------------------------------
+r12436 | zimmerma | 2018-02-23 20:45:32 +0000 (Fri, 23 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_str.c
+ M /trunk/tests/tget_str.c
+
+[src/get_str.c] improved case m < g
+[tests/tget_str.c] improve coverage
+
+------------------------------------------------------------------------
+r12435 | vlefevre | 2018-02-23 18:15:42 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Correction: for AC_COMPILE_IFELSE, there are only
+2 cases: TRUE and FALSE.
+------------------------------------------------------------------------
+r12434 | zimmerma | 2018-02-23 17:59:56 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_str.c
+
+[tests/tget_str.c] fixed not enough allocation issue
+
+------------------------------------------------------------------------
+r12433 | vlefevre | 2018-02-23 17:36:49 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Correction: for AC_COMPILE_IFELSE, there are only
+2 cases: TRUE and FALSE.
+------------------------------------------------------------------------
+r12432 | zimmerma | 2018-02-23 17:02:14 +0000 (Fri, 23 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/get_str.c
+ M /trunk/tests/tget_str.c
+
+[doc/mpfr.texi] m=1 is now valid in get_str
+[src/get_str.c] allow m=1 for b=2^k
+[tests/tget_str.c] added test for m=1 and b=2
+
+------------------------------------------------------------------------
+r12430 | zimmerma | 2018-02-23 16:40:33 +0000 (Fri, 23 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_str.c
+ M /trunk/tests/tget_str.c
+
+[src/get_str.c] added a comment
+[tests/tget_str.c] improved coverage (finding this example was quite hard!)
+
+------------------------------------------------------------------------
+r12429 | vlefevre | 2018-02-23 16:34:06 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_sj.c
+
+[src/get_sj.c] Removed two assertions, including an incorrect one.
+Added an assertion.
+------------------------------------------------------------------------
+r12427 | vlefevre | 2018-02-23 15:37:08 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Correction: if we cannot test, the portable code must be
+selected.
+------------------------------------------------------------------------
+r12426 | zimmerma | 2018-02-23 15:24:59 +0000 (Fri, 23 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/src/get_sj.c
+
+[configure.ac,acinclude.m4] added new macro MPFR_INTMAX_WITHIN_LIMB
+[src/get_sj.c] optimized the code when MPFR_INTMAX_WITHIN_LIMB=1
+
+------------------------------------------------------------------------
+r12425 | vlefevre | 2018-02-23 15:19:12 +0000 (Fri, 23 Feb 2018) | 6 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/set_ld.c
+
+[src/mpfr-impl.h] Removed MPFR_LIMBS_PER_LONG_DOUBLE as it was not
+ properly specified in the general case and was actually used only
+ in src/set_ld.c with HAVE_LDOUBLE_IEEE_EXT_LITTLE.
+[src/set_ld.c] Simplified code. Moreover, the hypothetical case
+ GMP_NUMB_BITS == 16 will trigger a compilation error instead of
+ yielding incorrect code.
+------------------------------------------------------------------------
+r12424 | vlefevre | 2018-02-23 15:08:54 +0000 (Fri, 23 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/tests/tbuildopt.c
+
+[tests/tbuildopt.c]
+ * Added missing const.
+ * Use the variable s to avoid a warning and also to detect potential
+ undefined behavior with debugging tools if s is not a string.
+------------------------------------------------------------------------
+r12423 | zimmerma | 2018-02-23 15:00:55 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_sj.c
+
+[src/get_sj.c] fixed typo
+
+------------------------------------------------------------------------
+r12422 | zimmerma | 2018-02-23 14:48:40 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_sj.c
+
+[src/get_sj.c] added comments and simplified the code
+
+------------------------------------------------------------------------
+r12421 | vlefevre | 2018-02-23 14:31:59 +0000 (Fri, 23 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Typo in a comment.
+------------------------------------------------------------------------
+r12420 | zimmerma | 2018-02-23 14:12:09 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tget_q.c
+
+[tests/tget_q.c] improved coverage
+
+------------------------------------------------------------------------
+r12419 | vlefevre | 2018-02-23 13:59:02 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_d64.c
+
+[src/get_d64.c] Parsing in the portable version of string_to_Decimal64:
+similar changes as in r12416 for the _MPFR_IEEE_FLOATS version.
+------------------------------------------------------------------------
+r12418 | zimmerma | 2018-02-23 13:37:33 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_ld.c
+
+[src/get_ld.c] removed dead code (as in r12413 for mpfr_get_d)
+
+------------------------------------------------------------------------
+r12417 | zimmerma | 2018-02-23 13:35:35 +0000 (Fri, 23 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/get_flt.c
+ M /trunk/tests/tget_flt.c
+
+[src/get_flt.c] optimized code when MPFR_LIMBS_PER_FLT=1
+[tests/tget_flt.c] improved coverage
+
+------------------------------------------------------------------------
+r12416 | zimmerma | 2018-02-23 12:02:51 +0000 (Fri, 23 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/src/get_d64.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/tests/tget_set_d64.c
+
+[src/get_d64.c] simplified code, and removed dead code
+[src/mpfr-impl.h] added comment
+[tests/tget_set_d64.c] improve coverage
+
+------------------------------------------------------------------------
+r12415 | vlefevre | 2018-02-23 09:50:25 +0000 (Fri, 23 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/set_q.c
+
+[src/set_q.c] Simplified code.
+------------------------------------------------------------------------
+r12414 | zimmerma | 2018-02-23 08:59:39 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_d.c
+
+[src/get_d.c] removed dead code
+
+------------------------------------------------------------------------
+r12413 | zimmerma | 2018-02-23 08:56:52 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/get_d.c
+
+[src/get_d.c] optimized for common case MPFR_LIMBS_PER_DOUBLE=1
+
+------------------------------------------------------------------------
+r12412 | zimmerma | 2018-02-23 08:38:33 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tset_z_exp.c
+
+[tests/tset_z_exp.c] improved coverage
+
+------------------------------------------------------------------------
+r12411 | zimmerma | 2018-02-23 08:28:09 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_q.c
+
+[src/set_q.c] removed dead code on 64-bit processor
+
+------------------------------------------------------------------------
+r12410 | zimmerma | 2018-02-23 07:40:36 +0000 (Fri, 23 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] improve code when HAVE_LDOUBLE_IEEE_EXT_LITTLE is defined
+
+------------------------------------------------------------------------
+r12409 | vlefevre | 2018-02-22 22:45:19 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] Reverted r12408: MPFR_LIMBS_PER_LONG_DOUBLE cannot be
+used with the preprocessor due to the use of "sizeof".
+------------------------------------------------------------------------
+r12408 | zimmerma | 2018-02-22 19:24:40 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/set_ld.c
+
+[src/set_ld.c] improve code for MPFR_LIMBS_PER_LONG_DOUBLE=1
+
+------------------------------------------------------------------------
+r12407 | zimmerma | 2018-02-22 19:06:22 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] improved coverage of mpfr_set_1_2
+
+------------------------------------------------------------------------
+r12406 | zimmerma | 2018-02-22 18:11:44 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tbuildopt.c
+
+[tests/tbuildopt.c] improve coverage
+
+------------------------------------------------------------------------
+r12405 | vlefevre | 2018-02-22 16:11:57 +0000 (Thu, 22 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Corrected a comment.
+------------------------------------------------------------------------
+r12404 | vlefevre | 2018-02-22 16:08:46 +0000 (Thu, 22 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] Joined test_overflow3 and test_overflow4 by using a loop.
+Improved the corresponding test and error message. Also run this test
+with the default exponent range.
+------------------------------------------------------------------------
+r12403 | vlefevre | 2018-02-22 15:49:53 +0000 (Thu, 22 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] Added FIXME for r12396, which still seems incorrect.
+------------------------------------------------------------------------
+r12402 | vlefevre | 2018-02-22 13:30:11 +0000 (Thu, 22 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/mpfr-impl.h
+
+[src/mpfr-impl.h] Typo in a comment.
+------------------------------------------------------------------------
+r12401 | vlefevre | 2018-02-22 13:25:25 +0000 (Thu, 22 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] Update about the change of __float128 to _Float128: clarification
+that it is from ISO/IEC TS 18661 ("standard" was too vague); added FIXME
+on a possible fallback to __float128 and ABI considerations.
+------------------------------------------------------------------------
+r12400 | vlefevre | 2018-02-22 13:08:15 +0000 (Thu, 22 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/configure.ac
+
+[configure.ac] For --enable-float128, this is still autodetect, e.g.:
+ checking if compiler knows _Float128 with C99 constants... no
+Added a FIXME: a fallback to __float128 is necessary to avoid
+regressions.
+------------------------------------------------------------------------
+r12399 | zimmerma | 2018-02-22 13:07:01 +0000 (Thu, 22 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sqr.c
+ M /trunk/tests/tsqr.c
+
+[src/sqr.c] added comments
+[tests/tsqr.c] improve coverage of sqr.c to 100%
+
+------------------------------------------------------------------------
+r12398 | zimmerma | 2018-02-22 12:48:52 +0000 (Thu, 22 Feb 2018) | 6 lines
+Changed paths:
+ M /trunk/src/sqr.c
+ M /trunk/tests/tsqr.c
+
+[src/sqr.c] fixed a bug in mpfr_sqr_1n in a rare case near underflow,
+ only use mpfr_sqr_1, mpfr_sqr_1n, mpfr_sqr_2, mpfr_sqr_3
+ when all numbers have same precision (like for mpfr_mul),
+ and added comments
+[tests/tsqr.c] added tests, including non-regression for above bug
+
+------------------------------------------------------------------------
+r12397 | zimmerma | 2018-02-22 10:45:53 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] added comments and a FIXME
+
+------------------------------------------------------------------------
+r12396 | zimmerma | 2018-02-22 10:30:25 +0000 (Thu, 22 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/fma.c
+ M /trunk/tests/tfma.c
+
+[src/fma.c] fixed last failure
+[tests/tfma.c] removed debug stuff
+
+------------------------------------------------------------------------
+r12395 | zimmerma | 2018-02-22 10:27:29 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfma.c
+
+[tests/tfma.c] added new failing test
+
+------------------------------------------------------------------------
+r12394 | zimmerma | 2018-02-22 10:23:39 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/fma.c
+
+[src/fma.c] fix failure from last test
+
+------------------------------------------------------------------------
+r12393 | zimmerma | 2018-02-22 10:19:52 +0000 (Thu, 22 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/fma.c
+ M /trunk/tests/tfma.c
+
+[src/fma.c] added comments
+[tests/tfma.c] added a test (currently failing)
+
+------------------------------------------------------------------------
+r12392 | zimmerma | 2018-02-22 10:01:46 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mips/mparam.h
+
+[mips/mparam.h] updated
+
+------------------------------------------------------------------------
+r12391 | zimmerma | 2018-02-22 09:18:55 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/README.dev
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/get_float128.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr.h
+ M /trunk/src/set_float128.c
+ M /trunk/tests/tset_float128.c
+
+changed __float128 (gcc specific) into the standard type _Float128
+
+------------------------------------------------------------------------
+r12390 | zimmerma | 2018-02-22 08:50:12 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/arm/mparam.h
+
+[arm/mparam.h] updated
+
+------------------------------------------------------------------------
+r12389 | zimmerma | 2018-02-22 08:27:54 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/x86/mparam.h
+
+[x86/mparam.h] updated
+
+------------------------------------------------------------------------
+r12388 | zimmerma | 2018-02-22 08:14:41 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] amd/k8/mparam.h -> amd/mparam.h
+
+------------------------------------------------------------------------
+r12387 | zimmerma | 2018-02-22 08:14:07 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ D /trunk/src/amd/amdfam10
+ D /trunk/src/amd/k8
+ A /trunk/src/amd/mparam.h (from /trunk/src/amd/k8/mparam.h:12386)
+
+[amd/mparam.h] updated
+
+------------------------------------------------------------------------
+r12386 | zimmerma | 2018-02-22 08:06:23 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sparc64/mparam.h
+
+[sparc64/mparam.h] updated
+
+------------------------------------------------------------------------
+r12385 | zimmerma | 2018-02-22 08:04:27 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/x86_64/core2/mparam.h
+
+[x86_64/core2/mparam.h] updated
+
+------------------------------------------------------------------------
+r12384 | zimmerma | 2018-02-22 08:02:12 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/powerpc64/mparam.h
+
+[powerpc64/mparam.h] updated
+
+------------------------------------------------------------------------
+r12383 | zimmerma | 2018-02-22 07:42:49 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/x86_64/mparam.h
+
+[x86_64/mparam.h] updated
+
+------------------------------------------------------------------------
+r12382 | zimmerma | 2018-02-22 07:36:02 +0000 (Thu, 22 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mulders.c
+
+[src/mulders.c] removed dead code
+
+------------------------------------------------------------------------
+r12381 | zimmerma | 2018-02-21 20:52:31 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tune/tuneup.c
+
+[tune/tuneup.c] ensure k < n in mpfr_divhigh_n[]
+
+------------------------------------------------------------------------
+r12380 | zimmerma | 2018-02-21 17:01:07 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] added __tune_znver1__ for AMD64 (e.g., gcc67.fsffrance.org)
+
+------------------------------------------------------------------------
+r12379 | zimmerma | 2018-02-21 16:08:54 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mips/mparam.h
+
+[src/mips/mparam.h] updated on gcc22
+
+------------------------------------------------------------------------
+r12378 | zimmerma | 2018-02-21 15:07:41 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/NEWS
+
+[NEWS] added item
+
+------------------------------------------------------------------------
+r12377 | zimmerma | 2018-02-21 15:03:32 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ D /trunk/src/x86/core2
+ M /trunk/src/x86/mparam.h
+
+removed tuning for x86/core2, updated tuning for generic x86
+
+------------------------------------------------------------------------
+r12376 | zimmerma | 2018-02-21 14:57:59 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/arm/mparam.h
+ M /trunk/src/mparam_h.in
+ M /trunk/src/sparc64/mparam.h
+
+[src/sparc64/mparam.h] updated tuning parameters for sparc64
+
+------------------------------------------------------------------------
+r12375 | vlefevre | 2018-02-21 14:32:43 +0000 (Wed, 21 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] Use the generic parameters for x86_64 with Clang.
+------------------------------------------------------------------------
+r12374 | zimmerma | 2018-02-21 14:24:44 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ A /trunk/src/arm
+ A /trunk/src/arm/mparam.h
+ M /trunk/src/mparam_h.in
+
+added tuning for ARM
+
+------------------------------------------------------------------------
+r12373 | vlefevre | 2018-02-21 14:13:28 +0000 (Wed, 21 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ A /trunk/src/sparc64 (from /trunk/src/sparc64:12367)
+
+Reverted r12368: sparc64 tuning should be updated on gcc202.
+------------------------------------------------------------------------
+r12372 | zimmerma | 2018-02-21 14:09:31 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] generic case for all remaining i386's
+
+------------------------------------------------------------------------
+r12371 | zimmerma | 2018-02-21 13:58:35 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] put back __tune_k8__
+
+------------------------------------------------------------------------
+r12370 | zimmerma | 2018-02-21 13:48:37 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mparam_h.in
+
+[src/mparam_h.in] check __amd64__ before generic __x86_64__
+
+------------------------------------------------------------------------
+r12369 | zimmerma | 2018-02-21 13:25:44 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ D /trunk/src/hppa
+ M /trunk/src/mparam_h.in
+
+removed tuning for hppa (gcc61 is offline)
+
+------------------------------------------------------------------------
+r12368 | zimmerma | 2018-02-21 13:24:22 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ D /trunk/src/sparc64
+
+removed tuning parameters for sparc64 (gcc64, gcc200 and gcc201 are offline)
+
+------------------------------------------------------------------------
+r12367 | zimmerma | 2018-02-21 13:23:16 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tune/tuneup.c
+
+[tune/tuneup.c] for mpfr_div_threshold, start from 3 limbs again
+
+------------------------------------------------------------------------
+r12366 | zimmerma | 2018-02-21 13:06:31 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ D /trunk/src/powerpc32
+
+removed tuning for powerpc32 (no such machine available any more)
+
+------------------------------------------------------------------------
+r12365 | zimmerma | 2018-02-21 12:55:42 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/powerpc64/mparam.h
+
+[src/powerpc64/mparam.h] updated tuning parameters for powerpc64
+
+------------------------------------------------------------------------
+r12364 | zimmerma | 2018-02-21 11:17:39 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/amd/k8/mparam.h
+
+[src/amd/k8/mparam.h] fixed MPFR_DIV_THRESHOLD
+
+------------------------------------------------------------------------
+r12363 | zimmerma | 2018-02-21 11:16:20 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/amd/k8/mparam.h
+ M /trunk/src/x86/core2/mparam.h
+
+updated tuning parameters for amd/k8 and x86/core2
+
+------------------------------------------------------------------------
+r12362 | vlefevre | 2018-02-21 11:14:29 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ A /trunk/src/x86/mparam.h (from /trunk/src/x86/mparam.h:12358)
+
+Reverted r12359 and added a comment: tuning for x86 is used when
+building GMP/MPFR with a 32-bit ABI (ABI=32 / -m32).
+------------------------------------------------------------------------
+r12361 | zimmerma | 2018-02-21 11:14:27 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tune/tuneup.c
+
+[tuneup.c] start from 4 limbs for mpfr_div_threshold
+
+------------------------------------------------------------------------
+r12360 | zimmerma | 2018-02-21 10:45:20 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ D /trunk/src/ia64
+ M /trunk/src/mparam_h.in
+
+removed tuning for ia64 (gcc60.fsffrance.org is now offline)
+
+------------------------------------------------------------------------
+r12359 | zimmerma | 2018-02-21 10:42:40 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ D /trunk/src/x86/mparam.h
+
+removed tuning for x86 (no more access to such machine)
+
+------------------------------------------------------------------------
+r12358 | zimmerma | 2018-02-21 10:35:31 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tune/tuneup.c
+
+[tune/tuneup.c] make tune_simple_func more robust for small precisions
+
+------------------------------------------------------------------------
+r12357 | zimmerma | 2018-02-21 10:32:43 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/x86_64/mparam.h
+
+[src/x86_64/mparam.h] fixed MPFR_DIV_THRESHOLD
+
+------------------------------------------------------------------------
+r12356 | zimmerma | 2018-02-21 10:29:58 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/x86_64/core2/mparam.h
+
+[x86_64/core2/mparam.h] updated on gcc14
+
+------------------------------------------------------------------------
+r12355 | vlefevre | 2018-02-21 09:47:29 +0000 (Wed, 21 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] In the "long double" format recognition, added
+size information for IEEE extended (not used by MPFR, but this
+may be useful information for the user).
+------------------------------------------------------------------------
+r12354 | zimmerma | 2018-02-21 09:44:15 +0000 (Wed, 21 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ D /trunk/src/amd/athlon
+ M /trunk/src/mparam_h.in
+
+removed tuning parameters for amd/athlon (we have no access to such machine
+any more)
+
+------------------------------------------------------------------------
+r12353 | zimmerma | 2018-02-21 09:32:10 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ D /trunk/src/x86_64/pentium4
+
+removed tuning for pentium4
+
+------------------------------------------------------------------------
+r12352 | zimmerma | 2018-02-21 09:16:47 +0000 (Wed, 21 Feb 2018) | 2 lines
+Changed paths:
+ D /trunk/src/x86_64/corei5
+
+removed tuning for corei5 (was not used)
+
+------------------------------------------------------------------------
+r12351 | zimmerma | 2018-02-21 09:09:32 +0000 (Wed, 21 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ M /trunk/src/mparam_h.in
+ A /trunk/src/x86_64/mparam.h
+ M /trunk/tune/tuneup.c
+
+[src/x86_64/mparam.h] added tuning for generic x86_64
+[tune/tuneup.c] mpfr_divhigh now wants n >= 2
+
+------------------------------------------------------------------------
+r12350 | zimmerma | 2018-02-21 07:19:56 +0000 (Wed, 21 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+ D /trunk/src/arm
+ M /trunk/src/mparam_h.in
+
+removed thresholds for arm since gcc57 is no longer available, thus we cannot
+tune on an ARM machine
+
+------------------------------------------------------------------------
+r12349 | vlefevre | 2018-02-21 02:34:18 +0000 (Wed, 21 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/mulders.c
+
+[src/mulders.c] Removed unused variable dinv.
+------------------------------------------------------------------------
+r12348 | zimmerma | 2018-02-20 17:11:58 +0000 (Tue, 20 Feb 2018) | 6 lines
+Changed paths:
+ M /trunk/src/div.c
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mulders.c
+ M /trunk/tests/tmul.c
+ M /trunk/tune/tuneup.c
+
+[src/div.c] added comment
+[src/mpfr-gmp.h] moved definition of MUL_FFT_THRESHOLD
+[src/mulders.c] removed unused code, and force n>=2 in mpfr_divhigh_n_basecase
+[tests/tmul.c] improve coverage
+[tune/tuneup.c] forbid k = n-1 in divhigh_ktab[]
+
+------------------------------------------------------------------------
+r12347 | zimmerma | 2018-02-20 16:37:55 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] improve coverage, now 100% for div.c
+
+------------------------------------------------------------------------
+r12346 | zimmerma | 2018-02-20 16:16:40 +0000 (Tue, 20 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/ai.c
+ M /trunk/tests/tai.c
+
+[src/ai.c] revert part of r12312
+[tests/tai.c] added coverage test provided by Sylvain Chevillard
+
+------------------------------------------------------------------------
+r12345 | zimmerma | 2018-02-20 15:36:05 +0000 (Tue, 20 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] revert r12317 since it did not consider UBFs. For the record,
+ tfmma was failing with GMP_CHECK_RANDOMIZE=1519138438006416.
+
+------------------------------------------------------------------------
+r12344 | zimmerma | 2018-02-20 15:19:40 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div.c
+ M /trunk/tests/tdiv.c
+
+[src/div.c] get rid of mpfr_div_with_mpz_tdiv_q
+
+------------------------------------------------------------------------
+r12343 | vlefevre | 2018-02-20 14:54:05 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/gmp_op.c
+
+[src/gmp_op.c] Fixed a bug in mpfr_cmp_q on NaN rational: the NaN flag
+was set by mpfr_set_q, but the flags were not restored just after.
+------------------------------------------------------------------------
+r12342 | vlefevre | 2018-02-20 14:45:35 +0000 (Tue, 20 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/gmp_op.c
+
+[src/gmp_op.c] Reverted incorrect change in r12337 for mpfr_cmp_q.
+Explanation in comment. If the code was not tested, it should be by
+using mpq_set_num and mpq_set_den to construct such rationals.
+------------------------------------------------------------------------
+r12341 | zimmerma | 2018-02-20 14:27:22 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] improve coverage
+
+------------------------------------------------------------------------
+r12340 | zimmerma | 2018-02-20 14:08:20 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] improve coverage of mpfr_div_2
+
+------------------------------------------------------------------------
+r12339 | vlefevre | 2018-02-20 13:55:40 +0000 (Tue, 20 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+ M /trunk/src/sub1sp.c
+
+[src/{add,sub}1sp.c] Updated/added comments for MPFR_WANT_ASSERT >= 2.
+------------------------------------------------------------------------
+r12338 | zimmerma | 2018-02-20 13:53:51 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div.c
+
+[src/div.c] removed dead code
+
+------------------------------------------------------------------------
+r12337 | zimmerma | 2018-02-20 13:45:08 +0000 (Tue, 20 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/gmp_op.c
+ M /trunk/tests/tgmpop.c
+
+[src/gmp_op.c] removed dead code
+[tests/tgmpop.c] improve coverage of gmp_op.c to 100%
+
+------------------------------------------------------------------------
+r12336 | vlefevre | 2018-02-20 12:33:38 +0000 (Tue, 20 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added missing ";;" before "esac" for code robustness.
+------------------------------------------------------------------------
+r12335 | vlefevre | 2018-02-20 12:31:34 +0000 (Tue, 20 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added a FIXME. Added a ";;" for safety.
+------------------------------------------------------------------------
+r12334 | zimmerma | 2018-02-20 11:48:29 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] added comment, and define MPFR_LONG_WITHIN_LIMB when cannot test
+
+------------------------------------------------------------------------
+r12333 | vlefevre | 2018-02-20 09:33:38 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] Improved highest_bit_idx in the case where
+MPFR_LONG_WITHIN_LIMB is not defined (tested with GCC).
+------------------------------------------------------------------------
+r12332 | zimmerma | 2018-02-20 09:17:15 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] resolved FIXME and removed dead code
+
+------------------------------------------------------------------------
+r12331 | zimmerma | 2018-02-20 08:45:20 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tmul.c
+
+[tests/tmul.c] improve coverage
+
+------------------------------------------------------------------------
+r12330 | zimmerma | 2018-02-20 08:31:14 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] highest_bit_idx() assumes x > 0
+
+------------------------------------------------------------------------
+r12329 | zimmerma | 2018-02-20 08:27:35 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] fixed comment
+
+------------------------------------------------------------------------
+r12328 | zimmerma | 2018-02-20 08:24:24 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] redo change r12315 using MPFR_LONG_WITHIN_LIMB
+
+------------------------------------------------------------------------
+r12327 | zimmerma | 2018-02-20 08:09:46 +0000 (Tue, 20 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] added 2 FIXME
+
+------------------------------------------------------------------------
+r12326 | vlefevre | 2018-02-19 23:32:38 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tai.c
+
+[tests/tai.c] Renamed test_near_zero to test_near_m2e, since this is
+"exercise mpfr_ai near m*2^e", as documented. Corrected comments.
+------------------------------------------------------------------------
+r12325 | vlefevre | 2018-02-19 23:29:35 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tai.c
+
+[tests/tai.c] For test_near_zero(), check that the NaN flag was not set
+(useful since such tests don't really check that the result is not NaN).
+------------------------------------------------------------------------
+r12324 | zimmerma | 2018-02-19 20:53:27 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tmul.c
+
+[tests/tmul.c] improve coverage
+
+------------------------------------------------------------------------
+r12323 | zimmerma | 2018-02-19 18:22:00 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tmul.c
+
+[tests/tmul.c] improve coverage
+
+------------------------------------------------------------------------
+r12322 | vlefevre | 2018-02-19 17:35:09 +0000 (Mon, 19 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] Reverted incorrect change r12315: MPFR_LIMB_MAX
+cannot be used with the preprocessor due to the cast. The test should
+be done in "pure" C and the middle-end of the compiler should optimize.
+------------------------------------------------------------------------
+r12321 | vlefevre | 2018-02-19 17:27:03 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] Removed an unused label.
+------------------------------------------------------------------------
+r12320 | vlefevre | 2018-02-19 16:36:39 +0000 (Mon, 19 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tzeta.c
+
+[tests/tzeta.c] Check that the NaN flag was not set in some tests
+that do not involve NaN (useful since such tests don't really check
+that the result is not NaN).
+------------------------------------------------------------------------
+r12319 | zimmerma | 2018-02-19 16:28:34 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1.c
+
+[src/sub1.c] removed dead code, now coverage should be 100%
+
+------------------------------------------------------------------------
+r12318 | vlefevre | 2018-02-19 16:26:51 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] Avoid more integer overflows.
+------------------------------------------------------------------------
+r12317 | zimmerma | 2018-02-19 16:24:11 +0000 (Mon, 19 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sub1.c
+ M /trunk/tests/tsub.c
+
+[src/sub1.c] removed dead code
+[tests/tsub.c] added coverage test
+
+------------------------------------------------------------------------
+r12316 | vlefevre | 2018-02-19 16:17:03 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] Detect some potential integer overflows.
+------------------------------------------------------------------------
+r12315 | zimmerma | 2018-02-19 16:02:44 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/random_deviate.c
+
+[src/random_deviate.c] don't compile alternate code if not needed
+
+------------------------------------------------------------------------
+r12314 | vlefevre | 2018-02-19 16:00:44 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] Coding style. Corrected comments.
+------------------------------------------------------------------------
+r12313 | zimmerma | 2018-02-19 15:52:02 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tzeta.c
+
+[tests/tzeta.c] improve coverage (and also uceil_exp2.c)
+
+------------------------------------------------------------------------
+r12312 | zimmerma | 2018-02-19 14:37:07 +0000 (Mon, 19 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/ai.c
+ M /trunk/tests/tai.c
+
+[src/ai.c] removed dead code, and improved coverage
+[tests/tai.c] exercise mpfr_ai near (negative) zeroes
+
+------------------------------------------------------------------------
+r12311 | zimmerma | 2018-02-19 10:38:48 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] fixed recomputation of wprec (to be confirmed)
+
+------------------------------------------------------------------------
+r12310 | zimmerma | 2018-02-19 07:10:52 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] removed dead code
+
+------------------------------------------------------------------------
+r12309 | vlefevre | 2018-02-19 03:01:53 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Fixed indentation.
+------------------------------------------------------------------------
+r12308 | vlefevre | 2018-02-19 02:55:05 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r12307 | vlefevre | 2018-02-19 02:54:12 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sqrt.c
+
+[src/sqrt.c] Coding style.
+------------------------------------------------------------------------
+r12306 | vlefevre | 2018-02-19 02:46:30 +0000 (Mon, 19 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] Avoid a potential integer overflow in a type conversion
+for 32-bit mpfr_exp_t and 64-bit long (e.g. with -D_MPFR_PREC_FORMAT=2
+on a 64-bit Linux machine).
+------------------------------------------------------------------------
+r12305 | vlefevre | 2018-02-19 02:19:29 +0000 (Mon, 19 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/src/div_2ui.c
+ M /trunk/tests/tmul_2exp.c
+
+[src/div_2ui.c] Reverted incorrect change in r12272 and added comments
+ and assertions.
+[tests/tmul_2exp.c] Improved a test to trigger the bug in r12272 also
+ when mpfr_exp_t > 32 bits (e.g. on 64-bit Linux machines).
+------------------------------------------------------------------------
+r12304 | vlefevre | 2018-02-19 01:46:30 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tmul_2exp.c
+
+[tests/tmul_2exp.c] Improved output if mpfr_exp_t > long (for positive).
+------------------------------------------------------------------------
+r12303 | vlefevre | 2018-02-19 01:43:20 +0000 (Mon, 19 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tmul_2exp.c
+
+[tests/tmul_2exp.c] Improved output if mpfr_exp_t > long (for negative).
+------------------------------------------------------------------------
+r12302 | vlefevre | 2018-02-19 01:10:13 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tsub1sp.c
+
+[tests] Fixed type errors with -D_MPFR_PREC_FORMAT=2 in CFLAGS and the
+--enable-assert=full configure option (signaled by GCC's -Wformat).
+------------------------------------------------------------------------
+r12301 | vlefevre | 2018-02-19 01:00:48 +0000 (Mon, 19 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/mul.c
+
+[src/mul.c] Fixed type error with -D_MPFR_PREC_FORMAT=2 in CFLAGS and
+the --enable-assert=full configure option (signaled by GCC's -Wformat).
+------------------------------------------------------------------------
+r12300 | vlefevre | 2018-02-19 00:38:01 +0000 (Mon, 19 Feb 2018) | 6 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Removed the mention of MPFR_EXT_EMIN and MPFR_EXT_EMAX,
+replacing them by MPFR_EMIN_MIN and MPFR_EMAX_MAX, as done in r12298.
+Note: These old macros had been introduced in r7863 so that one could
+choose different values for the extended exponent range for debugging
+purpose, but they were not used in practice and were adding complexity
+(and potential inconsistency) for no really good reason.
+------------------------------------------------------------------------
+r12299 | zimmerma | 2018-02-18 17:53:00 +0000 (Sun, 18 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/agm.c
+ M /trunk/tests/tagm.c
+
+[src/agm.c] added comment about line of code impossible to cover
+
+------------------------------------------------------------------------
+r12298 | zimmerma | 2018-02-18 14:23:01 +0000 (Sun, 18 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/agm.c
+ M /trunk/src/div.c
+ M /trunk/src/mpfr-impl.h
+
+[src/agm.c,src/div.c,src/mpfr-impl.h] replaced MPFR_EXT_EMIN by MPFR_EMIN_MIN,
+ and MPFR_EXT_EMAX by MPFR_EMAX_MAX
+
+------------------------------------------------------------------------
+r12297 | zimmerma | 2018-02-18 14:09:55 +0000 (Sun, 18 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sqrt.c
+ M /trunk/tests/tsqrt.c
+
+[src/sqrt.c] removed dead code
+[tests/tsqrt.c] improve coverage of mpfr_sqrt, now at 100%
+
+------------------------------------------------------------------------
+r12296 | zimmerma | 2018-02-18 12:48:51 +0000 (Sun, 18 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] improve coverage
+
+------------------------------------------------------------------------
+r12295 | zimmerma | 2018-02-18 12:31:53 +0000 (Sun, 18 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] improve coverage
+
+------------------------------------------------------------------------
+r12294 | zimmerma | 2018-02-17 19:30:39 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqrt.c
+
+[src/sqrt.c] removed dead code
+
+------------------------------------------------------------------------
+r12293 | zimmerma | 2018-02-17 16:53:57 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] improve coverage
+
+------------------------------------------------------------------------
+r12292 | zimmerma | 2018-02-17 12:53:46 +0000 (Sat, 17 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sqrt.c
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] improved coverage
+[src/sqrt.c] added comments
+
+------------------------------------------------------------------------
+r12291 | vlefevre | 2018-02-17 12:26:01 +0000 (Sat, 17 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] Added a FIXME comment.
+------------------------------------------------------------------------
+r12290 | zimmerma | 2018-02-17 11:53:07 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsqrt.c
+
+[tests/tsqrt.c] improve coverage
+
+------------------------------------------------------------------------
+r12289 | zimmerma | 2018-02-17 11:01:10 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sqrt.c
+
+[src/sqrt.c] removed dead code
+
+------------------------------------------------------------------------
+r12287 | vlefevre | 2018-02-17 10:28:33 +0000 (Sat, 17 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Improved a comment.
+------------------------------------------------------------------------
+r12286 | vlefevre | 2018-02-17 10:27:19 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Check reuse of arguments for all mpfr_sub tests, when
+possible.
+------------------------------------------------------------------------
+r12285 | zimmerma | 2018-02-17 09:39:57 +0000 (Sat, 17 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+ M /trunk/tests/tsub1sp.c
+
+[src/sub1sp.c] fixed bug in mpfr_sub1sp1n (corner case when a=c)
+[tests/tsub1sp.c] added non-regression test
+
+------------------------------------------------------------------------
+r12284 | zimmerma | 2018-02-17 08:52:47 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed case 2e
+
+------------------------------------------------------------------------
+r12283 | vlefevre | 2018-02-17 03:25:38 +0000 (Sat, 17 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Updated bug20180217 to trigger the bug: one needs to
+reuse the smallest input variable as the output variable.
+------------------------------------------------------------------------
+r12282 | vlefevre | 2018-02-17 03:03:09 +0000 (Sat, 17 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Added a test.
+------------------------------------------------------------------------
+r12281 | vlefevre | 2018-02-17 01:36:28 +0000 (Sat, 17 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] Updated a comment.
+------------------------------------------------------------------------
+r12280 | vlefevre | 2018-02-17 01:29:43 +0000 (Sat, 17 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] Fixed an integer overflow from r12276.
+------------------------------------------------------------------------
+r12279 | vlefevre | 2018-02-17 01:12:49 +0000 (Sat, 17 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] Added a log message.
+------------------------------------------------------------------------
+r12278 | zimmerma | 2018-02-16 19:10:57 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfmma.c
+
+[tests/tfmma.c] added coverage test
+
+------------------------------------------------------------------------
+r12277 | zimmerma | 2018-02-16 16:30:09 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tfmma.c
+
+[tests/tfmma.c] improve coverage of add.c (ubf case)
+
+------------------------------------------------------------------------
+r12276 | vlefevre | 2018-02-16 16:11:17 +0000 (Fri, 16 Feb 2018) | 9 lines
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] It seems that code removed in r12273 wasn't necessarily
+dead code with mpfr_exp_t > long (-D_MPFR_EXP_FORMAT=4 needed) because
+for MPFR_SMALL_INPUT_AFTER_SAVE_EXPO, err would be limited to -LONG_MAX
+and precisions larger than LONG_MAX could be problems. The -LONG_MAX
+bound from r4127 was arbitrary and only used to simplify the code due
+to the fact that mpfr_cmp_si compares to a "long" argument. But now we
+have the internal mpfr_get_exp_t function, allowing us to avoid this
+arbitrary bound (fixing the code and making it more efficient for these
+extreme cases) and simplify the code even more.
+------------------------------------------------------------------------
+r12275 | zimmerma | 2018-02-16 15:54:26 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/mbench/mfv5.cc
+ M /trunk/tools/mbench/mfv5.h
+
+[mbench] added new option to usage
+
+------------------------------------------------------------------------
+r12274 | zimmerma | 2018-02-16 15:39:59 +0000 (Fri, 16 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/tools/mbench/mfv5.cc
+ M /trunk/tools/mbench/mfv5.h
+
+[mbench] added option -d to fix the exponent difference between operands
+ (useful for mpfr_add and mpfr_sub, for example use -d0 for operands
+ with same exponent, -d1 for operands differing by 1, ...)
+
+------------------------------------------------------------------------
+r12273 | zimmerma | 2018-02-16 15:09:38 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/expm1.c
+
+[src/expm1.c] improve coverage (by removing dead code)
+
+------------------------------------------------------------------------
+r12272 | vlefevre | 2018-02-16 14:35:38 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div_2ui.c
+
+[src/div_2ui.c] No need for mpfr_uexp_t, due to the constraints on
+the valid exponents.
+------------------------------------------------------------------------
+r12271 | vlefevre | 2018-02-16 14:32:58 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Update about mpfr_exp_t.
+------------------------------------------------------------------------
+r12270 | vlefevre | 2018-02-16 14:13:15 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/mul_2ui.c
+
+[src/mul_2ui.c] Simplified mpfr_mul_2ui (like mpfr_div_2ui).
+------------------------------------------------------------------------
+r12269 | vlefevre | 2018-02-16 14:09:39 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_2ui.c
+
+[src/div_2ui.c] Simplified justification.
+------------------------------------------------------------------------
+r12268 | vlefevre | 2018-02-16 13:50:07 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_2ui.c
+
+[src/div_2ui.c] Simplified code as suggested by PZ; added justification.
+------------------------------------------------------------------------
+r12267 | zimmerma | 2018-02-16 12:37:56 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1.c
+ M /trunk/src/div_ui.c
+ M /trunk/src/sub1sp.c
+
+GNU style: https://www.gnu.org/prep/standards/standards.html#Formatting
+
+------------------------------------------------------------------------
+r12266 | zimmerma | 2018-02-16 12:35:19 +0000 (Fri, 16 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/div_2ui.c
+ M /trunk/tests/tmul_2exp.c
+
+[src/div_2ui.c] added comment
+[tests/tmul_2exp.c] added coverage test
+
+------------------------------------------------------------------------
+r12265 | vlefevre | 2018-02-16 11:31:31 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_2ui.c
+
+[src/div_2ui.c] Replaced FIXME by an explanation.
+------------------------------------------------------------------------
+r12264 | zimmerma | 2018-02-16 10:55:46 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div_2ui.c
+
+[src/div_2ui.c] added FIXME
+
+------------------------------------------------------------------------
+r12263 | zimmerma | 2018-02-16 10:43:49 +0000 (Fri, 16 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/cmp_ld.c
+
+[src/cmp_ld.c] simplified code (and avoid useless test when long double is not
+ double-double)
+
+------------------------------------------------------------------------
+r12262 | zimmerma | 2018-02-16 10:32:47 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub1sp.c
+
+[tests/tsub1sp.c] improve coverage
+
+------------------------------------------------------------------------
+r12261 | zimmerma | 2018-02-16 09:31:31 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] improve coverage of add1sp
+
+------------------------------------------------------------------------
+r12260 | zimmerma | 2018-02-16 08:23:06 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed bug20180216
+
+------------------------------------------------------------------------
+r12259 | zimmerma | 2018-02-16 07:53:26 +0000 (Fri, 16 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tadd1sp.c
+
+[tests/tadd1sp.c] added coverage test
+
+------------------------------------------------------------------------
+r12257 | vlefevre | 2018-02-16 02:22:30 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] More tests in bug20180216.
+------------------------------------------------------------------------
+r12256 | vlefevre | 2018-02-16 02:08:03 +0000 (Fri, 16 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Added bug20180216 test currently failing (corresponding
+to the failure mentioned in r12253, r12254 and r12255, but reproducible
+with a simple "./configure").
+------------------------------------------------------------------------
+r12255 | vlefevre | 2018-02-16 01:39:57 +0000 (Fri, 16 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/exp_2.c
+
+[src/exp_2.c] Note that the internal behavior depends on whether
+MPFR_LONG_WITHIN_LIMB is defined or not (see also r12253). This
+should not matter, possibly except in case of bug, like currently.
+------------------------------------------------------------------------
+r12254 | vlefevre | 2018-02-16 01:29:24 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Updated FIXME for MPFR_CHECK_MP_LIMB_T_VS_LONG.
+------------------------------------------------------------------------
+r12253 | vlefevre | 2018-02-16 01:23:07 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/acinclude.m4
+
+[acinclude.m4] Added a FIXME for MPFR_CHECK_MP_LIMB_T_VS_LONG.
+------------------------------------------------------------------------
+r12252 | vlefevre | 2018-02-16 00:00:13 +0000 (Fri, 16 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Squeezed useless double-space.
+------------------------------------------------------------------------
+r12251 | zimmerma | 2018-02-15 18:42:18 +0000 (Thu, 15 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed bug20180215()
+
+------------------------------------------------------------------------
+r12250 | vlefevre | 2018-02-15 15:10:10 +0000 (Thu, 15 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Updated comment for bug20180215.
+------------------------------------------------------------------------
+r12249 | vlefevre | 2018-02-15 14:51:02 +0000 (Thu, 15 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Use "else" for symmetry with above code.
+------------------------------------------------------------------------
+r12248 | vlefevre | 2018-02-15 14:39:54 +0000 (Thu, 15 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Added a comment for bug20180215 (bug in the case
+2 <= d < p in generic code mpfr_sub1sp() introduced in r12242).
+------------------------------------------------------------------------
+r12246 | vlefevre | 2018-02-15 14:27:08 +0000 (Thu, 15 Feb 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/tsub.c
+
+[tests/tsub.c] Added bug20180215 test currently failing, found from a
+failure using -DMPFR_GENERIC_ABI in CFLAGS and the --enable-assert=full
+configure option; but the test had to be extended so that it also fails
+with a simple "configure", i.e. without -DMPFR_GENERIC_ABI in CFLAGS
+and without the --enable-assert=full configure option.
+------------------------------------------------------------------------
+r12245 | vlefevre | 2018-02-15 14:13:52 +0000 (Thu, 15 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r12243 | zimmerma | 2018-02-14 16:11:04 +0000 (Wed, 14 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] review of case 2 <= d < p in generic code mpfr_sub1sp()
+
+------------------------------------------------------------------------
+r12242 | zimmerma | 2018-02-14 14:41:48 +0000 (Wed, 14 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+ M /trunk/src/sub1sp.c
+
+[src/div_ui.c] GNU style
+[src/sub1sp.c] reviewed the code for d>=p in mpfr_sub1sp()
+
+------------------------------------------------------------------------
+r12241 | vlefevre | 2018-02-14 11:10:09 +0000 (Wed, 14 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
+
+[tools/mpfrlint] Much improved the check of the use of GMP internals.
+------------------------------------------------------------------------
+r12240 | zimmerma | 2018-02-14 10:06:46 +0000 (Wed, 14 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] fixed a FIXME
+
+------------------------------------------------------------------------
+r12239 | zimmerma | 2018-02-14 09:50:02 +0000 (Wed, 14 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/sub1sp.c
+
+[src/mpfr-gmp.h] define prototype of __gmpn_rsblsh1_n
+[src/sub1sp.c] changed names of variables to something more readable
+
+------------------------------------------------------------------------
+r12238 | zimmerma | 2018-02-14 09:36:58 +0000 (Wed, 14 Feb 2018) | 3 lines
+Changed paths:
+ M /trunk/configure.ac
+ M /trunk/src/sub1sp.c
+
+[configure.ac] detect mpn_rsblsh1_n instead of mpn_rsblsh_n
+[src/sub1sp.c] use mpn_rsblsh1_n instead of mpn_rsblsh_n with k=1
+
+------------------------------------------------------------------------
+r12237 | vlefevre | 2018-02-14 03:17:10 +0000 (Wed, 14 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Added 2 FIXME's.
+------------------------------------------------------------------------
+r12236 | vlefevre | 2018-02-14 03:03:16 +0000 (Wed, 14 Feb 2018) | 4 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] In mpfr_sub1sp, initialize k only once. This slightly
+simplifies the code and avoids a -Wmaybe-uninitialized warning from
+GCC. The only failure on a 64-bit Linux machine is tsub1sp, due to
+an assertion failure in mpfr_sub1sp, as before this change.
+------------------------------------------------------------------------
+r12235 | vlefevre | 2018-02-14 02:49:07 +0000 (Wed, 14 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] Avoid the swapping of the exponents when they are equal.
+------------------------------------------------------------------------
+r12234 | zimmerma | 2018-02-13 16:06:18 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] review of case d=1 in generic code
+
+------------------------------------------------------------------------
+r12233 | zimmerma | 2018-02-13 15:42:28 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] no need of MPFR_TMP_MARK any more
+
+------------------------------------------------------------------------
+r12232 | zimmerma | 2018-02-13 15:19:27 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] end of review of case d=0 in generic code
+
+------------------------------------------------------------------------
+r12231 | zimmerma | 2018-02-13 15:01:34 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] work in progress
+
+------------------------------------------------------------------------
+r12230 | vlefevre | 2018-02-13 14:49:52 +0000 (Tue, 13 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] Moved a MPFR_ASSERTD to the right place.
+------------------------------------------------------------------------
+r12229 | zimmerma | 2018-02-13 14:26:57 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] re-enable __gmpn_rsblsh_n (with WANT_GMP_INTERNALS)
+
+------------------------------------------------------------------------
+r12228 | zimmerma | 2018-02-13 14:13:23 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/sub1sp.c
+
+[src/sub1sp.c] small improvement
+
+------------------------------------------------------------------------
+r12227 | zimmerma | 2018-02-13 13:59:18 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/cfarm.sh
+
+[tools/cfarm.sh] updated for 4.0.1-rc2
+
+------------------------------------------------------------------------
+r12226 | zimmerma | 2018-02-13 13:53:19 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] mp_ptr -> mp_limb_t*
+
+------------------------------------------------------------------------
+r12225 | zimmerma | 2018-02-13 13:49:43 +0000 (Tue, 13 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] get rid of MPN_COPY/MPN_ZERO in generic code
+
+------------------------------------------------------------------------
+r12223 | vlefevre | 2018-02-13 02:48:00 +0000 (Tue, 13 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] Improved comments and other minor changes.
+------------------------------------------------------------------------
+r12222 | vlefevre | 2018-02-13 02:39:54 +0000 (Tue, 13 Feb 2018) | 6 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] In the generic code of mpfr_add1sp, fixed the computation
+of the round and sticky bits from r12220. At the same time, improved the
+handling of MPFR_RNDF in this part of the code:
+ * The "while" loop to compute the sticky bit is no longer done in this
+ case (the sticky bit does not matter).
+ * The "goto" is avoided.
+------------------------------------------------------------------------
+r12221 | vlefevre | 2018-02-13 01:22:50 +0000 (Tue, 13 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tadd.c
+
+[tests/tadd.c] Added 2 tests that fail starting with r12220.
+------------------------------------------------------------------------
+r12220 | zimmerma | 2018-02-12 15:40:42 +0000 (Mon, 12 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/src/add1sp.c
+
+[src/add1sp.c] cleanup generic code mpfr_add1sp()
+
+------------------------------------------------------------------------
+r12219 | vlefevre | 2018-02-09 14:17:18 +0000 (Fri, 09 Feb 2018) | 7 lines
+Changed paths:
+ M /trunk/src/fma.c
+ M /trunk/src/hypot.c
+
+[src/fma.c] Added a FIXME comment about overflow/underflow issues in
+ corner cases (already caught with MPFR_ASSERTN), fixable with UBF
+ like in mpfr_fmma.
+[src/hypot.c] Updated a comment: The problem that would come from an
+ underflow in y^2, in particular because x was scaled in order to
+ avoid an overflow in x^2, has been avoided by using a FMA (though
+ still buggy for these cases, as mentioned just above).
+------------------------------------------------------------------------
+r12215 | vlefevre | 2018-02-08 01:20:13 +0000 (Thu, 08 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tsprintf.c
+ M /trunk/tests/tversion.c
+
+[tests] Added/updated comments about the config.h inclusion.
+------------------------------------------------------------------------
+r12214 | vlefevre | 2018-02-08 01:07:46 +0000 (Thu, 08 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_ld.c
+
+[tests/{tset_float128.c,tset_ld.c}] Removed obsolete WITH_FPU_CONTROL
+related code (this should have been done in r12185).
+------------------------------------------------------------------------
+r12212 | vlefevre | 2018-02-07 23:37:29 +0000 (Wed, 07 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+
+[INSTALL] Updated GMP URL.
+------------------------------------------------------------------------
+r12210 | vlefevre | 2018-02-07 23:32:29 +0000 (Wed, 07 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r12208 | vlefevre | 2018-02-07 23:30:03 +0000 (Wed, 07 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/tools/mpfrlint
+
+[doc/mpfr.texi] Corrected minimal GMP version.
+[tools/mpfrlint] Updated test to detect minimal GMP version mismatch.
+------------------------------------------------------------------------
+r12206 | vlefevre | 2018-02-07 23:21:02 +0000 (Wed, 07 Feb 2018) | 2 lines
+Changed paths:
+ M /trunk/INSTALL
+ M /trunk/tools/mpfrlint
+
+[INSTALL] Corrected minimal GMP version (thanks to David Edelsohn).
+[tools/mpfrlint] Added a test to detect minimal GMP version mismatch.
+------------------------------------------------------------------------
+r12198 | vlefevre | 2018-02-07 11:59:15 +0000 (Wed, 07 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/tools/announce-text
-[doc/README.dev] "To make a release": moved a sentence.
[tools/announce-text] For releases, check the VERSION file of the tag.
-(merged changesets r12197-12198 from the trunk)
------------------------------------------------------------------------
-r12195 | vlefevre | 2018-02-02 13:17:33 +0000 (Fri, 02 Feb 2018) | 4 lines
+r12197 | vlefevre | 2018-02-07 11:39:23 +0000 (Wed, 07 Feb 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] "To make a release": moved a sentence.
+------------------------------------------------------------------------
+r12194 | vlefevre | 2018-02-02 13:06:29 +0000 (Fri, 02 Feb 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tdiv_ui.c
+ M /trunk/tests/tdiv_ui.c
[tests/tdiv_ui.c] Forcibly disable value coverage checking if
mp_limb_t > unsigned long (e.g. on mips64 with the n32 ABI).
-Corrected comments.
-(merged changesets r12193-12194 from the trunk)
------------------------------------------------------------------------
-r12192 | vlefevre | 2018-02-02 12:34:56 +0000 (Fri, 02 Feb 2018) | 1 line
+r12193 | vlefevre | 2018-02-02 12:46:28 +0000 (Fri, 02 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/tests/tdiv_ui.c
-ChangeLog update with "TZ=UTC svn log -rHEAD:0 -v" (in UTF-8 locales).
+[tests/tdiv_ui.c] Corrected comments.
------------------------------------------------------------------------
-r12191 | vlefevre | 2018-02-02 12:32:02 +0000 (Fri, 02 Feb 2018) | 6 lines
+r12190 | vlefevre | 2018-02-02 11:47:35 +0000 (Fri, 02 Feb 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/terandom.c
- M /branches/4.0/tests/terandom_chisq.c
- M /branches/4.0/tests/tgrandom.c
- M /branches/4.0/tests/tnrandom.c
- M /branches/4.0/tests/tnrandom_chisq.c
- M /branches/4.0/tests/trandom.c
- M /branches/4.0/tests/trandom_deviate.c
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tests/tsub_d.c
- M /branches/4.0/tests/turandom.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/tnrandom_chisq.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/turandom.c
-[tests]
+[tests/t*random*.c]
* Replaced calloc + free by tests_allocate + tests_free as usual.
- * Replaced some fprintf with stderr by printf.
+ * trandom.c, turandom.c: do bitwise operations in unsigned arithmetic.
+------------------------------------------------------------------------
+r12189 | vlefevre | 2018-02-02 11:27:03 +0000 (Fri, 02 Feb 2018) | 5 lines
+Changed paths:
+ M /trunk/tests/terandom.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/tgrandom.c
+ M /trunk/tests/tnrandom.c
+ M /trunk/tests/tnrandom_chisq.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/trandom_deviate.c
+
+[tests/t*random*.c]
+ * Replaced some fprintf with stderr by printf (but not those
+ concerning memory allocation errors).
* Do bitwise operations in unsigned arithmetic.
* Formatting.
-(merged changesets r12188-12190 from the trunk)
------------------------------------------------------------------------
-r12187 | vlefevre | 2018-02-02 10:57:17 +0000 (Fri, 02 Feb 2018) | 16 lines
+r12188 | vlefevre | 2018-02-02 11:08:16 +0000 (Fri, 02 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tests.c
- M /branches/4.0/tests/tremquo.c
- M /branches/4.0/tests/tset_float128.c
- M /branches/4.0/tests/tset_ld.c
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tsub_d.c
-[tests] Fixed the cases where tests_start_mpfr was called too late,
-i.e. after potential output (to stdout).
- * tremquo.c: moved the call to tests_start_mpfr to the beginning.
- * tset_float128.c, tset_ld.c: removed the optional, obsolete code
- setting the FPU control word; MPFR_FPU_PREC can be used instead
- (see tests.c).
+[tests] Formatting.
+------------------------------------------------------------------------
+r12186 | vlefevre | 2018-02-02 10:53:26 +0000 (Fri, 02 Feb 2018) | 7 lines
+Changed paths:
+ M /trunk/tests/tests.c
[tests/tests.c] Make stderr unbuffered again.
Note for the history: both stdout and stderr were made unbuffered in
@@ -2282,896 +12989,1238 @@ setbuf on stderr removed) in r2449 for consistency, but stderr was
used later for specific cases (e.g. memory allocation errors or when
stdout is already used for something else), and it is also used for
assertion failures. Thus the setbuf on stderr is still needed.
+------------------------------------------------------------------------
+r12185 | vlefevre | 2018-02-02 10:36:50 +0000 (Fri, 02 Feb 2018) | 6 lines
+Changed paths:
+ M /trunk/tests/tremquo.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_ld.c
-(merged changesets r12185-12186 from the trunk)
+[tests] Fixed the cases where tests_start_mpfr was called too late,
+i.e. after potential output (to stdout).
+ * tremquo.c: moved the call to tests_start_mpfr to the beginning.
+ * tset_float128.c, tset_ld.c: removed the optional, obsolete code
+ setting the FPU control word; MPFR_FPU_PREC can be used instead
+ (see tests.c).
------------------------------------------------------------------------
-r12184 | vlefevre | 2018-02-02 10:14:04 +0000 (Fri, 02 Feb 2018) | 3 lines
+r12183 | vlefevre | 2018-02-02 10:12:38 +0000 (Fri, 02 Feb 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tabort_defalloc1.c
- M /branches/4.0/tests/tabort_defalloc2.c
- M /branches/4.0/tests/tabort_prec_max.c
+ M /trunk/tests/tabort_defalloc1.c
+ M /trunk/tests/tabort_defalloc2.c
+ M /trunk/tests/tabort_prec_max.c
-Reverse-merged r12182 since tests_start_mpfr disables stdout buffering,
+Reverse-merged r12181 since tests_start_mpfr disables stdout buffering,
so that the fflush() are unnecessary.
-(merged changeset r12183 from the trunk)
------------------------------------------------------------------------
-r12182 | vlefevre | 2018-02-02 09:55:12 +0000 (Fri, 02 Feb 2018) | 4 lines
+r12181 | vlefevre | 2018-02-02 09:52:45 +0000 (Fri, 02 Feb 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tabort_defalloc1.c
- M /branches/4.0/tests/tabort_defalloc2.c
- M /branches/4.0/tests/tabort_prec_max.c
+ M /trunk/tests/tabort_defalloc1.c
+ M /trunk/tests/tabort_defalloc2.c
+ M /trunk/tests/tabort_prec_max.c
[tests/tabort_*.c] Flush stdout after a printf(), as an abort() is
expected. This is needed on platforms where abort() does not flush
the stdio streams, such as with the GNU C Library (glibc) 2.27.
-(merged changeset r12181 from the trunk)
------------------------------------------------------------------------
-r12180 | vlefevre | 2018-02-01 14:31:06 +0000 (Thu, 01 Feb 2018) | 1 line
+r12178 | vlefevre | 2018-02-01 14:27:11 +0000 (Thu, 01 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/NEWS
-ChangeLog update with "TZ=UTC svn log -rHEAD:0 -v" (in UTF-8 locales).
+[NEWS] Mention "make check-exported-symbols" (experimental).
------------------------------------------------------------------------
-r12179 | vlefevre | 2018-02-01 14:28:02 +0000 (Thu, 01 Feb 2018) | 1 line
+r12172 | vlefevre | 2018-02-01 13:28:12 +0000 (Thu, 01 Feb 2018) | 1 line
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/tests/tdiv_ui.c
-[NEWS] Mention "make check-exported-symbols" (experimental).
+[tests/tdiv_ui.c] Portability update, in case MPFR_PREC_MIN > 1.
------------------------------------------------------------------------
-r12177 | vlefevre | 2018-02-01 14:22:32 +0000 (Thu, 01 Feb 2018) | 1 line
+r12169 | vlefevre | 2018-01-31 15:15:01 +0000 (Wed, 31 Jan 2018) | 3 lines
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/tests/tdiv_ui.c
-Updated version to 4.0.1-rc2.
+[tests/tdiv_ui.c] In corner_cases, test larger values for xn,
+as suggested by Paul, allowing one to cover case 2 for both
+sb=0 and sb=1. Value coverage is now complete.
------------------------------------------------------------------------
-r12176 | vlefevre | 2018-02-01 14:21:13 +0000 (Thu, 01 Feb 2018) | 1 line
+r12168 | vlefevre | 2018-01-31 15:02:18 +0000 (Wed, 31 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/tests/tdiv_ui.c
-[doc/mpfr.texi] Updated the month.
+[tests/tdiv_ui.c] Updated midpoint_exact to also test the divisor
+ULONG_MAX, allowing one to cover cases 3 and 4.
------------------------------------------------------------------------
-r12175 | vlefevre | 2018-02-01 13:47:27 +0000 (Thu, 01 Feb 2018) | 1 line
+r12167 | vlefevre | 2018-01-31 14:55:17 +0000 (Wed, 31 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/tests/tdiv_ui.c
-[NEWS] Mention the mpfr_div_ui bug.
+[tests/tdiv_ui.c] Added tests with simple midpoint and exact cases.
+This covers case 9, sb=0.
------------------------------------------------------------------------
-r12170 | vlefevre | 2018-01-31 16:21:15 +0000 (Wed, 31 Jan 2018) | 3 lines
+r12166 | vlefevre | 2018-01-31 13:45:02 +0000 (Wed, 31 Jan 2018) | 7 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/div_ui.c
- M /branches/4.0/src/mpfr-impl.h
- M /branches/4.0/tests/tdiv_ui.c
+ M /trunk/src/div_ui.c
+ M /trunk/src/mpfr-impl.h
+
+Added a case for the value coverage for tdiv_ui.
+→ Now, on a 64-bit Linux machine:
+ mpfr_div_ui not tested on case 2, sb=0
+ mpfr_div_ui not tested on case 2, sb=1
+ mpfr_div_ui not tested on case 3, sb=0
+ mpfr_div_ui not tested on case 4, sb=0
+ mpfr_div_ui not tested on case 9, sb=0
+------------------------------------------------------------------------
+r12165 | vlefevre | 2018-01-31 13:34:35 +0000 (Wed, 31 Jan 2018) | 6 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+ M /trunk/src/mpfr-impl.h
+ M /trunk/tests/tdiv_ui.c
Added value coverage for tdiv_ui (combinations of rb and sb in the
-different cases of the mpfr_div_ui code) and other tests.
-(merged changesets r12164-12169 from the trunk)
+different cases of the mpfr_div_ui code).
+→ Currently on a 64-bit Linux machine:
+ mpfr_div_ui not tested on case 2, sb=0
+ mpfr_div_ui not tested on case 3, sb=0
+ mpfr_div_ui not tested on case 8, sb=0
+------------------------------------------------------------------------
+r12163 | vlefevre | 2018-01-31 02:37:05 +0000 (Wed, 31 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Case tmp[yn] != 0: simplified code since u ≥ 2.
+------------------------------------------------------------------------
+r12162 | vlefevre | 2018-01-31 02:30:02 +0000 (Wed, 31 Jan 2018) | 5 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Case tmp[yn] == 0:
+ * corrected/improved comments;
+ * simplified condition rb && sb to rb (since if rb ≠ 0, then r ≠ 0,
+ so that the current sb ≠ 0);
+ * replaced "& (~MPFR_LIMB_HIGHBIT)" by "<< 1" (should be simpler).
------------------------------------------------------------------------
-r12164 | vlefevre | 2018-01-31 09:57:51 +0000 (Wed, 31 Jan 2018) | 5 lines
+r12161 | zimmerma | 2018-01-30 20:31:58 +0000 (Tue, 30 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/div_ui.c
- M /branches/4.0/tests/tdiv.c
- M /branches/4.0/tests/tdiv_ui.c
- M /branches/4.0/tools/mpfrlint
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] fixed corner case (hopefully)
+
+------------------------------------------------------------------------
+r12160 | vlefevre | 2018-01-30 17:17:11 +0000 (Tue, 30 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/tools/mpfrlint
-[src/div_ui.c] Major rewrite to fix a mpfr_div_ui bug.
-[tests/tdiv.c] Updated comment for bug20180126.
-[tests/tdiv_ui.c] Added tests triggering the bug just fixed.
[tools/mpfrlint] Improved a regexp (avoiding false positives).
-(merged the remaining changesets starting at r12123 from the trunk)
------------------------------------------------------------------------
-r12138 | vlefevre | 2018-01-27 03:52:35 +0000 (Sat, 27 Jan 2018) | 2 lines
+r12159 | vlefevre | 2018-01-30 16:57:55 +0000 (Tue, 30 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tdiv.c
+ M /trunk/tests/tdiv_ui.c
-[tests/tdiv.c] mpfr_div bug bug20180126: also test negative values.
-(merged changeset r12137 from the trunk)
+[tests/tdiv_ui.c] corner_cases() requires limbs to fit in unsigned long.
------------------------------------------------------------------------
-r12135 | vlefevre | 2018-01-27 03:21:15 +0000 (Sat, 27 Jan 2018) | 2 lines
+r12158 | vlefevre | 2018-01-30 16:52:57 +0000 (Tue, 30 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tdiv.c
+ M /trunk/tests/tdiv_ui.c
-[tests/tdiv.c] mpfr_div bug bug20180126 was introduced by r9086.
-(merged changeset r12134 from the trunk)
+[tests/tdiv_ui.c] Back to a decimal constant (the UL suffix was
+incorrect, but just a U is OK).
------------------------------------------------------------------------
-r12133 | vlefevre | 2018-01-26 17:04:38 +0000 (Fri, 26 Jan 2018) | 2 lines
+r12157 | zimmerma | 2018-01-30 16:38:20 +0000 (Tue, 30 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tdiv.c
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] added test for corner case (currently fails)
-[tests/tdiv.c] Completed r12128 test with new comments and an assert.
-(merged changeset r12132 from the trunk)
------------------------------------------------------------------------
-r12130 | vlefevre | 2018-01-26 15:29:25 +0000 (Fri, 26 Jan 2018) | 1 line
+r12156 | vlefevre | 2018-01-30 16:25:08 +0000 (Tue, 30 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/tests/tdiv_ui.c
-Updated version to 4.0.1-dev.
+[tests/tdiv_ui.c] Fixed a value (from a zsh bug).
------------------------------------------------------------------------
-r12129 | vlefevre | 2018-01-26 15:28:39 +0000 (Fri, 26 Jan 2018) | 2 lines
+r12155 | vlefevre | 2018-01-30 16:21:13 +0000 (Tue, 30 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tdiv.c
+ M /trunk/src/div_ui.c
-[tests/tdiv.c] Added test case for a mpfr_div bug of MPFR 4.
-(merged changeset r12128 from the trunk)
+[src/div_ui.c] Comment: now, "i.e." is correct.
------------------------------------------------------------------------
-r12127 | vlefevre | 2018-01-25 15:19:15 +0000 (Thu, 25 Jan 2018) | 2 lines
+r12154 | vlefevre | 2018-01-30 16:17:53 +0000 (Tue, 30 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/README.dev
+ M /trunk/tests/tdiv_ui.c
-[doc/README.dev] Added information about symbol checking.
-(merged changeset r12126 from the trunk)
+[tests/tdiv_ui.c] Added ABI-independent bug20180126 tests.
------------------------------------------------------------------------
-r12125 | vlefevre | 2018-01-25 14:46:21 +0000 (Thu, 25 Jan 2018) | 8 lines
+r12153 | zimmerma | 2018-01-30 15:55:58 +0000 (Tue, 30 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/Makefile.am
- M /branches/4.0/doc/README.dev
- M /branches/4.0/src/Makefile.am
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] fixed a comment
-* Added check-exported-symbols make rule to check that MPFR does not
- define symbols with a GMP reserved prefix.
-* For the check-gmp-symbols and check-exported-symbols make rules, if
- the library is not $(top_builddir)/src/.libs/libmpfr.so, these rules
- do nothing instead of potentially failing.
-* doc/README.dev, "To make a release": mention "make check-gmp-symbols"
- and "make check-exported-symbols".
-(merged changesets r12111-12114 from the trunk)
------------------------------------------------------------------------
-r12123 | vlefevre | 2018-01-23 09:41:27 +0000 (Tue, 23 Jan 2018) | 4 lines
+r12152 | vlefevre | 2018-01-30 13:22:48 +0000 (Tue, 30 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tests.c
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Typo in a comment.
+------------------------------------------------------------------------
+r12151 | vlefevre | 2018-01-30 13:14:13 +0000 (Tue, 30 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Updated a comment.
+------------------------------------------------------------------------
+r12150 | vlefevre | 2018-01-30 13:05:10 +0000 (Tue, 30 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Clarified the notation (this was ambiguous, with two
+possible interpretations). Added comments about mpn_divrem_1.
+------------------------------------------------------------------------
+r12149 | vlefevre | 2018-01-30 09:15:21 +0000 (Tue, 30 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Added a FIXME.
+------------------------------------------------------------------------
+r12148 | zimmerma | 2018-01-30 06:35:31 +0000 (Tue, 30 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] fixed a comment, and added a FIXME
+
+------------------------------------------------------------------------
+r12146 | vlefevre | 2018-01-29 14:11:54 +0000 (Mon, 29 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Clarified a comment.
+------------------------------------------------------------------------
+r12145 | vlefevre | 2018-01-29 14:05:24 +0000 (Mon, 29 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Started to review the code; minor changes.
+------------------------------------------------------------------------
+r12142 | vlefevre | 2018-01-29 01:23:41 +0000 (Mon, 29 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Minor update of comments.
+------------------------------------------------------------------------
+r12141 | vlefevre | 2018-01-29 01:06:44 +0000 (Mon, 29 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/div_ui.c
+
+[src/div_ui.c] Fixed the exact case, which used nexttoinf uninitialized.
+------------------------------------------------------------------------
+r12140 | vlefevre | 2018-01-29 01:03:34 +0000 (Mon, 29 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tdiv_ui.c
+
+[tests/tdiv_ui.c] bug20180126: enable the test only when a limb fits in
+an unsigned long; clarified a comment.
+------------------------------------------------------------------------
+r12139 | zimmerma | 2018-01-28 09:05:30 +0000 (Sun, 28 Jan 2018) | 4 lines
+Changed paths:
+ M /trunk/src/div_ui.c
+ M /trunk/tests/tdiv_ui.c
+
+[src/div_ui.c] fixed bug20180126 (from tdiv.c), with a complete rewrite of
+ mpfr_div_ui using the round and sticky bits
+[tests/tdiv_ui.c] added more tests
-[tests/tests.c] Mention a libtool 2.4.6 bug concerning Solaris, yielding
-potential failures if a compatible MPFR version is already installed:
-this MPFR library is tested instead of the one that has just been built.
-(merged changeset r12122 from the trunk)
------------------------------------------------------------------------
-r12121 | vlefevre | 2018-01-22 13:58:27 +0000 (Mon, 22 Jan 2018) | 1 line
+r12137 | vlefevre | 2018-01-27 03:50:48 +0000 (Sat, 27 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/tests/tdiv.c
-ChangeLog update with "TZ=UTC svn log -rHEAD:0 -v" (in UTF-8 locales).
+[tests/tdiv.c] mpfr_div bug bug20180126: also test negative values.
------------------------------------------------------------------------
-r12120 | vlefevre | 2018-01-22 13:56:18 +0000 (Mon, 22 Jan 2018) | 1 line
+r12136 | vlefevre | 2018-01-27 03:40:19 +0000 (Sat, 27 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/src/Makefile.am
+ M /trunk/tests/tdiv.c
-[src/Makefile.am] Updated libmpfr_la_LDFLAGS for MPFR 4.0.1.
+[tests/tdiv.c] Updated comment about mpfr_div bug bug20180126.
------------------------------------------------------------------------
-r12119 | vlefevre | 2018-01-22 13:53:01 +0000 (Mon, 22 Jan 2018) | 1 line
+r12134 | vlefevre | 2018-01-27 03:19:43 +0000 (Sat, 27 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/tests/tdiv.c
-Updated version to 4.0.1-rc1.
+[tests/tdiv.c] mpfr_div bug bug20180126 was introduced by r9086.
------------------------------------------------------------------------
-r12118 | vlefevre | 2018-01-22 12:21:10 +0000 (Mon, 22 Jan 2018) | 1 line
+r12132 | vlefevre | 2018-01-26 17:03:19 +0000 (Fri, 26 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] Completed r12128 test with new comments and an assert.
+------------------------------------------------------------------------
+r12128 | vlefevre | 2018-01-26 15:23:39 +0000 (Fri, 26 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tdiv.c
+
+[tests/tdiv.c] Added test case for a mpfr_div bug of MPFR 4.
+------------------------------------------------------------------------
+r12126 | vlefevre | 2018-01-25 15:17:55 +0000 (Thu, 25 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] Added information about symbol checking.
+------------------------------------------------------------------------
+r12122 | vlefevre | 2018-01-23 09:40:06 +0000 (Tue, 23 Jan 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tests.c
+
+[tests/tests.c] Mention a libtool 2.4.6 bug concerning Solaris, yielding
+potential failures if a compatible MPFR version is already installed:
+this MPFR library is tested instead of the one that has just been built.
+------------------------------------------------------------------------
+r12117 | vlefevre | 2018-01-22 12:20:14 +0000 (Mon, 22 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/NEWS
[NEWS] + Improved __GMP_CC and __GMP_CFLAGS retrieval.
------------------------------------------------------------------------
-r12116 | vlefevre | 2018-01-22 01:51:10 +0000 (Mon, 22 Jan 2018) | 4 lines
+r12115 | vlefevre | 2018-01-22 01:48:07 +0000 (Mon, 22 Jan 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/configure.ac
+ M /trunk/configure.ac
[configure.ac] In the CC and CFLAGS setup from gmp.h, added to the
cpp list: "clang -E"; "cl -E" and "icl -E" for Windows ICC and MSVC
(suggested by Alexander).
-(merged changeset r12115 from the trunk)
------------------------------------------------------------------------
-r12110 | vlefevre | 2018-01-19 11:36:10 +0000 (Fri, 19 Jan 2018) | 1 line
+r12114 | vlefevre | 2018-01-20 13:15:43 +0000 (Sat, 20 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/README.dev
+
+[doc/README.dev] "To make a release": mention "make check-gmp-symbols"
+and "make check-exported-symbols".
+------------------------------------------------------------------------
+r12113 | vlefevre | 2018-01-20 13:11:23 +0000 (Sat, 20 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/Makefile.am
+
+[Makefile.am] Updated comments.
+------------------------------------------------------------------------
+r12112 | vlefevre | 2018-01-20 12:59:47 +0000 (Sat, 20 Jan 2018) | 3 lines
+Changed paths:
+ M /trunk/src/Makefile.am
+
+[src/Makefile.am] For check-gmp-symbols and check-exported-symbols, if
+the library is not $(top_builddir)/src/.libs/libmpfr.so, these rules
+do nothing instead of potentially failing.
+------------------------------------------------------------------------
+r12111 | vlefevre | 2018-01-20 12:38:52 +0000 (Sat, 20 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/Makefile.am
+ M /trunk/src/Makefile.am
+
+Added check-exported-symbols make rule to check that MPFR does not
+define symbols with a GMP reserved prefix.
+------------------------------------------------------------------------
+r12108 | vlefevre | 2018-01-18 12:29:58 +0000 (Thu, 18 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/mp_clz_tab.c
+
+[src/mp_clz_tab.c] Fixed a condition (see bug mentioned at r12107).
+------------------------------------------------------------------------
+r12107 | vlefevre | 2018-01-18 12:27:19 +0000 (Thu, 18 Jan 2018) | 11 lines
+Changed paths:
+ M /trunk/src/mpfr-gmp.h
+
+[src/mpfr-gmp.h] Reverse-merged r11969, which yields a build failure
+under MinGW when GMP is built with "--disable-shared --enable-static
+--enable-assert --disable-assembly" and MPFR is built using the GMP
+build. Indeed, this commit was incorrect, as if the GMP build is used,
+then this is GMP's longlong.h that is used and GMP's __clz_tab version
+that should be used.
+The real cause of the "multiple definition of `__gmpn_clz_tab'" error
+reported at
+ https://sympa.inria.fr/sympa/arc/mpfr/2017-12/msg00061.html
+is that MPFR defines its own __gmpn_clz_tab while this is not needed
+(and must not be done) when the GMP build is used.
+------------------------------------------------------------------------
+r12104 | vlefevre | 2018-01-16 11:12:30 +0000 (Tue, 16 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/texinfo.tex
+
+Eliding mergeinfo from 'doc/texinfo.tex' (as done after a
+"svn merge -c -12102 .", though this was an unrelated commit).
+------------------------------------------------------------------------
+r12103 | vlefevre | 2018-01-16 11:09:03 +0000 (Tue, 16 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/TODO
+
+[TODO] - Decide whether multiple calls to mpfr_clear should be allowed.
+------------------------------------------------------------------------
+r12102 | vlefevre | 2018-01-16 08:58:00 +0000 (Tue, 16 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/TODO
-[NEWS] Mention the bug fix r12109.
+[TODO] + Decide whether multiple calls to mpfr_clear should be allowed.
------------------------------------------------------------------------
-r12109 | vlefevre | 2018-01-19 00:27:24 +0000 (Fri, 19 Jan 2018) | 6 lines
+r12101 | vlefevre | 2018-01-13 13:57:53 +0000 (Sat, 13 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/mp_clz_tab.c
- M /branches/4.0/src/mpfr-gmp.h
+ M /trunk/ChangeLog
+
+ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC svn log -rHEAD:0 -v".
+------------------------------------------------------------------------
+r12100 | vlefevre | 2018-01-13 13:50:28 +0000 (Sat, 13 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/NEWS
-Correct fix for the use of __clz_tab when the GMP build is used.
- * src/mpfr-gmp.h: reverse-merged r11969, which is incorrect and
- yields a build failure under some conditions.
- * src/mp_clz_tab.c: fixed the condition that tests whether the
- GMP build is used.
-(merged changesets r12107-12108 from the trunk)
+[NEWS] Update. Prepare for new version 4.1.0.
------------------------------------------------------------------------
-r12106 | vlefevre | 2018-01-18 10:52:25 +0000 (Thu, 18 Jan 2018) | 1 line
+r12099 | vlefevre | 2018-01-13 13:43:02 +0000 (Sat, 13 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0/NEWS
+ M /trunk/doc/FAQ.html
-[NEWS] Update for GNU MPFR 4.0.1.
+[doc] Updated FAQ.html with update-faq.
------------------------------------------------------------------------
-r12096 | vlefevre | 2018-01-10 17:03:36 +0000 (Wed, 10 Jan 2018) | 1 line
+r12092 | vlefevre | 2018-01-10 13:40:31 +0000 (Wed, 10 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/check.c
+ M /trunk/tests/tlgamma.c
-Typo in a comment (cherry-picked everything from r12073 of the trunk).
+[tests/tlgamma.c] bug20180110: test the ternary value and the flags.
------------------------------------------------------------------------
-r12095 | vlefevre | 2018-01-10 16:58:10 +0000 (Wed, 10 Jan 2018) | 4 lines
+r12091 | vlefevre | 2018-01-10 13:32:58 +0000 (Wed, 10 Jan 2018) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/lngamma.c
- M /branches/4.0/tests/tlgamma.c
+ M /trunk/src/lngamma.c
-[src/lngamma.c] Fixed handling of reduced exponent range in mpfr_lgamma
- (also removed a useless cast).
-[tests/tlgamma.c] Added a corresponding test case.
-(merged changesets r12089-12092 from the trunk)
+[src/lngamma.c] Fixed mpfr_lgamma bug for tiny negative x, in case
+emax < exponent of the result (the issue was an overflow in the "fast"
+algorithm, which made it loop with more and more working precision).
------------------------------------------------------------------------
-r12094 | vlefevre | 2018-01-10 16:48:57 +0000 (Wed, 10 Jan 2018) | 4 lines
+r12090 | vlefevre | 2018-01-10 13:24:29 +0000 (Wed, 10 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/ai.c
- M /branches/4.0/tests/tai.c
+ M /trunk/src/lngamma.c
-[src/ai.c] Fixed handling of reduced exponent range.
-[tests/tai.c] Added corresponding test cases (in addition to what
- has been done in tgeneric.c).
-(merged changesets r12070-12072,12074-12075 from the trunk)
+[src/lngamma.c] Removed a useless cast.
------------------------------------------------------------------------
-r12093 | vlefevre | 2018-01-10 16:38:44 +0000 (Wed, 10 Jan 2018) | 8 lines
+r12089 | vlefevre | 2018-01-10 13:17:50 +0000 (Wed, 10 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tgeneric.c
+ M /trunk/tests/tlgamma.c
-[tests/tgeneric.c] Tests in a reduced exponent range:
- * Do several overflow/underflow tests instead of 1, and this for each
- precision. This allows one to detect 2 bugs (fixed in the trunk)
- that did not handle reduced exponent ranges correctly:
- - in mpfr_ai, making tai fail;
- - in mpfr_lgamma, making tlgamma hang with a 32-bit ABI.
- * Added some comments.
-(merged changesets r12087-12088 from the trunk)
+[tests/tlgamma.c] Added a test case for a bug found from the tgeneric
+change done in r12088.
------------------------------------------------------------------------
-r12086 | vlefevre | 2018-01-10 10:15:30 +0000 (Wed, 10 Jan 2018) | 4 lines
+r12088 | vlefevre | 2018-01-10 12:22:11 +0000 (Wed, 10 Jan 2018) | 5 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/tests/tsprintf.c
+ M /trunk/tests/tgeneric.c
-[tests/tsprintf.c] Fixed/simplified code with incorrect strncpy
-usage (bug detected by gcc-snapshot 20180107-1 under Debian with
--Werror=stringop-truncation).
-(merged changesets r12084-12085 from the trunk)
+[tests/tgeneric.c] Do several overflow/underflow tests instead of 1, and
+this for each precision. This allows one to detect the mpfr_ai bug found
+and fixed on 2018-01-07 (with 32-bit *and* 64-bit ABI):
+ https://sympa.inria.fr/sympa/arc/mpfr/2018-01/msg00001.html
+Moreover, this makes tlgamma loop with a 32-bit ABI (x86). To be fixed.
------------------------------------------------------------------------
-r12083 | vlefevre | 2018-01-09 15:17:48 +0000 (Tue, 09 Jan 2018) | 6 lines
+r12087 | vlefevre | 2018-01-10 11:49:52 +0000 (Wed, 10 Jan 2018) | 1 line
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
+ M /trunk/tests/tgeneric.c
-[doc/mpfr.texi] Misc improvements and corrections affecting the
-description of the following functions:
- * mpfr_ai: fixed font encoding issue for PDF/DVI/PS (—x— → |x|).
- * mpfr_custom_init_set: fixed typography; improved text.
- * mpfr_custom_get_exp: improved text.
-(merged changesets r12077-12082 from the trunk)
+[tests/tgeneric.c] Added comments for tests in a reduced exponent range.
------------------------------------------------------------------------
-r12078 | vlefevre | 2018-01-09 12:34:03 +0000 (Tue, 09 Jan 2018) | 5 lines
+r12085 | vlefevre | 2018-01-10 10:12:19 +0000 (Wed, 10 Jan 2018) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/doc/texinfo.tex
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] About r12084, simplified the code, without needing
+strncpy.
+------------------------------------------------------------------------
+r12084 | vlefevre | 2018-01-10 09:59:30 +0000 (Wed, 10 Jan 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tsprintf.c
+
+[tests/tsprintf.c] Fixed strncpy usage, in particular to ensure a
+null-terminated string (bug detected by gcc-snapshot 20180107-1 under
+Debian with -Werror=stringop-truncation).
+------------------------------------------------------------------------
+r12082 | vlefevre | 2018-01-09 14:44:43 +0000 (Tue, 09 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Fixed the @GMPabs macro in tex mode: due to the use of
+the OT1 encoding, the pipe character "|" was giving a wide dash.
+------------------------------------------------------------------------
+r12081 | vlefevre | 2018-01-09 14:06:43 +0000 (Tue, 09 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] For mpfr_custom_get_exp, restored the spec for NaN,
+infinity and zero, with more details.
+------------------------------------------------------------------------
+r12080 | vlefevre | 2018-01-09 13:51:51 +0000 (Tue, 09 Jan 2018) | 5 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Improved description of mpfr_custom_init_set.
+Note: For the versions of the manual generated with TeX (PDF/DVI/PS),
+"|kind|" appears as "—kind—", and the description of mpfr_ai has
+the same issue (since its introduction in MPFR 3.0.0). The cause
+is unclear, and this will be fixed later.
+------------------------------------------------------------------------
+r12079 | zimmerma | 2018-01-09 13:28:21 +0000 (Tue, 09 Jan 2018) | 3 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] for mpfr_custom_get_exp, explain the significand is considered
+ in [1/2,1) as for mpfr_get_exp
+
+------------------------------------------------------------------------
+r12076 | vlefevre | 2018-01-09 12:19:03 +0000 (Tue, 09 Jan 2018) | 4 lines
+Changed paths:
+ M /trunk/doc/mpfr.texi
+ M /trunk/doc/texinfo.tex
[doc]
* texinfo.tex: update to the latest version 2018-01-09.11, which
supports @var with script font size without any drawback.
* mpfr.texi: replaced the now useless @svar by @var.
-(merged changeset r12076 from the trunk)
-------------------------------------------------------------------------
-r12077 | vlefevre | 2018-01-09 12:30:58 +0000 (Tue, 09 Jan 2018) | 6 lines
-Changed paths:
- M /branches/4.0
- M /branches/4.0/BUGS
- M /branches/4.0/INSTALL
- M /branches/4.0/Makefile.am
- M /branches/4.0/NEWS
- M /branches/4.0/README
- M /branches/4.0/TODO
- M /branches/4.0/acinclude.m4
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/FAQ.html
- M /branches/4.0/doc/Makefile.am
- M /branches/4.0/doc/README.dev
- M /branches/4.0/doc/check-typography
- M /branches/4.0/doc/faq.xsl
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/examples/can_round.c
- M /branches/4.0/examples/divworst.c
- M /branches/4.0/examples/rndo-add.c
- M /branches/4.0/examples/sample.c
- M /branches/4.0/examples/version.c
- M /branches/4.0/src/Makefile.am
- M /branches/4.0/src/abort_prec_max.c
- M /branches/4.0/src/acos.c
- M /branches/4.0/src/acosh.c
- M /branches/4.0/src/add.c
- M /branches/4.0/src/add1.c
- M /branches/4.0/src/add1sp.c
- M /branches/4.0/src/add_d.c
- M /branches/4.0/src/add_ui.c
- M /branches/4.0/src/agm.c
- M /branches/4.0/src/ai.c
- M /branches/4.0/src/amd/amdfam10/mparam.h
- M /branches/4.0/src/amd/athlon/mparam.h
- M /branches/4.0/src/amd/k8/mparam.h
- M /branches/4.0/src/arm/mparam.h
- M /branches/4.0/src/asin.c
- M /branches/4.0/src/asinh.c
- M /branches/4.0/src/atan.c
- M /branches/4.0/src/atan2.c
- M /branches/4.0/src/atanh.c
- M /branches/4.0/src/bernoulli.c
- M /branches/4.0/src/beta.c
- M /branches/4.0/src/buildopt.c
- M /branches/4.0/src/cache.c
- M /branches/4.0/src/cbrt.c
- M /branches/4.0/src/check.c
- M /branches/4.0/src/clear.c
- M /branches/4.0/src/clears.c
- M /branches/4.0/src/cmp.c
- M /branches/4.0/src/cmp2.c
- M /branches/4.0/src/cmp_abs.c
- M /branches/4.0/src/cmp_d.c
- M /branches/4.0/src/cmp_ld.c
- M /branches/4.0/src/cmp_si.c
- M /branches/4.0/src/cmp_ui.c
- M /branches/4.0/src/comparisons.c
- M /branches/4.0/src/const_catalan.c
- M /branches/4.0/src/const_euler.c
- M /branches/4.0/src/const_log2.c
- M /branches/4.0/src/const_pi.c
- M /branches/4.0/src/constant.c
- M /branches/4.0/src/copysign.c
- M /branches/4.0/src/cos.c
- M /branches/4.0/src/cosh.c
- M /branches/4.0/src/cot.c
- M /branches/4.0/src/coth.c
- M /branches/4.0/src/csc.c
- M /branches/4.0/src/csch.c
- M /branches/4.0/src/d_div.c
- M /branches/4.0/src/d_sub.c
- M /branches/4.0/src/digamma.c
- M /branches/4.0/src/dim.c
- M /branches/4.0/src/div.c
- M /branches/4.0/src/div_2exp.c
- M /branches/4.0/src/div_2si.c
- M /branches/4.0/src/div_2ui.c
- M /branches/4.0/src/div_d.c
- M /branches/4.0/src/div_ui.c
- M /branches/4.0/src/dump.c
- M /branches/4.0/src/eint.c
- M /branches/4.0/src/eq.c
- M /branches/4.0/src/erandom.c
- M /branches/4.0/src/erf.c
- M /branches/4.0/src/erfc.c
- M /branches/4.0/src/exceptions.c
- M /branches/4.0/src/exp.c
- M /branches/4.0/src/exp10.c
- M /branches/4.0/src/exp2.c
- M /branches/4.0/src/exp3.c
- M /branches/4.0/src/exp_2.c
- M /branches/4.0/src/expm1.c
- M /branches/4.0/src/extract.c
- M /branches/4.0/src/factorial.c
- M /branches/4.0/src/fits_intmax.c
- M /branches/4.0/src/fits_s.h
- M /branches/4.0/src/fits_sint.c
- M /branches/4.0/src/fits_slong.c
- M /branches/4.0/src/fits_sshort.c
- M /branches/4.0/src/fits_u.h
- M /branches/4.0/src/fits_uint.c
- M /branches/4.0/src/fits_uintmax.c
- M /branches/4.0/src/fits_ulong.c
- M /branches/4.0/src/fits_ushort.c
- M /branches/4.0/src/fma.c
- M /branches/4.0/src/fmma.c
- M /branches/4.0/src/fms.c
- M /branches/4.0/src/fpif.c
- M /branches/4.0/src/frac.c
- M /branches/4.0/src/free_cache.c
- M /branches/4.0/src/frexp.c
- M /branches/4.0/src/gamma.c
- M /branches/4.0/src/gamma_inc.c
- M /branches/4.0/src/gammaonethird.c
- M /branches/4.0/src/gen_inverse.h
- M /branches/4.0/src/generic/coverage/mparam.h
- M /branches/4.0/src/generic/mparam.h
- M /branches/4.0/src/get_d.c
- M /branches/4.0/src/get_d64.c
- M /branches/4.0/src/get_exp.c
- M /branches/4.0/src/get_f.c
- M /branches/4.0/src/get_float128.c
- M /branches/4.0/src/get_flt.c
- M /branches/4.0/src/get_ld.c
- M /branches/4.0/src/get_q.c
- M /branches/4.0/src/get_si.c
- M /branches/4.0/src/get_sj.c
- M /branches/4.0/src/get_str.c
- M /branches/4.0/src/get_ui.c
- M /branches/4.0/src/get_uj.c
- M /branches/4.0/src/get_z.c
- M /branches/4.0/src/get_z_exp.c
- M /branches/4.0/src/gmp_op.c
- M /branches/4.0/src/grandom.c
- M /branches/4.0/src/hppa/mparam.h
- M /branches/4.0/src/hypot.c
- M /branches/4.0/src/ia64/mparam.h
- M /branches/4.0/src/ieee_floats.h
- M /branches/4.0/src/init.c
- M /branches/4.0/src/init2.c
- M /branches/4.0/src/inits.c
- M /branches/4.0/src/inits2.c
- M /branches/4.0/src/inp_str.c
- M /branches/4.0/src/int_ceil_log2.c
- M /branches/4.0/src/invert_limb.h
- M /branches/4.0/src/invsqrt_limb.h
- M /branches/4.0/src/isinf.c
- M /branches/4.0/src/isinteger.c
- M /branches/4.0/src/isnan.c
- M /branches/4.0/src/isnum.c
- M /branches/4.0/src/isqrt.c
- M /branches/4.0/src/isregular.c
- M /branches/4.0/src/iszero.c
- M /branches/4.0/src/jn.c
- M /branches/4.0/src/jyn_asympt.c
- M /branches/4.0/src/li2.c
- M /branches/4.0/src/lngamma.c
- M /branches/4.0/src/log.c
- M /branches/4.0/src/log10.c
- M /branches/4.0/src/log1p.c
- M /branches/4.0/src/log2.c
- M /branches/4.0/src/log_ui.c
- M /branches/4.0/src/logging.c
- M /branches/4.0/src/min_prec.c
- M /branches/4.0/src/minmax.c
- M /branches/4.0/src/mips/mparam.h
- M /branches/4.0/src/modf.c
- M /branches/4.0/src/mp_clz_tab.c
- M /branches/4.0/src/mparam_h.in
- M /branches/4.0/src/mpf2mpfr.h
- M /branches/4.0/src/mpfr-cvers.h
- M /branches/4.0/src/mpfr-gmp.c
- M /branches/4.0/src/mpfr-gmp.h
- M /branches/4.0/src/mpfr-impl.h
- M /branches/4.0/src/mpfr-intmax.h
- M /branches/4.0/src/mpfr-longlong.h
- M /branches/4.0/src/mpfr-mini-gmp.c
- M /branches/4.0/src/mpfr-mini-gmp.h
- M /branches/4.0/src/mpfr-sassert.h
- M /branches/4.0/src/mpfr-thread.h
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/mpn_exp.c
- M /branches/4.0/src/mul.c
- M /branches/4.0/src/mul_2exp.c
- M /branches/4.0/src/mul_2si.c
- M /branches/4.0/src/mul_2ui.c
- M /branches/4.0/src/mul_d.c
- M /branches/4.0/src/mul_ui.c
- M /branches/4.0/src/mulders.c
- M /branches/4.0/src/neg.c
- M /branches/4.0/src/next.c
- M /branches/4.0/src/nrandom.c
- M /branches/4.0/src/odd_p.c
- M /branches/4.0/src/out_str.c
- M /branches/4.0/src/pool.c
- M /branches/4.0/src/pow.c
- M /branches/4.0/src/pow_si.c
- M /branches/4.0/src/pow_ui.c
- M /branches/4.0/src/pow_z.c
- M /branches/4.0/src/powerof2.c
- M /branches/4.0/src/powerpc32/mparam.h
- M /branches/4.0/src/powerpc64/mparam.h
- M /branches/4.0/src/print_raw.c
- M /branches/4.0/src/print_rnd_mode.c
- M /branches/4.0/src/printf.c
- M /branches/4.0/src/random_deviate.c
- M /branches/4.0/src/random_deviate.h
- M /branches/4.0/src/rec_sqrt.c
- M /branches/4.0/src/reldiff.c
- M /branches/4.0/src/rem1.c
- M /branches/4.0/src/rint.c
- M /branches/4.0/src/rndna.c
- M /branches/4.0/src/root.c
- M /branches/4.0/src/round_near_x.c
- M /branches/4.0/src/round_p.c
- M /branches/4.0/src/round_prec.c
- M /branches/4.0/src/round_raw_generic.c
- M /branches/4.0/src/scale2.c
- M /branches/4.0/src/sec.c
- M /branches/4.0/src/sech.c
- M /branches/4.0/src/set.c
- M /branches/4.0/src/set_d.c
- M /branches/4.0/src/set_d64.c
- M /branches/4.0/src/set_dfl_prec.c
- M /branches/4.0/src/set_exp.c
- M /branches/4.0/src/set_f.c
- M /branches/4.0/src/set_float128.c
- M /branches/4.0/src/set_flt.c
- M /branches/4.0/src/set_inf.c
- M /branches/4.0/src/set_ld.c
- M /branches/4.0/src/set_nan.c
- M /branches/4.0/src/set_prc_raw.c
- M /branches/4.0/src/set_prec.c
- M /branches/4.0/src/set_q.c
- M /branches/4.0/src/set_rnd.c
- M /branches/4.0/src/set_si.c
- M /branches/4.0/src/set_si_2exp.c
- M /branches/4.0/src/set_sj.c
- M /branches/4.0/src/set_str.c
- M /branches/4.0/src/set_str_raw.c
- M /branches/4.0/src/set_ui.c
- M /branches/4.0/src/set_ui_2exp.c
- M /branches/4.0/src/set_uj.c
- M /branches/4.0/src/set_z.c
- M /branches/4.0/src/set_z_exp.c
- M /branches/4.0/src/set_zero.c
- M /branches/4.0/src/setmax.c
- M /branches/4.0/src/setmin.c
- M /branches/4.0/src/setsign.c
- M /branches/4.0/src/sgn.c
- M /branches/4.0/src/si_op.c
- M /branches/4.0/src/signbit.c
- M /branches/4.0/src/sin.c
- M /branches/4.0/src/sin_cos.c
- M /branches/4.0/src/sinh.c
- M /branches/4.0/src/sinh_cosh.c
- M /branches/4.0/src/sparc64/mparam.h
- M /branches/4.0/src/sqr.c
- M /branches/4.0/src/sqrt.c
- M /branches/4.0/src/sqrt_ui.c
- M /branches/4.0/src/stack_interface.c
- M /branches/4.0/src/strtofr.c
- M /branches/4.0/src/sub.c
- M /branches/4.0/src/sub1.c
- M /branches/4.0/src/sub1sp.c
- M /branches/4.0/src/sub_d.c
- M /branches/4.0/src/sub_ui.c
- M /branches/4.0/src/subnormal.c
- M /branches/4.0/src/sum.c
- M /branches/4.0/src/swap.c
- M /branches/4.0/src/tan.c
- M /branches/4.0/src/tanh.c
- M /branches/4.0/src/ubf.c
- M /branches/4.0/src/uceil_exp2.c
- M /branches/4.0/src/uceil_log2.c
- M /branches/4.0/src/ufloor_log2.c
- M /branches/4.0/src/ui_div.c
- M /branches/4.0/src/ui_pow.c
- M /branches/4.0/src/ui_pow_ui.c
- M /branches/4.0/src/ui_sub.c
- M /branches/4.0/src/urandom.c
- M /branches/4.0/src/urandomb.c
- M /branches/4.0/src/vasprintf.c
- M /branches/4.0/src/version.c
- M /branches/4.0/src/volatile.c
- M /branches/4.0/src/x86/core2/mparam.h
- M /branches/4.0/src/x86/mparam.h
- M /branches/4.0/src/x86_64/core2/mparam.h
- M /branches/4.0/src/x86_64/corei5/mparam.h
- M /branches/4.0/src/x86_64/pentium4/mparam.h
- M /branches/4.0/src/yn.c
- M /branches/4.0/src/zeta.c
- M /branches/4.0/src/zeta_ui.c
- M /branches/4.0/tests/Makefile.am
- M /branches/4.0/tests/cmp_str.c
- M /branches/4.0/tests/data/digamma
- M /branches/4.0/tests/data/li2
- M /branches/4.0/tests/memory.c
- M /branches/4.0/tests/mpf_compat.c
- M /branches/4.0/tests/mpf_compat.h
- M /branches/4.0/tests/mpfr-test.h
- M /branches/4.0/tests/mpfr_compat.c
- M /branches/4.0/tests/random2.c
- M /branches/4.0/tests/reuse.c
- M /branches/4.0/tests/rnd_mode.c
- M /branches/4.0/tests/tabort_defalloc1.c
- M /branches/4.0/tests/tabort_defalloc2.c
- M /branches/4.0/tests/tabort_prec_max.c
- M /branches/4.0/tests/tabs.c
- M /branches/4.0/tests/tacos.c
- M /branches/4.0/tests/tacosh.c
- M /branches/4.0/tests/tadd.c
- M /branches/4.0/tests/tadd1sp.c
- M /branches/4.0/tests/tadd_d.c
- M /branches/4.0/tests/tadd_ui.c
- M /branches/4.0/tests/tagm.c
- M /branches/4.0/tests/tai.c
- M /branches/4.0/tests/talloc-cache.c
- M /branches/4.0/tests/talloc.c
- M /branches/4.0/tests/tasin.c
- M /branches/4.0/tests/tasinh.c
- M /branches/4.0/tests/tassert.c
- M /branches/4.0/tests/tatan.c
- M /branches/4.0/tests/tatanh.c
- M /branches/4.0/tests/taway.c
- M /branches/4.0/tests/tbeta.c
- M /branches/4.0/tests/tbuildopt.c
- M /branches/4.0/tests/tcan_round.c
- M /branches/4.0/tests/tcbrt.c
- M /branches/4.0/tests/tcheck.c
- M /branches/4.0/tests/tcmp.c
- M /branches/4.0/tests/tcmp2.c
- M /branches/4.0/tests/tcmp_d.c
- M /branches/4.0/tests/tcmp_ld.c
- M /branches/4.0/tests/tcmp_ui.c
- M /branches/4.0/tests/tcmpabs.c
- M /branches/4.0/tests/tcomparisons.c
- M /branches/4.0/tests/tconst_catalan.c
- M /branches/4.0/tests/tconst_euler.c
- M /branches/4.0/tests/tconst_log2.c
- M /branches/4.0/tests/tconst_pi.c
- M /branches/4.0/tests/tcopysign.c
- M /branches/4.0/tests/tcos.c
- M /branches/4.0/tests/tcosh.c
- M /branches/4.0/tests/tcot.c
- M /branches/4.0/tests/tcoth.c
- M /branches/4.0/tests/tcsc.c
- M /branches/4.0/tests/tcsch.c
- M /branches/4.0/tests/td_div.c
- M /branches/4.0/tests/td_sub.c
- M /branches/4.0/tests/tdigamma.c
- M /branches/4.0/tests/tdim.c
- M /branches/4.0/tests/tdiv.c
- M /branches/4.0/tests/tdiv_d.c
- M /branches/4.0/tests/tdiv_ui.c
- M /branches/4.0/tests/teint.c
- M /branches/4.0/tests/teq.c
- M /branches/4.0/tests/terandom.c
- M /branches/4.0/tests/terandom_chisq.c
- M /branches/4.0/tests/terf.c
- M /branches/4.0/tests/tests.c
- M /branches/4.0/tests/texceptions.c
- M /branches/4.0/tests/texp.c
- M /branches/4.0/tests/texp10.c
- M /branches/4.0/tests/texp2.c
- M /branches/4.0/tests/texpm1.c
- M /branches/4.0/tests/tfactorial.c
- M /branches/4.0/tests/tfits.c
- M /branches/4.0/tests/tfma.c
- M /branches/4.0/tests/tfmma.c
- M /branches/4.0/tests/tfmod.c
- M /branches/4.0/tests/tfms.c
- M /branches/4.0/tests/tfpif.c
- M /branches/4.0/tests/tfprintf.c
- M /branches/4.0/tests/tfrac.c
- M /branches/4.0/tests/tfrexp.c
- M /branches/4.0/tests/tgamma.c
- M /branches/4.0/tests/tgamma_inc.c
- M /branches/4.0/tests/tgeneric.c
- M /branches/4.0/tests/tgeneric_ui.c
- M /branches/4.0/tests/tget_d.c
- M /branches/4.0/tests/tget_d_2exp.c
- M /branches/4.0/tests/tget_f.c
- M /branches/4.0/tests/tget_flt.c
- M /branches/4.0/tests/tget_ld_2exp.c
- M /branches/4.0/tests/tget_q.c
- M /branches/4.0/tests/tget_set_d64.c
- M /branches/4.0/tests/tget_sj.c
- M /branches/4.0/tests/tget_str.c
- M /branches/4.0/tests/tget_z.c
- M /branches/4.0/tests/tgmpop.c
- M /branches/4.0/tests/tgrandom.c
- M /branches/4.0/tests/thyperbolic.c
- M /branches/4.0/tests/thypot.c
- M /branches/4.0/tests/tinits.c
- M /branches/4.0/tests/tinp_str.c
- M /branches/4.0/tests/tinternals.c
- M /branches/4.0/tests/tisnan.c
- M /branches/4.0/tests/tisqrt.c
- M /branches/4.0/tests/tj0.c
- M /branches/4.0/tests/tj1.c
- M /branches/4.0/tests/tjn.c
- M /branches/4.0/tests/tl2b.c
- M /branches/4.0/tests/tlgamma.c
- M /branches/4.0/tests/tli2.c
- M /branches/4.0/tests/tlngamma.c
- M /branches/4.0/tests/tlog.c
- M /branches/4.0/tests/tlog10.c
- M /branches/4.0/tests/tlog1p.c
- M /branches/4.0/tests/tlog2.c
- M /branches/4.0/tests/tlog_ui.c
- M /branches/4.0/tests/tmin_prec.c
- M /branches/4.0/tests/tminmax.c
- M /branches/4.0/tests/tmodf.c
- M /branches/4.0/tests/tmul.c
- M /branches/4.0/tests/tmul_2exp.c
- M /branches/4.0/tests/tmul_d.c
- M /branches/4.0/tests/tmul_ui.c
- M /branches/4.0/tests/tnext.c
- M /branches/4.0/tests/tnrandom.c
- M /branches/4.0/tests/tnrandom_chisq.c
- M /branches/4.0/tests/tout_str.c
- M /branches/4.0/tests/toutimpl.c
- M /branches/4.0/tests/tpow.c
- M /branches/4.0/tests/tpow3.c
- M /branches/4.0/tests/tpow_all.c
- M /branches/4.0/tests/tpow_z.c
- M /branches/4.0/tests/tprintf.c
- M /branches/4.0/tests/trandom.c
- M /branches/4.0/tests/trandom_deviate.c
- M /branches/4.0/tests/trec_sqrt.c
- M /branches/4.0/tests/tremquo.c
- M /branches/4.0/tests/trint.c
- M /branches/4.0/tests/trndna.c
- M /branches/4.0/tests/troot.c
- M /branches/4.0/tests/trootn_ui.c
- M /branches/4.0/tests/tround_prec.c
- M /branches/4.0/tests/tsec.c
- M /branches/4.0/tests/tsech.c
- M /branches/4.0/tests/tset.c
- M /branches/4.0/tests/tset_d.c
- M /branches/4.0/tests/tset_exp.c
- M /branches/4.0/tests/tset_f.c
- M /branches/4.0/tests/tset_float128.c
- M /branches/4.0/tests/tset_ld.c
- M /branches/4.0/tests/tset_q.c
- M /branches/4.0/tests/tset_si.c
- M /branches/4.0/tests/tset_sj.c
- M /branches/4.0/tests/tset_str.c
- M /branches/4.0/tests/tset_z.c
- M /branches/4.0/tests/tset_z_exp.c
- M /branches/4.0/tests/tsgn.c
- M /branches/4.0/tests/tsi_op.c
- M /branches/4.0/tests/tsin.c
- M /branches/4.0/tests/tsin_cos.c
- M /branches/4.0/tests/tsinh.c
- M /branches/4.0/tests/tsinh_cosh.c
- M /branches/4.0/tests/tsprintf.c
- M /branches/4.0/tests/tsqr.c
- M /branches/4.0/tests/tsqrt.c
- M /branches/4.0/tests/tsqrt_ui.c
- M /branches/4.0/tests/tstckintc.c
- M /branches/4.0/tests/tstdint.c
- M /branches/4.0/tests/tstrtofr.c
- M /branches/4.0/tests/tsub.c
- M /branches/4.0/tests/tsub1sp.c
- M /branches/4.0/tests/tsub_d.c
- M /branches/4.0/tests/tsub_ui.c
- M /branches/4.0/tests/tsubnormal.c
- M /branches/4.0/tests/tsum.c
- M /branches/4.0/tests/tswap.c
- M /branches/4.0/tests/ttan.c
- M /branches/4.0/tests/ttanh.c
- M /branches/4.0/tests/ttrunc.c
- M /branches/4.0/tests/tui_div.c
- M /branches/4.0/tests/tui_pow.c
- M /branches/4.0/tests/tui_sub.c
- M /branches/4.0/tests/turandom.c
- M /branches/4.0/tests/tvalist.c
- M /branches/4.0/tests/tversion.c
- M /branches/4.0/tests/ty0.c
- M /branches/4.0/tests/ty1.c
- M /branches/4.0/tests/tyn.c
- M /branches/4.0/tests/tzeta.c
- M /branches/4.0/tests/tzeta_ui.c
- M /branches/4.0/tools/bench/Makefile.am
- M /branches/4.0/tools/bench/benchtime.h
- M /branches/4.0/tools/bench/mpfrbench.c
- M /branches/4.0/tools/ck-clz_tab
- M /branches/4.0/tools/ck-copyright-notice
- M /branches/4.0/tools/ck-mparam
- M /branches/4.0/tools/ck-news
- M /branches/4.0/tools/ck-version-info
- M /branches/4.0/tools/get_patches.sh
- M /branches/4.0/tune/Makefile.am
- M /branches/4.0/tune/bidimensional_sample.c
- M /branches/4.0/tune/speed.c
- M /branches/4.0/tune/tuneup.c
-
-Minor date-related changes as in the trunk:
-* Copyright notice update in most files: added 2018.
-* tools/ck-mparam: in the copyright notice, just keep the year 2011
- since this file is not part of the tarball (just used by mpfrlint).
-* doc/mpfr.texi: updated the month.
-(merged changesets r12067-12069 from the trunk)
-------------------------------------------------------------------------
-r12060 | vlefevre | 2017-12-25 15:04:55 +0000 (Mon, 25 Dec 2017) | 1 line
-Changed paths:
- M /branches/4.0/INSTALL
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
-
-Updated version to 4.0.1-dev.
-------------------------------------------------------------------------
-r12057 | vlefevre | 2017-12-25 11:17:31 +0000 (Mon, 25 Dec 2017) | 2 lines
-Changed paths:
- M /branches/4.0
- M /branches/4.0/NEWS
+------------------------------------------------------------------------
+r12075 | vlefevre | 2018-01-07 20:45:25 +0000 (Sun, 07 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/tests/tai.c
+
+[tests/tai.c] In bug20180107, also check the flags.
+------------------------------------------------------------------------
+r12074 | vlefevre | 2018-01-07 20:06:18 +0000 (Sun, 07 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] Really fixed the bug.
+------------------------------------------------------------------------
+r12073 | vlefevre | 2018-01-07 19:51:21 +0000 (Sun, 07 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/src/check.c
+
+[src/check.c] Typo.
+------------------------------------------------------------------------
+r12072 | zimmerma | 2018-01-07 19:51:20 +0000 (Sun, 07 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/src/ai.c
+
+[src/ai.c] missing call to mpfr_check_range
+
+------------------------------------------------------------------------
+r12071 | zimmerma | 2018-01-07 19:47:02 +0000 (Sun, 07 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/tests/tai.c
+
+[tests/tai.c] added test that fails on x86_64
+
+------------------------------------------------------------------------
+r12070 | zimmerma | 2018-01-07 18:51:13 +0000 (Sun, 07 Jan 2018) | 3 lines
+Changed paths:
+ M /trunk/tests/tai.c
+
+[tests/tai.c] added test for bug in mpfr_ai (see thread
+https://sympa.inria.fr/sympa/arc/mpfr/2018-01/msg00001.html)
+
+------------------------------------------------------------------------
+r12069 | vlefevre | 2018-01-03 10:58:06 +0000 (Wed, 03 Jan 2018) | 1 line
+Changed paths:
+ M /trunk/doc/mpfr.texi
+
+[doc/mpfr.texi] Updated the month.
+------------------------------------------------------------------------
+r12068 | vlefevre | 2018-01-03 10:56:21 +0000 (Wed, 03 Jan 2018) | 2 lines
+Changed paths:
+ M /trunk/tools/ck-mparam
+
+[tools/ck-mparam] In the copyright notice, just keep the year 2011
+since this file is not part of the tarball (just used by mpfrlint).
+------------------------------------------------------------------------
+r12067 | vlefevre | 2018-01-03 10:53:21 +0000 (Wed, 03 Jan 2018) | 6 lines
+Changed paths:
+ M /trunk/BUGS
+ M /trunk/INSTALL
+ M /trunk/Makefile.am
+ M /trunk/NEWS
+ M /trunk/README
+ M /trunk/TODO
+ M /trunk/acinclude.m4
+ M /trunk/configure.ac
+ M /trunk/doc/FAQ.html
+ M /trunk/doc/Makefile.am
+ M /trunk/doc/README.dev
+ M /trunk/doc/check-typography
+ M /trunk/doc/faq.xsl
+ M /trunk/doc/mpfr.texi
+ M /trunk/examples/can_round.c
+ M /trunk/examples/divworst.c
+ M /trunk/examples/rndo-add.c
+ M /trunk/examples/sample.c
+ M /trunk/examples/version.c
+ M /trunk/src/Makefile.am
+ M /trunk/src/abort_prec_max.c
+ M /trunk/src/acos.c
+ M /trunk/src/acosh.c
+ M /trunk/src/add.c
+ M /trunk/src/add1.c
+ M /trunk/src/add1sp.c
+ M /trunk/src/add_d.c
+ M /trunk/src/add_ui.c
+ M /trunk/src/agm.c
+ M /trunk/src/ai.c
+ M /trunk/src/amd/amdfam10/mparam.h
+ M /trunk/src/amd/athlon/mparam.h
+ M /trunk/src/amd/k8/mparam.h
+ M /trunk/src/arm/mparam.h
+ M /trunk/src/asin.c
+ M /trunk/src/asinh.c
+ M /trunk/src/atan.c
+ M /trunk/src/atan2.c
+ M /trunk/src/atanh.c
+ M /trunk/src/bernoulli.c
+ M /trunk/src/beta.c
+ M /trunk/src/buildopt.c
+ M /trunk/src/cache.c
+ M /trunk/src/cbrt.c
+ M /trunk/src/check.c
+ M /trunk/src/clear.c
+ M /trunk/src/clears.c
+ M /trunk/src/cmp.c
+ M /trunk/src/cmp2.c
+ M /trunk/src/cmp_abs.c
+ M /trunk/src/cmp_d.c
+ M /trunk/src/cmp_ld.c
+ M /trunk/src/cmp_si.c
+ M /trunk/src/cmp_ui.c
+ M /trunk/src/comparisons.c
+ M /trunk/src/const_catalan.c
+ M /trunk/src/const_euler.c
+ M /trunk/src/const_log2.c
+ M /trunk/src/const_pi.c
+ M /trunk/src/constant.c
+ M /trunk/src/copysign.c
+ M /trunk/src/cos.c
+ M /trunk/src/cosh.c
+ M /trunk/src/cot.c
+ M /trunk/src/coth.c
+ M /trunk/src/csc.c
+ M /trunk/src/csch.c
+ M /trunk/src/d_div.c
+ M /trunk/src/d_sub.c
+ M /trunk/src/digamma.c
+ M /trunk/src/dim.c
+ M /trunk/src/div.c
+ M /trunk/src/div_2exp.c
+ M /trunk/src/div_2si.c
+ M /trunk/src/div_2ui.c
+ M /trunk/src/div_d.c
+ M /trunk/src/div_ui.c
+ M /trunk/src/dump.c
+ M /trunk/src/eint.c
+ M /trunk/src/eq.c
+ M /trunk/src/erandom.c
+ M /trunk/src/erf.c
+ M /trunk/src/erfc.c
+ M /trunk/src/exceptions.c
+ M /trunk/src/exp.c
+ M /trunk/src/exp10.c
+ M /trunk/src/exp2.c
+ M /trunk/src/exp3.c
+ M /trunk/src/exp_2.c
+ M /trunk/src/expm1.c
+ M /trunk/src/extract.c
+ M /trunk/src/factorial.c
+ M /trunk/src/fits_intmax.c
+ M /trunk/src/fits_s.h
+ M /trunk/src/fits_sint.c
+ M /trunk/src/fits_slong.c
+ M /trunk/src/fits_sshort.c
+ M /trunk/src/fits_u.h
+ M /trunk/src/fits_uint.c
+ M /trunk/src/fits_uintmax.c
+ M /trunk/src/fits_ulong.c
+ M /trunk/src/fits_ushort.c
+ M /trunk/src/fma.c
+ M /trunk/src/fmma.c
+ M /trunk/src/fms.c
+ M /trunk/src/fpif.c
+ M /trunk/src/frac.c
+ M /trunk/src/free_cache.c
+ M /trunk/src/frexp.c
+ M /trunk/src/gamma.c
+ M /trunk/src/gamma_inc.c
+ M /trunk/src/gammaonethird.c
+ M /trunk/src/gen_inverse.h
+ M /trunk/src/generic/coverage/mparam.h
+ M /trunk/src/generic/mparam.h
+ M /trunk/src/get_d.c
+ M /trunk/src/get_d64.c
+ M /trunk/src/get_exp.c
+ M /trunk/src/get_f.c
+ M /trunk/src/get_float128.c
+ M /trunk/src/get_flt.c
+ M /trunk/src/get_ld.c
+ M /trunk/src/get_q.c
+ M /trunk/src/get_si.c
+ M /trunk/src/get_sj.c
+ M /trunk/src/get_str.c
+ M /trunk/src/get_ui.c
+ M /trunk/src/get_uj.c
+ M /trunk/src/get_z.c
+ M /trunk/src/get_z_exp.c
+ M /trunk/src/gmp_op.c
+ M /trunk/src/grandom.c
+ M /trunk/src/hppa/mparam.h
+ M /trunk/src/hypot.c
+ M /trunk/src/ia64/mparam.h
+ M /trunk/src/ieee_floats.h
+ M /trunk/src/init.c
+ M /trunk/src/init2.c
+ M /trunk/src/inits.c
+ M /trunk/src/inits2.c
+ M /trunk/src/inp_str.c
+ M /trunk/src/int_ceil_log2.c
+ M /trunk/src/invert_limb.h
+ M /trunk/src/invsqrt_limb.h
+ M /trunk/src/isinf.c
+ M /trunk/src/isinteger.c
+ M /trunk/src/isnan.c
+ M /trunk/src/isnum.c
+ M /trunk/src/isqrt.c
+ M /trunk/src/isregular.c
+ M /trunk/src/iszero.c
+ M /trunk/src/jn.c
+ M /trunk/src/jyn_asympt.c
+ M /trunk/src/li2.c
+ M /trunk/src/lngamma.c
+ M /trunk/src/log.c
+ M /trunk/src/log10.c
+ M /trunk/src/log1p.c
+ M /trunk/src/log2.c
+ M /trunk/src/log_ui.c
+ M /trunk/src/logging.c
+ M /trunk/src/min_prec.c
+ M /trunk/src/minmax.c
+ M /trunk/src/mips/mparam.h
+ M /trunk/src/modf.c
+ M /trunk/src/mp_clz_tab.c
+ M /trunk/src/mparam_h.in
+ M /trunk/src/mpf2mpfr.h
+ M /trunk/src/mpfr-cvers.h
+ M /trunk/src/mpfr-gmp.c
+ M /trunk/src/mpfr-gmp.h
+ M /trunk/src/mpfr-impl.h
+ M /trunk/src/mpfr-intmax.h
+ M /trunk/src/mpfr-longlong.h
+ M /trunk/src/mpfr-mini-gmp.c
+ M /trunk/src/mpfr-mini-gmp.h
+ M /trunk/src/mpfr-sassert.h
+ M /trunk/src/mpfr-thread.h
+ M /trunk/src/mpfr.h
+ M /trunk/src/mpn_exp.c
+ M /trunk/src/mul.c
+ M /trunk/src/mul_2exp.c
+ M /trunk/src/mul_2si.c
+ M /trunk/src/mul_2ui.c
+ M /trunk/src/mul_d.c
+ M /trunk/src/mul_ui.c
+ M /trunk/src/mulders.c
+ M /trunk/src/neg.c
+ M /trunk/src/next.c
+ M /trunk/src/nrandom.c
+ M /trunk/src/odd_p.c
+ M /trunk/src/out_str.c
+ M /trunk/src/pool.c
+ M /trunk/src/pow.c
+ M /trunk/src/pow_si.c
+ M /trunk/src/pow_ui.c
+ M /trunk/src/pow_z.c
+ M /trunk/src/powerof2.c
+ M /trunk/src/powerpc32/mparam.h
+ M /trunk/src/powerpc64/mparam.h
+ M /trunk/src/print_raw.c
+ M /trunk/src/print_rnd_mode.c
+ M /trunk/src/printf.c
+ M /trunk/src/random_deviate.c
+ M /trunk/src/random_deviate.h
+ M /trunk/src/rec_sqrt.c
+ M /trunk/src/reldiff.c
+ M /trunk/src/rem1.c
+ M /trunk/src/rint.c
+ M /trunk/src/rndna.c
+ M /trunk/src/root.c
+ M /trunk/src/round_near_x.c
+ M /trunk/src/round_p.c
+ M /trunk/src/round_prec.c
+ M /trunk/src/round_raw_generic.c
+ M /trunk/src/scale2.c
+ M /trunk/src/sec.c
+ M /trunk/src/sech.c
+ M /trunk/src/set.c
+ M /trunk/src/set_d.c
+ M /trunk/src/set_d64.c
+ M /trunk/src/set_dfl_prec.c
+ M /trunk/src/set_exp.c
+ M /trunk/src/set_f.c
+ M /trunk/src/set_float128.c
+ M /trunk/src/set_flt.c
+ M /trunk/src/set_inf.c
+ M /trunk/src/set_ld.c
+ M /trunk/src/set_nan.c
+ M /trunk/src/set_prc_raw.c
+ M /trunk/src/set_prec.c
+ M /trunk/src/set_q.c
+ M /trunk/src/set_rnd.c
+ M /trunk/src/set_si.c
+ M /trunk/src/set_si_2exp.c
+ M /trunk/src/set_sj.c
+ M /trunk/src/set_str.c
+ M /trunk/src/set_str_raw.c
+ M /trunk/src/set_ui.c
+ M /trunk/src/set_ui_2exp.c
+ M /trunk/src/set_uj.c
+ M /trunk/src/set_z.c
+ M /trunk/src/set_z_exp.c
+ M /trunk/src/set_zero.c
+ M /trunk/src/setmax.c
+ M /trunk/src/setmin.c
+ M /trunk/src/setsign.c
+ M /trunk/src/sgn.c
+ M /trunk/src/si_op.c
+ M /trunk/src/signbit.c
+ M /trunk/src/sin.c
+ M /trunk/src/sin_cos.c
+ M /trunk/src/sinh.c
+ M /trunk/src/sinh_cosh.c
+ M /trunk/src/sparc64/mparam.h
+ M /trunk/src/sqr.c
+ M /trunk/src/sqrt.c
+ M /trunk/src/sqrt_ui.c
+ M /trunk/src/stack_interface.c
+ M /trunk/src/strtofr.c
+ M /trunk/src/sub.c
+ M /trunk/src/sub1.c
+ M /trunk/src/sub1sp.c
+ M /trunk/src/sub_d.c
+ M /trunk/src/sub_ui.c
+ M /trunk/src/subnormal.c
+ M /trunk/src/sum.c
+ M /trunk/src/swap.c
+ M /trunk/src/tan.c
+ M /trunk/src/tanh.c
+ M /trunk/src/ubf.c
+ M /trunk/src/uceil_exp2.c
+ M /trunk/src/uceil_log2.c
+ M /trunk/src/ufloor_log2.c
+ M /trunk/src/ui_div.c
+ M /trunk/src/ui_pow.c
+ M /trunk/src/ui_pow_ui.c
+ M /trunk/src/ui_sub.c
+ M /trunk/src/urandom.c
+ M /trunk/src/urandomb.c
+ M /trunk/src/vasprintf.c
+ M /trunk/src/version.c
+ M /trunk/src/volatile.c
+ M /trunk/src/x86/core2/mparam.h
+ M /trunk/src/x86/mparam.h
+ M /trunk/src/x86_64/core2/mparam.h
+ M /trunk/src/x86_64/corei5/mparam.h
+ M /trunk/src/x86_64/pentium4/mparam.h
+ M /trunk/src/yn.c
+ M /trunk/src/zeta.c
+ M /trunk/src/zeta_ui.c
+ M /trunk/tests/Makefile.am
+ M /trunk/tests/cmp_str.c
+ M /trunk/tests/data/digamma
+ M /trunk/tests/data/li2
+ M /trunk/tests/memory.c
+ M /trunk/tests/mpf_compat.c
+ M /trunk/tests/mpf_compat.h
+ M /trunk/tests/mpfr-test.h
+ M /trunk/tests/mpfr_compat.c
+ M /trunk/tests/random2.c
+ M /trunk/tests/reuse.c
+ M /trunk/tests/rnd_mode.c
+ M /trunk/tests/tabort_defalloc1.c
+ M /trunk/tests/tabort_defalloc2.c
+ M /trunk/tests/tabort_prec_max.c
+ M /trunk/tests/tabs.c
+ M /trunk/tests/tacos.c
+ M /trunk/tests/tacosh.c
+ M /trunk/tests/tadd.c
+ M /trunk/tests/tadd1sp.c
+ M /trunk/tests/tadd_d.c
+ M /trunk/tests/tadd_ui.c
+ M /trunk/tests/tagm.c
+ M /trunk/tests/tai.c
+ M /trunk/tests/talloc-cache.c
+ M /trunk/tests/talloc.c
+ M /trunk/tests/tasin.c
+ M /trunk/tests/tasinh.c
+ M /trunk/tests/tassert.c
+ M /trunk/tests/tatan.c
+ M /trunk/tests/tatanh.c
+ M /trunk/tests/taway.c
+ M /trunk/tests/tbeta.c
+ M /trunk/tests/tbuildopt.c
+ M /trunk/tests/tcan_round.c
+ M /trunk/tests/tcbrt.c
+ M /trunk/tests/tcheck.c
+ M /trunk/tests/tcmp.c
+ M /trunk/tests/tcmp2.c
+ M /trunk/tests/tcmp_d.c
+ M /trunk/tests/tcmp_ld.c
+ M /trunk/tests/tcmp_ui.c
+ M /trunk/tests/tcmpabs.c
+ M /trunk/tests/tcomparisons.c
+ M /trunk/tests/tconst_catalan.c
+ M /trunk/tests/tconst_euler.c
+ M /trunk/tests/tconst_log2.c
+ M /trunk/tests/tconst_pi.c
+ M /trunk/tests/tcopysign.c
+ M /trunk/tests/tcos.c
+ M /trunk/tests/tcosh.c
+ M /trunk/tests/tcot.c
+ M /trunk/tests/tcoth.c
+ M /trunk/tests/tcsc.c
+ M /trunk/tests/tcsch.c
+ M /trunk/tests/td_div.c
+ M /trunk/tests/td_sub.c
+ M /trunk/tests/tdigamma.c
+ M /trunk/tests/tdim.c
+ M /trunk/tests/tdiv.c
+ M /trunk/tests/tdiv_d.c
+ M /trunk/tests/tdiv_ui.c
+ M /trunk/tests/teint.c
+ M /trunk/tests/teq.c
+ M /trunk/tests/terandom.c
+ M /trunk/tests/terandom_chisq.c
+ M /trunk/tests/terf.c
+ M /trunk/tests/tests.c
+ M /trunk/tests/texceptions.c
+ M /trunk/tests/texp.c
+ M /trunk/tests/texp10.c
+ M /trunk/tests/texp2.c
+ M /trunk/tests/texpm1.c
+ M /trunk/tests/tfactorial.c
+ M /trunk/tests/tfits.c
+ M /trunk/tests/tfma.c
+ M /trunk/tests/tfmma.c
+ M /trunk/tests/tfmod.c
+ M /trunk/tests/tfms.c
+ M /trunk/tests/tfpif.c
+ M /trunk/tests/tfprintf.c
+ M /trunk/tests/tfrac.c
+ M /trunk/tests/tfrexp.c
+ M /trunk/tests/tgamma.c
+ M /trunk/tests/tgamma_inc.c
+ M /trunk/tests/tgeneric.c
+ M /trunk/tests/tgeneric_ui.c
+ M /trunk/tests/tget_d.c
+ M /trunk/tests/tget_d_2exp.c
+ M /trunk/tests/tget_f.c
+ M /trunk/tests/tget_flt.c
+ M /trunk/tests/tget_ld_2exp.c
+ M /trunk/tests/tget_q.c
+ M /trunk/tests/tget_set_d64.c
+ M /trunk/tests/tget_sj.c
+ M /trunk/tests/tget_str.c
+ M /trunk/tests/tget_z.c
+ M /trunk/tests/tgmpop.c
+ M /trunk/tests/tgrandom.c
+ M /trunk/tests/thyperbolic.c
+ M /trunk/tests/thypot.c
+ M /trunk/tests/tinits.c
+ M /trunk/tests/tinp_str.c
+ M /trunk/tests/tinternals.c
+ M /trunk/tests/tisnan.c
+ M /trunk/tests/tisqrt.c
+ M /trunk/tests/tj0.c
+ M /trunk/tests/tj1.c
+ M /trunk/tests/tjn.c
+ M /trunk/tests/tl2b.c
+ M /trunk/tests/tlgamma.c
+ M /trunk/tests/tli2.c
+ M /trunk/tests/tlngamma.c
+ M /trunk/tests/tlog.c
+ M /trunk/tests/tlog10.c
+ M /trunk/tests/tlog1p.c
+ M /trunk/tests/tlog2.c
+ M /trunk/tests/tlog_ui.c
+ M /trunk/tests/tmin_prec.c
+ M /trunk/tests/tminmax.c
+ M /trunk/tests/tmodf.c
+ M /trunk/tests/tmul.c
+ M /trunk/tests/tmul_2exp.c
+ M /trunk/tests/tmul_d.c
+ M /trunk/tests/tmul_ui.c
+ M /trunk/tests/tnext.c
+ M /trunk/tests/tnrandom.c
+ M /trunk/tests/tnrandom_chisq.c
+ M /trunk/tests/tout_str.c
+ M /trunk/tests/toutimpl.c
+ M /trunk/tests/tpow.c
+ M /trunk/tests/tpow3.c
+ M /trunk/tests/tpow_all.c
+ M /trunk/tests/tpow_z.c
+ M /trunk/tests/tprintf.c
+ M /trunk/tests/trandom.c
+ M /trunk/tests/trandom_deviate.c
+ M /trunk/tests/trec_sqrt.c
+ M /trunk/tests/tremquo.c
+ M /trunk/tests/trint.c
+ M /trunk/tests/trndna.c
+ M /trunk/tests/troot.c
+ M /trunk/tests/trootn_ui.c
+ M /trunk/tests/tround_prec.c
+ M /trunk/tests/tsec.c
+ M /trunk/tests/tsech.c
+ M /trunk/tests/tset.c
+ M /trunk/tests/tset_d.c
+ M /trunk/tests/tset_exp.c
+ M /trunk/tests/tset_f.c
+ M /trunk/tests/tset_float128.c
+ M /trunk/tests/tset_ld.c
+ M /trunk/tests/tset_q.c
+ M /trunk/tests/tset_si.c
+ M /trunk/tests/tset_sj.c
+ M /trunk/tests/tset_str.c
+ M /trunk/tests/tset_z.c
+ M /trunk/tests/tset_z_exp.c
+ M /trunk/tests/tsgn.c
+ M /trunk/tests/tsi_op.c
+ M /trunk/tests/tsin.c
+ M /trunk/tests/tsin_cos.c
+ M /trunk/tests/tsinh.c
+ M /trunk/tests/tsinh_cosh.c
+ M /trunk/tests/tsprintf.c
+ M /trunk/tests/tsqr.c
+ M /trunk/tests/tsqrt.c
+ M /trunk/tests/tsqrt_ui.c
+ M /trunk/tests/tstckintc.c
+ M /trunk/tests/tstdint.c
+ M /trunk/tests/tstrtofr.c
+ M /trunk/tests/tsub.c
+ M /trunk/tests/tsub1sp.c
+ M /trunk/tests/tsub_d.c
+ M /trunk/tests/tsub_ui.c
+ M /trunk/tests/tsubnormal.c
+ M /trunk/tests/tsum.c
+ M /trunk/tests/tswap.c
+ M /trunk/tests/ttan.c
+ M /trunk/tests/ttanh.c
+ M /trunk/tests/ttrunc.c
+ M /trunk/tests/tui_div.c
+ M /trunk/tests/tui_pow.c
+ M /trunk/tests/tui_sub.c
+ M /trunk/tests/turandom.c
+ M /trunk/tests/tvalist.c
+ M /trunk/tests/tversion.c
+ M /trunk/tests/ty0.c
+ M /trunk/tests/ty1.c
+ M /trunk/tests/tyn.c
+ M /trunk/tests/tzeta.c
+ M /trunk/tests/tzeta_ui.c
+ M /trunk/tools/bench/Makefile.am
+ M /trunk/tools/bench/benchtime.h
+ M /trunk/tools/bench/mpfrbench.c
+ M /trunk/tools/ck-clz_tab
+ M /trunk/tools/ck-copyright-notice
+ M /trunk/tools/ck-news
+ M /trunk/tools/ck-version-info
+ M /trunk/tools/get_patches.sh
+ M /trunk/tune/Makefile.am
+ M /trunk/tune/bidimensional_sample.c
+ M /trunk/tune/speed.c
+ M /trunk/tune/tuneup.c
+
+Copyright notice update: added 2018 with
+ perl -pi -e 's/ (\d{4}-)?(2017)(?= Free Software)/
+ " ".($1||"$2-").($2+1)/e' **/*(^/)
+under zsh, reverting the ck-mparam and timings-mpfr.c files and
+the mbench directory under "tools" (not distributed with MPFR).
+Removed 2017 from the example in the doc/README.dev file.
+------------------------------------------------------------------------
+r12066 | zimmerma | 2018-01-03 10:20:46 +0000 (Wed, 03 Jan 2018) | 3 lines
+Changed paths:
+ M /trunk/src/zeta.c
+
+[src/zeta.c] added comments and FIXME
+
+Note (2019-04-30): a bug has also been introduced (fixed in r13485).
+------------------------------------------------------------------------
+r12056 | vlefevre | 2017-12-25 11:15:53 +0000 (Mon, 25 Dec 2017) | 1 line
+Changed paths:
+ M /trunk/NEWS
[NEWS] Minor corrections for GNU MPFR 4.0.0.
-(merged changeset r12056 from the trunk)
------------------------------------------------------------------------
-r12051 | vlefevre | 2017-12-23 10:19:32 +0000 (Sat, 23 Dec 2017) | 1 line
+r12055 | vlefevre | 2017-12-23 21:38:16 +0000 (Sat, 23 Dec 2017) | 1 line
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/tests/tests.c
-ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC svn log -rHEAD:0 -v".
+[tests/tests.c] Added a note about gettimeofday() and a cast.
------------------------------------------------------------------------
-r12050 | vlefevre | 2017-12-23 10:17:50 +0000 (Sat, 23 Dec 2017) | 1 line
+r12054 | vlefevre | 2017-12-23 21:17:25 +0000 (Sat, 23 Dec 2017) | 2 lines
Changed paths:
- M /branches/4.0/VERSION
- M /branches/4.0/configure.ac
- M /branches/4.0/doc/mpfr.texi
- M /branches/4.0/src/mpfr.h
- M /branches/4.0/src/version.c
+ M /trunk/tests/tests.c
-Updated version to 4.0.0.
+[tests/tests.c] Fixed a potential integer overflow from r12053 with
+GMP_CHECK_RANDOMIZE=1, in particular under a 32-bit Linux.
------------------------------------------------------------------------
-r12049 | vlefevre | 2017-12-23 10:15:10 +0000 (Sat, 23 Dec 2017) | 1 line
+r12053 | zimmerma | 2017-12-23 17:08:06 +0000 (Sat, 23 Dec 2017) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/exp_2.c
- M /branches/4.0/src/subnormal.c
- M /branches/4.0/tests/texp.c
+ M /trunk/tests/tests.c
+
+[tests/tests.c] decrease probability of collision with random seed
-Merged changesets r12046-12048 from the trunk (bug fix and test).
------------------------------------------------------------------------
-r12046 | vlefevre | 2017-12-23 01:39:00 +0000 (Sat, 23 Dec 2017) | 1 line
+r12048 | zimmerma | 2017-12-23 08:46:50 +0000 (Sat, 23 Dec 2017) | 3 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/src/hypot.c
- M /branches/4.0/src/lngamma.c
- M /branches/4.0/src/sin.c
- M /branches/4.0/src/subnormal.c
- M /branches/4.0/tests/thypot.c
- M /branches/4.0/tests/tj1.c
- M /branches/4.0/tests/tlngamma.c
+ M /trunk/src/exp_2.c
+ M /trunk/src/subnormal.c
+
+[src/exp_2.c] fixed bug from previous commit
+[src/subnormal.c] added assert
-Merged changesets r12026-12045 from the trunk (bug fixes and tests).
------------------------------------------------------------------------
-r12027 | vlefevre | 2017-12-20 01:59:31 +0000 (Wed, 20 Dec 2017) | 1 line
+r12047 | zimmerma | 2017-12-23 08:38:01 +0000 (Sat, 23 Dec 2017) | 2 lines
Changed paths:
- M /branches/4.0/ChangeLog
+ M /trunk/tests/texp.c
+
+[tests/texp.c] added test for new bug
+
+------------------------------------------------------------------------
+r12045 | vlefevre | 2017-12-22 11:01:53 +0000 (Fri, 22 Dec 2017) | 1 line
+Changed paths:
+ M /trunk/tests/tlngamma.c
+
+Removed trailing whitespace.
+------------------------------------------------------------------------
+r12044 | vlefevre | 2017-12-22 10:54:49 +0000 (Fri, 22 Dec 2017) | 1 line
+Changed paths:
+ M /trunk/src/subnormal.c
+
+[src/subnormal.c] Replaced FIXME.
+------------------------------------------------------------------------
+r12043 | vlefevre | 2017-12-22 10:48:08 +0000 (Fri, 22 Dec 2017) | 1 line
+Changed paths:
+ M /trunk/tests/tj1.c
+
+[tests/tj1.c] Avoid a potential integer overflow.
+------------------------------------------------------------------------
+r12042 | zimmerma | 2017-12-22 08:10:22 +0000 (Fri, 22 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/src/subnormal.c
+
+[src/subnormal.c] added FIXME
+
+------------------------------------------------------------------------
+r12041 | zimmerma | 2017-12-22 08:06:04 +0000 (Fri, 22 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/src/sin.c
+
+[src/sin.c] simplified code with RNDA
+
+------------------------------------------------------------------------
+r12040 | zimmerma | 2017-12-22 08:03:49 +0000 (Fri, 22 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/src/hypot.c
+
+[src/hypot.c] mimic mpfr_round_near_x
+
+------------------------------------------------------------------------
+r12039 | zimmerma | 2017-12-22 07:54:59 +0000 (Fri, 22 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/tj1.c
+
+[tests/tj1.c] exercise corner case
+
+------------------------------------------------------------------------
+r12038 | zimmerma | 2017-12-22 07:38:25 +0000 (Fri, 22 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/tj1.c
+
+[tests/tj1.c] added test for j1(z) with small z
-ChangeLog update with "LC_ALL=en_US.UTF8 TZ=UTC svn log -rHEAD:0 -v".
------------------------------------------------------------------------
-r12026 | vlefevre | 2017-12-20 01:57:34 +0000 (Wed, 20 Dec 2017) | 4 lines
+r12037 | zimmerma | 2017-12-22 07:36:41 +0000 (Fri, 22 Dec 2017) | 2 lines
Changed paths:
- M /branches/4.0
- M /branches/4.0/NEWS
- M /branches/4.0/doc/FAQ.html
+ M /trunk/src/hypot.c
+
+[src/hypot.c] fixed issue with overflow flag not correctly set
-Re-added changes specific to the old 4.0 branch:
- * doc/FAQ.html: assume MPFR 4.0.0 has been released (since this is
- a file for the MPFR 4.0.0 release).
- * NEWS: added test coverage for MPFR 4.0.0.
------------------------------------------------------------------------
-r12024 | vlefevre | 2017-12-20 01:53:52 +0000 (Wed, 20 Dec 2017) | 4 lines
+r12036 | vlefevre | 2017-12-21 09:17:04 +0000 (Thu, 21 Dec 2017) | 2 lines
Changed paths:
- R /branches/4.0 (from /trunk:12023)
+ M /trunk/src/next.c
-Replaced the 4.0 branch by a copy of the trunk (in order to keep the
-history of the latest changes of the trunk); this replacement is due
-to a limitation of Subversion where a merge is regarded as a single
-commit, and is OK here since the 4.0 branch is new.
+[src/next.c] Reverted r12035 as per documentation, which follows
+IEEE 754 (with the usual special treatment for the single NaN).
+------------------------------------------------------------------------
+r12035 | zimmerma | 2017-12-21 07:37:30 +0000 (Thu, 21 Dec 2017) | 3 lines
+Changed paths:
+ M /trunk/src/next.c
+ M /trunk/tests/thypot.c
+
+[src/next.c] fixed nextinf (missing overflow flag)
+[tests/thypot.c] removed debug call to mpfr_dump in previous commit
+
+------------------------------------------------------------------------
+r12034 | zimmerma | 2017-12-21 07:29:57 +0000 (Thu, 21 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/thypot.c
+
+[tests/thypot.c] another fix...
+
+------------------------------------------------------------------------
+r12033 | zimmerma | 2017-12-21 07:21:29 +0000 (Thu, 21 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/thypot.c
+
+[tests/thypot.c] fixed bug20171221()
+
+------------------------------------------------------------------------
+r12032 | zimmerma | 2017-12-21 07:12:14 +0000 (Thu, 21 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/thypot.c
+
+[tests/thypot.c] new failing test
+
+------------------------------------------------------------------------
+r12031 | zimmerma | 2017-12-21 06:18:05 +0000 (Thu, 21 Dec 2017) | 4 lines
+Changed paths:
+ M /trunk/src/lngamma.c
+ M /trunk/tests/tlngamma.c
+
+[src/lngamma.c] fixed bug when u=0 in case z0 < 1
+[tests/tlngamma.c] fixed test case which was wrong
+
+
+------------------------------------------------------------------------
+r12030 | zimmerma | 2017-12-20 20:28:49 +0000 (Wed, 20 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/tlngamma.c
+
+[tests/tlngamma.c] added test for new failure
+
+------------------------------------------------------------------------
+r12029 | zimmerma | 2017-12-20 10:48:26 +0000 (Wed, 20 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/src/lngamma.c
+
+[src/lngamma.c] fixed bug found in previous commit
+
+------------------------------------------------------------------------
+r12028 | zimmerma | 2017-12-20 10:40:34 +0000 (Wed, 20 Dec 2017) | 2 lines
+Changed paths:
+ M /trunk/tests/tlngamma.c
+
+[tests/tlngamma.c] added failing test with mpfr-4.0.0-rc2
+
+------------------------------------------------------------------------
+r12025 | vlefevre | 2017-12-20 01:54:18 +0000 (Wed, 20 Dec 2017) | 1 line
+Changed paths:
+ M /trunk/INSTALL
+ M /trunk/VERSION
+ M /trunk/configure.ac
+ M /trunk/doc/mpfr.texi
+ M /trunk/src/mpfr.h
+ M /trunk/src/version.c
+
+Updated version to 4.1.0-dev again.
------------------------------------------------------------------------
r12023 | vlefevre | 2017-12-20 01:52:21 +0000 (Wed, 20 Dec 2017) | 1 line
Changed paths:
@@ -25024,7 +36073,7 @@ Changed paths:
[src/mpfr-sassert.h] Get rid of annoying warnings
typedef 'MPFR_ASSERT_xxx' locally defined but not used
with GCC 4.8+ (better than the non-portable solution r8618). Thanks to
-Jonathan Wakely: https://gcc.gnu.org/ml/gcc-help/2013-07/msg00142.html
+Jonathan Wakely: https://gcc.gnu.org/legacy-ml/gcc-help/2013-07/msg00142.html
------------------------------------------------------------------------
r8624 | zimmerma | 2013-07-22 12:06:18 +0000 (Mon, 22 Jul 2013) | 4 lines
Changed paths:
@@ -43109,7 +54158,7 @@ acinclude.m4: Make sure results of calculations on constants used with
the fesetround() test are not precomputed by GCC (occurs on MIPS).
Patch from Maciej W. Rozycki.
https://sympa.inria.fr/sympa/arc/mpfr/2009-06/msg00036.html
- http://article.gmane.org/gmane.comp.lib.mpfr.general/174
+ gmane.comp.lib.mpfr.general:174
------------------------------------------------------------------------
r6272 | zimmerma | 2009-06-13 02:00:58 +0000 (Sat, 13 Jun 2009) | 2 lines
Changed paths:
@@ -46856,7 +57905,7 @@ Changed paths:
M /trunk/INSTALL
INSTALL: TLS on darwin may work, but I don't know anything more.
-See thread <https://gcc.gnu.org/ml/gcc/2008-12/msg00107.html>.
+See thread <https://gcc.gnu.org/legacy-ml/gcc/2008-12/msg00107.html>.
------------------------------------------------------------------------
r5702 | vlefevre | 2008-12-08 16:02:29 +0000 (Mon, 08 Dec 2008) | 1 line
Changed paths:
@@ -55002,8 +66051,8 @@ Changed paths:
A /trunk/patch-libtool
Added patch-libtool (patch for aclocal.m4 and configure that comes from
-<http://thread.gmane.org/gmane.comp.gnu.libtool.bugs/5771/focus=5776>).
-
+<https://lists.gnu.org/archive/html/bug-libtool/2007-07/msg00007.html>
+or gmane.comp.gnu.libtool.bugs:5776).
------------------------------------------------------------------------
r4614 | vlefevre | 2007-07-02 12:17:08 +0000 (Mon, 02 Jul 2007) | 2 lines
Changed paths:
diff --git a/Build/source/libs/mpfr/mpfr-src/INSTALL b/Build/source/libs/mpfr/mpfr-src/INSTALL
index 8c78c3034da..f1b6a5cccec 100644
--- a/Build/source/libs/mpfr/mpfr-src/INSTALL
+++ b/Build/source/libs/mpfr/mpfr-src/INSTALL
@@ -1,4 +1,4 @@
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -37,17 +37,17 @@ MPFR).
not been done yet and if patches are available. You can check
on the release page:
- https://www.mpfr.org/mpfr-4.0.2/
+ https://www.mpfr.org/mpfr-4.1.0/
which may have additional information. The patches can be applied
with commands like:
- wget https://www.mpfr.org/mpfr-4.0.2/allpatches
+ wget https://www.mpfr.org/mpfr-4.1.0/allpatches
patch -N -Z -p1 < allpatches
or
- curl https://www.mpfr.org/mpfr-4.0.2/allpatches | patch -N -Z -p1
+ curl https://www.mpfr.org/mpfr-4.1.0/allpatches | patch -N -Z -p1
(Those instructions are for the GNU patch command, for example
/usr/bin/gpatch on Solaris.)
@@ -207,7 +207,7 @@ specific architecture.
--enable-assert build MPFR with assertions.
--enable-thread-safe build MPFR as thread safe, using compiler-level
- Thread Local Storage (TLS). Note: TLS support is
+ Thread-Local Storage (TLS). Note: TLS support is
roughly tested by configure. If configure detects
that TLS does not work (because of the compiler,
linker or system libraries), it will output an
@@ -224,6 +224,27 @@ specific architecture.
buggy (MPFR tests may fail). In such a case,
this option is useful.
+--enable-decimal-float build conversion functions from/to decimal floats.
+ Note that detection by the configure script is
+ limited in case of cross-compilation.
+ Accepted arguments:
+ yes Decimal support is requested and the configure
+ script fails if it detects that decimals do not
+ work.
+ The encoding (BID or DPD) will automatically be
+ detected at configure time or at compile time if
+ possible (if not, generic code will be used).
+ no Decimal support is explicitly disabled.
+ auto Decimal support is enabled if the configure script
+ detects that it works. This is the default when
+ --{enable,disable}-decimal-float is not given.
+ bid Decimal support is requested and the encoding is
+ assumed to be BID (some check may be done).
+ dpd Decimal support is requested and the encoding is
+ assumed to be DPD (some check may be done).
+ generic Decimal support is requested and the generic code
+ is used (mainly for developers).
+
--enable-gmp-internals allows the MPFR build to use GMP's undocumented
functions (not from the public API). Note that
library versioning is not guaranteed to work if
@@ -234,9 +255,6 @@ specific architecture.
may be useful in cross-compilation). If you use
this option, you need to have Libtool 2.4+ on
the target system. See Libtool 2.4+'s NEWS file.
- Technical information can be found at [1].
-
-[1] http://permalink.gmane.org/gmane.comp.gnu.libtool.patches/10111
Note: By default, the configure script tries to set CC / CFLAGS to GMP's
ones from gmp.h (__GMP_CC / __GMP_CFLAGS) in order to ensure that MPFR is
@@ -369,7 +387,7 @@ Several documents may help you to solve the problem:
* the FAQ (either the FAQ.html file distributed with MPFR, or the
on-line version <https://www.mpfr.org/faq.html>, which may be more
up-to-date);
- * the MPFR web page for this version <https://www.mpfr.org/mpfr-4.0.2/>,
+ * the MPFR web page for this version <https://www.mpfr.org/mpfr-4.1.0/>,
which lists bugs found in this version and provides some patches.
If the "configure" fails, please check that the C compiler and its
@@ -437,8 +455,8 @@ is to make sure that the dynamic linker configuration is consistent
with GCC's behavior, for instance by having /usr/local/lib in
/etc/ld.so.conf or in some file from /etc/ld.so.conf.d (as Debian
did: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=395177). See
-also https://gcc.gnu.org/ml/gcc-help/2010-01/msg00171.html for more
-information. Alternatively you can use:
+also https://gcc.gnu.org/legacy-ml/gcc-help/2010-01/msg00171.html for
+more information. Alternatively you can use:
* environment variables. This may sometimes be necessary. If DIR
is the installation directory of GMP, add DIR/include to your
CPATH or C_INCLUDE_PATH (for compilers other than GCC, please
@@ -599,32 +617,58 @@ a. Using MinGW
3 - To avoid using the Microsoft runtime (which might not be conform to ISO C),
you can use the MinGW runtime package (which is an integral part of MinGW).
- For example, with MinGW versions 3.15 and later you can get an
- ISO-compliant printf() if you compile your application with either
- '-ansi', '-posix' or '-D__USE_MINGW_ANSI_STDIO'. In order to have the
- MPFR formatted output functions based on ISO-compliant printf(), you
- need to compile GMP (not MPFR) with CC="gcc -D__USE_MINGW_ANSI_STDIO"
- (since the standard printf modifiers %e, %Ld and %td are passed to GMP).
- Not doing so may result in failures of some of the printf-related tests.
- For instance, the following error on some Windows machine has been
- reported:
-
- https://sympa.inria.fr/sympa/arc/mpfr/2016-02/msg00053.html
+
+ With old MinGW versions, you can get an ISO-compliant printf()
+ if you compile your application with either '-ansi', '-posix' or
+ '-D__USE_MINGW_ANSI_STDIO'. But note that this latter option,
+ which was useful in the past (see below) should no longer be used.
+
+ The following applies to old MinGW versions, and may be discouraged
+ with recent MinGW versions.
+
+ In order to have the MPFR formatted output functions based on an
+ ISO-compliant printf(), you need to compile GMP (not MPFR) with
+ CC="gcc -D__USE_MINGW_ANSI_STDIO" (since the standard printf modifiers
+ %e, %Ld and %td are passed to GMP).
+
+ To avoid failures of some of the printf-related tests, MPFR needs to
+ be compiled with the same __USE_MINGW_ANSI_STDIO as with GMP, i.e.
+ this macro should be defined for both or undefined for both; this
+ should be the case by default, unless CC or CFLAGS has been redefined.
+ For instance, if __USE_MINGW_ANSI_STDIO is defined in GMP but not in
+ MPFR, the following error may occur:
Error in mpfr_vsprintf (s, "%e", ...);
expected: "-1.250000e+000"
got: "-1.250000e+00"
FAIL tsprintf.exe (exit status: 1)
- The cause is that here the C functions vsnprintf and vsprintf used
- internally in GMP do not produce the same output:
+ and in the opposite case:
+
+ Error in mpfr_vsprintf (s, "%e", ...);
+ expected: "-1.250000e+00"
+ got: "-1.250000e+000"
+ FAIL tsprintf.exe (exit status: 1)
+
+ Note with old GMP versions: Other issues could arise due to the fact
+ that the C functions vsnprintf and vsprintf both used internally in
+ old GMP versions do not produce the same output:
https://sympa.inria.fr/sympa/arc/mpfr/2016-03/msg00045.html
https://sympa.inria.fr/sympa/arc/mpfr/2016-03/msg00051.html
https://sympa.inria.fr/sympa/arc/mpfr/2016-03/msg00053.html
- Building MPFR with -D__USE_MINGW_ANSI_STDIO is currently useless except
- for some error messages in the test suite.
+ If __USE_MINGW_ANSI_STDIO has not been defined when building GMP,
+ then the length modifiers j, L and t are not supported with the GMP
+ formatted output functions, and as a consequence, also with MPFR.
+ This is automatically detected by the configure script, except when
+ cross-compiling (e.g. under Linux), in which case some macros need
+ to be defined explicitly, e.g. with
+
+ "CPPFLAGS=-DNPRINTF_J -DNPRINTF_L -DNPRINTF_T"
+
+ in order to avoid potential issues with the MPFR library and failures
+ in the test suite (the corresponding tests are disabled explicitly).
b. Using Cygwin
===============
@@ -646,13 +690,30 @@ Static and dynamic MPFR libraries for the 32- and 64-bit versions of
Windows can be built with Microsoft Visual Studio 2015 using the
Microsoft Visual C++ compiler, see:
- https://www.visualstudio.com/
+ https://visualstudio.microsoft.com/
The Intel C++ compiler provided as a part of Intel Parallel Studio XE
can also be used:
- https://software.intel.com/en-us/intel-parallel-studio-xe
+ https://software.intel.com/en-us/parallel-studio-xe
The relevant build projects are available here:
https://github.com/BrianGladman
+
+d. Using the CompCert compiler
+==============================
+
+[this was tested with CompCert 3.7 and MPFR revision 13851 on x86_64-linux]
+
+CompCert (http://compcert.inria.fr/) is a formally verified compiler.
+To compile MPFR with CompCert:
+
+$ ./configure CC=ccomp CFLAGS="-fbitfields -flongdouble -fstruct-passing" --disable-shared
+
+You also need to unset LD_LIBRARY_PATH, and/or you might need to change
+wl="" into wl="-Wl," in the libtool file.
+
+All tests (make check) should pass (tget_set_d64, tget_set_d128 and
+tset_float128 are skipped, since CompCert does not support _Decimal64,
+_Decimal128 nor _Float128).
diff --git a/Build/source/libs/mpfr/mpfr-src/Makefile.am b/Build/source/libs/mpfr/mpfr-src/Makefile.am
index b05fe760a3f..89242c6a725 100644
--- a/Build/source/libs/mpfr/mpfr-src/Makefile.am
+++ b/Build/source/libs/mpfr/mpfr-src/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright 2000-2019 Free Software Foundation, Inc.
+# Copyright 2000-2020 Free Software Foundation, Inc.
# This Makefile.am is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -9,6 +9,12 @@
# PARTICULAR PURPOSE.
+# Since we do not require GNU "make", let's select the POSIX behavior to
+# uniformize the behavior a bit more with various "make" implementations
+# and ease maintenance. This target should be removed only if one day,
+# we need to require GNU "make".
+.POSIX:
+
AUTOMAKE_OPTIONS = gnu
# ACLOCAL_AMFLAGS will be fully deprecated in Automake 2.0;
@@ -24,28 +30,35 @@ pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = mpfr.pc
nobase_dist_doc_DATA = AUTHORS BUGS COPYING COPYING.LESSER NEWS TODO \
- examples/ReadMe examples/divworst.c examples/rndo-add.c examples/sample.c \
- examples/version.c examples/can_round.c
+ examples/ReadMe examples/can_round.c examples/divworst.c \
+ examples/rndo-add.c examples/sample.c examples/threads.c \
+ examples/version.c
-EXTRA_DIST = PATCHES VERSION doc/README.dev doc/check-typography \
- tools/ck-clz_tab tools/ck-copyright-notice tools/ck-news \
- tools/ck-version-info tools/get_patches.sh \
+EXTRA_DIST = PATCHES VERSION doc/README.dev doc/check-typography doc/mini-gmp \
+ tools/check_mparam.c tools/ck-clz_tab tools/ck-copyright-notice \
+ tools/ck-mparam tools/ck-news tools/ck-version-info tools/get_patches.sh \
$(DATAFILES)
bench:
cd tools/bench && $(MAKE) $(AM_MAKEFLAGS) bench
-# Various checks for "make dist".
+# Various checks for "make dist" / "make distcheck".
+# Warning! With "make distcheck", neither the top-level directory nor
+# the tools directory is writable.
# * Check consistency concerning -version-info. Moreover if the VERSION
# file doesn't end with "-dev", check that the -version-info value is
# up-to-date. Note: this is a heuristic, to detect some mistakes.
# * Check that copyright notices exist and appear to be correct.
# * Check the NEWS file.
+# * Check the __clz_tab sizes.
+# * Check the mparam.h files.
+# * Check typography in mpfr.texi (Texinfo rules).
dist-hook:
cd $(srcdir) && tools/ck-version-info
cd $(srcdir) && tools/ck-copyright-notice
cd $(srcdir) && tools/ck-news
cd $(srcdir) && tools/ck-clz_tab
+ $(srcdir)/tools/ck-mparam
cd $(srcdir)/doc && ./check-typography
# Check that MPFR does not use GMP internal symbols. Of course, do not run
diff --git a/Build/source/libs/mpfr/mpfr-src/NEWS b/Build/source/libs/mpfr/mpfr-src/NEWS
index 7dcf5996d58..b3060ce47f1 100644
--- a/Build/source/libs/mpfr/mpfr-src/NEWS
+++ b/Build/source/libs/mpfr/mpfr-src/NEWS
@@ -1,4 +1,4 @@
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,26 +20,47 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
##############################################################################
-Changes from version 4.0.1 to version 4.0.2:
-- Corrected minimal GMP version in the INSTALL file and the MPFR manual.
+Changes from versions 4.0.* to version 4.1.0:
+- The "épinards à la crème" release.
+- Binary compatible with MPFR 4.0.*, though some minor changes in the
+ behavior of the formatted output functions may be visible, regarded
+ as underspecified behavior or bug fixes (see below).
+- New --enable-formally-proven-code configure option, to use (when available)
+ formally proven code.
+- Improved __GMP_CC and __GMP_CFLAGS retrieval (in particular for MS Windows).
- Option -pedantic is now always removed from __GMP_CFLAGS (see INSTALL).
+- Changed __float128 to the type _Float128 specified in ISO/IEC TS 18661.
+ __float128 is used as a fallback if _Float128 is not supported.
+- New function mpfr_get_str_ndigits about conversion to a string of digits.
+- New function mpfr_dot for the dot product (incomplete, experimental).
+- New functions mpfr_get_decimal128 and mpfr_set_decimal128 (available only
+ when MPFR has been built with decimal float support).
+- New function mpfr_cmpabs_ui.
+- New function mpfr_total_order_p for the IEEE 754 totalOrder predicate.
+- The mpfr_out_str function now accepts bases from -2 to -36, in order to
+ follow mpfr_get_str and GMP's mpf_out_str functions (these cases gave an
+ assertion failure, as with other invalid bases).
- Shared caches: cleanup; really detect lock failures (abort in this case).
-- Improved MPFR manual. In particular, corrected/completed the
- mpfr_get_str description in order to follow the historical behavior
- and GMP's mpf_get_str function.
-- Bug fixes (see ChangeLog file).
-
-Changes from version 4.0.0 to version 4.0.1:
-- Improved MPFR manual.
-- Improved __GMP_CC and __GMP_CFLAGS retrieval (in particular for MS Windows).
-- Fixed a build failure on some platforms when --with-gmp-build is used.
-- Bug fixes (see ChangeLog file), in particular in mpfr_div_ui, which
- could yield an incorrectly rounded result to nearest when using
- different precisions; this bug had been present since the introduction
- of mpfr_div_ui, and in MPFR 4.0.0, it was affecting mpfr_div too.
+- The behavior of the formatted output functions (mpfr_printf, etc.) with
+ an empty precision field has improved: trailing zeros are kept in a way
+ similar to the formatted output functions from C.
+- Improved mpfr_add and mpfr_sub when all operands have a precision equal to
+ twice the number of bits per word, e.g., 128 bits on a 64-bit platform.
+- Optimized the tuning parameters for various architectures.
+- Improved test coverage to 98.6% of code for x86_64.
+- Bug fixes.
+- MPFR manual: corrected/completed the mpfr_get_str description in order to
+ follow the historical behavior and GMP's mpf_get_str function.
- New: optional "make check-exported-symbols", mainly for the MPFR developers
and binary distributions, to check that MPFR does not define symbols with a
GMP reserved prefix (experimental).
+- Mini-gmp support: replaced --enable-mini-gmp configure option by
+ --with-mini-gmp (still experimental, read doc/mini-gmp).
+- A GCC bug on Sparc (present at least in old GCC 4.5.3 and 5.5.0 versions),
+ which made several tests fail when TLS was enabled, is now avoided in the
+ tests. The MPFR library itself was not affected and normal code using the
+ MPFR library should not be affected either. Users and distributions that
+ disabled TLS just because of the test failures can safely re-enable it.
Changes from versions 3.1.* to version 4.0.0:
- The "dinde aux marrons" release.
@@ -136,7 +157,7 @@ Changes from versions 3.1.* to version 4.0.0:
- Bug fixes. In particular: a speed improvement when the --enable-assert
or --enable-assert=full configure option is used with GCC; mpfr_get_str
now sets the NaN flag on NaN input and the inexact flag when the conversion
- is inexact. For a full list, see http://www.mpfr.org/mpfr-3.1.6/#fixed
+ is inexact. For a full list, see https://www.mpfr.org/mpfr-3.1.6/#fixed
and the same section for any previous 3.1.x version (follow the links
in the "Changes..." sections).
- Microsoft Windows: Added support for thread-safe DLL (shared library).
@@ -428,4 +449,4 @@ Changes from version 0.4 to version 1.0:
which is called mp_rnd_t.
You'll find other news concerning the GNU MPFR library on the web
-page <http://www.mpfr.org/>.
+page <https://www.mpfr.org/>.
diff --git a/Build/source/libs/mpfr/mpfr-src/README b/Build/source/libs/mpfr/mpfr-src/README
index 99cb7f2dec8..689e3c69d31 100644
--- a/Build/source/libs/mpfr/mpfr-src/README
+++ b/Build/source/libs/mpfr/mpfr-src/README
@@ -1,4 +1,4 @@
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -63,6 +63,16 @@ For any copyright year range specified as YYYY-ZZZZ in this package,
note that the range specifies every single year in that closed interval.
+Official GNU MPFR website:
+
+ https://www.mpfr.org/
+
+
+NOTE: At the time of the release 4.1.0, the MPFR repository is hosted at
+InriaForge, but it will need to migrate since InriaForge will shut down in
+December 2020. Please go to https://www.mpfr.org/ for the current status.
+What follows remains valid until the migration is done.
+
You can get the latest source code by Subversion at InriaForge:
svn checkout svn://scm.gforge.inria.fr/svn/mpfr/trunk mpfr
diff --git a/Build/source/libs/mpfr/mpfr-src/TODO b/Build/source/libs/mpfr/mpfr-src/TODO
index 9896c1fc645..684a442533d 100644
--- a/Build/source/libs/mpfr/mpfr-src/TODO
+++ b/Build/source/libs/mpfr/mpfr-src/TODO
@@ -1,4 +1,4 @@
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -37,20 +37,8 @@ Table of contents:
2. Compiler/library detection
##############################################################################
-- if we want to distinguish GMP and MPIR, we can check at configure time
- the following symbols which are only defined in MPIR:
-
- #define __MPIR_VERSION 0
- #define __MPIR_VERSION_MINOR 9
- #define __MPIR_VERSION_PATCHLEVEL 0
-
- There is also a library symbol mpir_version, which should match VERSION, set
- by configure, for example 0.9.0.
-
- update ICC detection.
* Use only __INTEL_COMPILER instead of the obsolete macro __ICC?
- * Possibly enable some features with ICC. For instance, removing
- "&& !defined(__ICC)" from src/mpfr.h works with ICC 15.0.0 20140723.
##############################################################################
3. Changes in existing functions
@@ -117,6 +105,8 @@ Table of contents:
4. New functions to implement
##############################################################################
+- a function to compute the hash of a floating-point number
+ (suggested by Patrick Pelissier)
- implement new functions from the C++17 standard:
http://en.cppreference.com/w/cpp/numeric/special_math
assoc_laguerre, assoc_legendre, comp_ellint_1, comp_ellint_2, comp_ellint_3,
@@ -127,15 +117,6 @@ Table of contents:
See also https://isocpp.org/files/papers/P0226R1.pdf and §29.9.5 in the
C++17 draft:
https://github.com/cplusplus/draft/blob/master/source/numerics.tex
-- implement mpfr_get_decimal128 and mpfr_set_decimal128
-- implement mpfr_log_ui to compute log(n) for an unsigned long n.
- We can write for argument reduction n = 2^k * n/2^k, where
- 2/3 <= n/2^k < 4/3, i.e., k = floor(log2(3n))-1, thus
- log(n) = k*log(2) + log(n/2^k), and we can use binary splitting on the
- Taylor expansion of log(1+x) to compute log(n/2^k), where at most
- p*log(2)/log(3) terms are needed for precision p.
- Other idea (from Fredrik Johansson): compute log(m) + log(n/m) where
- m=2^a*3^b*5^c*7^d and m is close to n.
- implement mpfr_q_sub, mpfr_z_div, mpfr_q_div?
- implement mpfr_pow_q and variants with two integers (native or mpz)
instead of a rational? See IEEE P1788.
@@ -294,6 +275,80 @@ Table of contents:
- asec, acsc, acot, asech, acsch and acoth (mail from Björn Terelius on mpfr
list, 18 June 2009)
+- function to reduce the precision of a variable, with a ternary value in
+ input, i.e. taking care of double rounding. Two possible forms: like
+ mpfr_set (i.e. with input and output) or like mpfr_prec_round (i.e. with
+ a single variable). mpfr_subnormalize and mpfr_round_nearest_away_end
+ could use it.
+
+- UBF functions for +, -, *, fmma, /, sqrt.
+ Support UBF in mpfr_check_range or add mpfr_ubf_check_range?
+ Make this available in the API, e.g. for MPC.
+
+- mpfr_cmp_uj and mpfr_cmp_sj. They would be useful to test MPFR with
+ _MPFR_EXP_FORMAT=4.
+
+- base conversion with the round-trip property using a minimal precision,
+ such as the to_chars functions from the C++ standard:
+
+ The functions [...] ensure that the string representation consists
+ of the smallest number of characters such that there is at least
+ one digit before the radix point (if present) and parsing the
+ representation using the corresponding from_chars function
+ recovers value exactly. [Note: This guarantee applies only if
+ to_chars and from_chars are executed on the same implementation.
+ — end note] If there are several such representations, the
+ representation with the smallest difference from the
+ floating-point argument value is chosen, resolving any remaining
+ ties using rounding according to round_to_nearest.
+
+ Text from: https://www.zsh.org/mla/workers/2019/msg01138.html
+
+- Serialization / Deserialization. Suggested by Frédéric Pétrot:
+ https://sympa.inria.fr/sympa/arc/mpfr/2020-02/msg00006.html
+ like mpfr_fpif_{import,export}, but with memory instead of file.
+
+ Idea of implementation to reuse most of the code and change very little:
+
+ Instead of passing a FILE *fh, pass a struct ext_data *h, and instead of
+ using fread and fwrite, use
+ h->read (h, buffer, size)
+ h->write (h, buffer, size)
+ respectively.
+
+ The struct ext_data structure could contain the following fields:
+ * read: pointer to a wrapper function for the read method.
+ * write: pointer to a wrapper function for the write method.
+ * FILE *fh: to be used for operations with files.
+ * unsigned char *arena: to be used for operations with memory.
+
+ The wrapper functions for the read method could be:
+
+ static int
+ read_from_file (struct ext_data *h, unsigned char *buffer, size_t size)
+ {
+ return fread (buffer, size, 1, h->fh) != 1;
+ }
+
+ static int
+ read_from_memory (struct ext_data *h, unsigned char *buffer, size_t size)
+ {
+ if (h->arena == NULL)
+ return 1;
+ memcpy (buffer, h->arena, size);
+ h->arena += size;
+ return 0;
+ }
+
+ So I expect very few changes in the existing code:
+ * Write a few wrapper functions.
+ * Rename mpfr_fpif_export to mpfr_fpif_export_aux and
+ mpfr_fpif_import to mpfr_fpif_import_aux.
+ * In the existing functions, replace FILE *fh, and fread/fwrite
+ calls as mentioned above.
+ * Add new mpfr_fpif_export, mpfr_fpif_import, mpfr_fpif_export_mem,
+ mpfr_fpif_import_mem.
+
##############################################################################
5. Efficiency
##############################################################################
@@ -306,9 +361,6 @@ Table of contents:
using recursive instead of iterative binary splitting:
https://github.com/fredrik-johansson/arb/blob/master/elefun/exp_sum_bs_powtab.c
- improve mpfr_grandom using the algorithm in http://arxiv.org/abs/1303.6257
-- use the src/x86_64/corei5/mparam.h file once GMP recognizes correctly the
- Core i5 processors (note that gcc -mtune=native gives __tune_corei7__
- and not __tune_corei5__ on those processors)
- implement a mpfr_sqrthigh algorithm based on Mulders' algorithm, with a
basecase variant
- use mpn_div_q to speed up mpfr_div. However mpn_div_q, which is new in
@@ -450,17 +502,6 @@ Table of contents:
option (but this does not affect the C library, which may or may not
accept signaling NaNs).
-- check again coverage: on 2007-07-27, Patrick Pelissier reports that the
- following files are not tested at 100%: add1.c, atan.c, atan2.c,
- cache.c, cmp2.c, const_catalan.c, const_euler.c, const_log2.c, cos.c,
- gen_inverse.h, div_ui.c, eint.c, exp3.c, exp_2.c, expm1.c, fma.c, fms.c,
- lngamma.c, gamma.c, get_d.c, get_f.c, get_ld.c, get_str.c, get_z.c,
- inp_str.c, jn.c, jyn_asympt.c, lngamma.c, mpfr-gmp.c, mul.c, mul_ui.c,
- mulders.c, out_str.c, pow.c, print_raw.c, rint.c, root.c, round_near_x.c,
- round_raw_generic.c, set_d.c, set_ld.c, set_q.c, set_uj.c, set_z.c, sin.c,
- sin_cos.c, sinh.c, sqr.c, stack_interface.c, sub1.c, sub1sp.c, subnormal.c,
- uceil_exp2.c, uceil_log2.c, ui_pow_ui.c, urandomb.c, yn.c, zeta.c, zeta_ui.c.
-
- check the constants mpfr_set_emin (-16382-63) and mpfr_set_emax (16383) in
get_ld.c and the other constants, and provide a testcase for large and
small numbers.
@@ -494,24 +535,6 @@ Table of contents:
* In debug mode, MPFR would check that the result is exact
(i.e. that the ternary value is 0).
-- new "rounding mode" MPFR_RNDF (faithful rounding)?
- This is not really a rounding mode since it is non-deterministic. The
- goal is to avoid the Table Maker's Dilemma in internal computations.
- The definition of faithful rounding of a real number x is: return either
- RNDD(x) or RNDU(x). This means that if x is exactly representable, one
- returns x exactly. In MPFR, the ternary value should be unspecified for
- efficiency reasons.
- Note: One typically implements faithful rounding by computing an
- approximation to the result with some adequately chosen error bound,
- then by rounding this approximation to nearest.
- Concerning the choice of the error bound, if the result x is equal to
- 1 + t, where t is a very small positive number, then the error bound
- needs to be at most ulp(x)/4 + t. Since t can be arbitrarily small,
- the error bound needs to be at most ulp(x)/4. And this error bound
- is sufficient in all cases. Note that with the even rounding rule or
- rounding away from zero, it is not needed to relax the condition when
- x is exactly representable.
-
- add tests of the ternary value for constants
- When doing Extensive Check (--enable-assert=full), since all the
@@ -630,15 +653,6 @@ Table of contents:
that is, with a large error during the computation of the secondary term
(when the TMD occurs).
-- add internal or public variants of some basic functions (+, -, *) with
- mpz_t as the exponent for correctly rounded polynomials (like fmma),
- in order to avoid internal overflow and underflow in extreme cases?
- Alternatively, for fmma, modify add*.c and sub*.c code to define
- mpfr_add_raw, which takes arrays of limbs and their precision, and the
- positive exponent delta (as mpfr_uexp_t to be always representable).
- The exponent delta should be sufficient for now since it can be bounded
- by MPFR_PREC_MAX+1 if need be.
-
- use the keyword "static" in array indices of parameter declarations with
C99 compilers (6.7.5.3p7) when the pointer is expected not to be null?
For instance, if mpfr.h is changed to have:
@@ -674,6 +688,12 @@ Table of contents:
constants) because we do not have the control of memory allocation for
mpz_init.
+- use GCC's nonnull attribute (available since GCC 4.0) where applicable.
+
+- avoid the use of MPFR_MANT(x) as an lvalue; use other (more high level)
+ internal macros if possible, such as MPFR_TMP_INIT1, MPFR_TMP_INIT and
+ MPFR_ALIAS.
+
##############################################################################
7. Portability
@@ -689,4 +709,17 @@ Table of contents:
- use https://gcc.gnu.org/viewcvs/gcc/trunk/config/stdint.m4 for mpfr-gmp.h
-- with MinGW, build with -D__USE_MINGW_ANSI_STDIO by default?
+- By default, GNU Automake adds -I options to local directories, with
+ the side effect that these directories have the precedence to search
+ for system headers (#include <...>). This may make the build fail if
+ a C implementation includes a file that has the same name as one used
+ in such a directory.
+ For instance, if one adds an empty file "src/bits/types.h", then the
+ MPFR build fails under Linux because /usr/include/stdio.h has
+ #include <bits/types.h>
+ Possible workaround:
+ * disable the default -I options with nostdinc as documented in
+ the Automake manual;
+ * have a rule that copies the needed files ("mpfr.h" or they should
+ be prefixed with "mpfr-") to $(top_builddir)/include;
+ * use "-I$(top_builddir)/include".
diff --git a/Build/source/libs/mpfr/mpfr-src/VERSION b/Build/source/libs/mpfr/mpfr-src/VERSION
index 4d54daddb61..ee74734aa22 100644
--- a/Build/source/libs/mpfr/mpfr-src/VERSION
+++ b/Build/source/libs/mpfr/mpfr-src/VERSION
@@ -1 +1 @@
-4.0.2
+4.1.0
diff --git a/Build/source/libs/mpfr/mpfr-src/acinclude.m4 b/Build/source/libs/mpfr/mpfr-src/acinclude.m4
index 02a11973c66..5e58d476cd0 100644
--- a/Build/source/libs/mpfr/mpfr-src/acinclude.m4
+++ b/Build/source/libs/mpfr/mpfr-src/acinclude.m4
@@ -1,6 +1,6 @@
dnl MPFR specific autoconf macros
-dnl Copyright 2000, 2002-2019 Free Software Foundation, Inc.
+dnl Copyright 2000, 2002-2020 Free Software Foundation, Inc.
dnl Contributed by the AriC and Caramba projects, INRIA.
dnl
dnl This file is part of the GNU MPFR Library.
@@ -27,8 +27,7 @@ dnl If you change the required version, please update README.dev too!
AC_PREREQ(2.60)
dnl ------------------------------------------------------------
-dnl You must put in MPFR_CONFIGS everything which configure MPFR
-dnl except:
+dnl You must put in MPFR_CONFIGS everything that configures MPFR except:
dnl - Everything dealing with CC and CFLAGS in particular the ABI
dnl but the IEEE-754 specific flags must be set here.
dnl - Tests that depend on gmp.h (see MPFR_CHECK_DBL2INT_BUG as an example:
@@ -129,6 +128,9 @@ AC_CHECK_MEMBERS([struct lconv.decimal_point, struct lconv.thousands_sep],,,
dnl Check how to get `alloca'
AC_FUNC_ALLOCA
+dnl Define uintptr_t if not available.
+AC_TYPE_UINTPTR_T
+
dnl va_copy macro
AC_MSG_CHECKING([how to copy va_list])
AC_LINK_IFELSE([AC_LANG_PROGRAM([[
@@ -147,22 +149,21 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
]])], [AC_DEFINE([HAVE___VA_COPY]) AC_MSG_RESULT([__va_copy])],
[AC_MSG_RESULT([memcpy])])])
-dnl FIXME: The functions memmove, memset and strtol are really needed by
-dnl MPFR, but if they are implemented as macros, this is also OK (in our
-dnl case). So, we do not return an error, but their tests are currently
-dnl useless.
-dnl Moreover, for memmove and memset, when gcc -Werror is used, these
-dnl functions are considered to be missing because of a "conflicting
-dnl types for built-in function" error. Possible workarounds if the
-dnl results of this test are used (thus one doesn't want an error):
-dnl * If "$GCC" is set, disable built-ins by adding -fno-builtin
-dnl to $CFLAGS for this test (this would yield a failure if such
-dnl functions are defined only as built-ins, but does this occur
-dnl in practice?).
-dnl * Enable -Werror only for the main compilation (and possibly
-dnl some particular tests) via a new configure option.
-dnl gettimeofday is not defined for MinGW
-AC_CHECK_FUNCS([memmove memset setlocale strtol gettimeofday signal])
+dnl Options like -Werror can yield a failure as AC_CHECK_FUNCS uses some
+dnl fixed prototype for function detection, generally incompatible with
+dnl the standard one. For instance, with GCC, if the function is defined
+dnl as a builtin, one can get a "conflicting types for built-in function"
+dnl error [-Werror=builtin-declaration-mismatch], even though the header
+dnl is not included; when these functions were tested, this occurred with
+dnl memmove and memset. Even though no failures are known with the tested
+dnl functions at this time, let's remove options starting with "-Werror"
+dnl since failures may still be possible.
+dnl
+dnl The gettimeofday function is not defined with MinGW.
+saved_CFLAGS="$CFLAGS"
+CFLAGS=`[echo " $CFLAGS" | $SED 's/ -Werror[^ ]*//g']`
+AC_CHECK_FUNCS([setlocale gettimeofday signal])
+CFLAGS="$saved_CFLAGS"
dnl We cannot use AC_CHECK_FUNCS on sigaction, because while this
dnl function may be provided by the C library, its prototype and
@@ -190,7 +191,7 @@ AC_CHECK_TYPES([intmax_t])
if test "$ac_cv_type_intmax_t" = yes; then
AC_CACHE_CHECK([for working INTMAX_MAX], mpfr_cv_have_intmax_max, [
saved_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I$srcdir/src"
+ CPPFLAGS="$CPPFLAGS -I$srcdir/src -DMPFR_NEED_INTMAX_H"
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[[#include "mpfr-intmax.h"]],
[[intmax_t x = INTMAX_MAX; (void) x;]]
@@ -201,34 +202,6 @@ if test "$ac_cv_type_intmax_t" = yes; then
if test "$mpfr_cv_have_intmax_max" = "yes"; then
AC_DEFINE(MPFR_HAVE_INTMAX_MAX,1,[Define if you have a working INTMAX_MAX.])
fi
- AC_CACHE_CHECK([for working printf length modifier for intmax_t],
- mpfr_cv_printf_maxlm, [
- saved_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS -I$srcdir/src"
- for modifier in j ll l
- do
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-#include <stdio.h>
-#include <string.h>
-#include "mpfr-intmax.h"
-]],[[
- char s[64];
- sprintf (s, "%${modifier}d %${modifier}u",
- (intmax_t) -17, (uintmax_t) 42);
- return strcmp (s, "-17 42") != 0;
-]])],
- mpfr_cv_printf_maxlm=${modifier}; break,
- mpfr_cv_printf_maxlm=none,
-dnl We assume that j is working when cross-compiling.
- mpfr_cv_printf_maxlm=j; break
- )
- done
- CPPFLAGS="$saved_CPPFLAGS"
- ])
- if test "$mpfr_cv_printf_maxlm" != "none"; then
- AC_DEFINE_UNQUOTED([MPFR_PRINTF_MAXLM],["$mpfr_cv_printf_maxlm"],
- [Define to a working printf length modifier for intmax_t])
- fi
fi
AC_CHECK_TYPE( [union fpc_csr],
@@ -323,11 +296,17 @@ static double get_max (void) { static volatile double d = DBL_MAX; return d; }
fi
fi
-dnl Check if subnormal (denormalized) numbers are supported
+dnl Check if subnormal numbers are supported.
dnl for the binary64 format, the smallest normal number is 2^(-1022)
dnl for the binary32 format, the smallest normal number is 2^(-126)
+dnl Note: One could double-check with the value of the macros
+dnl DBL_HAS_SUBNORM and FLT_HAS_SUBNORM, when defined (C2x), but
+dnl neither tests would be reliable on implementations with partial
+dnl subnormal support. Anyway, this check is useful only for the
+dnl tests. Thus in doubt, assume that subnormals are not supported,
+dnl in order to disable the corresponding tests (which could fail).
AC_CACHE_CHECK([for subnormal double-precision numbers],
-mpfr_cv_have_denorms, [
+mpfr_cv_have_subnorm_dbl, [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
int main (void) {
@@ -336,15 +315,16 @@ int main (void) {
return 2.0 * (double) (x / 2.0) != x;
}
]])],
- [mpfr_cv_have_denorms="yes"],
- [mpfr_cv_have_denorms="no"],
- [mpfr_cv_have_denorms="cannot test, assume no"])
+ [mpfr_cv_have_subnorm_dbl="yes"],
+ [mpfr_cv_have_subnorm_dbl="no"],
+ [mpfr_cv_have_subnorm_dbl="cannot test, assume no"])
])
-if test "$mpfr_cv_have_denorms" = "yes"; then
- AC_DEFINE(HAVE_DENORMS,1,[Define if subnormal (denormalized) doubles work.])
+if test "$mpfr_cv_have_subnorm_dbl" = "yes"; then
+ AC_DEFINE(HAVE_SUBNORM_DBL, 1,
+ [Define if the double type fully supports subnormals.])
fi
AC_CACHE_CHECK([for subnormal single-precision numbers],
-mpfr_cv_have_denorms_flt, [
+mpfr_cv_have_subnorm_flt, [
AC_RUN_IFELSE([AC_LANG_SOURCE([[
#include <stdio.h>
int main (void) {
@@ -353,13 +333,13 @@ int main (void) {
return 2.0 * (float) (x / 2.0) != x;
}
]])],
- [mpfr_cv_have_denorms_flt="yes"],
- [mpfr_cv_have_denorms_flt="no"],
- [mpfr_cv_have_denorms_flt="cannot test, assume no"])
+ [mpfr_cv_have_subnorm_flt="yes"],
+ [mpfr_cv_have_subnorm_flt="no"],
+ [mpfr_cv_have_subnorm_flt="cannot test, assume no"])
])
-if test "$mpfr_cv_have_denorms_flt" = "yes"; then
- AC_DEFINE(HAVE_DENORMS_FLT,1,
- [Define if subnormal (denormalized) floats work.])
+if test "$mpfr_cv_have_subnorm_flt" = "yes"; then
+ AC_DEFINE(HAVE_SUBNORM_FLT, 1,
+ [Define if the float type fully supports subnormals.])
fi
dnl Check if signed zeros are supported. Note: the test will fail
@@ -438,12 +418,14 @@ if test "$mpfr_cv_nanisnan" = "yes"; then
AC_MSG_WARN([platform and/or document the behavior.])
fi
-dnl Check if the chars '0' to '9' are consecutive values
+dnl Check if the chars '0' to '9', 'a' to 'z', and 'A' to 'Z' are
+dnl consecutive values.
+dnl The const is necessary with GCC's "-Wwrite-strings -Werror".
AC_MSG_CHECKING([if charset has consecutive values])
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-char *number = "0123456789";
-char *lower = "abcdefghijklmnopqrstuvwxyz";
-char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+const char *number = "0123456789";
+const char *lower = "abcdefghijklmnopqrstuvwxyz";
+const char *upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
]],[[
int i;
unsigned char *p;
@@ -543,8 +525,61 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
LIBS="$saved_LIBS"
-dnl Now try to check the long double format
-MPFR_C_LONG_DOUBLE_FORMAT
+dnl Try to determine the format of double
+MPFR_C_REALFP_FORMAT(double,)
+case $mpfr_cv_c_double_format in
+ "IEEE double, big endian"*)
+ AC_DEFINE(HAVE_DOUBLE_IEEE_BIG_ENDIAN, 1)
+ ;;
+ "IEEE double, little endian"*)
+ AC_DEFINE(HAVE_DOUBLE_IEEE_LITTLE_ENDIAN, 1)
+ ;;
+ unknown*)
+ ;;
+ *)
+ AC_MSG_WARN([format of `double' unsupported or not recognized: $mpfr_cv_c_double_format])
+ ;;
+esac
+
+dnl Now try to determine the format of long double
+MPFR_C_REALFP_FORMAT(long double,L)
+case $mpfr_cv_c_long_double_format in
+ "IEEE double, big endian"*)
+ AC_DEFINE(HAVE_LDOUBLE_IS_DOUBLE, 1)
+ ;;
+ "IEEE double, little endian"*)
+ AC_DEFINE(HAVE_LDOUBLE_IS_DOUBLE, 1)
+ ;;
+ "IEEE extended, little endian"*)
+ AC_DEFINE(HAVE_LDOUBLE_IEEE_EXT_LITTLE, 1)
+ ;;
+ "IEEE extended, big endian"*)
+ AC_DEFINE(HAVE_LDOUBLE_IEEE_EXT_BIG, 1)
+ ;;
+ "IEEE quad, big endian"*)
+ AC_DEFINE(HAVE_LDOUBLE_IEEE_QUAD_BIG, 1)
+ ;;
+ "IEEE quad, little endian"*)
+ AC_DEFINE(HAVE_LDOUBLE_IEEE_QUAD_LITTLE, 1)
+ ;;
+ "possibly double-double, big endian"*)
+ AC_MSG_WARN([This format is known on GCC/PowerPC platforms,])
+ AC_MSG_WARN([but due to GCC PR26374, we can't test further.])
+ AC_MSG_WARN([You can safely ignore this warning, though.])
+ AC_DEFINE(HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE, 1)
+ ;;
+ "possibly double-double, little endian"*)
+ AC_MSG_WARN([This format is known on GCC/PowerPC platforms,])
+ AC_MSG_WARN([but due to GCC PR26374, we can't test further.])
+ AC_MSG_WARN([You can safely ignore this warning, though.])
+ AC_DEFINE(HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE, 1)
+ ;;
+ unknown*)
+ ;;
+ *)
+ AC_MSG_WARN([format of `long double' unsupported or not recognized: $mpfr_cv_c_long_double_format])
+ ;;
+esac
dnl Check if thread-local variables are supported.
dnl At least two problems can occur in practice:
@@ -613,11 +648,23 @@ then
fi
fi
+if test "$enable_decimal_float" != no; then
+
dnl Check if decimal floats are available.
dnl For the different cases, we try to use values that will not be returned
dnl by build tools. For instance, 1 must not be used as it can be returned
-dnl by ld in case of link failure.
-if test "$enable_decimal_float" != no; then
+dnl by gcc or by ld in case of link failure.
+dnl Note: We currently reread the 64-bit data memory as a double and compare
+dnl it with constants. However, if there is any issue with double, such as
+dnl the use of an extended precision, this may fail. Possible solutions:
+dnl 1. Use the hex format for the double constants (this format should be
+dnl supported if _Decimal64 is).
+dnl 2. Use more precision in the double constants (more decimal digits),
+dnl just in case.
+dnl 3. Use uint64_t (or unsigned long long, though this type might not be
+dnl on 64 bits) instead of or in addition to the test on double.
+dnl 4. Use an array of 8 unsigned char's instead of or in addition to the
+dnl test on double, considering the 2 practical cases of endianness.
AC_MSG_CHECKING(if compiler knows _Decimal64)
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[_Decimal64 x;]])],
@@ -637,38 +684,113 @@ return y.d == 0.14894469406741037E-123 ? 80 :
[d64_exit_status=$?
case "$d64_exit_status" in
80) AC_MSG_RESULT(DPD)
- AC_DEFINE([DPD_FORMAT],1,[DPD format])
- AC_DEFINE([MPFR_WANT_DECIMAL_FLOATS],1,
- [Build decimal float functions]) ;;
- 81) AC_MSG_RESULT(BID)
- AC_DEFINE([MPFR_WANT_DECIMAL_FLOATS],1,
- [Build decimal float functions]) ;;
- 82) AC_MSG_RESULT(neither DPD nor BID)
- if test "$enable_decimal_float" = yes; then
- AC_MSG_ERROR([unsupported decimal float format.
-Please build MPFR without --enable-decimal-float.])
+ if test "$enable_decimal_float" = bid; then
+ AC_MSG_ERROR([encoding mismatch (BID requested).])
+ fi
+ if test "$enable_decimal_float" != generic; then
+ enable_decimal_float=dpd
fi ;;
- *) AC_MSG_RESULT(unknown (exit status $d64_exit_status))
- if test "$enable_decimal_float" = yes; then
- AC_MSG_ERROR([internal or link error.
-Please build MPFR without --enable-decimal-float.])
+ 81) AC_MSG_RESULT(BID)
+ if test "$enable_decimal_float" = dpd; then
+ AC_MSG_ERROR([encoding mismatch (DPD requested).])
+ fi
+ if test "$enable_decimal_float" != generic; then
+ enable_decimal_float=bid
fi ;;
+ 82) AC_MSG_RESULT(neither DPD nor BID)
+ if test "$enable_decimal_float" = dpd; then
+ AC_MSG_ERROR([encoding mismatch (DPD requested).])
+ fi
+ if test "$enable_decimal_float" = bid; then
+ AC_MSG_ERROR([encoding mismatch (BID requested).])
+ fi
+ enable_decimal_float=generic
+ AC_MSG_WARN([The _Decimal64 encoding is non-standard or there was an])
+ AC_MSG_WARN([issue with its detection. The generic code will be used.])
+ AC_MSG_WARN([Please do not forget to test with `make check'.])
+ AC_MSG_WARN([In case of failure of a decimal test, you should rebuild])
+ AC_MSG_WARN([MPFR without --enable-decimal-float.]) ;;
+ *) AC_MSG_RESULT(error (exit status $d64_exit_status))
+ case "$enable_decimal_float" in
+ yes|bid|dpd|generic) AC_MSG_FAILURE([internal or link error.
+Please build MPFR without --enable-decimal-float.]) ;;
+ *) enable_decimal_float=no ;;
+ esac ;;
esac],
- [AC_MSG_RESULT(assuming DPD)
- AC_DEFINE([DPD_FORMAT],1,[])
- AC_DEFINE([MPFR_WANT_DECIMAL_FLOATS],1,
- [Build decimal float functions])])
- ],
+ [AC_MSG_RESULT(cannot test)
+ dnl Since the _Decimal64 type exists, we assume that it is correctly
+ dnl supported. The detection of the encoding may still be done at
+ dnl compile time. We do not add a configure test for it so that this
+ dnl can be done on platforms where configure cannot be used.
+ enable_decimal_float=compile-time])
+ ],
[AC_MSG_RESULT(no)
- if test "$enable_decimal_float" = yes; then
- AC_MSG_ERROR([compiler doesn't know _Decimal64 (ISO/IEC TR 24732).
-Please use another compiler or build MPFR without --enable-decimal-float.])
- fi])
+ case "$enable_decimal_float" in
+ yes|bid|dpd|generic)
+ AC_MSG_FAILURE([compiler doesn't know _Decimal64 (ISO/IEC TR 24732).
+Please use another compiler or build MPFR without --enable-decimal-float.]) ;;
+ *) enable_decimal_float=no ;;
+ esac])
+ if test "$enable_decimal_float" != no; then
+ AC_DEFINE([MPFR_WANT_DECIMAL_FLOATS],1,
+ [Build decimal float functions])
+ case "$enable_decimal_float" in
+ dpd) AC_DEFINE([DECIMAL_DPD_FORMAT],1,[]) ;;
+ bid) AC_DEFINE([DECIMAL_BID_FORMAT],1,[]) ;;
+ generic) AC_DEFINE([DECIMAL_GENERIC_CODE],1,[]) ;;
+ compile-time) ;;
+ *) AC_MSG_ERROR(internal error) ;;
+ esac
+ fi
+
+dnl Check the bit-field ordering for _Decimal128.
+dnl Little endian: sig=0 comb=49400 t0=0 t1=0 t2=0 t3=10
+dnl Big endian: sig=0 comb=8 t0=0 t1=0 t2=0 t3=570933248
+dnl Note: If the compilation fails, the compiler should exit with
+dnl an exit status less than 80.
+ AC_MSG_CHECKING(bit-field ordering for _Decimal128)
+ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+ ]], [[
+ union ieee_decimal128
+ {
+ struct
+ {
+ unsigned int t3:32;
+ unsigned int t2:32;
+ unsigned int t1:32;
+ unsigned int t0:14;
+ unsigned int comb:17;
+ unsigned int sig:1;
+ } s;
+ _Decimal128 d128;
+ } x;
+
+ x.d128 = 1.0dl;
+ if (x.s.sig == 0 && x.s.comb == 49400 &&
+ x.s.t0 == 0 && x.s.t1 == 0 && x.s.t2 == 0 && x.s.t3 == 10)
+ return 80; /* little endian */
+ else if (x.s.sig == 0 && x.s.comb == 8 &&
+ x.s.t0 == 0 && x.s.t1 == 0 && x.s.t2 == 0 && x.s.t3 == 570933248)
+ return 81; /* big endian */
+ else
+ return 82; /* unknown encoding */
+ ]])], [AC_MSG_RESULT(internal error)],
+ [d128_exit_status=$?
+ case "$d128_exit_status" in
+ 80) AC_MSG_RESULT(little endian)
+ AC_DEFINE([HAVE_DECIMAL128_IEEE_LITTLE_ENDIAN],1) ;;
+ 81) AC_MSG_RESULT(big endian)
+ AC_DEFINE([HAVE_DECIMAL128_IEEE_BIG_ENDIAN],1) ;;
+ *) AC_MSG_RESULT(unavailable or unknown) ;;
+ esac],
+ [AC_MSG_RESULT(cannot test)])
+
fi
+# End of decimal float checks
-dnl Check if __float128 is available. We also require the compiler
-dnl to support C99 constants (this prevents the __float128 support
-dnl with GCC's -std=c90, but who cares?).
+dnl Check if _Float128 or __float128 is available. We also require the
+dnl compiler to support hex constants with the f128 or q suffix (this
+dnl prevents the _Float128 support with GCC's -std=c90, but who cares?).
dnl Note: We use AC_LINK_IFELSE instead of AC_COMPILE_IFELSE since an
dnl error may occur only at link time, such as under NetBSD:
dnl https://mail-index.netbsd.org/pkgsrc-users/2018/02/02/msg026220.html
@@ -677,18 +799,33 @@ dnl By using volatile and making the exit code depend on the value of
dnl this variable, we also make sure that optimization doesn't make
dnl the "undefined reference" error disappear.
if test "$enable_float128" != no; then
- AC_MSG_CHECKING(if __float128 with hex constants is supported)
+ AC_MSG_CHECKING(if _Float128 with hex constants is supported)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
-volatile __float128 x = 0x1.fp+16383q;
+volatile _Float128 x = 0x1.fp+16383f128;
return x == 0;
]])],
[AC_MSG_RESULT(yes)
AC_DEFINE([MPFR_WANT_FLOAT128],1,[Build float128 functions])],
[AC_MSG_RESULT(no)
- if test "$enable_float128" = yes; then
- AC_MSG_ERROR([compiler doesn't know __float128 with C99 constants
+ AC_MSG_CHECKING(if __float128 can be used as a fallback)
+dnl Use the q suffix in this case.
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#define _Float128 __float128
+]], [[
+volatile _Float128 x = 0x1.fp+16383q;
+return x == 0;
+]])],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE([MPFR_WANT_FLOAT128],2,
+ [Build float128 functions with float128 fallback])
+ AC_DEFINE([_Float128],[__float128],[__float128 fallback])],
+ [AC_MSG_RESULT(no)
+ if test "$enable_float128" = yes; then
+ AC_MSG_ERROR(
+[compiler doesn't know _Float128 or __float128 with hex constants.
Please use another compiler or build MPFR without --enable-float128.])
fi])
+ ])
fi
dnl Check if Static Assertions are supported.
@@ -700,10 +837,8 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include "mpfr-sassert.h"
/* Test if Static Assertions work */
-MPFR_DECL_STATIC_ASSERT(sizeof(char) <= sizeof(int));
int main (void) {
- MPFR_DECL_STATIC_ASSERT(sizeof(int) <= sizeof(long));
int x;
(void) (x = 1); /* cast to void: avoid a warning, at least with GCC */
/* Test of the macro after a declaraction and a statement. */
@@ -715,8 +850,6 @@ int main (void) {
AC_DEFINE([MPFR_USE_STATIC_ASSERT],1,[Build MPFR with Static Assertions])
],
[AC_MSG_RESULT(no)
- ],
- [AC_MSG_RESULT([cannot test, assume no])
])
CPPFLAGS="$saved_CPPFLAGS"
@@ -724,6 +857,27 @@ if test "$enable_lto" = "yes" ; then
MPFR_LTO
fi
+dnl Logging support needs nested functions and the 'cleanup' attribute.
+dnl This is checked at the end because the change of CC and/or CFLAGS that
+dnl could occur before may have an influence on this test. The tested code
+dnl is very similar to what is used in MPFR (mpfr-impl.h).
+if test "$enable_logging" = yes; then
+AC_MSG_CHECKING(for nested functions and 'cleanup' attribute)
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+int main (void) {
+ auto void f_cleanup (int *p);
+ void f_cleanup (int *p) { int v = *p; (void) v; }
+ int v __attribute__ ((cleanup (f_cleanup)));
+ v = 0;
+ return 0;
+}
+ ]])],
+ [AC_MSG_RESULT(yes)],
+ [AC_MSG_RESULT(no)
+ AC_MSG_ERROR([logging support needs nested functions and the 'cleanup' attribute])
+ ])
+fi
+
])
dnl end of MPFR_CONFIGS
@@ -755,17 +909,17 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
if (GMP_NAIL_BITS != 0)
{
fprintf (stderr, "GMP_NAIL_BITS != 0\n");
- return 1;
+ return 81;
}
if (GMP_NUMB_BITS != mp_bits_per_limb)
{
fprintf (stderr, "GMP_NUMB_BITS != mp_bits_per_limb\n");
- return 2;
+ return 82;
}
if (GMP_NUMB_BITS != sizeof(mp_limb_t) * CHAR_BIT)
{
fprintf (stderr, "GMP_NUMB_BITS != sizeof(mp_limb_t) * CHAR_BIT\n");
- return 3;
+ return 83;
}
return 0;
]])], [mpfr_cv_check_gmp="yes"],
@@ -775,7 +929,7 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
case $mpfr_cv_check_gmp in
no*)
AC_MSG_ERROR([bad GMP library or header - ABI problem?
-See 'config.log' for details.])
+See 'config.log' for details.]) ;;
esac
])
@@ -784,9 +938,6 @@ dnl MPFR_CHECK_DBL2INT_BUG
dnl ----------------------
dnl Check for double-to-integer conversion bug
dnl https://gforge.inria.fr/tracker/index.php?func=detail&aid=14435
-dnl For the exit status, the lowest values (including some values after 128)
-dnl are reserved for various system errors. So, let's use the largest values
-dnl below 255 for errors in the test itself.
dnl The following problem has been seen under Solaris in config.log,
dnl i.e. the failure to link with libgmp wasn't detected in the first
dnl test:
@@ -809,6 +960,7 @@ AC_DEFUN([MPFR_CHECK_DBL2INT_BUG], [
AC_REQUIRE([MPFR_CONFIGS])dnl
AC_CACHE_CHECK([for double-to-integer conversion bug], mpfr_cv_dbl_int_bug, [
AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
#include <gmp.h>
]], [[
double d;
@@ -825,7 +977,11 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
break;
u = u >> 1;
}
- return (i == 0 && u == 1UL) ? 0 : 254 - i;
+ if (i == 0 && u == 1UL)
+ return 0;
+ fprintf (stderr, "Failure: i = %d, (unsigned long) u = %lu\n",
+ i, (unsigned long) u);
+ return 1;
]])], [mpfr_cv_dbl_int_bug="no"],
[mpfr_cv_dbl_int_bug="yes or failed to exec (exit status is $?)"],
[mpfr_cv_dbl_int_bug="cannot test, assume not present"])
@@ -833,36 +989,82 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM([[
case $mpfr_cv_dbl_int_bug in
yes*)
AC_MSG_ERROR([double-to-integer conversion is incorrect.
-You need to use another compiler (or lower the optimization level).])
+You need to use another compiler (or lower the optimization level).]) ;;
esac
])
dnl MPFR_CHECK_MP_LIMB_T_VS_LONG
dnl ----------------------------
-dnl Check that a long can fit in a mp_limb_t.
-dnl If so, it set the define MPFR_LONG_WITHIN_LIMB
+dnl Check whether a long fits in mp_limb_t.
+dnl If static assertions are not supported, one gets "no" even though a long
+dnl fits in mp_limb_t. Therefore, code without MPFR_LONG_WITHIN_LIMB defined
+dnl needs to be portable.
+dnl According to the GMP developers, a limb is always as large as a long,
+dnl except when __GMP_SHORT_LIMB is defined. It is currently never defined:
+dnl https://gmplib.org/list-archives/gmp-discuss/2018-February/006190.html
+dnl but it is not clear whether this could change in the future.
AC_DEFUN([MPFR_CHECK_MP_LIMB_T_VS_LONG], [
AC_REQUIRE([MPFR_CONFIGS])
AC_CACHE_CHECK([for long to fit in mp_limb_t], mpfr_cv_long_within_limb, [
saved_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -I$srcdir/src"
-AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+dnl AC_LINK_IFELSE is safer than AC_COMPILE_IFELSE, as it will detect
+dnl undefined function-like macros (which otherwise may be regarded
+dnl as valid function calls with AC_COMPILE_IFELSE since prototypes
+dnl are not required by the C standard).
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
#include <gmp.h>
+/* Make sure that a static assertion is used (not MPFR_ASSERTN). */
+#undef MPFR_USE_STATIC_ASSERT
+#define MPFR_USE_STATIC_ASSERT 1
#include "mpfr-sassert.h"
]], [[
MPFR_STAT_STATIC_ASSERT ((mp_limb_t) -1 >= (unsigned long) -1);
return 0;
]])], [mpfr_cv_long_within_limb="yes"],
- [mpfr_cv_long_within_limb="no"],
- [mpfr_cv_long_within_limb="cannot test, assume not present"])
+ [mpfr_cv_long_within_limb="no"])
])
case $mpfr_cv_long_within_limb in
yes*)
- AC_DEFINE([MPFR_LONG_WITHIN_LIMB],1,[long can be stored in mp_limb_t])
+ AC_DEFINE([MPFR_LONG_WITHIN_LIMB],1,[long can be stored in mp_limb_t]) ;;
esac
CPPFLAGS="$saved_CPPFLAGS"
])
+dnl MPFR_CHECK_MP_LIMB_T_VS_INTMAX
+dnl ------------------------------
+dnl Check that an intmax_t can fit in a mp_limb_t.
+AC_DEFUN([MPFR_CHECK_MP_LIMB_T_VS_INTMAX], [
+AC_REQUIRE([MPFR_CONFIGS])
+if test "$ac_cv_type_intmax_t" = yes; then
+AC_CACHE_CHECK([for intmax_t to fit in mp_limb_t], mpfr_cv_intmax_within_limb, [
+saved_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I$srcdir/src -DMPFR_NEED_INTMAX_H"
+dnl AC_LINK_IFELSE is safer than AC_COMPILE_IFELSE, as it will detect
+dnl undefined function-like macros (which otherwise may be regarded
+dnl as valid function calls with AC_COMPILE_IFELSE since prototypes
+dnl are not required by the C standard).
+AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+#include <gmp.h>
+/* Make sure that a static assertion is used (not MPFR_ASSERTN). */
+#undef MPFR_USE_STATIC_ASSERT
+#define MPFR_USE_STATIC_ASSERT 1
+#include "mpfr-sassert.h"
+#include "mpfr-intmax.h"
+]], [[
+ MPFR_STAT_STATIC_ASSERT ((mp_limb_t) -1 >= (uintmax_t) -1);
+ return 0;
+]])], [mpfr_cv_intmax_within_limb="yes"],
+ [mpfr_cv_intmax_within_limb="no"])
+])
+case $mpfr_cv_intmax_within_limb in
+yes*)
+ AC_DEFINE([MPFR_INTMAX_WITHIN_LIMB],1,[intmax_t can be stored in mp_limb_t]) ;;
+esac
+CPPFLAGS="$saved_CPPFLAGS"
+fi
+])
+
dnl MPFR_PARSE_DIRECTORY
dnl Input: $1 = a string to a relative or absolute directory
dnl Output: $2 = the variable to set with the absolute directory
@@ -903,54 +1105,55 @@ AC_DEFUN([MPFR_PARSE_DIRECTORY],
])
-dnl MPFR_C_LONG_DOUBLE_FORMAT
-dnl -------------------------
-dnl Determine the format of a long double.
-dnl
-dnl The object file is grepped, so as to work when cross compiling. A
-dnl start and end sequence is included to avoid false matches, and
-dnl allowance is made for the desired data crossing an "od -b" line
-dnl boundary. The test number is a small integer so it should appear
-dnl exactly, no rounding or truncation etc.
-dnl
-dnl "od -b" is supported even by Unix V7, and the awk script used doesn't
-dnl have functions or anything, so even an "old" awk should suffice.
+dnl MPFR_C_REALFP_FORMAT
+dnl --------------------
+dnl Determine the format of a real floating type (first argument),
+dnl actually either double or long double. The second argument is
+dnl the printf length modifier.
dnl
-dnl The 10-byte IEEE extended format is generally padded to either 12 or 16
-dnl bytes for alignment purposes. The SVR4 i386 ABI is 12 bytes, or i386
-dnl gcc -m128bit-long-double selects 16 bytes. IA-64 is 16 bytes in LP64
-dnl mode, or 12 bytes in ILP32 mode. The first 10 bytes is the relevant
-dnl part in all cases (big and little endian).
+dnl The object file is grepped, so as to work when cross-compiling.
+dnl Start and end sequences are included to avoid false matches, and
+dnl allowance is made for the desired data crossing an "od -b" line
+dnl boundary. The test number is a small integer so it should appear
+dnl exactly, without rounding or truncation, etc.
dnl
-dnl Enhancements:
+dnl "od -b" is supported even by Unix V7, and the awk script used doesn't
+dnl have functions or anything, so even an "old" awk should suffice.
dnl
-dnl Could match more formats, but no need to worry until there's code
-dnl wanting to use them.
+dnl Concerning long double: The 10-byte IEEE extended format is generally
+dnl padded with null bytes to either 12 or 16 bytes for alignment purposes.
+dnl The SVR4 i386 ABI is 12 bytes, or i386 gcc -m128bit-long-double selects
+dnl 16 bytes. IA-64 is 16 bytes in LP64 mode, or 12 bytes in ILP32 mode.
+dnl The relevant part in all cases (big and little endian) consists of the
+dnl first 10 bytes.
dnl
-dnl Don't want to duplicate the double matching from GMP_C_DOUBLE_FORMAT,
-dnl perhaps we should merge with that macro, to match data formats
-dnl irrespective of the C type in question. Or perhaps just let the code
-dnl use DOUBLE macros when sizeof(double)==sizeof(long double).
-
-AC_DEFUN([MPFR_C_LONG_DOUBLE_FORMAT],
+dnl We compile and link (with "-o conftest$EXEEXT") instead of just
+dnl compiling (with "-c"), so that this test works with GCC's and
+dnl clang's LTO (-flto). If we just compile with LTO, the generated
+dnl object file does not contain the structure as is. This new test
+dnl is inspired by the one used by GMP for the double type:
+dnl https://gmplib.org/repo/gmp/rev/33eb0998a052
+dnl https://gmplib.org/repo/gmp/rev/cbc6dbf95a10
+dnl "$EXEEXT" had to be added, otherwise the test was failing on
+dnl MS-Windows (see Autoconf manual).
+
+AC_DEFUN([MPFR_C_REALFP_FORMAT],
[AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_AWK])
AC_REQUIRE([AC_OBJEXT])
-AC_CHECK_TYPES([long double])
-AC_CACHE_CHECK([format of `long double' floating point],
- mpfr_cv_c_long_double_format,
-[mpfr_cv_c_long_double_format=unknown
-if test "$ac_cv_type_long_double" != yes; then
- mpfr_cv_c_long_double_format="not available"
-else
- cat >conftest.c <<\EOF
+AS_VAR_PUSHDEF([my_Type_var], [mpfr_cv_c_$1_format])dnl
+AC_CACHE_CHECK([format of floating-point type `$1'],
+ my_Type_var,
+[my_Type_var=unknown
+ cat >conftest.c <<\EOF
[
+#include <stdio.h>
/* "before" is 16 bytes to ensure there's no padding between it and "x".
- We're not expecting any "long double" bigger than 16 bytes or with
+ We're not expecting any type bigger than 16 bytes or with
alignment requirements stricter than 16 bytes. */
typedef struct {
char before[16];
- long double x;
+ $1 x;
char after[8];
} foo_t;
@@ -960,11 +1163,18 @@ foo_t foo = {
-123456789.0,
{ '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' }
};
+
+int main (void) {
+ int i;
+ for (i = 0; i < 8; i++)
+ printf ("%d %$2f\n", foo.before[i] + foo.after[i], foo.x);
+ return 0;
+}
]
EOF
- mpfr_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >&AS_MESSAGE_LOG_FD 2>&1"
- if AC_TRY_EVAL(mpfr_compile); then
- cat >conftest.awk <<\EOF
+ mpfr_compile="$CC $CFLAGS $CPPFLAGS $LDFLAGS conftest.c -o conftest$EXEEXT >&AS_MESSAGE_LOG_FD 2>&1"
+ if AC_TRY_EVAL(mpfr_compile); then
+ cat >conftest.awk <<\EOF
[
BEGIN {
found = 0
@@ -1074,7 +1284,7 @@ BEGIN {
got[11] == "031" && \
got[10] == "300")
{
- print "IEEE extended, little endian"
+ print "IEEE extended, little endian (12 bytes)"
found = 1
exit
}
@@ -1093,7 +1303,7 @@ BEGIN {
got[08] == "000")
{
# format found on m68k
- print "IEEE extended, big endian"
+ print "IEEE extended, big endian (12 bytes)"
found = 1
exit
}
@@ -1137,7 +1347,7 @@ BEGIN {
got[15] == "031" && \
got[14] == "300")
{
- print "IEEE extended, little endian"
+ print "IEEE extended, little endian (16 bytes)"
found = 1
exit
}
@@ -1242,68 +1452,18 @@ END {
}
]
EOF
- mpfr_cv_c_long_double_format=`od -b conftest.$OBJEXT | $AWK -f conftest.awk`
- case $mpfr_cv_c_long_double_format in
- unknown*)
- echo "cannot match anything, conftest.$OBJEXT contains" >&AS_MESSAGE_LOG_FD
- od -b conftest.$OBJEXT >&AS_MESSAGE_LOG_FD
- ;;
- esac
- else
- AC_MSG_WARN([oops, cannot compile test program])
- fi
-fi
-rm -f conftest*
-])
-
-AH_VERBATIM([HAVE_LDOUBLE],
-[/* Define one of the following to 1 for the format of a `long double'.
- If your format is not among these choices, or you don't know what it is,
- then leave all undefined.
- IEEE_EXT is the 10-byte IEEE extended precision format.
- IEEE_QUAD is the 16-byte IEEE quadruple precision format.
- LITTLE or BIG is the endianness. */
-#undef HAVE_LDOUBLE_IEEE_EXT_LITTLE
-#undef HAVE_LDOUBLE_IEEE_QUAD_BIG])
-
-case $mpfr_cv_c_long_double_format in
- "IEEE double, big endian")
- AC_DEFINE(HAVE_LDOUBLE_IS_DOUBLE, 1)
- ;;
- "IEEE double, little endian")
- AC_DEFINE(HAVE_LDOUBLE_IS_DOUBLE, 1)
- ;;
- "IEEE extended, little endian")
- AC_DEFINE(HAVE_LDOUBLE_IEEE_EXT_LITTLE, 1)
- ;;
- "IEEE extended, big endian")
- AC_DEFINE(HAVE_LDOUBLE_IEEE_EXT_BIG, 1)
- ;;
- "IEEE quad, big endian")
- AC_DEFINE(HAVE_LDOUBLE_IEEE_QUAD_BIG, 1)
- ;;
- "IEEE quad, little endian")
- AC_DEFINE(HAVE_LDOUBLE_IEEE_QUAD_LITTLE, 1)
- ;;
- "possibly double-double, big endian")
- AC_MSG_WARN([This format is known on GCC/PowerPC platforms,])
- AC_MSG_WARN([but due to GCC PR26374, we can't test further.])
- AC_MSG_WARN([You can safely ignore this warning, though.])
- AC_DEFINE(HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE, 1)
- ;;
- "possibly double-double, little endian")
- AC_MSG_WARN([This format is known on GCC/PowerPC platforms,])
- AC_MSG_WARN([but due to GCC PR26374, we can't test further.])
- AC_MSG_WARN([You can safely ignore this warning, though.])
- AC_DEFINE(HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE, 1)
- ;;
- unknown* | "not available")
- ;;
- *)
- AC_MSG_WARN([unrecognized long double FP format: $mpfr_cv_c_long_double_format])
- ;;
-esac
-])
+ my_Type_var=`od -b conftest$EXEEXT | $AWK -f conftest.awk`
+ case $my_Type_var in
+ unknown*)
+ echo "cannot match anything, conftest$EXEEXT contains" >&AS_MESSAGE_LOG_FD
+ od -b conftest$EXEEXT >&AS_MESSAGE_LOG_FD
+ ;;
+ esac
+ else
+ AC_MSG_WARN([oops, cannot compile test program])
+ fi
+ rm -f conftest*
+])])
dnl MPFR_CHECK_LIBM
dnl ---------------
@@ -1390,7 +1550,7 @@ fi
dnl MPFR_FUNC_GMP_PRINTF_SPEC
dnl ------------------------------------
dnl MPFR_FUNC_GMP_PRINTF_SPEC(spec, type, [includes], [if-true], [if-false])
-dnl Check if gmp_sprintf supports the conversion specification 'spec'
+dnl Check if sprintf and gmp_sprintf support the conversion specifier 'spec'
dnl with type 'type'.
dnl Expand 'if-true' if printf supports 'spec', 'if-false' otherwise.
@@ -1405,8 +1565,19 @@ $3
char s[256];
$2 a = 17;
- if (gmp_sprintf (s, "(%0.0$1)(%d)", a, 42) == -1) return 1;
- return (strcmp (s, "(17)(42)") != 0);
+ /* Contrary to the gmp_sprintf test, do not use the 0 flag with the
+ precision, as -Werror=format yields an error, even though this
+ flag is allowed by the ISO C standard (it is just ignored).
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70813 */
+ if (sprintf (s, "(%.0$1)(%d)", a, 42) != 8 ||
+ strcmp (s, "(17)(42)") != 0)
+ return 1;
+
+ if (gmp_sprintf (s, "(%0.0$1)(%d)", a, 42) == -1 ||
+ strcmp (s, "(17)(42)") != 0)
+ return 1;
+
+ return 0;
]])],
[AC_MSG_RESULT(yes)
$4],
@@ -1433,24 +1604,24 @@ if test "$ac_cv_type_intmax_t" = yes; then
# include <stdint.h>
#endif
],,
- [AC_DEFINE([NPRINTF_J], 1, [gmp_printf cannot read intmax_t])])
+ [AC_DEFINE([NPRINTF_J], 1, [printf/gmp_printf cannot read intmax_t])])
fi
MPFR_FUNC_GMP_PRINTF_SPEC([hhd], [char], [
#include <gmp.h>
],,
- [AC_DEFINE([NPRINTF_HH], 1, [gmp_printf cannot use `hh' length modifier])])
+ [AC_DEFINE([NPRINTF_HH], 1, [printf/gmp_printf cannot use `hh' length modifier])])
MPFR_FUNC_GMP_PRINTF_SPEC([lld], [long long int], [
#include <gmp.h>
],,
- [AC_DEFINE([NPRINTF_LL], 1, [gmp_printf cannot read long long int])])
+ [AC_DEFINE([NPRINTF_LL], 1, [printf/gmp_printf cannot read long long int])])
MPFR_FUNC_GMP_PRINTF_SPEC([Lf], [long double], [
#include <gmp.h>
],
- [AC_DEFINE([PRINTF_L], 1, [gmp_printf can read long double])],
- [AC_DEFINE([NPRINTF_L], 1, [gmp_printf cannot read long double])])
+ [AC_DEFINE([PRINTF_L], 1, [printf/gmp_printf can read long double])],
+ [AC_DEFINE([NPRINTF_L], 1, [printf/gmp_printf cannot read long double])])
MPFR_FUNC_GMP_PRINTF_SPEC([td], [ptrdiff_t], [
#if defined (__cplusplus)
@@ -1460,8 +1631,8 @@ MPFR_FUNC_GMP_PRINTF_SPEC([td], [ptrdiff_t], [
#endif
#include <gmp.h>
],
- [AC_DEFINE([PRINTF_T], 1, [gmp_printf can read ptrdiff_t])],
- [AC_DEFINE([NPRINTF_T], 1, [gmp_printf cannot read ptrdiff_t])])
+ [AC_DEFINE([PRINTF_T], 1, [printf/gmp_printf can read ptrdiff_t])],
+ [AC_DEFINE([NPRINTF_T], 1, [printf/gmp_printf cannot read ptrdiff_t])])
])
dnl MPFR_CHECK_PRINTF_GROUPFLAG
diff --git a/Build/source/libs/mpfr/mpfr-src/configure.ac b/Build/source/libs/mpfr/mpfr-src/configure.ac
index 00df01cac85..ea92c1f9716 100644
--- a/Build/source/libs/mpfr/mpfr-src/configure.ac
+++ b/Build/source/libs/mpfr/mpfr-src/configure.ac
@@ -4,7 +4,7 @@ dnl WARNING! C code starting with # (preprocessor directives) must not
dnl be indented!
AC_COPYRIGHT([
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -26,26 +26,38 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
])
dnl Add check-news when it checks for more than 15 lines
-AC_INIT([MPFR],[4.0.2])
+AC_INIT([MPFR],[4.1.0])
dnl Older Automake versions than 1.13 may still be supported, but no longer
dnl tested, and many things have changed in 1.13. Moreover the INSTALL file
dnl and MPFR manual assume that MPFR has been built using Automake 1.13+
dnl (due to parallel tests, introduced by default in Automake 1.13).
-AM_INIT_AUTOMAKE([1.13 no-define dist-bzip2 dist-xz dist-zip])
+dnl The subdir-objects option is needed due to configuration related to
+dnl mini-gmp, which has sources in an external directory.
+AM_INIT_AUTOMAKE([1.13 no-define dist-bzip2 dist-xz dist-zip subdir-objects])
AM_MAINTAINER_MODE(enable)
AC_CONFIG_MACRO_DIR([m4])
-dnl FIXME: Several AC_RUN_IFELSE programs can return several values
-dnl (one for each format to be detected), but the Autoconf manual says:
-dnl "This exit status might be that of a failed compilation, or it might
-dnl be that of a failed program execution." Unfortunately, we cannot
-dnl know whether a non-zero exit status comes from a failed compilation,
-dnl so that the detection may be incorrect. To avoid this problem, write
-dnl a test program for each possible format? Alternatively, the test
-dnl program could output the result of the format detection to a file
-dnl and return with the 0 exit status if it could do that successfully.
+dnl Some AC_RUN_IFELSE programs need to be able to return several values
+dnl (e.g., in a format detection, one for each possible format). But the
+dnl Autoconf manual says: "This exit status might be that of a failed
+dnl compilation, or it might be that of a failed program execution."
+dnl Unfortunately, we cannot know whether a non-zero exit status comes
+dnl from a failed compilation, so that the detection may be incorrect.
+dnl Since failures generally occur with a small exit status, the value 77
+dnl is reserved for skipped tests by Autoconf, and values larger than 125
+dnl have special meanings in POSIX[*], good candidates for success are 0
+dnl and values from 80 to 125.
+dnl https://tldp.org/LDP/abs/html/exitcodes.html suggests the range 64-113
+dnl but note that /usr/include/sysexits.h now allocates previously unused
+dnl exit codes from 64 - 78 (for various kinds of errors).
+dnl
+dnl Alternatively, the test program could output the result to a file and
+dnl return with the 0 exit status if it could do that successfully.
+dnl
+dnl [*] 2.8.2 Exit Status for Commands
+dnl https://pubs.opengroup.org/onlinepubs/9699919799//utilities/V3_chap02.html#tag_18_08_02
test_CFLAGS=${CFLAGS+set}
@@ -66,10 +78,11 @@ dnl To use a separate config header.
dnl There is still some problem with GMP's HAVE_CONFIG
dnl AC_CONFIG_HEADERS([mpfrconf.h:mpfrconf.in])
-dnl Extra arguments to configure
-
unset gmp_lib_path GMP_CFLAGS GMP_CC
+dnl ********************************************************************
+dnl Extra arguments to configure (AC_ARG_WITH and AC_ARG_ENABLE)
+
AC_ARG_WITH(gmp_include,
[ --with-gmp-include=DIR GMP include directory ],
MPFR_PARSE_DIRECTORY(["$withval"],[withval])
@@ -121,6 +134,25 @@ AC_ARG_WITH(gmp_build,
fi
])
+AC_ARG_WITH(mini_gmp,
+ [ --with-mini-gmp=DIR use mini-gmp (sources in DIR) instead of GMP
+ (experimental, please read doc/mini-gmp file)],
+ [
+ MPFR_PARSE_DIRECTORY(["$withval"],[withval])
+ if test -z "$gmp_lib_path" && test -z "$with_gmp_include" && \
+ test -z "$use_gmp_build"; then
+ if test -f "$withval/mini-gmp.c" && test -f "$withval/mini-gmp.h"; then
+ AC_DEFINE([MPFR_USE_MINI_GMP],1,[Use mini-gmp])
+ mini_gmp_path="$withval"
+ AC_SUBST(mini_gmp_path)
+ else
+ AC_MSG_FAILURE([mini-gmp.{c,h} not found in $withval])
+ fi
+ else
+ AC_MSG_FAILURE([Do not use --with-mini-gmp and other --with-gmp options simultaneously.])
+ fi
+ ])
+
AC_ARG_WITH(mulhigh_size,
[ --with-mulhigh-size=NUM internal threshold table for mulhigh],
AC_DEFINE_UNQUOTED([MPFR_MULHIGH_SIZE],$withval, [Mulhigh size]))
@@ -144,8 +176,8 @@ AC_ARG_ENABLE(assert,
esac])
AC_ARG_ENABLE(logging,
- [ --enable-logging enable MPFR logging (the system must support it)
- [[default=no]]],
+ [ --enable-logging enable MPFR logging (needs nested functions
+ and the 'cleanup' attribute) [[default=no]]],
[ case $enableval in
yes) AC_DEFINE([MPFR_USE_LOGGING],1,[Enable MPFR logging support]) ;;
no) ;;
@@ -204,6 +236,75 @@ AC_ARG_ENABLE(tune-for-coverage,
*) AC_MSG_ERROR([bad value for --enable-tune-for-coverage]) ;;
esac])
+dnl Support for _Decimal64 and _Decimal128 (ISO/IEC TS 18661).
+dnl See acinclude.m4 for more information and tests.
+dnl FIXME: differentiate the support of _Decimal64 and _Decimal128, e.g.
+dnl --enable-decimal64 for _Decimal64
+dnl --enable-decimal128 for _Decimal128
+dnl --enable-decimal-float would explicitly enable both (or fail).
+dnl --disable-decimal-float would explicitly disable both.
+AC_ARG_ENABLE(decimal-float,
+ [ --disable-decimal-float explicitly disable decimal floats support
+ --enable-decimal-float build conversion functions from/to decimal floats
+ (see INSTALL file for details) [[default=auto]]],
+ [ case $enableval in
+ yes|no|auto|bid|dpd|generic) ;;
+ *) AC_MSG_ERROR([bad value for --enable-decimal-float]) ;;
+ esac])
+
+dnl Warning! Not to be confused with _Decimal128. Thus it is better
+dnl to say binary128 in the description. It can correspond to either
+dnl _Float128 (ISO/IEC TS 18661) or __float128 (old type name).
+AC_ARG_ENABLE(float128,
+ [ --disable-float128 explicitly disable binary128 support
+ --enable-float128 build conversion functions from/to binary128
+ (_Float128 or __float128) [[default=autodetect]]],
+ [ case $enableval in
+ yes) ;;
+ no) ;;
+ *) AC_MSG_ERROR([bad value for --enable-float128: yes or no]) ;;
+ esac])
+
+AC_ARG_ENABLE(debug-prediction,
+ [ --enable-debug-prediction
+ [[for developers]] enable debug of branch prediction
+ (for x86 and x86-64 with GCC, static libs)],
+ [ case $enableval in
+ yes) if test "$enable_shared" != no; then
+ AC_MSG_ERROR([--enable-debug-prediction can only work in static mode (--disable-shared)])
+ fi
+ AC_DEFINE([MPFR_DEBUG_PREDICTION],1,
+ [Enable debug of branch prediction]) ;;
+ no) ;;
+ *) AC_MSG_ERROR([bad value for --enable-debug-prediction: yes or no]) ;;
+ esac])
+
+AC_ARG_ENABLE(lto,
+ [ --enable-lto build MPFR with link-time-optimization
+ (experimental) [[default: no]]],
+ [ case $enableval in
+ yes) if test "$enable_shared" != "no"; then
+ AC_MSG_ERROR([--enable-lto can only work in static mode (--disable-shared)])
+ fi
+ enable_lto=yes
+ ;;
+ no) ;;
+ *) AC_MSG_ERROR([bad value for --enable-lto: yes or no]) ;;
+ esac])
+
+AC_ARG_ENABLE(formally-proven-code,
+ [ --enable-formally-proven-code
+ use formally proven code when available
+ (needs a C99 compiler) [[default=no]]],
+ [ case $enableval in
+ yes) AC_DEFINE([MPFR_WANT_PROVEN_CODE],1,[Want formally proven code]) ;;
+ no) ;;
+ *) AC_MSG_ERROR([bad value for --enable-formally-proven-code: yes or no]) ;;
+ esac])
+
+dnl Makefile.am files can use "if MINI_GMP" / ... / "endif".
+AM_CONDITIONAL([MINI_GMP], [test -n "$mini_gmp_path"])
+
dnl First, detect incompatibilities between the above configure options.
AC_MSG_CHECKING([whether configure options are compatible])
if test "$enable_logging" = yes; then
@@ -240,7 +341,11 @@ dnl Warning! The following tests must be done before Autoconf selects
dnl a compiler. This means that some macros such as AC_PROG_CC and
dnl AM_PROG_AR must be put after the following code.
-if test -z "$user_redefine_cc" && test "$cross_compiling" != yes ; then
+dnl We do not do this check if mini-gmp is used.
+
+if test -z "$user_redefine_cc" && \
+ test "$cross_compiling" != yes && \
+ test "${with_mini_gmp+set}" != set ; then
dnl We need to guess the C preprocessor instead of using AC_PROG_CPP,
dnl since AC_PROG_CPP implies AC_PROG_CC, which chooses a compiler
@@ -248,7 +353,6 @@ dnl (before we have the chance to get it from gmp.h) and does some
dnl checking related to this compiler (such as dependency tracking
dnl options); if the compiler changes due to __GMP_CC in gmp.h, one
dnl would have incorrect settings.
-dnl FIXME: Move this in acinclude.m4 ?
if test -z "$GMP_CC$GMP_CFLAGS" ; then
AC_MSG_CHECKING(for CC and CFLAGS in gmp.h)
GMP_CC=__GMP_CC
@@ -316,119 +420,9 @@ AM_PROG_AR
dnl This must done before MPFR_CONFIGS.
LT_INIT(win32-dll)
-dnl Try to determine the double format
-AC_MSG_CHECKING(format of `double' floating point)
-AC_RUN_IFELSE([AC_LANG_PROGRAM([[
-]], [[
-union ieee_double_extract
-{
- double d;
- unsigned char x[8];
-} t;
-t.d = 2.877939254133025759330166692961938679218292236328125; /* exact */
-if (sizeof (double) != 8)
- return 0;
-if (sizeof (unsigned char) != 1)
- return 0;
-if (t.x[0] == 1 && t.x[1] == 2 && t.x[2] == 3 && t.x[3] == 4 &&
- t.x[4] == 5 && t.x[5] == 6 && t.x[6] == 7 && t.x[7] == 64)
- return 1; /* little endian */
-else if (t.x[7] == 1 && t.x[6] == 2 && t.x[5] == 3 && t.x[4] == 4 &&
- t.x[3] == 5 && t.x[2] == 6 && t.x[1] == 7 && t.x[0] == 64)
- return 2; /* big endian */
-else
- return 0; /* unknown */
-]])],
- [mpfr_ieee_double=$?],
- [mpfr_ieee_double=$?],
- [mpfr_ieee_double=0])
-case "$mpfr_ieee_double" in
- 1) AC_MSG_RESULT([IEEE little endian])
- AC_DEFINE(HAVE_DOUBLE_IEEE_LITTLE_ENDIAN) ;;
- 2) AC_MSG_RESULT([IEEE big endian])
- AC_DEFINE(HAVE_DOUBLE_IEEE_BIG_ENDIAN) ;;
- *) AC_MSG_WARN([format of `double' floating-point not recognized]) ;;
-esac
-
-dnl For GCC, _Decimal64 was introduced in GCC 4.3 for some targets
-dnl (note that it is not guaranteed to be available because it may
-dnl be disabled in the GCC build). See:
-dnl https://gcc.gnu.org/gcc-4.3/changes.html
-dnl _Decimal64 is not yet defined in GCC for C++:
-dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51364
-dnl _Decimal64 support is broken with GCC 4.6.3 and 4.7.2 on powerpc64
-dnl with the mode32 ABI, e.g. "-m32 -mpowerpc64 -mtune=970 -O3"; this
-dnl is detected by the x != x test below.
-AC_ARG_ENABLE(decimal-float,
- [ --disable-decimal-float explicitly disable decimal floats support
- --enable-decimal-float build conversion functions from/to decimal floats
- [[default=autodetect]]],
- [ case $enableval in
- yes) ;;
- no) ;;
- *) AC_MSG_ERROR([bad value for --enable-decimal-float: yes or no]) ;;
- esac])
-
-dnl GCC >= 4.3 provides __float128, but since this is not standard,
-dnl the default is "autodetect" and not "yes"
-AC_ARG_ENABLE(float128,
- [ --disable-float128 explicitly disable __float128 support
- --enable-float128 build conversion functions from/to __float128
- [[default=autodetect]]],
- [ case $enableval in
- yes) ;;
- no) ;;
- *) AC_MSG_ERROR([bad value for --enable-float128: yes or no]) ;;
- esac])
-
-test_libgmp=__gmpz_init
-
-AC_ARG_ENABLE(mini-gmp,
- [ --enable-mini-gmp build MPFR with mini-gmp (experimental) [[default=no]]],
- [ case $enableval in
- yes) AC_DEFINE([MPFR_USE_MINI_GMP],1,[Use mini-gmp])
- # With mini-gmp, mp_limb_t is always unsigned long.
- AC_COMPUTE_INT(nettle_cv_gmp_numb_bits, [(sizeof(unsigned long) * CHAR_BIT)],
- [#include <limits.h>],
- [AC_MSG_FAILURE([cannot find value of GMP_NUMB_BITS])])
- AC_MSG_RESULT([$nettle_cv_gmp_numb_bits bits])
- AC_DEFINE_UNQUOTED([GMP_NUMB_BITS], $nettle_cv_gmp_numb_bits, [number of bits in a limb])
- AC_DEFINE([GMP_NAIL_BITS], 0, [number of nails in a limb])
- test_libgmp=mpz_init;;
- no) ;;
- *) AC_MSG_ERROR([bad value for --enable-mini-gmp: yes or no]) ;;
- esac])
-
-AC_ARG_ENABLE(debug-prediction,
- [ --enable-debug-prediction
- [[for developers]] enable debug of branch prediction
- (for x86 and x86-64 with GCC, static libs)],
- [ case $enableval in
- yes) if test "$enable_shared" != no; then
- AC_MSG_ERROR([--enable-debug-prediction can only work in static mode (--disable-shared)])
- fi
- AC_DEFINE([MPFR_DEBUG_PREDICTION],1,
- [Enable debug of branch prediction]) ;;
- no) ;;
- *) AC_MSG_ERROR([bad value for --enable-debug-prediction: yes or no]) ;;
- esac])
-
-AC_ARG_ENABLE(lto,
- [ --enable-lto build MPFR with link-time-optimization
- (experimental) [[default: no]]],
- [ case $enableval in
- yes) if test "$enable_shared" != "no"; then
- AC_MSG_ERROR([--enable-lto can only work in static mode (--disable-shared)])
- fi
- enable_lto=yes
- ;;
- no) ;;
- *) AC_MSG_ERROR([bad value for --enable-lto: yes or no]) ;;
- esac])
-
-dnl Check if compiler is ICC, and if such a case, disable GCC
-dnl And add some specific flags.
-dnl Don't add Warnings Flags (Otherwise you'll get more than 20000 warnings).
+dnl Warning: This test is *only* for CFLAGS settings.
+dnl If the compiler is ICC, add some specific flags, except on MS-Windows.
+dnl Don't add warnings flags (Otherwise you'll get more than 20000 warnings).
dnl Add -long_double flags? Don't use -pc64 !
dnl Notes (VL):
dnl * With icc 10.1 20080212 on itanium, the __ICC macro is not defined,
@@ -446,10 +440,10 @@ dnl to use -fp-model <arg> instead of -mp, but what is <arg>? Anyway
dnl -mieee-fp solves the tset_d failure due to a negative zero. This
dnl option has been introduced in ICC 9.0 for Linux (2005-06):
dnl http://www.ncsa.illinois.edu/UserInfo/Resources/Software/Intel/Compilers/9.0/C_ReleaseNotes.htm
-AC_MSG_CHECKING(for ICC)
+AC_MSG_CHECKING(for non-MS-Windows ICC)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
-#if !defined(__ICC)
-# error "Not ICC"
+#if (!defined(__ICC) && !defined(__INTEL_COMPILER)) || defined(_WIN32)
+# error "Not a non-MS-Windows ICC"
error
#endif
]], [[]])],[
@@ -464,6 +458,8 @@ dnl (__GMP_CFLAGS macro in gmp.h) above. The consequence is that this
dnl might yield a compilation failure if the -Werror option appears in
dnl __GMP_CFLAGS. But in this case, since -Werror is not used by default,
dnl one may expect that the user would also set CFLAGS for MPFR.
+dnl Note: When the compiler is GCC not in C++ mode, -Wc++-compat may be
+dnl interesting, but it has been introduced in GCC 4.1 only.
if test "$test_CFLAGS" != set && test -n "$GCC"; then
CFLAGS="-Wpointer-arith $CFLAGS"
AC_MSG_CHECKING(whether the selected language is C++)
@@ -474,7 +470,7 @@ error
#endif
]], [[]])],[
AC_MSG_RESULT(no)
- CFLAGS="-Wmissing-prototypes -Wc++-compat $CFLAGS"
+ CFLAGS="-Wmissing-prototypes $CFLAGS"
],[
AC_MSG_RESULT(yes)
CFLAGS="-Wmissing-declarations -Wno-sign-compare $CFLAGS"
@@ -506,8 +502,6 @@ dnl (i.e. generic code must be used).
AC_C_BIGENDIAN([AC_DEFINE(HAVE_BIG_ENDIAN)],[AC_DEFINE(HAVE_LITTLE_ENDIAN)],
[true],[true])
-MPFR_CONFIGS
-
# (Based on GMP 5.1)
# clock_gettime is in librt on *-*-osf5.1 and on glibc < 2.17, so add -lrt to
# TUNE_LIBS if needed (e.g. if clock_gettime is not already in the C library).
@@ -520,10 +514,56 @@ TUNE_LIBS="$LIBS"
LIBS="$old_LIBS"
AC_SUBST(TUNE_LIBS)
+dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
+dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
+dnl the precedence over the run path, so that if a compatible MPFR library
+dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
+dnl MPFR library will be this library instead of the MPFR library from the
+dnl build tree. Other OS with the same issue might be added later.
+dnl
+dnl References:
+dnl https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
+dnl http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
+dnl
+dnl We need to check whether --disable-new-dtags is supported as alternate
+dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
+dnl
+case $host in
+ *-*-linux*)
+ if test -n "$LD_LIBRARY_PATH"; then
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags"
+ AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
+ AC_LINK_IFELSE([AC_LANG_SOURCE([[
+int main (void) { return 0; }
+ ]])],
+ [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
+ [AC_MSG_RESULT(no)
+ LDFLAGS="$saved_LDFLAGS"
+ ])
+ fi
+ ;;
+esac
+
+dnl MPFR_CONFIGS uses LDFLAGS, thus must be invoked after LDFLAGS has
+dnl been determined completely.
+MPFR_CONFIGS
+
dnl
-dnl Setup GMP detection
+dnl For mpfr-longlong.h - TODO: should be replaced (see acinclude.m4).
dnl
+GMP_C_ATTRIBUTE_MODE
+
+
+dnl
+dnl Setup related to GMP / mini-gmp
+dnl
+
+if test -z "$mini_gmp_path" ; then
+
+dnl Setup for GMP
+
dnl Check GMP Header
AC_MSG_CHECKING(for gmp.h)
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
@@ -577,57 +617,14 @@ error
;;
esac
-dnl Under Linux, make sure that the old dtags are used if LD_LIBRARY_PATH
-dnl is defined. The issue is that with the new dtags, LD_LIBRARY_PATH has
-dnl the precedence over the run path, so that if a compatible MPFR library
-dnl is installed in some directory from $LD_LIBRARY_PATH, then the tested
-dnl MPFR library will be this library instead of the MPFR library from the
-dnl build tree. Other OS with the same issue might be added later.
-dnl
-dnl References:
-dnl https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=859732
-dnl http://lists.gnu.org/archive/html/libtool/2017-05/msg00000.html
-dnl
-dnl We need to check whether --disable-new-dtags is supported as alternate
-dnl linkers may be used (e.g., with tcc: CC=tcc LD=tcc).
-dnl
-case $host in
- *-*-linux*)
- if test -n "$LD_LIBRARY_PATH"; then
- saved_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -Wl,--disable-new-dtags"
- AC_MSG_CHECKING(whether --disable-new-dtags is supported by the linker)
- AC_LINK_IFELSE([AC_LANG_SOURCE([[
-int main (void) { return 0; }
- ]])],
- [AC_MSG_RESULT(yes (use it since LD_LIBRARY_PATH is set))],
- [AC_MSG_RESULT(no)
- LDFLAGS="$saved_LDFLAGS"
- ])
- fi
- ;;
-esac
-
-dnl
-dnl For mpfr-longlong.h - TODO: should be replaced (see acinclude.m4).
-dnl
-
-GMP_C_ATTRIBUTE_MODE
-
-
-dnl
-dnl Setup GMP detection (continued)
-dnl
-
dnl Check minimal GMP version
dnl We only guarantee that with a *functional* and recent enough GMP version,
dnl MPFR will compile; we do not guarantee that GMP will compile.
dnl In particular fat builds are broken in GMP 4.3.2 and GMP 5.0.0
dnl (at least on 64-bit Core 2 under Linux),
dnl see <https://gmplib.org/list-archives/gmp-bugs/2011-August/002345.html>.
-if test -z "$enable_mini_gmp" ; then
- AC_MSG_CHECKING(for recent GMP)
- AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+AC_MSG_CHECKING(for recent GMP)
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
#include "gmp.h"
#if (__GNU_MP_VERSION*100+__GNU_MP_VERSION_MINOR*10 < 500)
# error "GMP 5.0.0 or newer is required"
@@ -637,7 +634,6 @@ error
AC_MSG_RESULT(no)
AC_MSG_ERROR([GMP 5.0.0 or newer is required])
])
-fi
dnl Check if gmp.h is usable at link time; this may detect errors such as
dnl with GMP 4.1, which uses "extern __inline__" unconditionally with all
@@ -696,7 +692,7 @@ See 'config.log' for details (search for GMP_NUMB_BITS).])],
[AC_MSG_RESULT([cannot test])])
dnl Check if we can link with GMP
-AC_CHECK_LIB(gmp, $test_libgmp, [LIBS="-lgmp $LIBS"],
+AC_CHECK_LIB(gmp, __gmpz_init, [LIBS="-lgmp $LIBS"],
[AC_MSG_ERROR([libgmp not found or uses a different ABI (including static vs shared).
Please read the INSTALL file -- see "In case of problem".])])
@@ -709,11 +705,10 @@ dnl incorrect and even have security implications.
dnl WARNING! LD_RUN_PATH is not taken into account by the GNU gold ld,
dnl e.g. from binutils-gold 2.22-5 under Debian; see
dnl https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=660813
-if test -z "$enable_mini_gmp" ; then
- saved_LD_RUN_PATH="$LD_RUN_PATH"
- LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$gmp_lib_path"
- export LD_RUN_PATH
- AC_RUN_IFELSE([AC_LANG_PROGRAM([[
+saved_LD_RUN_PATH="$LD_RUN_PATH"
+LD_RUN_PATH="${LD_RUN_PATH:+$LD_RUN_PATH$PATH_SEPARATOR}$gmp_lib_path"
+export LD_RUN_PATH
+AC_RUN_IFELSE([AC_LANG_PROGRAM([[
#include <stdio.h>
#include <string.h>
#include "gmp.h"
@@ -744,7 +739,9 @@ if test -z "$enable_mini_gmp" ; then
AC_MSG_WARN([see the version numbers above). A cause may be different])
AC_MSG_WARN([GMP versions with different ABI's or the use of --with-gmp])
AC_MSG_WARN([or --with-gmp-include with a system include directory])
- AC_MSG_WARN([(such as /usr/include or /usr/local/include).])
+ AC_MSG_WARN([(such as /usr/include or /usr/local/include). Another])
+ AC_MSG_WARN([cause may be that LD_RUN_PATH is not honored (problem])
+ AC_MSG_WARN([seen under OpenBSD 6.6).])
AC_MSG_WARN([However since we can't use 'libtool' inside the configure,])
AC_MSG_WARN([we can't be sure. See 'config.log' for details.])
AC_MSG_WARN([CC="$CC"])
@@ -756,8 +753,7 @@ if test -z "$enable_mini_gmp" ; then
AC_MSG_WARN([==========================================================])
],AC_MSG_RESULT([cannot test])
)
- LD_RUN_PATH="$saved_LD_RUN_PATH"
-fi
+LD_RUN_PATH="$saved_LD_RUN_PATH"
dnl __gmpn_sbpi1_divappr_q is an internal GMP symbol; thus its behavior
dnl may change or this symbol may be removed in the future (without being
@@ -771,33 +767,69 @@ dnl (see above).
AC_CHECK_FUNCS([__gmpn_sbpi1_divappr_q])
dnl same for other GMP internal functions
AC_CHECK_FUNCS([__gmpn_invert_limb])
-AC_CHECK_FUNCS([__gmpn_rsblsh_n])
+dnl mpn_rsblsh1_n(rp, up, vp, n) does {rp, n} <- 2 * {vp, n} - {up, n}
+AC_CHECK_FUNCS([__gmpn_rsblsh1_n])
MPFR_CHECK_MP_LIMB_T_VS_LONG
+MPFR_CHECK_MP_LIMB_T_VS_INTMAX
+
+else
+
+dnl Setup for mini-gmp
+
+dnl Let us make the configure script clean up the mini-gmp.* files
+dnl and add the symbolic links to mini-gmp.{c,h} instead of relying
+dnl on timestamp-based make rules, which may not work when testing
+dnl several mini-gmp versions (whose source can go back in time).
+mpfr_build_src="${ac_top_build_prefix}src"
+mkdir -p "$mpfr_build_src"
+rm -f -- "$mpfr_build_src"/mini-gmp.*
+for i in c h
+do
+ ln -s -- "$mini_gmp_path/mini-gmp.$i" "$mpfr_build_src/mini-gmp.$i"
+done
+
+dnl First check whether mini-gmp defines GMP_NUMB_BITS. If it doesn't,
+dnl then guess the value from the size of mp_limb_t.
+AC_MSG_CHECKING(for GMP_NUMB_BITS)
+how="from mini-gmp.h"
+saved_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS -I$mpfr_build_src"
+AC_COMPUTE_INT(mini_gmp_numb_bits, [(GMP_NUMB_BITS)],
+ [#include <mini-gmp.h>],
+ [how="not in mini-gmp.h; guessed"
+ AC_COMPUTE_INT(mini_gmp_numb_bits, [(sizeof(mp_limb_t) * CHAR_BIT)],
+ [#include <limits.h>
+ #include <mini-gmp.h>],
+ [AC_MSG_FAILURE([cannot define GMP_NUMB_BITS])])
+ AC_DEFINE_UNQUOTED([GMP_NUMB_BITS], $mini_gmp_numb_bits, [number of bits in a limb])
+ ])
+CPPFLAGS="$saved_CPPFLAGS"
+AC_MSG_RESULT([$mini_gmp_numb_bits bits ($how)])
+
+dnl We need to check the availability of lrand48 (used by random_limb)
+dnl and srand48 (used by gmp_randseed_ui), in particular because these
+dnl functions are not part of the ISO C standard.
+AC_CHECK_FUNC(lrand48,,AC_MSG_FAILURE([MPFR + mini-gmp requires lrand48]))
+AC_CHECK_FUNC(srand48,,AC_MSG_FAILURE([MPFR + mini-gmp requires srand48]))
+
+fi
+
+dnl End of setup related to GMP / mini-gmp
dnl The getrusage function is needed for MPFR bench (cf tools/bench)
AC_CHECK_FUNCS([getrusage])
-dnl Remove also many MACROS (AC_DEFINE) which are unused by MPFR
-dnl and polluate (and slow down because libtool has to parse them) the build.
+dnl Remove also many macros (AC_DEFINE), which are unused by MPFR and
+dnl pollute (and slow down because libtool has to parse them) the build.
if test -f confdefs.h; then
- $SED '/#define PACKAGE_/d' <confdefs.h >confdefs.tmp
- $SED '/#define HAVE_STRING/d' <confdefs.tmp >confdefs.h
- $SED '/#define HAVE_ALLOCA /d' <confdefs.h >confdefs.tmp
- $SED '/#define HAVE_DLFCN_H/d' <confdefs.tmp >confdefs.h
- $SED '/#define HAVE_MEM/d' <confdefs.h >confdefs.tmp
- $SED '/#define STDC_HEADERS/d' <confdefs.tmp >confdefs.h
- $SED '/#define HAVE_STRTOL/d' <confdefs.h >confdefs.tmp
- $SED '/#define HAVE_STDLIB_H/d' <confdefs.tmp >confdefs.h
- $SED '/#define HAVE_UNISTD_H/d' <confdefs.h >confdefs.tmp
- $SED '/#define HAVE_STDC_HEADERS/d' <confdefs.tmp >confdefs.h
- $SED '/#define HAVE_LONG_DOUBLE/d' <confdefs.h >confdefs.tmp
- $SED '/#define HAVE_SYS_STAT_H/d' <confdefs.tmp >confdefs.h
- $SED '/#define HAVE_SYS_TYPES_H/d' <confdefs.h >confdefs.tmp
- $SED '/#define PROTOTYPES/d' <confdefs.tmp >confdefs.h
- $SED '/#define __PROTOTYPES/d' <confdefs.h >confdefs.tmp
-
- mv confdefs.tmp confdefs.h
+ for i in PACKAGE_ HAVE_STRING HAVE_DLFCN_H HAVE_MEM STDC_HEADERS \
+ HAVE_STDLIB_H HAVE_UNISTD_H HAVE_STDC_HEADERS \
+ HAVE_SYS_STAT_H HAVE_SYS_TYPES_H PROTOTYPES __PROTOTYPES
+ do
+ $SED "/#define $i/d" < confdefs.h > confdefs.tmp
+ mv confdefs.tmp confdefs.h
+ done
fi
if $EGREP -q -e '-dev$' $srcdir/VERSION; then
diff --git a/Build/source/libs/mpfr/mpfr-src/src/Makefile.am b/Build/source/libs/mpfr/mpfr-src/src/Makefile.am
index 74e1473cfd5..4ef1380345f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/Makefile.am
+++ b/Build/source/libs/mpfr/mpfr-src/src/Makefile.am
@@ -1,4 +1,4 @@
-# Copyright 2000-2019 Free Software Foundation, Inc.
+# Copyright 2000-2020 Free Software Foundation, Inc.
# This Makefile.am is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -9,17 +9,23 @@
# PARTICULAR PURPOSE.
-EXTRA_DIST = round_raw_generic.c jyn_asympt.c x86/core2/mparam.h \
- x86/mparam.h x86_64/core2/mparam.h x86_64/pentium4/mparam.h \
- ia64/mparam.h arm/mparam.h powerpc64/mparam.h sparc64/mparam.h \
- generic/mparam.h amd/athlon/mparam.h amd/k8/mparam.h \
- amd/amdfam10/mparam.h powerpc32/mparam.h hppa/mparam.h \
- mips/mparam.h generic/coverage/mparam.h
+# Since we do not require GNU "make", let's select the POSIX behavior to
+# uniformize the behavior a bit more with various "make" implementations
+# and ease maintenance. This target should be removed only if one day,
+# we need to require GNU "make".
+.POSIX:
-include_HEADERS = mpfr.h mpf2mpfr.h
+EXTRA_DIST = round_raw_generic.c jyn_asympt.c \
+ add1sp1_extracted.c mul_1_extracted.c sub1sp1_extracted.c \
+ amd/mparam.h arm/mparam.h \
+ generic/coverage/mparam.h generic/mparam.h \
+ mips/mparam.h powerpc64/mparam.h sparc64/mparam.h \
+ x86/mparam.h x86_64/core2/mparam.h x86_64/mparam.h
-BUILT_SOURCES = mparam.h
+include_HEADERS = mpfr.h mpf2mpfr.h
+nodist_include_HEADERS =
+BUILT_SOURCES = get_patches.c mparam.h
lib_LTLIBRARIES = libmpfr.la
@@ -27,8 +33,8 @@ libmpfr_la_SOURCES = mpfr.h mpf2mpfr.h mpfr-cvers.h mpfr-gmp.h \
mpfr-impl.h mpfr-intmax.h mpfr-longlong.h mpfr-sassert.h mpfr-thread.h \
exceptions.c extract.c uceil_exp2.c \
uceil_log2.c ufloor_log2.c add.c add1.c add_ui.c agm.c clear.c cmp.c \
-cmp_abs.c cmp_si.c cmp_ui.c comparisons.c div_2exp.c div_2si.c \
-div_2ui.c div.c div_ui.c dump.c eq.c exp10.c exp2.c exp3.c exp.c \
+cmpabs.c cmp_si.c cmp_ui.c comparisons.c div_2exp.c div_2si.c \
+div_2ui.c div.c div_ui.c dot.c dump.c eq.c exp10.c exp2.c exp3.c exp.c \
frac.c frexp.c get_d.c get_exp.c get_str.c init.c inp_str.c isinteger.c \
isinf.c isnan.c isnum.c const_log2.c log.c modf.c mul_2exp.c mul_2si.c \
mul_2ui.c mul.c mul_ui.c neg.c next.c out_str.c printf.c vasprintf.c \
@@ -53,14 +59,17 @@ int_ceil_log2.c isqrt.c strtofr.c pow_z.c logging.c mulders.c get_f.c \
round_p.c erfc.c atan2.c subnormal.c const_catalan.c root.c \
gen_inverse.h sec.c csc.c cot.c eint.c sech.c csch.c coth.c \
round_near_x.c constant.c abort_prec_max.c stack_interface.c lngamma.c \
-zeta_ui.c set_d64.c get_d64.c jn.c yn.c rem1.c get_patches.c add_d.c \
+zeta_ui.c set_d64.c get_d64.c jn.c yn.c rem1.c add_d.c \
sub_d.c d_sub.c mul_d.c div_d.c d_div.c li2.c rec_sqrt.c min_prec.c \
buildopt.c digamma.c bernoulli.c isregular.c set_flt.c get_flt.c \
scale2.c set_z_exp.c ai.c gammaonethird.c ieee_floats.h \
grandom.c fpif.c set_float128.c get_float128.c rndna.c nrandom.c \
random_deviate.h random_deviate.c erandom.c mpfr-mini-gmp.c \
mpfr-mini-gmp.h fmma.c log_ui.c gamma_inc.c ubf.c invert_limb.h \
-invsqrt_limb.h beta.c odd_p.c get_q.c pool.c
+invsqrt_limb.h beta.c odd_p.c get_q.c pool.c total_order.c set_d128.c \
+get_d128.c nbits_ulong.c cmpabs_ui.c
+
+nodist_libmpfr_la_SOURCES = $(BUILT_SOURCES)
libmpfr_la_LIBADD = @LIBOBJS@
@@ -73,6 +82,10 @@ libmpfr_la_LIBADD = @LIBOBJS@
# 3. Interfaces removed or changed (BAD, breaks upward compatibility):
# ==> Increment CURRENT, set AGE and REVISION to 0.
#
+# For each new MPFR major-minor version, add a new line below with the
+# corresponding -version-info CURRENT and AGE. This will be checked by
+# the tools/ck-version-info script.
+#
# MPFR -version-info
# 2.1.x -
# 2.2.x 1:x:0
@@ -81,22 +94,32 @@ libmpfr_la_LIBADD = @LIBOBJS@
# 3.0.x 4:x:0
# 3.1.x 5:x:1
# 4.0.x 6:x:0
-libmpfr_la_LDFLAGS = $(MPFR_LDFLAGS) $(LIBMPFR_LDFLAGS) -version-info 6:2:0
-
-# Important note: If for some reason, srcdir is read-only at build time
-# (and you use objdir != srcdir), then you need to rebuild get_patches.c
-# (with "make get_patches.c") just after patching the MPFR source. This
-# should not be a problem in practice, in particular because "make dist"
-# automatically rebuilds get_patches.c before generating the archives.
-$(srcdir)/get_patches.c: $(top_srcdir)/PATCHES $(top_srcdir)/tools/get_patches.sh
- (cd $(top_srcdir) && ./tools/get_patches.sh) > $@ || rm -f $@
-
-# Do not add get_patches.c to CLEANFILES so that this file doesn't
-# need to be (re)built as long as no patches are applied. Anyway the
-# update of this file should be regarded as part of the patch process,
-# and "make clean" shouldn't remove it, just like it doesn't remove
-# what has been changed by "patch".
-#CLEANFILES = get_patches.c
+# 4.1.x 7:x:1
+libmpfr_la_LDFLAGS = $(MPFR_LDFLAGS) $(LIBMPFR_LDFLAGS) -version-info 7:0:1
+
+GET_PATCHES_SH = $(top_srcdir)/tools/get_patches.sh
+PATCHES = $(top_srcdir)/PATCHES
+get_patches.c: $(GET_PATCHES_SH) $(PATCHES)
+ $(GET_PATCHES_SH) $(PATCHES) > $@ || { rm -f $@; exit 1; }
+
+if MINI_GMP
+
+# The mini-gmp.{c,h} files are external files, not part of MPFR, thus they
+# must not be put in the tarballs by "make dist". Hence the use of nodist_
+# on the corresponding sources (this is needed even when --with-mini-gmp
+# has not been used).
+nodist_include_HEADERS += mini-gmp.h
+
+# The noinst_ below seems OK as libminigmp should be included in libmpfr,
+# and this is confirmed by ldd (replacing noinst_ by lib_ does not seem to
+# do this and makes linking of the test programs fail).
+noinst_LTLIBRARIES = libminigmp.la
+nodist_libminigmp_la_SOURCES = mini-gmp.h mini-gmp.c
+libmpfr_la_LIBADD += libminigmp.la
+
+DISTCLEANFILES = $(nodist_libminigmp_la_SOURCES)
+
+endif
# For check-gmp-symbols
GMPC = $(top_builddir)/src/gmp.c
@@ -146,6 +169,6 @@ check-exported-symbols: $(LTLIBRARIES)
fi; \
fi
-CLEANFILES = $(GMPC) $(GMPI)
+CLEANFILES = get_patches.c $(GMPC) $(GMPI)
.PHONY: check-gmp-symbols check-exported-symbols
diff --git a/Build/source/libs/mpfr/mpfr-src/src/abort_prec_max.c b/Build/source/libs/mpfr/mpfr-src/src/abort_prec_max.c
index 7dbf6aeadfe..27685b485b1 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/abort_prec_max.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/abort_prec_max.c
@@ -1,6 +1,6 @@
/* mpfr_abort_prec_max -- Abort due to maximal precision overflow.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/acos.c b/Build/source/libs/mpfr/mpfr-src/src/acos.c
index d2f8ff07cd9..fb737354266 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/acos.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/acos.c
@@ -1,6 +1,6 @@
/* mpfr_acos -- arc-cosinus of a floating-point number
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/acosh.c b/Build/source/libs/mpfr/mpfr-src/src/acosh.c
index d681c6d07e1..61e805110c7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/acosh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/acosh.c
@@ -1,6 +1,6 @@
/* mpfr_acosh -- inverse hyperbolic cosine
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -92,7 +92,7 @@ mpfr_acosh (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode)
MPFR_BLOCK_DECL (flags);
/* compute acosh */
- MPFR_BLOCK (flags, mpfr_mul (t, x, x, MPFR_RNDD)); /* x^2 */
+ MPFR_BLOCK (flags, mpfr_sqr (t, x, MPFR_RNDD)); /* x^2 */
if (MPFR_OVERFLOW (flags))
{
mpfr_t ln2;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/add.c b/Build/source/libs/mpfr/mpfr-src/src/add.c
index 30a5feffedd..6026922a97f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/add.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/add.c
@@ -1,6 +1,6 @@
/* mpfr_add -- add two floating-point numbers
-Copyright 1999-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/add1.c b/Build/source/libs/mpfr/mpfr-src/src/add1.c
index a5e17e8442e..6e0a33fc3ec 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/add1.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/add1.c
@@ -1,6 +1,6 @@
/* mpfr_add1 -- internal function to perform a "real" addition
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -41,7 +41,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (MPFR_UNLIKELY (MPFR_IS_UBF (b)))
{
- exp = mpfr_ubf_zexp2exp (MPFR_ZEXP (b));
+ exp = MPFR_UBF_GET_EXP (b);
if (exp > __gmpfr_emax)
return mpfr_overflow (a, rnd_mode, MPFR_SIGN (b));;
}
@@ -81,7 +81,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
MPFR_SET_SAME_SIGN(a, b);
- MPFR_UPDATE2_RND_MODE(rnd_mode, MPFR_SIGN(b));
+ MPFR_UPDATE2_RND_MODE (rnd_mode, MPFR_SIGN (b));
/* now rnd_mode is either MPFR_RNDN, MPFR_RNDZ, MPFR_RNDA or MPFR_RNDF. */
if (MPFR_UNLIKELY (MPFR_IS_UBF (c)))
{
@@ -189,7 +189,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mask = MPFR_LIMB_MASK (sh);
bb = ap[0] & mask;
- ap[0] &= (~mask) << 1;
+ ap[0] &= MPFR_LIMB_LSHIFT (~mask, 1);
if (bb == 0)
fb = 0;
else if (bb == mask)
@@ -379,7 +379,7 @@ mpfr_add1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (fb)
goto rounding;
rb ^= 1;
- if (rb == 0 && mpn_add_1(ap, ap, an, MPFR_LIMB_ONE << sh))
+ if (rb == 0 && mpn_add_1 (ap, ap, an, MPFR_LIMB_ONE << sh))
{
if (MPFR_UNLIKELY(exp == __gmpfr_emax))
{
@@ -404,7 +404,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 << (GMP_NUMB_BITS - difs))
+ if (difs && MPFR_LIMB_LSHIFT(cprev, GMP_NUMB_BITS - difs) != 0)
{
fb = 1;
goto rounding;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/add1sp.c b/Build/source/libs/mpfr/mpfr-src/src/add1sp.c
index 64f7f03a188..ad13e3ecb6b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/add1sp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/add1sp.c
@@ -1,7 +1,7 @@
/* mpfr_add1sp -- internal function to perform a "real" addition
All the op must have the same precision
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -24,8 +24,21 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-/* Check if we have to check the result of mpfr_add1sp with mpfr_add1 */
#if MPFR_WANT_ASSERT >= 2
+/* Check the result of mpfr_add1sp with mpfr_add1.
+
+ Note: mpfr_add1sp itself has two algorithms: one always valid and one
+ faster for small precisions (up to 3 limbs). The latter one is disabled
+ if MPFR_GENERIC_ABI is defined. When MPFR_WANT_ASSERT >= 2, it could be
+ interesting to compare the results of these different algorithms. For
+ the time being, this is currently done by running the same code on the
+ same data with and without MPFR_GENERIC_ABI defined, where we have the
+ following comparisons in small precisions:
+ mpfr_add1sp slow <-> mpfr_add1 when MPFR_GENERIC_ABI is defined;
+ mpfr_add1sp fast <-> mpfr_add1 when MPFR_GENERIC_ABI is not defined.
+ By transitivity, the absence of failures implies that the 3 results are
+ the same.
+*/
int mpfr_add1sp_ref (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
@@ -68,6 +81,10 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
inexact = mpfr_add1sp_ref (a, b, c, rnd_mode);
flags = __gmpfr_flags;
+ /* Convert the ternary values to (-1,0,1). */
+ inexact2 = VSIGN (inexact2);
+ inexact = VSIGN (inexact);
+
if (! mpfr_equal_p (tmpa, a) || inexact != inexact2 || flags != flags2)
{
fprintf (stderr, "add1 & add1sp return different values for %s\n"
@@ -83,9 +100,10 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mpfr_fdump (stderr, tmpa);
fprintf (stderr, "add1sp: ");
mpfr_fdump (stderr, a);
- fprintf (stderr, "Inexact sp = %d | Inexact = %d\n"
- "Flags sp = %u | Flags = %u\n",
- inexact, inexact2, flags, flags2);
+ fprintf (stderr, "add1 : ternary = %2d, flags =", inexact2);
+ flags_fout (stderr, flags2);
+ fprintf (stderr, "add1sp: ternary = %2d, flags =", inexact);
+ flags_fout (stderr, flags);
MPFR_ASSERTN (0);
}
mpfr_clears (tmpa, tmpb, tmpc, (mpfr_ptr) 0);
@@ -96,6 +114,18 @@ int mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
#if !defined(MPFR_GENERIC_ABI)
+#if defined(MPFR_WANT_PROVEN_CODE) && GMP_NUMB_BITS == 64 && \
+ UINT_MAX == 0xffffffff && MPFR_PREC_BITS == 64 && \
+ _MPFR_PREC_FORMAT == 3 && _MPFR_EXP_FORMAT == _MPFR_PREC_FORMAT
+
+/* The code assumes that mp_limb_t has 64 bits exactly, unsigned int
+ has 32 bits exactly, mpfr_prec_t and mpfr_exp_t are of type long,
+ which has 64 bits exactly. */
+
+#include "add1sp1_extracted.c"
+
+#else
+
/* same as mpfr_add1sp, but for p < GMP_NUMB_BITS */
static int
mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
@@ -128,9 +158,16 @@ mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
ap[0] = a0 ^ rb;
sb = 0; /* since b + c fits on p+1 bits, the sticky bit is zero */
}
- else if (bx > cx)
+ else
{
- BGreater1:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
mask = MPFR_LIMB_MASK(sh);
/* TODO: Should the case d < sh be removed, i.e. seen as a particular
@@ -143,7 +180,7 @@ mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
a0 = bp[0] + (cp[0] >> d);
if (a0 < bp[0]) /* carry */
{
- MPFR_ASSERTD ((a0 & 1) == 0);
+ MPFR_ASSERTD ((a0 & MPFR_LIMB_ONE) == 0);
a0 = MPFR_LIMB_HIGHBIT | (a0 >> 1);
bx ++;
}
@@ -157,7 +194,7 @@ mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
a0 = bp[0] + (cp[0] >> d);
if (a0 < bp[0]) /* carry */
{
- sb |= a0 & 1;
+ sb |= a0 & MPFR_LIMB_ONE;
a0 = MPFR_LIMB_HIGHBIT | (a0 >> 1);
bx ++;
}
@@ -172,14 +209,6 @@ mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
sb = 1; /* since c <> 0 */
}
}
- else /* bx < cx: swap b and c */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- goto BGreater1;
- }
/* Note: we could keep the output significand in a0 for the rounding,
and only store it in ap[0] at the very end, but this seems slower
@@ -223,6 +252,8 @@ mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
}
}
+#endif /* MPFR_WANT_PROVEN_CODE */
+
/* same as mpfr_add1sp, but for p = GMP_NUMB_BITS */
static int
mpfr_add1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
@@ -249,9 +280,16 @@ mpfr_add1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
bx ++;
sb = 0; /* since b + c fits on p+1 bits, the sticky bit is zero */
}
- else if (bx > cx)
+ else
{
- BGreater1:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
if (d < GMP_NUMB_BITS) /* 1 <= d < GMP_NUMB_BITS */
{
@@ -260,7 +298,7 @@ mpfr_add1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (a0 < bp[0]) /* carry */
{
ap[0] = MPFR_LIMB_HIGHBIT | (a0 >> 1);
- rb = a0 & 1;
+ rb = a0 & MPFR_LIMB_ONE;
bx ++;
}
else /* no carry */
@@ -277,14 +315,6 @@ mpfr_add1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
rb = d == GMP_NUMB_BITS;
}
}
- else /* bx < cx: swap b and c */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- goto BGreater1;
- }
/* Note: we could keep the output significand in a0 for the rounding,
and only store it in ap[0] at the very end, but this seems slower
@@ -359,9 +389,16 @@ mpfr_add1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
ap[0] = a0 ^ rb;
sb = 0; /* since b + c fits on p+1 bits, the sticky bit is zero */
}
- else if (bx > cx)
+ else
{
- BGreater2:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
mask = MPFR_LIMB_MASK(sh);
if (d < GMP_NUMB_BITS) /* 0 < d < GMP_NUMB_BITS */
@@ -372,7 +409,7 @@ mpfr_add1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
if (a1 < bp[1]) /* carry in high word */
{
exponent_shift:
- sb |= a0 & 1;
+ sb |= a0 & MPFR_LIMB_ONE;
/* shift a by 1 */
a0 = (a1 << (GMP_NUMB_BITS - 1)) | (a0 >> 1);
ap[1] = MPFR_LIMB_HIGHBIT | (a1 >> 1);
@@ -405,14 +442,6 @@ mpfr_add1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
sb = 1; /* since c <> 0 */
}
}
- else /* bx < cx: swap b and c */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- goto BGreater2;
- }
/* now perform rounding */
if (MPFR_UNLIKELY(bx > __gmpfr_emax))
@@ -451,6 +480,137 @@ mpfr_add1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
}
}
+/* same as mpfr_add1sp, but for p = 2*GMP_NUMB_BITS */
+static int
+mpfr_add1sp2n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
+{
+ mpfr_exp_t bx = MPFR_GET_EXP (b);
+ mpfr_exp_t cx = MPFR_GET_EXP (c);
+ mp_limb_t *ap = MPFR_MANT(a);
+ mp_limb_t *bp = MPFR_MANT(b);
+ mp_limb_t *cp = MPFR_MANT(c);
+ mp_limb_t rb; /* round bit */
+ mp_limb_t sb; /* sticky bit */
+ mp_limb_t a1, a0;
+ mpfr_uexp_t d;
+
+ if (bx == cx)
+ {
+ /* since bp[1], cp[1] >= MPFR_LIMB_HIGHBIT, a carry always occurs */
+ a0 = bp[0] + cp[0];
+ a1 = bp[1] + cp[1] + (a0 < bp[0]);
+ rb = a0 & MPFR_LIMB_ONE;
+ sb = 0; /* since b + c fits on p+1 bits, the sticky bit is zero */
+ ap[0] = (a1 << (GMP_NUMB_BITS - 1)) | (a0 >> 1);
+ ap[1] = MPFR_LIMB_HIGHBIT | (a1 >> 1);
+ bx ++;
+ }
+ else
+ {
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ }
+ MPFR_ASSERTD (bx > cx);
+ d = (mpfr_uexp_t) bx - cx;
+ if (d >= 2 * GMP_NUMB_BITS)
+ {
+ if (d == 2 * GMP_NUMB_BITS)
+ {
+ rb = 1;
+ sb = (cp[0] != MPFR_LIMB_ZERO ||
+ cp[1] > MPFR_LIMB_HIGHBIT);
+ }
+ else
+ {
+ rb = 0;
+ sb = 1;
+ }
+ ap[0] = bp[0];
+ ap[1] = bp[1];
+ }
+ else
+ {
+ /* First, compute (a0,a1) = b + (c >> d), and determine sb from
+ the bits shifted out such that (MSB, other bits) is regarded
+ as (rounding bit, sticky bit), assuming no carry. */
+ if (d < GMP_NUMB_BITS) /* 0 < d < GMP_NUMB_BITS */
+ {
+ sb = cp[0] << (GMP_NUMB_BITS - d);
+ a0 = bp[0] + ((cp[1] << (GMP_NUMB_BITS - d)) | (cp[0] >> d));
+ a1 = bp[1] + (cp[1] >> d) + (a0 < bp[0]);
+ }
+ else /* GMP_NUMB_BITS <= d < 2 * GMP_NUMB_BITS */
+ {
+ /* The most significant bit of sb should be the rounding bit,
+ while the other bits represent the sticky bit:
+ * if d = GMP_NUMB_BITS, we get cp[0];
+ * if d > GMP_NUMB_BITS: we get the least d-GMP_NUMB_BITS bits
+ of cp[1], and those from cp[0] as the LSB of sb. */
+ sb = (d == GMP_NUMB_BITS) ? cp[0]
+ : (cp[1] << (2*GMP_NUMB_BITS-d)) | (cp[0] != 0);
+ a0 = bp[0] + (cp[1] >> (d - GMP_NUMB_BITS));
+ a1 = bp[1] + (a0 < bp[0]);
+ }
+ if (a1 < bp[1]) /* carry in high word */
+ {
+ rb = a0 << (GMP_NUMB_BITS - 1);
+ /* and sb is the real sticky bit. */
+ /* Shift the result by 1 to the right. */
+ ap[0] = (a1 << (GMP_NUMB_BITS - 1)) | (a0 >> 1);
+ ap[1] = MPFR_LIMB_HIGHBIT | (a1 >> 1);
+ bx ++;
+ }
+ else
+ {
+ rb = MPFR_LIMB_MSB (sb);
+ sb <<= 1;
+ ap[0] = a0;
+ ap[1] = a1;
+ }
+ }
+ }
+
+ /* now perform rounding */
+ if (MPFR_UNLIKELY(bx > __gmpfr_emax))
+ return mpfr_overflow (a, rnd_mode, MPFR_SIGN(a));
+
+ MPFR_SET_EXP (a, bx);
+ if ((rb == 0 && sb == 0) || rnd_mode == MPFR_RNDF)
+ MPFR_RET(0);
+ else if (rnd_mode == MPFR_RNDN)
+ {
+ if (rb == 0 || (sb == 0 && (ap[0] & MPFR_LIMB_ONE) == 0))
+ goto truncate;
+ else
+ goto add_one_ulp;
+ }
+ else if (MPFR_IS_LIKE_RNDZ(rnd_mode, MPFR_IS_NEG(a)))
+ {
+ truncate:
+ MPFR_RET(-MPFR_SIGN(a));
+ }
+ else /* round away from zero */
+ {
+ add_one_ulp:
+ ap[0] += MPFR_LIMB_ONE;
+ ap[1] += (ap[0] == 0);
+ if (MPFR_UNLIKELY(ap[1] == 0))
+ {
+ ap[1] = MPFR_LIMB_HIGHBIT;
+ /* no need to have MPFR_LIKELY here, since we are in a rare branch */
+ if (bx + 1 <= __gmpfr_emax)
+ MPFR_SET_EXP (a, bx + 1);
+ else /* overflow */
+ return mpfr_overflow (a, rnd_mode, MPFR_SIGN(a));
+ }
+ MPFR_RET(MPFR_SIGN(a));
+ }
+}
+
/* same as mpfr_add1sp, but for 2*GMP_NUMB_BITS < p < 3*GMP_NUMB_BITS */
static int
mpfr_add1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
@@ -485,9 +645,16 @@ mpfr_add1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
ap[0] = a0 ^ rb;
sb = 0; /* since b + c fits on p+1 bits, the sticky bit is zero */
}
- else if (bx > cx)
+ else
{
- BGreater2:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
mask = MPFR_LIMB_MASK(sh);
if (d < GMP_NUMB_BITS) /* 0 < d < GMP_NUMB_BITS */
@@ -502,7 +669,7 @@ mpfr_add1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
if (a2 < bp[2] || (a2 == bp[2] && cy)) /* carry in high word */
{
exponent_shift:
- sb |= a0 & 1;
+ sb |= a0 & MPFR_LIMB_ONE;
/* shift a by 1 */
a0 = (a1 << (GMP_NUMB_BITS - 1)) | (a0 >> 1);
ap[1] = (a2 << (GMP_NUMB_BITS - 1)) | (a1 >> 1);
@@ -565,14 +732,6 @@ mpfr_add1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
sb = 1; /* since c <> 0 */
}
}
- else /* bx < cx: swap b and c */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- goto BGreater2;
- }
/* now perform rounding */
if (MPFR_UNLIKELY(bx > __gmpfr_emax))
@@ -614,6 +773,82 @@ mpfr_add1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
#endif /* !defined(MPFR_GENERIC_ABI) */
+/* {ap, n} <- {bp, n} + {cp + q, n - q} >> r where d = q * GMP_NUMB_BITS + r.
+ Return the carry at ap[n+1] (0 or 1) and set *low so that:
+ * the most significant bit of *low would be that of ap[-1] if we would
+ compute one more limb of the (infinite) addition
+ * the GMP_NUMB_BITS-1 least significant bits of *low are zero iff all bits
+ of ap[-1], ap[-2], ... would be zero (except the most significant bit
+ of ap[-1).
+ Assume 0 < d < GMP_NUMB_BITS*n. */
+static mp_limb_t
+mpfr_addrsh (mp_limb_t *ap, mp_limb_t *bp, mp_limb_t *cp, mp_size_t n,
+ mp_size_t d, mp_limb_t *low)
+{
+ mp_limb_t cy, cy2, c_shifted;
+ mp_size_t i;
+
+ if (d < GMP_NUMB_BITS)
+ {
+ /* {ap, n} <- {bp, n} + {cp, n} >> d */
+ MPFR_ASSERTD (d > 0);
+ /* thus 0 < GMP_NUMB_BITS - d < GMP_NUMB_BITS */
+ *low = cp[0] << (GMP_NUMB_BITS - d);
+ for (i = 0, cy = 0; i < n - 1; i++)
+ {
+ c_shifted = (cp[i+1] << (GMP_NUMB_BITS - d)) | (cp[i] >> d);
+ ap[i] = bp[i] + c_shifted;
+ cy2 = ap[i] < c_shifted;
+ ap[i] += cy;
+ cy = cy2 + (ap[i] < cy);
+ }
+ /* most significant limb is special */
+ c_shifted = cp[i] >> d;
+ ap[i] = bp[i] + c_shifted;
+ cy2 = ap[i] < c_shifted;
+ ap[i] += cy;
+ cy = cy2 + (ap[i] < cy);
+ }
+ else /* d >= GMP_NUMB_BITS */
+ {
+ mp_size_t q = d / GMP_NUMB_BITS;
+ mpfr_uexp_t r = d % GMP_NUMB_BITS;
+ if (r == 0)
+ {
+ MPFR_ASSERTD(q > 0);
+ *low = cp[q-1];
+ for (i = 0; i < q-1; i++)
+ *low |= !!cp[i];
+ cy = mpn_add_n (ap, bp, cp + q, n - q);
+ cy = mpn_add_1 (ap + n - q, bp + n - q, q, cy);
+ }
+ else /* 0 < r < GMP_NUMB_BITS */
+ {
+ *low = cp[q] << (GMP_NUMB_BITS - r);
+ for (i = 0; i < q; i++)
+ *low |= !!cp[i];
+ for (i = 0, cy = 0; i < n - q - 1; i++)
+ {
+ c_shifted = (cp[q+i+1] << (GMP_NUMB_BITS - r)) | (cp[q+i] >> r);
+ ap[i] = bp[i] + c_shifted;
+ cy2 = ap[i] < c_shifted;
+ ap[i] += cy;
+ cy = cy2 + (ap[i] < cy);
+ }
+ /* most significant limb of c is special */
+ MPFR_ASSERTD(i == n - q - 1);
+ c_shifted = cp[n-1] >> r;
+ ap[i] = bp[i] + c_shifted;
+ cy2 = ap[i] < c_shifted;
+ ap[i] += cy;
+ cy = cy2 + (ap[i] < cy);
+ /* upper limbs are copied */
+ cy = mpn_add_1 (ap + n - q, bp + n - q, q, cy);
+ }
+ }
+ return cy;
+}
+
/* compute sign(b) * (|b| + |c|).
Returns 0 iff result is exact,
a negative value when the result is less than the exact value,
@@ -625,14 +860,11 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mpfr_prec_t p;
unsigned int sh;
mp_size_t n;
- mp_limb_t *ap, *cp;
+ mp_limb_t *ap = MPFR_MANT(a);
mpfr_exp_t bx;
- mp_limb_t limb;
+ mp_limb_t limb, rb, sb;
int inexact;
int neg;
- MPFR_TMP_DECL(marker);
-
- MPFR_TMP_MARK(marker);
MPFR_ASSERTD(MPFR_PREC(a) == MPFR_PREC(b) && MPFR_PREC(b) == MPFR_PREC(c));
MPFR_ASSERTD(MPFR_IS_PURE_FP(b));
@@ -657,6 +889,9 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (2 * GMP_NUMB_BITS < p && p < 3 * GMP_NUMB_BITS)
return mpfr_add1sp3 (a, b, c, rnd_mode, p);
+
+ if (p == 2 * GMP_NUMB_BITS)
+ return mpfr_add1sp2n (a, b, c, rnd_mode);
#endif
/* We need to get the sign before the possible exchange. */
@@ -684,14 +919,13 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
/* mpfr_print_mant_binary("C= ", MPFR_MANT(c), p); */
/* mpfr_print_mant_binary("B= ", MPFR_MANT(b), p); */
bx++; /* exp + 1 */
- ap = MPFR_MANT(a);
limb = mpn_add_n (ap, MPFR_MANT(b), MPFR_MANT(c), n);
/* mpfr_print_mant_binary("A= ", ap, p); */
MPFR_ASSERTD(limb != 0); /* There must be a carry */
- limb = ap[0]; /* Get LSB (In fact, LSW) */
+ rb = ap[0] & (MPFR_LIMB_ONE << sh); /* Get round bit (sb=0) */
mpn_rshift (ap, ap, n, 1); /* Shift mantissa A */
ap[n-1] |= MPFR_LIMB_HIGHBIT; /* Set MSB */
- ap[0] &= ~MPFR_LIMB_MASK(sh); /* Clear LSB bit */
+ ap[0] &= ~MPFR_LIMB_MASK(sh); /* Clear round bit */
/* Fast track for faithful rounding: since b and c have the same
@@ -700,7 +934,7 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (rnd_mode == MPFR_RNDF)
{ inexact = 0; goto set_exponent; }
- if ((limb & (MPFR_LIMB_ONE << sh)) == 0) /* Check exact case */
+ if (rb == 0) /* Check exact case */
{ inexact = 0; goto set_exponent; }
/* Zero: Truncate
@@ -734,16 +968,16 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (rnd_mode == MPFR_RNDN || MPFR_IS_LIKE_RNDZ (rnd_mode, neg))
{
copy_set_exponent:
- ap = MPFR_MANT (a);
- MPN_COPY (ap, MPFR_MANT(b), n);
+ if (a != b)
+ MPN_COPY (ap, MPFR_MANT(b), n);
inexact = -1;
goto set_exponent;
}
else
{
copy_add_one_ulp:
- ap = MPFR_MANT(a);
- MPN_COPY (ap, MPFR_MANT(b), n);
+ if (a != b)
+ MPN_COPY (ap, MPFR_MANT(b), n);
goto add_one_ulp;
}
}
@@ -756,18 +990,9 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (rnd_mode == MPFR_RNDN)
{
/* Check if C was a power of 2 */
- cp = MPFR_MANT(c);
- if (MPFR_UNLIKELY (cp[n-1] == MPFR_LIMB_HIGHBIT))
- {
- mp_size_t k = n-1;
- do
- k--;
- while (k >= 0 && cp[k] == 0);
- if (MPFR_UNLIKELY (k < 0))
- /* Power of 2: Even rule */
- if (((MPFR_MANT (b))[0] & (MPFR_LIMB_ONE << sh)) == 0)
- goto copy_set_exponent;
- }
+ if (mpfr_powerof2_raw (c) &&
+ ((MPFR_MANT (b))[0] & (MPFR_LIMB_ONE << sh)) == 0)
+ goto copy_set_exponent;
/* Not a Power of 2 */
goto copy_add_one_ulp;
}
@@ -779,162 +1004,67 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
else /* 0 < d < p */
{
- mp_limb_t mask;
- mp_limb_t bcp, bcp1; /* Cp and C'p+1 */
+ mp_limb_t mask = ~MPFR_LIMB_MASK(sh);
/* General case: 1 <= d < p */
- cp = MPFR_TMP_LIMBS_ALLOC (n);
-
- /* Shift c in temporary allocated place */
- {
- mpfr_uexp_t dm;
- mp_size_t m;
-
- dm = d % GMP_NUMB_BITS;
- m = d / GMP_NUMB_BITS;
- if (MPFR_UNLIKELY (dm == 0))
- {
- /* dm = 0 and m > 0: Just copy */
- MPFR_ASSERTD (m != 0);
- MPN_COPY(cp, MPFR_MANT(c)+m, n-m);
- MPN_ZERO(cp+n-m, m);
- }
- else if (MPFR_LIKELY(m == 0))
- {
- /* dm >=1 and m == 0: just shift */
- MPFR_ASSERTD(dm >= 1);
- mpn_rshift(cp, MPFR_MANT(c), n, dm);
- }
- else
- {
- /* dm > 0 and m > 0: shift and zero */
- mpn_rshift(cp, MPFR_MANT(c)+m, n-m, dm);
- MPN_ZERO(cp+n-m, m);
- }
- }
-
- /* mpfr_print_mant_binary("Before", MPFR_MANT(c), p);
- mpfr_print_mant_binary("B= ", MPFR_MANT(b), p);
- mpfr_print_mant_binary("After ", cp, p); */
- /* fast track for RNDF */
- if (rnd_mode == MPFR_RNDF)
- {
- /* The bcp and bcp1 values will not matter for MPFR_RNDF, but
- let's set them to 0 to avoid undefined behavior. */
- bcp1 = bcp = 0;
- goto clean;
- }
+ limb = mpfr_addrsh (ap, MPFR_MANT(b), MPFR_MANT(c), n, d, &sb);
+ /* the most significant bit of sb contains what would be the most
+ significant bit of ap[-1], and the remaining bits of sb are 0
+ iff the remaining bits of ap[-1], ap[-2], ... are all zero */
- /* Compute bcp=Cp and bcp1=C'p+1: bcp is the first neglected bit
- (round bit), and bcp1 corresponds to the remaining bits (sticky bit).
- */
if (sh > 0)
{
- /* Try to compute them from C' rather than C */
- bcp = (cp[0] & (MPFR_LIMB_ONE<<(sh-1)));
- if (MPFR_LIKELY (cp[0] & MPFR_LIMB_MASK (sh - 1)))
- bcp1 = 1;
- else
- {
- /* We can't compute C'p+1 from C'. Compute it from C */
- /* Start from bit x=p-d+sh in mantissa C
- (+sh since we have already looked sh bits in C'!) */
- mpfr_prec_t x = p - d + sh - 1;
- if (MPFR_LIKELY (x > p))
- /* We are already looked at all the bits of c, so C'p+1 = 0*/
- bcp1 = 0;
- else
- {
- mp_limb_t *tp = MPFR_MANT(c);
- mp_size_t kx = n - 1 - (x / GMP_NUMB_BITS);
- mpfr_prec_t sx = GMP_NUMB_BITS - 1 - (x % GMP_NUMB_BITS);
- /* printf ("(First) x=%lu Kx=%ld Sx=%lu\n",
- (unsigned long) x, (long) kx, (unsigned long) sx); */
- /* Looks at the last bits of limb kx (if sx=0 does nothing)*/
- if (tp[kx] & MPFR_LIMB_MASK(sx))
- bcp1 = 1;
- else
- {
- /*kx += (sx==0);*/
- /*If sx==0, tp[kx] hasn't been checked*/
- do
- kx--;
- while (kx >= 0 && tp[kx] == 0);
- bcp1 = (kx >= 0);
- }
- }
- }
+ /* The round bit and a part of the sticky bit are in ap[0]. */
+ rb = (ap[0] & (MPFR_LIMB_ONE << (sh - 1)));
+ sb |= ap[0] & MPFR_LIMB_MASK (sh - 1);
}
- else /* sh == 0 */
- {
- /* Compute Cp and C'p+1 from C with sh=0 */
- 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 / GMP_NUMB_BITS);
- mpfr_prec_t sx = GMP_NUMB_BITS - 1 - (x % GMP_NUMB_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)*/
- if (tp[kx] & MPFR_LIMB_MASK(sx))
- bcp1 = 1;
- else
- {
- do
- kx--;
- while (kx >= 0 && tp[kx] == 0);
- bcp1 = (kx >= 0);
- }
+ else
+ {
+ /* The round bit and possibly a part of the sticky bit are
+ in sb. */
+ rb = sb & MPFR_LIMB_HIGHBIT;
+ sb &= ~MPFR_LIMB_HIGHBIT;
}
- /* printf("sh=%u Cp=%lu C'p+1=%lu\n", sh,
- (unsigned long) bcp, (unsigned long) bcp1); */
-
- clean:
- /* Clean shifted C' */
- mask = ~MPFR_LIMB_MASK(sh);
- cp[0] &= mask;
-
- /* Add the mantissa c from b in a */
- ap = MPFR_MANT(a);
- limb = mpn_add_n (ap, MPFR_MANT(b), cp, n);
- /* mpfr_print_mant_binary("Add= ", ap, p); */
-
- /* Check for overflow */
- if (MPFR_UNLIKELY (limb))
- {
- limb = ap[0] & (MPFR_LIMB_ONE<<sh); /* Get LSB */
- mpn_rshift (ap, ap, n, 1); /* Shift mantissa */
- bx++; /* Fix exponent */
- ap[n-1] |= MPFR_LIMB_HIGHBIT; /* Set MSB */
- ap[0] &= mask; /* Clear LSB bit */
- bcp1 |= bcp; /* Recompute C'p+1 */
- bcp = limb; /* Recompute Cp */
- /* printf ("(Overflow) Cp=%lu C'p+1=%lu\n",
- (unsigned long) bcp, (unsigned long) bcp1);
+
+ ap[0] &= mask;
+
+ /* Check for carry out */
+ if (MPFR_UNLIKELY (limb != 0))
+ {
+ limb = ap[0] & (MPFR_LIMB_ONE << sh); /* Get LSB (will be new rb) */
+ mpn_rshift (ap, ap, n, 1); /* Shift significand */
+ bx++; /* Increase exponent */
+ ap[n-1] |= MPFR_LIMB_HIGHBIT; /* Set MSB */
+ ap[0] &= mask; /* Clear LSB */
+ sb |= rb; /* Update sb */
+ rb = limb; /* New rb */
+ /* printf ("(Overflow) rb=%lu sb=%lu\n",
+ (unsigned long) rb, (unsigned long) sb);
mpfr_print_mant_binary ("Add= ", ap, p); */
}
/* Round:
Zero: Truncate but could be exact.
- Away: Add 1 if Cp or C'p+1 !=0
- Nearest: Truncate but could be exact if Cp==0
- Add 1 if C'p+1 !=0,
+ Away: Add 1 if rb or sb !=0
+ Nearest: Truncate but could be exact if sb==0
+ Add 1 if rb !=0,
Even rule else */
if (MPFR_LIKELY(rnd_mode == MPFR_RNDF))
{ inexact = 0; goto set_exponent; }
else if (rnd_mode == MPFR_RNDN)
{
- inexact = - (bcp1 != 0);
- if (bcp == 0)
+ inexact = - (sb != 0);
+ if (rb == 0)
goto set_exponent;
- else if (MPFR_UNLIKELY(bcp1==0) && (ap[0]&(MPFR_LIMB_ONE<<sh))==0)
+ else if (MPFR_UNLIKELY (sb == 0) &&
+ (ap[0] & (MPFR_LIMB_ONE << sh)) == 0)
{ inexact = -1; goto set_exponent; }
else
goto add_one_ulp;
}
MPFR_UPDATE_RND_MODE(rnd_mode, neg);
- inexact = -(bcp != 0 || bcp1 != 0);
+ inexact = - (rb != 0 || sb != 0);
if (rnd_mode == MPFR_RNDZ || inexact == 0)
goto set_exponent;
else
@@ -945,7 +1075,7 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
add_one_ulp:
/* add one unit in last place to a */
/* printf("AddOneUlp\n"); */
- if (MPFR_UNLIKELY( mpn_add_1(ap, ap, n, MPFR_LIMB_ONE<<sh) ))
+ if (MPFR_UNLIKELY (mpn_add_1 (ap, ap, n, MPFR_LIMB_ONE << sh)))
{
/* Case 100000x0 = 0x1111x1 + 1*/
/* printf("Pow of 2\n"); */
@@ -958,11 +1088,9 @@ mpfr_add1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (MPFR_UNLIKELY(bx > __gmpfr_emax)) /* Check for overflow */
{
/* printf("Overflow\n"); */
- MPFR_TMP_FREE(marker);
return mpfr_overflow (a, rnd_mode, MPFR_SIGN(a));
}
MPFR_SET_EXP (a, bx);
- MPFR_TMP_FREE(marker);
MPFR_RET (inexact * MPFR_INT_SIGN (a));
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/add1sp1_extracted.c b/Build/source/libs/mpfr/mpfr-src/src/add1sp1_extracted.c
new file mode 100644
index 00000000000..1ff0db1a0e8
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/add1sp1_extracted.c
@@ -0,0 +1,363 @@
+/* mpfr_add1sp1 -- internal function to perform a "real" addition on one limb
+ This code was extracted by Kremlin from a formal proof in F*
+ done by Jianyang Pan in April-August 2018: do not modify it!
+
+Source: https://github.com/project-everest/hacl-star/tree/dev_mpfr/code/mpfr
+
+Copyright 2004-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define int64_t long
+#define uint32_t unsigned int
+#define uint64_t mp_limb_t
+
+typedef struct MPFR_Add1sp1_state_s
+{
+ int64_t sh;
+ int64_t bx;
+ uint64_t rb;
+ uint64_t sb;
+}
+MPFR_Add1sp1_state;
+
+static MPFR_Add1sp1_state
+MPFR_Add1sp1_mk_state(int64_t sh, int64_t bx, uint64_t rb, uint64_t sb)
+{
+ return ((MPFR_Add1sp1_state){ .sh = sh, .bx = bx, .rb = rb, .sb = sb });
+}
+
+typedef struct K___uint64_t_int64_t_s
+{
+ uint64_t fst;
+ int64_t snd;
+}
+K___uint64_t_int64_t;
+
+typedef struct K___uint64_t_uint64_t_int64_t_s
+{
+ uint64_t fst;
+ uint64_t snd;
+ int64_t thd;
+}
+K___uint64_t_uint64_t_int64_t;
+
+#define MPFR_Lib_mpfr_struct __mpfr_struct
+#define MPFR_Lib_mpfr_RET(I) ((I) != 0 ? ((__gmpfr_flags |= MPFR_FLAGS_INEXACT), (I)) : 0)
+#define MPFR_Exceptions_mpfr_overflow mpfr_overflow
+#define mpfr_prec _mpfr_prec
+#define mpfr_exp _mpfr_exp
+#define mpfr_d _mpfr_d
+#define mpfr_sign _mpfr_sign
+#define MPFR_Lib_gmp_NUMB_BITS GMP_NUMB_BITS
+#define MPFR_Lib_mpfr_EMAX __gmpfr_emax
+
+#define MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode) (rnd_mode == MPFR_RNDN)
+#define MPFR_RoundingMode_mpfr_IS_LIKE_RNDZ MPFR_IS_LIKE_RNDZ
+
+/* same as mpfr_add1sp, but for p < GMP_NUMB_BITS */
+static int
+mpfr_add1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
+ mpfr_prec_t p)
+{
+ MPFR_Lib_mpfr_struct a0 = a[0U];
+ MPFR_Lib_mpfr_struct b0 = b[0U];
+ MPFR_Lib_mpfr_struct c0 = c[0U];
+ int64_t bx = b0.mpfr_exp;
+ int64_t cx = c0.mpfr_exp;
+ int64_t sh = MPFR_Lib_gmp_NUMB_BITS - p;
+ MPFR_Add1sp1_state st;
+ if (bx == cx)
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = b0.mpfr_d;
+ uint64_t *cp = c0.mpfr_d;
+ uint64_t a01 = (bp[0U] >> (uint32_t)1U) + (cp[0U] >> (uint32_t)1U);
+ int64_t bx1 = b0.mpfr_exp + (int64_t)1;
+ uint64_t rb = a01 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ ap[0U] = a01 ^ rb;
+ uint64_t sb = (uint64_t)0U;
+ st = MPFR_Add1sp1_mk_state(sh, bx1, rb, sb);
+ }
+ else
+ {
+ MPFR_Add1sp1_state ite0;
+ if (bx > cx)
+ {
+ int64_t bx1 = b0.mpfr_exp;
+ int64_t cx1 = c0.mpfr_exp;
+ int64_t d = bx1 - cx1;
+ uint64_t mask = ((uint64_t)1U << (uint32_t)sh) - (uint64_t)1U;
+ MPFR_Add1sp1_state ite1;
+ if (d < sh)
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = b0.mpfr_d;
+ uint64_t *cp = c0.mpfr_d;
+ int64_t bx2 = b0.mpfr_exp;
+ uint64_t a01 = bp[0U] + (cp[0U] >> (uint32_t)d);
+ K___uint64_t_int64_t scrut;
+ if (a01 < bp[0U])
+ scrut =
+ (
+ (K___uint64_t_int64_t){
+ .fst = (uint64_t)0x8000000000000000U | a01 >> (uint32_t)1U,
+ .snd = bx2 + (int64_t)1
+ }
+ );
+ else
+ scrut = ((K___uint64_t_int64_t){ .fst = a01, .snd = bx2 });
+ uint64_t a02 = scrut.fst;
+ int64_t bx3 = scrut.snd;
+ uint64_t rb = a02 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ uint64_t sb = (a02 & mask) ^ rb;
+ ap[0U] = a02 & ~mask;
+ ite1 = MPFR_Add1sp1_mk_state(sh, bx3, rb, sb);
+ }
+ else
+ {
+ MPFR_Add1sp1_state ite;
+ if (d < MPFR_Lib_gmp_NUMB_BITS)
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = b0.mpfr_d;
+ uint64_t *cp = c0.mpfr_d;
+ int64_t bx2 = b0.mpfr_exp;
+ uint64_t sb = cp[0U] << (uint32_t)(MPFR_Lib_gmp_NUMB_BITS - d);
+ uint64_t a01 = bp[0U] + (cp[0U] >> (uint32_t)d);
+ K___uint64_t_uint64_t_int64_t scrut;
+ if (a01 < bp[0U])
+ scrut =
+ (
+ (K___uint64_t_uint64_t_int64_t){
+ .fst = sb | (a01 & (uint64_t)1U),
+ .snd = (uint64_t)0x8000000000000000U | a01 >> (uint32_t)1U,
+ .thd = bx2 + (int64_t)1
+ }
+ );
+ else
+ scrut = ((K___uint64_t_uint64_t_int64_t){ .fst = sb, .snd = a01, .thd = bx2 });
+ uint64_t sb1 = scrut.fst;
+ uint64_t a02 = scrut.snd;
+ int64_t bx3 = scrut.thd;
+ uint64_t rb = a02 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ uint64_t sb2 = sb1 | ((a02 & mask) ^ rb);
+ ap[0U] = a02 & ~mask;
+ ite = MPFR_Add1sp1_mk_state(sh, bx3, rb, sb2);
+ }
+ else
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = b0.mpfr_d;
+ int64_t bx2 = b0.mpfr_exp;
+ ap[0U] = bp[0U];
+ uint64_t rb = (uint64_t)0U;
+ uint64_t sb = (uint64_t)1U;
+ ite = MPFR_Add1sp1_mk_state(sh, bx2, rb, sb);
+ }
+ ite1 = ite;
+ }
+ ite0 = ite1;
+ }
+ else
+ {
+ int64_t bx1 = c0.mpfr_exp;
+ int64_t cx1 = b0.mpfr_exp;
+ int64_t d = bx1 - cx1;
+ uint64_t mask = ((uint64_t)1U << (uint32_t)sh) - (uint64_t)1U;
+ MPFR_Add1sp1_state ite1;
+ if (d < sh)
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = c0.mpfr_d;
+ uint64_t *cp = b0.mpfr_d;
+ int64_t bx2 = c0.mpfr_exp;
+ uint64_t a01 = bp[0U] + (cp[0U] >> (uint32_t)d);
+ K___uint64_t_int64_t scrut;
+ if (a01 < bp[0U])
+ scrut =
+ (
+ (K___uint64_t_int64_t){
+ .fst = (uint64_t)0x8000000000000000U | a01 >> (uint32_t)1U,
+ .snd = bx2 + (int64_t)1
+ }
+ );
+ else
+ scrut = ((K___uint64_t_int64_t){ .fst = a01, .snd = bx2 });
+ uint64_t a02 = scrut.fst;
+ int64_t bx3 = scrut.snd;
+ uint64_t rb = a02 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ uint64_t sb = (a02 & mask) ^ rb;
+ ap[0U] = a02 & ~mask;
+ ite1 = MPFR_Add1sp1_mk_state(sh, bx3, rb, sb);
+ }
+ else
+ {
+ MPFR_Add1sp1_state ite;
+ if (d < MPFR_Lib_gmp_NUMB_BITS)
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = c0.mpfr_d;
+ uint64_t *cp = b0.mpfr_d;
+ int64_t bx2 = c0.mpfr_exp;
+ uint64_t sb = cp[0U] << (uint32_t)(MPFR_Lib_gmp_NUMB_BITS - d);
+ uint64_t a01 = bp[0U] + (cp[0U] >> (uint32_t)d);
+ K___uint64_t_uint64_t_int64_t scrut;
+ if (a01 < bp[0U])
+ scrut =
+ (
+ (K___uint64_t_uint64_t_int64_t){
+ .fst = sb | (a01 & (uint64_t)1U),
+ .snd = (uint64_t)0x8000000000000000U | a01 >> (uint32_t)1U,
+ .thd = bx2 + (int64_t)1
+ }
+ );
+ else
+ scrut = ((K___uint64_t_uint64_t_int64_t){ .fst = sb, .snd = a01, .thd = bx2 });
+ uint64_t sb1 = scrut.fst;
+ uint64_t a02 = scrut.snd;
+ int64_t bx3 = scrut.thd;
+ uint64_t rb = a02 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ uint64_t sb2 = sb1 | ((a02 & mask) ^ rb);
+ ap[0U] = a02 & ~mask;
+ ite = MPFR_Add1sp1_mk_state(sh, bx3, rb, sb2);
+ }
+ else
+ {
+ uint64_t *ap = a0.mpfr_d;
+ uint64_t *bp = c0.mpfr_d;
+ int64_t bx2 = c0.mpfr_exp;
+ ap[0U] = bp[0U];
+ uint64_t rb = (uint64_t)0U;
+ uint64_t sb = (uint64_t)1U;
+ ite = MPFR_Add1sp1_mk_state(sh, bx2, rb, sb);
+ }
+ ite1 = ite;
+ }
+ ite0 = ite1;
+ }
+ st = ite0;
+ }
+ if (st.bx > MPFR_Lib_mpfr_EMAX)
+ {
+ int32_t t = MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ return t;
+ }
+ else
+ {
+ uint64_t *ap = a->mpfr_d;
+ uint64_t a01 = ap[0U];
+ MPFR_Lib_mpfr_struct uu___72_3478 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3478.mpfr_prec,
+ .mpfr_sign = uu___72_3478.mpfr_sign,
+ .mpfr_exp = st.bx,
+ .mpfr_d = uu___72_3478.mpfr_d
+ }
+ );
+ if (st.rb == (uint64_t)0U && st.sb == (uint64_t)0U)
+ return MPFR_Lib_mpfr_RET((int32_t)0);
+ else if (MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode))
+ if
+ (
+ st.rb
+ == (uint64_t)0U
+ || (st.sb == (uint64_t)0U && (a01 & (uint64_t)1U << (uint32_t)st.sh) == (uint64_t)0U)
+ )
+ {
+ int32_t ite;
+ if (a->mpfr_sign == (int32_t)1)
+ ite = (int32_t)-1;
+ else
+ ite = (int32_t)1;
+ return MPFR_Lib_mpfr_RET(ite);
+ }
+ else
+ {
+ uint64_t *ap1 = a->mpfr_d;
+ ap1[0U] = ap1[0U] + ((uint64_t)1U << (uint32_t)st.sh);
+ if (ap1[0U] == (uint64_t)0U)
+ {
+ ap1[0U] = (uint64_t)0x8000000000000000U;
+ if (st.bx + (int64_t)1 <= MPFR_Lib_mpfr_EMAX)
+ {
+ MPFR_Lib_mpfr_struct uu___72_3574 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3574.mpfr_prec,
+ .mpfr_sign = uu___72_3574.mpfr_sign,
+ .mpfr_exp = st.bx + (int64_t)1,
+ .mpfr_d = uu___72_3574.mpfr_d
+ }
+ );
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else
+ {
+ int32_t t = MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ return MPFR_Lib_mpfr_RET(t);
+ }
+ }
+ else
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else if (MPFR_RoundingMode_mpfr_IS_LIKE_RNDZ(rnd_mode, a->mpfr_sign < (int32_t)0))
+ {
+ int32_t ite;
+ if (a->mpfr_sign == (int32_t)1)
+ ite = (int32_t)-1;
+ else
+ ite = (int32_t)1;
+ return MPFR_Lib_mpfr_RET(ite);
+ }
+ else
+ {
+ uint64_t *ap1 = a->mpfr_d;
+ ap1[0U] = ap1[0U] + ((uint64_t)1U << (uint32_t)st.sh);
+ if (ap1[0U] == (uint64_t)0U)
+ {
+ ap1[0U] = (uint64_t)0x8000000000000000U;
+ if (st.bx + (int64_t)1 <= MPFR_Lib_mpfr_EMAX)
+ {
+ MPFR_Lib_mpfr_struct uu___72_3781 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3781.mpfr_prec,
+ .mpfr_sign = uu___72_3781.mpfr_sign,
+ .mpfr_exp = st.bx + (int64_t)1,
+ .mpfr_d = uu___72_3781.mpfr_d
+ }
+ );
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else
+ {
+ int32_t t = MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ return MPFR_Lib_mpfr_RET(t);
+ }
+ }
+ else
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/add_d.c b/Build/source/libs/mpfr/mpfr-src/src/add_d.c
index 0cb9cd35e31..a934bfbddcc 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/add_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/add_d.c
@@ -1,7 +1,7 @@
/* mpfr_add_d -- add a multiple precision floating-point number
to a machine double precision float
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/add_ui.c b/Build/source/libs/mpfr/mpfr-src/src/add_ui.c
index f7c487ef609..df774950efd 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/add_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/add_ui.c
@@ -1,6 +1,6 @@
/* mpfr_add_ui -- add a floating-point number with a machine integer
-Copyright 2000-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -56,24 +56,38 @@ mpfr_add_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode
/* Main code */
{
- mpfr_t uu;
- mp_limb_t up[1];
- int cnt;
int inex;
MPFR_SAVE_EXPO_DECL (expo);
- MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
- MPFR_STAT_STATIC_ASSERT (MPFR_LIMB_MAX >= ULONG_MAX);
- /* So, u fits in a mp_limb_t, which justifies the casts below. */
- MPFR_ASSERTD (u != 0);
- count_leading_zeros (cnt, (mp_limb_t) u);
- up[0] = (mp_limb_t) u << cnt;
-
/* 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, GMP_NUMB_BITS - cnt);
- inex = mpfr_add (y, x, uu, rnd_mode);
+
+#ifdef MPFR_LONG_WITHIN_LIMB
+ {
+ mpfr_t uu;
+ mp_limb_t up[1];
+ int cnt;
+
+ MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
+ /* So, u fits in a mp_limb_t, which justifies the casts below. */
+ MPFR_ASSERTD (u != 0);
+ count_leading_zeros (cnt, (mp_limb_t) u);
+ up[0] = (mp_limb_t) u << cnt;
+ MPFR_SET_EXP (uu, GMP_NUMB_BITS - cnt);
+ inex = mpfr_add (y, x, uu, rnd_mode);
+ }
+#else
+ {
+ mpfr_t uu;
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
+ inex = mpfr_add (y, x, uu, rnd_mode);
+ mpfr_clear (uu);
+ }
+#endif
+
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inex, rnd_mode);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/agm.c b/Build/source/libs/mpfr/mpfr-src/src/agm.c
index 27997f010ec..a571ebefb80 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/agm.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/agm.c
@@ -1,6 +1,6 @@
/* mpfr_agm -- arithmetic-geometric mean of two floating-point numbers
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -164,19 +164,27 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode)
e1 > emin (see restriction below).
e1 + scale > emin - 1, thus e1 + scale >= emin.
3. e2 + scale <= emax, since scale < 0. */
- if (e1 + e2 > MPFR_EXT_EMAX)
+ if (e1 + e2 > MPFR_EMAX_MAX)
{
- scaleop = - (((e1 + e2) - MPFR_EXT_EMAX + 1) / 2);
+ scaleop = - (((e1 + e2) - MPFR_EMAX_MAX + 1) / 2);
MPFR_ASSERTN (scaleop < 0);
}
else
{
/* The addition necessarily overflowed. */
- MPFR_ASSERTN (e2 == MPFR_EXT_EMAX);
+ MPFR_ASSERTN (e2 == MPFR_EMAX_MAX);
/* The case where e1 = emin and e2 = emax is not supported
here. This would mean that the precision of e2 would be
huge (and possibly not supported in practice anyway). */
- MPFR_ASSERTN (e1 > MPFR_EXT_EMIN);
+ MPFR_ASSERTN (e1 > MPFR_EMIN_MIN);
+ /* Note: this case is probably impossible to have in practice
+ since we need e2 = emax, and no overflow in the product.
+ Since the product is >= 2^(e1+e2-2), it implies
+ e1 + e2 - 2 <= emax, thus e1 <= 2. Now to get an overflow
+ we need op1 >= 1/2 ulp(op2), which implies that the
+ precision of op2 should be at least emax-2. On a 64-bit
+ computer this is impossible to have, and would require
+ a huge amount of memory on a 32-bit computer. */
scaleop = -1;
}
@@ -191,7 +199,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode)
2. e1 + scale >= emin + 1 >= emin.
3. e2 + scale <= scale <= emax. */
MPFR_ASSERTN (e1 <= e2 && e2 <= 0);
- scaleop = (MPFR_EXT_EMIN + 2 - e1 - e2) / 2;
+ scaleop = (MPFR_EMIN_MIN + 2 - e1 - e2) / 2;
MPFR_ASSERTN (scaleop > 0);
}
@@ -220,7 +228,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode)
mpfr_add (vf, u, v, MPFR_RNDN); /* No overflow? */
mpfr_div_2ui (vf, vf, 1, MPFR_RNDN);
/* See proof in algorithms.tex */
- if (4*eq > p)
+ if (eq > p / 4)
{
mpfr_t w;
MPFR_BLOCK_DECL (flags3);
@@ -257,7 +265,7 @@ mpfr_agm (mpfr_ptr r, mpfr_srcptr op2, mpfr_srcptr op1, mpfr_rnd_t rnd_mode)
mpfr_exp_t scale2;
scale2 = - (((MPFR_GET_EXP (u) + MPFR_GET_EXP (v))
- - MPFR_EXT_EMAX + 1) / 2);
+ - MPFR_EMAX_MAX + 1) / 2);
MPFR_EXP (u) += scale2;
MPFR_EXP (v) += scale2;
scaleit += scale2;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ai.c b/Build/source/libs/mpfr/mpfr-src/src/ai.c
index 58d4addce30..66650dddd16 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ai.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ai.c
@@ -1,6 +1,6 @@
/* mpfr_ai -- Airy function Ai
-Copyright 2010-2019 Free Software Foundation, Inc.
+Copyright 2010-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -106,6 +106,9 @@ mpfr_ai1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
return mpfr_check_range (y, r, rnd);
}
+ /* now x is not zero */
+ MPFR_ASSERTD(!MPFR_IS_ZERO(x));
+
/* FIXME: underflow for large values of |x| ? */
@@ -133,43 +136,56 @@ mpfr_ai1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
mpfr_init2 (tmp2_sp, MPFR_SMALL_PRECISION);
mpfr_abs (tmp_sp, x, MPFR_RNDU);
mpfr_pow_ui (tmp_sp, tmp_sp, 3, MPFR_RNDU);
- mpfr_sqrt (tmp_sp, tmp_sp, MPFR_RNDU); /* tmp_sp ~ x^3/2 */
+ mpfr_sqrt (tmp_sp, tmp_sp, MPFR_RNDU); /* tmp_sp ~ |x|^(3/2) */
/* 0.96179669392597567 >~ 2/3 * log2(e). See algorithms.tex */
mpfr_set_str (tmp2_sp, "0.96179669392597567", 10, MPFR_RNDU);
mpfr_mul (tmp2_sp, tmp_sp, tmp2_sp, MPFR_RNDU);
/* cond represents the number of lost bits in the evaluation of the sum */
- if ( (MPFR_IS_ZERO (x)) || (MPFR_GET_EXP (x) <= 0) )
+ if (MPFR_GET_EXP (x) <= 0)
cond = 0;
else
- cond = mpfr_get_ui (tmp2_sp, MPFR_RNDU) - (MPFR_GET_EXP (x)-1)/4 - 1;
+ {
+ MPFR_BLOCK_DECL (flags);
+
+ MPFR_BLOCK (flags, cond = mpfr_get_ui (tmp2_sp, MPFR_RNDU));
+ MPFR_ASSERTN (! MPFR_ERANGEFLAG (flags));
+ cond -= (MPFR_GET_EXP (x) - 1) / 4 + 1;
+ }
/* The variable assumed_exponent is used to store the maximal assumed */
/* exponent of Ai(x). More precisely, we assume that |Ai(x)| will be */
/* greater than 2^{-assumed_exponent}. */
- if (MPFR_IS_ZERO (x))
- assumed_exponent = 2;
- else
+ if (MPFR_IS_POS (x))
{
- if (MPFR_IS_POS (x))
+ if (MPFR_GET_EXP (x) <= 0)
+ assumed_exponent = 3;
+ else
{
- if (MPFR_GET_EXP (x) <= 0)
- assumed_exponent = 3;
- else
- assumed_exponent = (2 + (MPFR_GET_EXP (x)/4 + 1)
- + mpfr_get_ui (tmp2_sp, MPFR_RNDU));
+ unsigned long int t;
+ MPFR_BLOCK_DECL (flags);
+
+ MPFR_BLOCK (flags, t = mpfr_get_ui (tmp2_sp, MPFR_RNDU));
+ MPFR_ASSERTN (! MPFR_ERANGEFLAG (flags));
+ assumed_exponent = t + 2 + (MPFR_GET_EXP (x) / 4 + 1);
+ MPFR_ASSERTN (assumed_exponent > t);
}
- /* We do not know Ai (x) yet */
- /* We cover the case when EXP (Ai (x))>=-10 */
- else
- assumed_exponent = 10;
}
+ /* We do not know Ai (x) yet */
+ /* We cover the case when EXP (Ai (x))>=-10 */
+ else
+ assumed_exponent = 10;
{
- mpfr_prec_t incr =
- MPFR_INT_CEIL_LOG2 (prec) + 5 + cond + assumed_exponent;
- wprec = MPFR_ADD_PREC (prec, incr);
+ unsigned long int t, u;
+
+ t = assumed_exponent + cond;
+ MPFR_ASSERTN (t >= cond);
+ u = MPFR_INT_CEIL_LOG2 (prec) + 5;
+ t += u;
+ MPFR_ASSERTN (t >= u);
+ wprec = MPFR_ADD_PREC (prec, t);
}
mpfr_init (ti);
@@ -244,15 +260,13 @@ mpfr_ai1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
MPFR_LOG_MSG (("Roundoff error: %Pu\n", err));
MPFR_LOG_MSG (("Approxim error: %Pu\n", wprec-prec-1));
- if (wprec < err+1)
- correct_bits=0;
+ if (wprec < err + 1)
+ correct_bits = 0;
+ else if (wprec < err + prec +1)
+ correct_bits = wprec - err - 1; /* since wprec > err + 1,
+ correct_bits > 0 */
else
- {
- if (wprec < err+prec+1)
- correct_bits = wprec - err - 1;
- else
- correct_bits = prec;
- }
+ correct_bits = prec;
if (MPFR_LIKELY (MPFR_CAN_ROUND (s, correct_bits, MPFR_PREC (y), rnd)))
break;
@@ -262,26 +276,24 @@ mpfr_ai1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
assumed_exponent *= 2;
MPFR_LOG_MSG (("Not a single bit correct (assumed_exponent=%lu)\n",
assumed_exponent));
- wprec = prec + 5 + MPFR_INT_CEIL_LOG2 (k) + cond + assumed_exponent;
+ wprec = prec + 5 + MPFR_INT_CEIL_LOG2 (prec) + cond +
+ assumed_exponent;
+ }
+ else if (correct_bits < prec)
+ { /* The precision was badly chosen */
+ MPFR_LOG_MSG (("Bad assumption on the exponent of Ai(x)"
+ " (E=%" MPFR_EXP_FSPEC "d)\n",
+ (mpfr_eexp_t) MPFR_GET_EXP (s)));
+ wprec = prec + err + 1;
}
else
- {
- if (correct_bits < prec)
- { /* The precision was badly chosen */
- MPFR_LOG_MSG (("Bad assumption on the exponent of Ai(x)"
- " (E=%" MPFR_EXP_FSPEC "d)\n",
- (mpfr_eexp_t) MPFR_GET_EXP (s)));
- wprec = prec + err + 1;
- }
- else
- { /* We are really in a bad case of the TMD */
- MPFR_ZIV_NEXT (loop, prec);
+ { /* We are really in a bad case of the TMD */
+ MPFR_ZIV_NEXT (loop, prec);
- /* We update wprec */
- /* We assume that K will not be multiplied by more than 4 */
- wprec = prec + (MPFR_INT_CEIL_LOG2 (k)+2) + 5 + cond
- - MPFR_GET_EXP (s);
- }
+ /* We update wprec */
+ /* We assume that K will not be multiplied by more than 4 */
+ wprec = prec + (MPFR_INT_CEIL_LOG2 (k) + 2) + 5 + cond
+ - MPFR_GET_EXP (s);
}
} /* End of ZIV loop */
@@ -305,7 +317,7 @@ mpfr_ai1 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
/* Airy function Ai evaluated by Smith algorithm.
- Assume that x is a finite number. */
+ Assume that x is a finite non-zero number. */
static int
mpfr_ai2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
{
@@ -338,7 +350,6 @@ mpfr_ai2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
/* FIXME: underflow for large values of |x| */
-
/* Set initial precision */
/* See the analysis for the naive evaluation */
@@ -350,40 +361,57 @@ mpfr_ai2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
mpfr_init2 (tmp2_sp, MPFR_SMALL_PRECISION);
mpfr_abs (tmp_sp, x, MPFR_RNDU);
mpfr_pow_ui (tmp_sp, tmp_sp, 3, MPFR_RNDU);
- mpfr_sqrt (tmp_sp, tmp_sp, MPFR_RNDU); /* tmp_sp ~ x^3/2 */
+ mpfr_sqrt (tmp_sp, tmp_sp, MPFR_RNDU); /* tmp_sp ~ |x|^(3/2) */
/* 0.96179669392597567 >~ 2/3 * log2(e). See algorithms.tex */
mpfr_set_str (tmp2_sp, "0.96179669392597567", 10, MPFR_RNDU);
mpfr_mul (tmp2_sp, tmp_sp, tmp2_sp, MPFR_RNDU);
/* cond represents the number of lost bits in the evaluation of the sum */
- if ( (MPFR_IS_ZERO (x)) || (MPFR_GET_EXP (x) <= 0) )
+ if (MPFR_GET_EXP (x) <= 0)
cond = 0;
else
- cond = mpfr_get_ui (tmp2_sp, MPFR_RNDU) - (MPFR_GET_EXP (x) - 1)/4 - 1;
+ {
+ MPFR_BLOCK_DECL (flags);
+
+ MPFR_BLOCK (flags, cond = mpfr_get_ui (tmp2_sp, MPFR_RNDU));
+ MPFR_ASSERTN (! MPFR_ERANGEFLAG (flags));
+ cond -= (MPFR_GET_EXP (x) - 1) / 4 + 1;
+ }
/* This variable is used to store the maximal assumed exponent of */
- /* Ai (x). More precisely, we assume that |Ai (x)| will be greater than */
- /* 2^{-assumedExp}. */
- if (MPFR_IS_ZERO (x))
- assumed_exponent = 2;
- else
+ /* Ai(x). More precisely, we assume that |Ai(x)| will be greater than */
+ /* 2^{-assumed_exponent}. */
+ if (MPFR_IS_POS (x))
{
- if (MPFR_IS_POS (x))
+ if (MPFR_GET_EXP (x) <= 0)
+ assumed_exponent = 3;
+ else
{
- if (MPFR_GET_EXP (x) <= 0)
- assumed_exponent = 3;
- else
- assumed_exponent = (2 + (MPFR_GET_EXP (x)/4 + 1)
- + mpfr_get_ui (tmp2_sp, MPFR_RNDU));
+ unsigned long int t;
+ MPFR_BLOCK_DECL (flags);
+
+ MPFR_BLOCK (flags, t = mpfr_get_ui (tmp2_sp, MPFR_RNDU));
+ MPFR_ASSERTN (! MPFR_ERANGEFLAG (flags));
+ assumed_exponent = t + 2 + (MPFR_GET_EXP (x) / 4 + 1);
+ MPFR_ASSERTN (assumed_exponent > t);
}
- /* We do not know Ai (x) yet */
- /* We cover the case when EXP (Ai (x))>=-10 */
- else
- assumed_exponent = 10;
}
+ /* We do not know Ai(x) yet */
+ /* We cover the case when EXP(Ai(x))>=-10 */
+ else
+ assumed_exponent = 10;
- wprec = prec + MPFR_INT_CEIL_LOG2 (prec) + 6 + cond + assumed_exponent;
+ {
+ unsigned long int t, u;
+
+ t = assumed_exponent + cond;
+ MPFR_ASSERTN (t >= cond);
+ u = MPFR_INT_CEIL_LOG2 (prec) + 6;
+ t += u;
+ MPFR_ASSERTN (t >= u);
+ wprec = MPFR_ADD_PREC (prec, t);
+ }
/* We assume that the truncation rank will be ~ prec */
L = __gmpfr_isqrt (prec);
@@ -629,6 +657,7 @@ mpfr_ai (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
}
else if (MPFR_IS_INF (x))
return mpfr_set_ui (y, 0, rnd);
+ /* the cases x = +0 or -0 will be treated below */
}
/* The exponent range must be large enough for the computation of temp1. */
@@ -655,5 +684,7 @@ mpfr_ai (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd)
MPFR_SAVE_EXPO_FREE (expo); /* Ignore all previous exceptions. */
+ /* we use ai2 if |x|*AI_THRESHOLD1/3 + PREC(y)*AI_THRESHOLD2 > AI_SCALE,
+ which means x cannot be zero in mpfr_ai2 */
return use_ai2 ? mpfr_ai2 (y, x, rnd) : mpfr_ai1 (y, x, rnd);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/amd/amdfam10/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/amd/amdfam10/mparam.h
deleted file mode 100644
index f63eb1bea27..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/amd/amdfam10/mparam.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.6.1 */
-/* contributed by Jim Cloos <cloos at jhcloos dot com> with GMP 5.0.2 on a
- "2009 or 2010 vintage phenom-II", where __amd64, __amd64__,
- __k8, __k8__, __x86_64 and __x86_64__ are also defined.
-*/
-
-
-#define MPFR_MULHIGH_TAB \
- -1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,8,9,10,11, \
- 12,12,12,14,14,14,16,16,18,18,19,20,18,22,20,20, \
- 20,20,20,20,22,22,22,24,28,28,28,28,28,28,32,32, \
- 30,32,32,32,32,32,32,38,38,38,38,40,40,40,40,40, \
- 40,40,44,44,48,48,44,46,48,48,56,56,56,56,56,56, \
- 56,56,56,60,64,60,64,64,64,64,64,64,64,64,64,64, \
- 60,64,64,72,64,64,72,72,64,64,64,72,80,72,80,76, \
- 76,80,76,80,80,80,80,76,80,79,80,80,80,80,80,80, \
- 81,80,86,93,90,87,93,93,93,93,92,93,93,92,93,92, \
- 93,93,93,93,102,105,105,104,105,105,105,105,105,105,111,116, \
- 111,110,111,117,117,111,114,116,117,117,117,117,117,116,116,117, \
- 116,117,117,117,117,117,117,117,117,117,117,117,117,117,117,117, \
- 117,117,117,117,117,117,117,117,117,148,148,156,148,148,148,148, \
- 148,156,156,156,155,156,156,156,156,156,156,156,156,156,155,156, \
- 156,156,156,156,172,156,172,172,172,156,172,156,172,172,172,172, \
- 172,172,172,172,172,172,172,180,172,180,172,172,172,188,188,172, \
- 188,188,188,188,188,188,179,188,188,188,188,188,188,188,188,188, \
- 188,220,220,220,220,188,220,220,220,220,220,220,220,220,220,220, \
- 220,220,220,220,220,220,220,220,220,220,220,220,220,219,220,220, \
- 220,220,220,220,236,220,220,220,252,252,236,252,252,252,252,236, \
- 236,236,252,236,252,252,236,252,236,252,252,252,252,251,250,252, \
- 252,252,252,252,252,252,252,252,252,252,252,252,251,252,252,251, \
- 252,252,252,252,252,252,252,252,252,252,252,252,252,252,284,284, \
- 252,284,284,284,284,284,284,284,284,284,284,284,284,284,283,284, \
- 284,283,284,284,300,300,300,284,284,300,284,284,298,300,316,316, \
- 300,284,300,316,300,316,300,284,316,316,316,316,300,316,300,316, \
- 316,300,316,300,316,316,315,316,316,316,316,316,316,316,316,316, \
- 316,316,316,316,313,316,316,316,316,316,316,316,320,316,320,368, \
- 316,316,316,368,368,368,367,368,368,368,368,368,368,368,368,368, \
- 367,367,368,368,368,368,368,368,368,368,368,368,368,368,368,368, \
- 368,368,368,366,368,368,367,368,368,367,368,368,368,368,368,368, \
- 367,366,367,368,368,367,368,368,368,368,368,368,368,368,368,368, \
- 368,368,368,368,368,368,368,368,416,368,368,368,368,368,368,416, \
- 368,416,415,416,416,368,416,416,416,415,415,416,416,416,416,416, \
- 416,416,415,416,416,415,416,416,440,416,415,416,416,415,416,415, \
- 416,416,416,474,415,416,416,415,416,416,416,416,416,416,474,474, \
- 488,474,440,440,488,488,504,473,504,474,504,504,503,503,503,503, \
- 503,504,501,504,504,503,474,474,503,504,504,503,504,488,488,488, \
- 503,503,504,504,504,504,504,504,501,503,504,503,504,504,499,504, \
- 504,503,504,504,504,504,503,504,504,504,488,504,504,504,474,504, \
- 501,504,504,501,504,503,504,504,504,504,504,504,504,504,503,504, \
- 504,503,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,503,568,568,568,504,504,504,504,568,504, \
- 568,567,568,568,568,568,567,568,567,568,567,600,568,600,568,568, \
- 568,568,568,567,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,567,568,568,568,568,568,568,568,568, \
- 568,568,568,632,600,568,568,568,565,568,568,568,632,568,568,600, \
- 600,631,600,632,600,632,632,600,600,632,600,600,632,600,600,600, \
- 632,616,600,632,600,632,632,600,600,600,600,600,600,632,600,632, \
- 632,616,632,632,632,616,632,632,632,627,631,629,632,632,631,632, \
- 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
- 632,632,632,632,687,629,688,632,632,632,632,632,632,632,632,632, \
- 688,712,632,688,712,688,712,712,688,688,688,711,712,712,680,736, \
- 712,712,712,688,688,712,712,712,712,712,712,728,712,736,736,711, \
- 733,736,735,711,728,728,736,728,712,736,736,710,734,736,736,712, \
- 712,736,712,712,719,728,712,712,712,734,733,726,736,736,736,735, \
- 736,736,736,712,736,736,736,736,736,736,727,736,736,736,735,736, \
- 731,736,736,736,736,736,736,736,733,712,736,736,736,736,736,712, \
- 712,736,736,784,712,712,736,725,760,760,736,727,736,830,736,784, \
- 728,736,727,783,832,736,734,830,736,736,831,736,736,830,829,832, \
- 832,832,831,736,782,784,832,828,736,824,736,832,832,831,736,824, \
- 824,832,832,832,832,832,832,825,832,832,832,824,832,832,832,828, \
- 822,824,831,829,832,827,832,832,832,831,832,829,829,832,824,832, \
- 830,832,832,832,832,832,830,832,832,832,832,828,855,832,830,830 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,-1,-1,-1,-1,-1,-1,7,8,9,8,9,9, \
- 11,11,11,13,13,14,15,16,17,17,19,19,16,19,17,19, \
- 19,18,19,19,21,21,21,23,23,25,25,23,25,25,25,25, \
- 28,27,27,29,29,28,31,31,34,34,34,34,38,36,38,38, \
- 42,42,42,42,42,42,44,46,42,46,44,50,46,50,42,50, \
- 44,44,46,50,50,50,50,50,50,50,50,50,50,50,50,50, \
- 52,50,54,54,54,54,56,56,56,56,58,56,56,58,58,60, \
- 60,62,62,67,62,68,72,68,68,72,68,76,72,72,72,76, \
- 76,76,76,76,84,72,84,76,76,76,84,76,76,84,84,84, \
- 92,84,84,84,84,84,92,92,92,92,92,92,92,92,92,100, \
- 92,92,100,100,92,100,100,100,100,100,100,92,100,100,92,100, \
- 100,100,92,92,100,92,100,104,100,108,100,100,100,108,104,100, \
- 100,104,100,108,108,108,112,108,112,112,112,123,112,123,112,135, \
- 116,123,123,135,123,135,135,135,135,135,135,135,135,135,135,135, \
- 135,135,147,135,135,135,135,147,147,147,147,147,147,147,147,147, \
- 147,147,147,147,147,147,147,147,147,147,147,159,147,147,147,147, \
- 165,147,147,159,153,147,147,147,165,159,147,147,165,153,147,159, \
- 165,165,165,165,165,171,171,159,165,159,165,165,165,165,165,165, \
- 171,165,171,171,165,177,171,171,189,183,171,165,165,165,183,165, \
- 165,165,183,183,186,189,165,189,165,171,165,165,189,165,183,183, \
- 183,189,183,201,201,189,189,183,189,183,195,189,189,189,183,213, \
- 183,183,195,195,213,189,189,189,201,201,189,195,213,225,225,201, \
- 201,213,213,195,213,201,225,225,225,225,225,224,225,225,213,225, \
- 225,225,225,225,225,225,225,225,225,225,225,225,225,225,249,225, \
- 249,249,248,225,249,249,249,249,249,249,225,249,249,248,249,249, \
- 249,249,249,248,249,249,249,249,249,249,249,249,249,249,249,249, \
- 249,249,249,249,249,249,249,249,249,249,249,249,249,249,249,249, \
- 273,273,273,273,273,273,273,273,273,273,273,273,273,273,273,273, \
- 273,273,273,273,273,273,273,273,273,273,297,297,297,297,297,296, \
- 297,297,297,297,297,297,297,297,297,297,297,297,297,297,297,297, \
- 297,297,297,297,297,297,297,297,297,273,273,273,273,273,273,296, \
- 273,309,297,321,321,297,297,297,297,297,297,296,297,297,297,296, \
- 297,296,297,297,297,297,297,297,297,297,297,297,297,297,309,297, \
- 297,297,309,297,297,297,297,297,297,297,321,297,321,333,297,366, \
- 333,333,333,366,333,296,333,333,333,297,333,333,333,297,297,321, \
- 321,345,402,345,402,402,402,402,402,402,402,402,402,402,402,402, \
- 401,401,402,402,402,402,402,402,402,402,402,402,401,402,402,401, \
- 402,402,402,402,401,402,402,402,402,402,401,402,402,401,401,402, \
- 401,401,393,402,402,438,401,402,402,401,401,402,401,402,402,402, \
- 402,401,402,402,402,402,402,402,402,402,402,401,402,401,402,401, \
- 402,402,400,402,402,402,402,402,402,402,438,438,438,438,438,438, \
- 438,438,402,438,402,402,402,402,438,438,402,438,401,402,438,438, \
- 438,438,438,438,438,438,401,437,438,402,401,402,438,401,402,402, \
- 402,402,402,402,401,437,438,438,438,437,438,438,401,402,402,438, \
- 438,438,402,402,402,402,401,402,402,437,438,438,438,438,438,438, \
- 438,438,438,438,437,437,438,438,438,438,438,438,438,437,437,438, \
- 437,438,438,438,438,402,438,402,438,438,438,438,438,438,437,438, \
- 456,438,438,438,438,437,438,438,438,438,437,438,438,438,437,438, \
- 438,438,438,473,437,456,438,438,438,438,438,437,438,438,438,438, \
- 438,438,437,438,438,438,438,438,456,474,455,456,456,474,473,492, \
- 456,474,456,474,474,474,474,474,536,512,474,512,474,536,474,474, \
- 536,474,536,536,474,474,536,536,536,536,536,536,536,536,536,536, \
- 536,534,536,536,536,535,536,536,536,536,535,536,536,536,536,536, \
- 536,535,536,535,536,536,512,536,536,536,536,536,536,535,536,534, \
- 535,584,536,536,536,534,535,536,536,536,536,536,536,536,536,534, \
- 536,536,536,536,535,536,584,535,536,584,536,536,536,536,584,584, \
- 584,584,536,584,584,584,584,584,584,584,583,584,582,584,584,584, \
- 584,584,584,584,584,582,583,584,584,584,584,584,584,584,584,584, \
- 584,583,584,584,696,584,584,583,584,584,696,726,696,584,584,584, \
- 728,696,696,696,584,728,696,584,696,696,694,696,696,696,727,584, \
- 695,694,584,696,696,695,728,696,696,696,696,696,694,696,727,695, \
- 696,695,695,696,696,728,696,696,695,696,696,696,696,696,696,696, \
- 727,696,696,696,696,695,696,728,727,696,695,727,696,726,727,726, \
- 727,728,728,727,694,727,728,728,728,727,727,728,727,728,727,728 \
-
-#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,9,10,11,10,13,14,15, \
- 14,15,18,19,18,14,15,18,18,18,19,17,18,19,18,19, \
- 22,21,23,21,22,22,23,25,26,27,26,27,27,27,30,30, \
- 30,34,30,34,32,33,34,31,30,34,37,34,38,38,38,38, \
- 38,38,42,43,42,42,39,38,42,44,43,42,40,45,46,46, \
- 46,45,46,43,44,50,48,48,48,46,53,51,50,50,50,50, \
- 53,51,53,53,53,53,55,55,55,55,55,55,60,64,60,60, \
- 62,63,64,65,60,64,68,72,64,68,68,64,64,68,72,66, \
- 67,69,71,72,76,80,71,72,76,74,74,76,76,77,76,80, \
- 79,84,84,84,78,84,88,88,92,84,80,92,92,80,88,84, \
- 92,88,91,92,92,92,93,95,92,90,92,92,92,92,92,96, \
- 96,96,92,92,92,92,96,96,102,96,95,110,96,96,100,100, \
- 112,100,100,106,106,110,112,110,110,111,110,120,110,110,112,120, \
- 110,120,120,120,112,120,128,128,128,128,124,128,128,120,128,128, \
- 127,128,124,128,128,128,128,126,128,128,128,128,136,140,128,128, \
- 128,128,136,144,128,128,144,144,128,144,144,144,144,128,152,152, \
- 152,152,152,160,160,152,144,144,152,151,144,143,152,144,144,152, \
- 152,144,152,152,152,152,151,152,160,158,144,160,160,160,160,160, \
- 152,160,152,152,152,160,152,160,160,156,158,160,160,160,160,160, \
- 160,160,160,160,168,160,160,160,160,160,159,160,160,160,176,176, \
- 180,176,176,184,184,186,184,184,184,184,186,184,186,172,176,192, \
- 184,184,184,184,185,176,176,185,184,185,186,183,184,184,181,191, \
- 192,184,184,185,192,192,192,186,192,192,192,192,192,191,196,192, \
- 192,192,192,192,196,190,192,192,200,192,198,220,222,204,200,222, \
- 220,220,222,222,224,222,222,219,222,222,224,224,220,222,220,224, \
- 220,221,222,220,232,222,221,232,222,220,224,232,220,232,222,232, \
- 224,220,220,222,222,222,221,222,220,220,222,222,224,224,224,222, \
- 220,224,224,232,224,222,222,232,224,222,223,224,224,224,231,232, \
- 256,232,231,232,239,232,239,234,238,238,239,232,239,232,256,256, \
- 288,288,248,256,256,256,256,256,256,239,255,256,256,256,256,256, \
- 256,256,256,256,256,256,296,256,254,256,256,272,272,272,256,256, \
- 288,272,256,256,280,296,288,280,288,288,296,280,288,288,288,294, \
- 296,296,294,304,288,287,288,296,304,304,288,303,304,296,288,312, \
- 312,312,312,288,288,312,288,288,312,320,305,288,320,320,288,312, \
- 311,312,312,312,304,304,312,304,319,296,288,310,312,288,288,320, \
- 304,304,304,288,300,312,309,304,304,311,288,296,296,320,312,311, \
- 296,320,312,304,304,312,312,320,296,320,312,296,305,312,304,303, \
- 304,312,303,312,304,311,312,312,320,312,311,320,320,320,320,320, \
- 312,320,312,312,312,320,312,312,320,320,319,320,320,320,320,320, \
- 320,320,320,320,320,320,320,320,320,320,320,320,320,320,352,336, \
- 344,352,352,344,360,360,343,336,352,366,370,352,360,368,376,360, \
- 360,360,367,368,360,352,371,360,368,368,372,352,352,352,352,352, \
- 384,370,360,368,384,372,375,360,368,368,368,368,368,368,384,372, \
- 352,372,352,368,366,376,352,367,384,368,360,368,360,384,371,376, \
- 360,366,368,368,360,369,371,367,368,369,384,376,368,372,372,384, \
- 440,368,376,384,372,376,440,440,376,440,368,369,384,370,440,440, \
- 440,392,440,440,384,384,440,440,448,440,440,440,440,440,440,440, \
- 440,440,384,440,439,440,384,384,440,440,440,440,440,440,439,448, \
- 440,440,440,440,440,440,440,440,440,440,440,440,440,440,440,440, \
- 440,440,440,440,440,440,439,440,440,440,440,440,440,440,440,440, \
- 440,440,440,440,440,440,440,440,440,440,440,440,440,440,440,480, \
- 440,440,440,440,468,480,440,440,440,440,440,464,440,440,440,440, \
- 480,440,440,440,440,448,439,440,440,440,440,440,440,448,440,448, \
- 512,439,440,448,440,440,440,438,440,440,440,440,496,440,465,440, \
- 440,466,440,440,440,440,512,440,440,440,440,464,440,440,448,466, \
- 512,496,512,512,512,448,512,447,448,468,472,448,480,464,480,512, \
- 466,466,496,468,512,468,496,480,512,512,496,467,472,512,512,512, \
- 512,468,512,512,512,512,512,478,512,472,512,512,512,496,512,512, \
- 512,512,512,512,496,480,496,496,512,512,512,496,480,512,544,480, \
- 576,512,512,576,512,512,512,576,512,512,496,496,512,480,576,576, \
- 512,510,496,568,576,576,496,560,576,511,512,576,576,512,512,576, \
- 560,496,576,512,512,512,512,512,512,576,576,512,512,576,512,512, \
- 512,512,576,512,512,512,508,512,576,512,576,576,512,576,592,512, \
- 568,512,576,568,576,576,576,512,576,576,592,576,592,512,608,576 \
-
-#define MPFR_MUL_THRESHOLD 17 /* limbs */
-#define MPFR_SQR_THRESHOLD 19 /* limbs */
-#define MPFR_DIV_THRESHOLD 28 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 1031 /* bits */
-#define MPFR_EXP_THRESHOLD 10625 /* bits */
-#define MPFR_SINCOS_THRESHOLD 26682 /* bits */
-#define MPFR_AI_THRESHOLD1 -11328 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 1045
-#define MPFR_AI_THRESHOLD3 17871
-/* Tuneup completed successfully, took 562 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/amd/athlon/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/amd/athlon/mparam.h
deleted file mode 100644
index a338ebb68eb..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/amd/athlon/mparam.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-#define MPFR_MULHIGH_TAB \
- -1,0,-1,0,-1,0,-1,-1,0,-1,-1,0,0,0,0,10, \
- 0,12,13,14,15,16,0,0,0,0,0,19,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,32, \
- 30,32,30,34,32,32,36,34,36,36,38,38,42,38,38,42, \
- 40,38,42,46,42,42,42,44,44,44,44,44,48,50,46,46, \
- 60,50,50,48,50,56,56,56,56,56,56,56,60,60,64,60, \
- 64,64,60,60,60,72,64,64,68,72,76,72,76,72,72,76, \
- 75,76,76,72,76,72,75,72,72,72,84,76,84,75,72,76, \
- 84,80,76,84,84,76,76,76,76,88,84,88,80,84,83,96, \
- 84,96,92,84,88,91,92,88,92,90,96,96,92,91,92,96, \
- 96,120,95,100,112,120,100,119,112,120,120,112,119,112,119,119, \
- 120,118,119,119,119,118,119,120,128,127,120,128,128,120,120,127, \
- 120,128,128,128,128,120,128,127,120,128,128,127,128,127,144,136, \
- 128,144,152,152,152,136,144,144,144,136,151,152,144,152,128,151, \
- 144,152,144,144,151,144,150,150,136,151,152,143,143,143,142,168, \
- 144,144,168,151,168,144,152,151,152,152,160,152,151,152,160,151, \
- 152,151,152,167,152,152,166,152,167,160,168,204,160,160,168,168, \
- 204,176,202,167,168,166,167,168,204,184,202,204,204,204,204,192, \
- 184,192,204,202,202,216,204,227,202,204,216,203,203,204,203,227, \
- 202,204,202,202,202,203,202,215,204,202,203,202,202,215,228,214, \
- 226,214,228,214,228,215,228,216,226,214,228,225,226,228,226,226, \
- 226,215,216,216,226,225,226,227,216,227,240,216,252,252,226,227, \
- 228,239,227,250,227,226,227,227,252,238,228,239,252,227,228,228, \
- 252,226,246,228,227,227,252,247,250,263,262,250,252,250,250,252, \
- 250,288,288,250,250,250,251,264,264,271,287,276,250,288,252,286, \
- 251,287,288,251,276,274,288,262,263,263,282,252,288,252,276,284, \
- 287,274,264,274,288,275,275,274,274,288,276,264,273,286,274,276, \
- 300,287,288,286,286,276,288,285,275,300,275,273,275,299,300,299, \
- 279,336,336,286,287,284,360,359,336,335,288,360,333,359,334,335, \
- 335,287,359,335,336,336,359,333,334,359,360,288,360,332,335,336, \
- 335,336,336,333,336,335,336,359,334,334,335,360,336,334,356,357, \
- 335,336,358,359,359,336,335,336,334,355,384,356,354,384,334,357, \
- 336,359,384,359,360,356,384,382,336,383,384,384,354,355,383,384, \
- 382,359,384,382,382,383,383,359,381,382,383,356,384,382,381,384, \
- 357,384,358,357,358,358,380,383,382,382,383,360,360,381,382,360, \
- 377,360,378,360,360,381,382,383,381,380,383,383,360,382,383,380, \
- 383,383,384,381,379,360,381,381,382,431,380,380,378,380,384,381, \
- 382,382,384,407,384,382,379,384,430,431,383,384,408,384,456,431, \
- 431,455,431,428,384,454,455,403,432,383,407,430,430,456,408,427, \
- 455,455,456,455,432,431,431,429,455,432,432,424,430,427,427,429, \
- 452,454,426,455,456,431,430,454,452,454,431,456,431,428,455,430, \
- 454,430,432,455,454,442,443,432,443,431,451,452,456,430,451,456, \
- 444,455,449,456,432,454,449,454,502,432,448,504,450,503,503,453, \
- 454,502,446,452,453,454,455,499,504,453,456,504,454,453,503,455, \
- 456,456,500,478,502,454,456,499,478,454,480,499,501,496,502,455, \
- 499,502,503,456,478,500,501,500,479,503,504,451,452,479,454,455, \
- 502,503,504,504,454,499,503,501,454,503,456,503,504,501,455,502, \
- 503,503,502,504,610,503,504,574,480,551,528,504,609,576,480,503, \
- 496,502,503,552,551,552,551,503,504,503,610,608,609,610,611,608, \
- 608,551,648,611,612,550,576,572,608,611,610,606,608,611,610,574, \
- 575,576,606,607,606,606,608,606,606,575,576,604,604,604,608,609, \
- 606,606,606,608,604,604,611,604,604,576,610,606,610,606,604,610, \
- 606,612,604,608,610,609,604,608,606,647,612,610,604,606,648,610, \
- 610,606,646,608,604,647,606,647,606,609,610,647,648,609,641,611, \
- 643,611,643,648,643,640,646,611,644,644,645,611,642,646,611,612, \
- 640,647,610,611,610,611,606,647,648,647,648,644,682,642,682,683, \
- 610,611,680,678,642,681,682,647,682,612,682,648,611,665,680,683, \
- 609,646,666,676,680,646,679,647,646,646,648,679,684,611,612,643, \
- 684,645,646,647,683,647,608,645,682,647,682,646,610,648,682,610, \
- 684,612,612,683,684,647,647,646,680,646,646,745,648,646,644,647, \
- 648,647,678,646,647,683,642,682,682,684,646,645,642,647,646,677, \
- 646,647,683,678,680,646,646,643,681,647,683,645,666,755,756,645, \
- 643,647,646,647,647,648,674,755,756,674,647,643,680,682,684,680, \
- 680,682,682,675,682,677,666,683,680,682,682,684,680,681,674,674 \
-
-#define MPFR_MUL_THRESHOLD 19
-#define MPFR_EXP_2_THRESHOLD 411 /* bits */
-#define MPFR_EXP_THRESHOLD 45200 /* bits */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/amd/k8/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/amd/k8/mparam.h
deleted file mode 100644
index 525967ab043..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/amd/k8/mparam.h
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.3.2 */
-/* gcc11.fsffrance.org (Dual-Core AMD Opteron(tm) Processor 2212)
- with gmp 5.0.2.
- Keith Briggs sent similar parameters obtained on a AMD Athlon
- (__tune_k8__, __x86_64, __amd64, __k8) */
-
-
-#define MPFR_MULHIGH_TAB \
- -1,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,11,11, \
- 12,12,11,15,14,14,15,16,18,18,19,20,18,19,19,20, \
- 22,22,23,24,26,30,28,28,32,30,30,32,32,30,32,32, \
- 32,30,30,32,32,38,32,32,36,40,40,40,36,38,40,38, \
- 40,44,40,44,44,44,44,48,48,46,48,48,56,56,56,56, \
- 56,56,56,60,64,60,60,64,64,64,64,64,64,64,64,64, \
- 72,72,72,72,72,72,72,72,72,72,72,72,80,80,80,80, \
- 80,80,80,80,80,80,80,80,80,80,80,80,93,80,93,93, \
- 93,76,80,93,80,93,93,90,93,93,93,93,93,93,93,93, \
- 93,93,111,105,93,117,105,105,117,117,111,117,117,105,117,117, \
- 117,105,117,117,117,117,117,117,117,117,117,117,117,117,117,117, \
- 117,117,117,117,116,117,116,117,117,117,117,117,117,117,117,117, \
- 117,117,140,117,140,140,140,140,140,148,148,147,140,156,156,156, \
- 148,148,156,148,156,156,156,156,156,155,156,155,156,155,156,156, \
- 156,156,156,156,156,156,156,156,172,172,172,156,172,172,172,172, \
- 172,172,172,172,180,180,180,180,180,180,180,188,188,188,188,188, \
- 180,188,188,188,188,187,188,188,188,188,188,188,188,188,188,188, \
- 188,188,188,188,188,188,188,188,188,188,188,188,188,220,220,204, \
- 220,220,220,219,220,220,220,220,220,219,220,219,220,219,220,220, \
- 220,236,236,220,236,219,233,236,233,252,236,252,236,252,252,236, \
- 235,236,236,252,252,236,236,252,252,236,252,252,236,251,250,251, \
- 252,252,251,252,252,252,252,252,252,252,252,252,252,252,252,252, \
- 252,252,284,252,284,284,284,284,284,252,284,284,284,284,284,284, \
- 283,284,284,284,284,284,284,284,284,284,284,283,284,284,284,284, \
- 284,284,283,284,284,284,284,284,284,284,284,284,284,300,284,300, \
- 300,316,300,300,300,316,300,300,316,316,316,316,316,316,316,316, \
- 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316, \
- 316,315,316,316,315,316,316,316,315,316,316,316,316,316,316,316, \
- 316,316,316,368,316,316,367,368,368,368,368,368,368,368,368,368, \
- 368,368,368,368,368,368,368,368,368,368,368,368,368,368,368,368, \
- 368,368,368,368,368,368,367,368,368,368,368,367,368,367,367,368, \
- 368,367,367,368,367,368,368,367,368,368,368,367,368,368,368,368, \
- 367,368,416,415,416,416,416,416,416,416,415,416,416,416,416,416, \
- 416,416,416,416,416,416,415,416,415,416,415,416,416,416,416,416, \
- 416,415,416,416,415,416,416,415,416,416,440,416,416,416,440,416, \
- 415,416,415,416,464,464,464,464,464,464,463,464,464,464,463,464, \
- 464,464,464,464,464,463,464,464,474,474,464,464,473,474,474,504, \
- 474,474,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,503,504,504,504,504,504,504, \
- 503,504,504,504,504,504,503,504,504,504,504,504,503,504,504,503, \
- 504,504,504,504,504,504,504,504,503,504,504,504,504,504,503,504, \
- 504,504,504,504,568,568,568,504,568,568,568,568,568,568,568,568, \
- 568,567,568,568,568,567,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,567,567,568,566,568,568,568,567, \
- 568,568,568,568,568,568,568,568,568,568,567,568,568,567,568,568, \
- 568,568,568,568,567,568,568,566,567,568,568,568,568,568,568,568, \
- 568,567,568,568,567,568,567,568,567,568,567,568,567,568,632,568, \
- 600,632,632,600,631,632,632,632,632,631,600,600,632,632,600,631, \
- 632,632,632,632,632,632,631,632,632,632,631,632,631,632,632,632, \
- 632,632,631,632,632,631,632,632,632,631,632,632,632,632,631,632, \
- 632,632,632,632,630,632,632,632,632,632,631,632,631,632,631,632, \
- 632,632,632,632,632,632,632,632,631,632,632,632,632,632,632,631, \
- 632,632,632,631,632,632,632,736,632,631,632,736,632,632,632,632, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,734,736,736,735,736,736,735,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,735,736,736,736,736,736,736,736,735,736, \
- 736,736,735,736,735,736,736,736,735,736,736,736,736,736,736,736, \
- 736,736,736,735,736,736,736,735,736,736,736,736,736,735,736,736, \
- 736,736,736,736,736,736,736,736,736,735,736,735,736,832,736,832, \
- 832,832,832,832,831,832,832,831,832,832,832,832,832,832,831,832, \
- 831,832,831,832,832,831,832,832,832,832,832,832,831,832,832,832, \
- 831,832,832,832,832,832,831,832,832,832,832,832,831,832,831,832, \
- 832,832,831,832,831,832,831,832,832,832,832,832,832,832,831,832 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,-1,-1,-1,-1,-1,7,7,8,9,9,11, \
- 11,11,11,11,13,13,15,15,17,17,18,17,17,17,18,20, \
- 20,21,23,23,20,21,23,23,24,25,23,23,24,25,26,25, \
- 28,27,28,29,28,31,34,31,34,34,34,34,34,34,34,34, \
- 40,34,40,36,40,42,40,42,40,40,42,42,48,48,46,46, \
- 42,46,48,48,46,50,46,52,54,54,48,56,54,50,54,52, \
- 50,54,54,52,54,54,58,58,62,64,58,58,58,64,62,64, \
- 58,64,66,72,68,68,68,68,68,62,66,72,72,72,68,68, \
- 72,72,68,72,72,72,72,72,80,84,80,80,80,84,80,80, \
- 80,84,84,84,84,84,92,80,80,84,92,84,92,92,92,96, \
- 100,92,100,92,96,92,92,96,100,100,96,96,96,100,100,96, \
- 96,96,92,92,96,96,108,100,96,100,100,112,112,112,112,112, \
- 112,112,108,112,100,104,112,116,104,116,116,108,112,112,112,116, \
- 112,112,112,112,112,141,135,141,116,135,135,135,141,141,141,141, \
- 141,141,141,141,141,141,135,135,141,141,147,141,141,141,140,141, \
- 141,141,147,147,141,147,147,147,147,147,147,147,147,147,147,159, \
- 153,147,147,159,159,159,159,159,159,159,159,159,165,171,171,171, \
- 165,170,171,171,165,171,171,171,165,171,171,171,183,171,171,171, \
- 183,183,171,183,171,183,183,183,183,183,183,183,189,189,183,195, \
- 171,171,188,171,171,195,171,171,171,195,195,182,195,177,182,183, \
- 183,181,182,183,183,189,183,194,195,195,194,195,195,195,195,195, \
- 195,195,213,195,195,195,195,195,189,195,195,195,195,195,195,195, \
- 212,195,213,195,195,195,213,195,195,195,195,195,195,213,213,201, \
- 195,195,195,213,213,213,213,213,212,213,213,213,213,213,213,213, \
- 237,212,213,213,213,213,213,225,213,213,213,249,213,249,237,237, \
- 237,237,237,249,237,237,237,237,249,237,249,237,237,237,249,249, \
- 249,236,237,249,249,249,249,249,249,249,249,249,249,249,249,249, \
- 249,273,273,273,273,273,273,272,273,273,273,273,273,273,273,273, \
- 273,273,273,273,273,273,273,285,273,284,285,285,285,285,297,284, \
- 285,297,285,297,297,297,297,297,297,297,297,296,297,296,297,296, \
- 297,297,297,297,297,297,297,273,297,273,309,273,273,273,273,320, \
- 321,321,321,285,285,285,285,285,284,285,297,285,297,297,297,297, \
- 297,297,333,297,297,297,296,297,309,297,297,297,297,285,309,348, \
- 297,297,348,348,285,321,297,321,321,297,320,321,321,297,297,321, \
- 297,321,333,366,333,333,309,333,333,333,332,333,297,321,321,321, \
- 321,348,321,345,348,348,348,366,348,347,348,365,366,365,333,366, \
- 402,366,333,366,366,366,366,402,366,365,366,366,366,366,366,366, \
- 366,348,420,420,348,420,419,420,419,420,420,420,366,366,420,366, \
- 366,365,366,402,366,366,366,366,402,402,402,401,402,402,402,401, \
- 420,401,402,402,420,420,420,420,402,420,420,420,420,419,420,419, \
- 420,419,420,420,402,401,420,402,402,420,402,420,402,401,420,420, \
- 420,420,420,420,420,402,420,420,402,420,420,420,420,420,420,420, \
- 420,420,420,420,420,420,420,420,420,419,420,420,438,420,420,438, \
- 420,420,420,420,420,420,438,420,437,438,438,420,438,438,420,420, \
- 438,420,420,438,438,420,420,420,438,420,420,420,420,419,420,420, \
- 420,420,420,420,474,419,420,420,420,438,419,456,438,474,438,437, \
- 438,438,438,438,438,420,438,420,438,438,438,420,420,419,420,420, \
- 438,420,438,419,420,420,420,420,420,419,420,474,420,420,438,420, \
- 438,473,474,474,474,473,438,474,474,438,438,437,438,438,438,438, \
- 438,438,474,437,437,474,560,456,473,474,535,536,474,560,536,536, \
- 560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, \
- 560,560,559,560,560,560,560,560,560,560,560,560,560,560,560,560, \
- 559,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, \
- 560,560,560,560,560,560,560,560,560,560,560,560,560,560,560,560, \
- 559,560,560,560,560,560,560,560,559,560,559,560,560,560,560,559, \
- 559,560,559,560,560,560,560,560,560,559,560,560,559,560,559,560, \
- 560,560,559,560,560,560,560,559,560,560,560,560,560,560,560,560, \
- 560,560,560,560,560,560,560,560,560,560,559,584,560,560,560,560, \
- 559,560,560,559,560,560,560,560,560,560,559,559,560,560,560,560, \
- 560,560,559,560,560,560,560,560,560,583,560,560,584,560,584,584, \
- 584,560,583,583,584,584,582,584,584,584,583,584,584,584,584,584, \
- 727,584,728,632,728,560,727,728,728,560,584,560,560,727,728,728, \
- 727,728,728,728,608,728,728,724,728,728,760,727,728,727,728,728, \
- 728,759,728,696,728,728,728,728,728,727,759,760,727,760,760,727 \
-
-#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
- 14,15,18,19,18,14,22,18,18,18,18,20,18,18,20,22, \
- 22,22,23,24,26,26,26,28,24,30,28,28,28,30,30,32, \
- 32,34,32,34,32,34,34,31,32,37,32,37,32,33,34,35, \
- 39,37,37,39,39,37,39,39,39,39,39,39,43,44,46,46, \
- 47,45,46,48,52,48,50,50,48,46,50,50,52,56,54,50, \
- 60,60,60,56,56,64,61,60,56,64,60,64,64,64,64,60, \
- 64,64,64,63,64,64,64,64,64,64,70,64,64,68,78,66, \
- 74,69,70,74,70,69,74,78,78,74,74,74,74,78,78,79, \
- 78,78,78,78,78,78,78,78,78,78,88,88,88,88,88,88, \
- 92,92,88,91,92,88,95,96,96,96,96,92,92,88,92,112, \
- 112,112,112,108,112,112,112,112,120,112,112,112,120,112,120,112, \
- 112,120,120,120,104,112,112,128,112,112,112,120,112,112,120,120, \
- 128,120,120,120,112,120,128,128,128,120,128,128,128,128,128,128, \
- 128,128,120,128,128,128,128,128,120,128,128,128,128,128,128,128, \
- 128,128,128,128,128,128,126,128,128,128,127,128,128,128,144,148, \
- 136,136,144,144,140,141,140,148,148,151,144,148,148,160,156,148, \
- 160,160,160,160,156,156,156,148,148,156,148,160,160,160,148,156, \
- 148,148,148,156,156,156,156,160,156,156,158,156,156,157,160,156, \
- 156,160,160,158,156,156,158,158,159,160,159,160,160,160,184,183, \
- 184,184,180,184,184,176,184,184,184,184,186,184,184,184,184,184, \
- 184,184,186,186,192,184,184,186,184,184,186,183,184,185,186,184, \
- 184,184,186,185,216,184,192,186,208,192,192,184,208,216,224,209, \
- 208,216,224,222,224,216,208,224,224,224,208,224,210,224,216,234, \
- 208,216,216,208,224,216,216,224,224,222,224,224,224,216,224,224, \
- 224,221,224,216,232,224,224,224,224,224,224,224,208,224,222,224, \
- 224,224,216,224,232,224,224,216,224,256,224,256,224,248,224,224, \
- 224,224,224,224,224,222,224,232,222,224,224,224,224,224,230,232, \
- 256,234,232,240,240,233,240,233,248,240,240,240,240,238,240,256, \
- 248,240,248,256,256,256,256,256,256,248,256,256,256,256,256,256, \
- 256,256,256,256,256,256,248,256,248,256,248,248,256,256,256,256, \
- 256,256,256,256,280,296,280,280,256,288,296,280,256,280,280,296, \
- 296,296,280,280,280,296,296,296,280,280,280,296,280,296,295,312, \
- 312,312,312,296,312,311,312,312,312,296,296,312,296,296,312,312, \
- 312,296,312,312,296,311,312,312,312,312,312,312,312,312,312,296, \
- 296,312,311,296,312,312,312,312,312,312,312,312,296,312,312,312, \
- 312,312,312,312,312,312,312,312,296,312,312,312,312,312,312,312, \
- 312,312,312,312,311,311,312,312,312,312,312,312,312,312,312,312, \
- 312,312,312,312,312,312,312,312,312,312,312,312,312,312,320,316, \
- 320,319,319,320,320,320,319,320,319,320,360,320,320,320,352,360, \
- 368,352,368,368,369,372,344,370,372,366,369,352,370,370,370,360, \
- 360,360,360,368,360,372,372,360,370,368,372,367,368,360,370,368, \
- 372,371,370,372,372,372,371,368,368,368,370,370,368,368,368,372, \
- 370,372,367,368,368,370,368,368,360,368,360,368,370,368,368,367, \
- 360,368,368,368,372,368,372,368,368,368,372,371,368,416,368,367, \
- 372,368,372,372,372,370,440,372,368,416,368,368,368,433,448,369, \
- 440,416,415,416,440,448,440,440,448,448,440,448,440,440,448,416, \
- 416,416,415,440,417,416,416,418,432,418,417,448,416,432,416,432, \
- 416,420,440,448,408,416,432,448,416,448,448,448,440,440,440,440, \
- 448,440,440,440,440,448,416,448,440,416,448,416,448,448,440,448, \
- 416,440,416,419,417,448,416,420,416,432,433,420,417,432,416,424, \
- 440,440,440,440,448,437,440,440,448,440,440,448,448,448,448,432, \
- 480,440,440,440,448,448,448,448,448,448,440,448,445,432,448,448, \
- 448,439,448,448,468,448,448,440,440,440,448,448,468,496,480,448, \
- 440,448,440,468,440,496,440,466,448,448,448,468,448,440,448,448, \
- 448,496,496,496,496,448,448,496,448,468,468,448,448,468,480,467, \
- 468,512,496,512,512,496,496,480,512,480,496,512,512,512,496,512, \
- 512,496,496,496,512,512,512,512,512,496,512,512,496,496,496,496, \
- 512,512,496,512,496,496,496,496,512,512,512,496,480,496,496,496, \
- 496,496,512,512,512,512,496,496,512,496,496,496,512,480,496,544, \
- 512,496,496,496,576,512,496,560,496,496,512,561,496,560,496,560, \
- 560,496,512,512,512,496,512,512,512,576,512,512,512,512,512,512, \
- 512,512,512,512,560,512,560,512,576,512,576,592,512,560,591,512, \
- 592,512,576,512,576,592,592,624,592,576,560,512,592,576,592,592 \
-
-#define MPFR_MUL_THRESHOLD 19 /* limbs */
-#define MPFR_SQR_THRESHOLD 18 /* limbs */
-#define MPFR_DIV_THRESHOLD 34 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 1031 /* bits */
-#define MPFR_EXP_THRESHOLD 11014 /* bits */
-#define MPFR_SINCOS_THRESHOLD 26907 /* bits */
-#define MPFR_AI_THRESHOLD1 -12404 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 1024
-#define MPFR_AI_THRESHOLD3 19611
-/* Tuneup completed successfully, took 759 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/amd/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/amd/mparam.h
new file mode 100644
index 00000000000..67cbd14de8c
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/amd/mparam.h
@@ -0,0 +1,233 @@
+/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
+
+Copyright 2005-2020 Free Software Foundation, Inc.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 6.3.0 */
+/* gcc13.fsffrance.org (Dual-Core AMD Opteron(tm) Processor 2212)
+ with gmp 6.1.2, which uses -m64 -mtune=k8 -march=k8. */
+
+#define MPFR_MULHIGH_TAB \
+ -1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,9,11, \
+ 12,13,11,15,14,15,15,16,18,18,19,20,18,19,19,20, \
+ 22,23,23,24,26,30,28,24,30,32,30,32,32,30,30,32, \
+ 32,30,30,32,32,38,32,40,36,36,40,40,38,38,38,38, \
+ 38,40,44,44,46,46,44,46,48,46,52,48,56,56,56,56, \
+ 56,56,56,60,60,60,64,64,64,64,64,64,64,64,64,64, \
+ 72,72,72,72,72,72,72,72,72,72,72,72,80,80,80,80, \
+ 80,80,80,80,80,80,80,80,80,93,80,93,93,80,80,93, \
+ 80,80,80,80,80,105,93,93,93,93,93,93,93,93,93,108, \
+ 93,93,111,93,105,117,105,117,117,117,111,117,117,105,111,105, \
+ 108,105,117,117,117,117,117,117,117,117,117,117,117,117,111,117, \
+ 117,117,117,117,129,129,117,129,129,129,135,129,129,129,135,135, \
+ 135,141,141,129,129,141,132,141,141,141,141,135,141,141,141,141, \
+ 141,141,141,141,141,141,141,159,141,153,141,153,153,165,165,165, \
+ 159,165,165,165,165,165,165,165,165,165,165,177,189,189,189,189, \
+ 189,189,177,189,189,189,189,189,189,189,189,189,189,189,189,189, \
+ 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, \
+ 189,213,213,189,189,189,189,189,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,225,225, \
+ 225,237,225,225,237,237,237,237,237,237,237,237,237,237,237,252, \
+ 237,237,252,252,252,252,252,252,252,252,252,252,252,252,252,252, \
+ 252,252,284,252,284,284,252,284,284,252,284,284,284,284,284,284, \
+ 284,284,284,284,284,284,284,284,284,284,284,284,284,284,284,284, \
+ 284,284,284,284,284,284,284,284,284,284,284,284,284,300,300,284, \
+ 300,300,300,300,300,300,300,300,316,316,315,316,316,315,316,316, \
+ 316,316,315,316,316,316,316,316,316,316,316,316,316,316,316,316, \
+ 316,314,315,316,316,316,316,314,315,316,316,316,316,316,316,316, \
+ 316,316,316,316,316,316,316,316,316,378,378,378,378,378,378,378, \
+ 378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
+ 378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
+ 378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,426, \
+ 378,426,378,426,378,378,378,378,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,425,426,426,426,426,426,426,426,426,426,425, \
+ 426,426,426,426,474,425,474,426,474,474,504,426,474,504,504,504, \
+ 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
+ 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
+ 504,504,504,504,504,504,504,504,504,504,504,504,504,503,504,504, \
+ 504,504,504,504,504,504,504,503,504,504,503,504,504,504,504,504, \
+ 504,504,568,504,568,504,504,504,568,504,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,567,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,567,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,567,568,568,568,567,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,567,568,568,568,568,568,568,568,568,568, \
+ 600,568,568,568,600,632,632,568,632,632,632,632,632,600,632,600, \
+ 632,632,600,600,632,632,599,600,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,631,632,632,632,632,632,630,631,632,632, \
+ 632,632,631,632,632,632,632,632,631,632,631,632,632,632,631,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,631, \
+ 632,632,632,632,632,632,631,632,632,632,632,632,632,736,632,736, \
+ 736,736,736,736,736,735,736,735,736,736,736,735,736,736,736,735, \
+ 735,736,735,736,736,736,736,736,736,736,736,735,736,736,736,736, \
+ 736,736,736,736,735,736,736,736,736,736,736,736,736,736,735,736, \
+ 736,736,736,736,736,736,735,736,734,736,736,736,736,736,735,736, \
+ 735,736,735,736,736,736,736,736,735,736,736,736,736,736,736,736, \
+ 736,736,736,736,736,736,736,735,736,736,736,832,736,736,832,832, \
+ 736,831,831,832,832,832,832,832,832,832,830,832,832,832,832,832, \
+ 832,832,831,832,832,832,832,832,832,832,832,830,831,832,831,832, \
+ 831,832,832,832,832,832,831,832,831,831,831,832,832,832,832,832, \
+ 832,832,832,832,831,832,832,832,832,832,832,832,831,832,831,832 \
+
+#define MPFR_SQRHIGH_TAB \
+ -1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,9,9,11, \
+ 11,11,11,12,13,14,15,15,17,18,18,17,17,18,18,20, \
+ 20,18,19,19,20,21,23,23,24,25,23,23,24,25,26,27, \
+ 28,27,28,29,28,31,32,31,32,31,32,33,34,34,34,40, \
+ 40,40,40,40,40,40,40,40,40,46,46,46,42,46,46,48, \
+ 48,48,48,48,48,48,48,48,56,54,56,56,56,48,56,56, \
+ 50,50,52,52,62,54,54,56,56,54,58,60,62,62,58,64, \
+ 64,62,66,64,64,72,66,68,66,72,72,72,72,72,72,72, \
+ 72,72,72,72,80,72,80,72,80,72,80,80,80,80,80,80, \
+ 84,80,80,84,80,80,80,80,80,92,92,92,96,92,96,92, \
+ 96,92,96,92,96,96,96,96,96,96,96,100,96,96,96,96, \
+ 96,96,96,96,100,96,96,112,112,112,96,112,112,112,112,112, \
+ 112,112,112,104,112,111,112,112,112,112,112,112,112,112,112,112, \
+ 112,112,112,141,112,141,135,135,141,135,128,141,141,141,135,141, \
+ 128,141,140,141,141,141,135,135,141,135,141,141,141,141,141,141, \
+ 141,141,147,141,141,147,147,141,141,141,159,147,141,147,147,159, \
+ 158,159,159,159,159,159,165,159,165,165,159,165,165,159,165,165, \
+ 165,171,159,165,165,165,165,165,165,165,171,171,165,171,171,183, \
+ 189,189,183,189,189,189,189,189,189,189,189,189,189,189,189,189, \
+ 189,189,189,188,189,189,188,171,171,188,189,189,189,189,189,189, \
+ 189,189,183,183,183,189,189,183,188,189,189,195,213,189,189,195, \
+ 189,189,188,195,189,189,189,195,213,189,189,189,213,213,213,189, \
+ 189,213,213,189,189,189,195,189,189,189,195,188,189,213,213,195, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,212,213,213,237,236,213,237,213,213,213,213,237,237, \
+ 237,237,237,237,237,237,237,237,237,237,237,236,237,237,237,237, \
+ 237,237,237,237,237,249,237,237,237,237,237,237,237,249,237,237, \
+ 237,272,273,236,273,237,273,273,273,285,273,273,249,273,237,285, \
+ 273,273,273,273,285,237,285,285,273,285,273,284,285,285,285,285, \
+ 285,285,285,285,285,285,285,284,285,285,285,285,285,284,273,284, \
+ 285,285,285,284,285,285,285,285,285,285,285,285,285,285,285,285, \
+ 285,285,285,285,284,333,333,333,309,333,285,332,333,333,309,333, \
+ 333,309,332,333,321,321,333,309,333,333,333,333,333,332,333,332, \
+ 333,333,333,333,333,332,333,333,332,333,333,333,333,333,333,333, \
+ 333,333,333,333,332,333,333,333,333,333,333,333,333,333,333,333, \
+ 333,333,333,333,333,332,333,333,333,332,333,333,333,333,333,333, \
+ 333,333,333,333,333,333,333,333,333,333,333,333,333,333,333,333, \
+ 333,333,333,333,333,420,333,333,333,402,420,420,402,402,420,420, \
+ 402,420,420,420,419,402,420,420,420,420,420,420,420,420,420,420, \
+ 420,420,420,420,420,420,420,420,420,420,420,419,420,420,420,420, \
+ 420,420,419,420,402,420,420,420,420,420,420,420,420,402,401,420, \
+ 420,420,402,420,420,402,419,420,420,420,419,420,420,420,420,420, \
+ 420,420,420,420,420,420,420,420,420,420,420,420,420,420,420,420, \
+ 420,420,420,420,420,418,419,420,419,420,420,420,420,420,420,420, \
+ 420,420,420,419,420,420,420,420,420,420,402,420,420,417,420,420, \
+ 420,420,420,420,420,420,420,420,419,420,420,420,420,420,420,420, \
+ 420,420,438,420,438,438,420,420,420,420,419,420,420,474,420,474, \
+ 474,474,474,492,492,474,420,474,492,474,420,492,568,473,420,492, \
+ 492,492,568,492,568,568,568,568,492,568,568,568,568,568,568,567, \
+ 568,568,568,568,568,568,492,568,568,492,568,568,568,492,568,568, \
+ 568,568,568,568,568,492,568,568,568,568,568,568,568,568,567,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,567,568,568,568,568,568,568,568,567,568,568,568,568,568, \
+ 568,568,567,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,567,568,568,568,568, \
+ 568,568,568,568,568,568,567,568,566,567,568,568,568,568,568,568, \
+ 568,568,568,568,566,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,632,568,632,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 632,568,568,568,568,568,568,568,568,568,568,568,568,630,568,568, \
+ 630,632,568,568,632,632,631,632,630,568,632,632,632,632,632,632, \
+ 632,632,632,632,631,632,632,632,632,632,632,632,664,631,632,664, \
+ 631,632,632,632,664,628,632,632,662,632,632,632,632,664,664,632, \
+ 632,632,632,664,664,632,632,632,664,631,632,632,664,632,632,632 \
+
+#define MPFR_DIVHIGH_TAB \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,22,0,0,0,0,0,26,26,26,27,0,29,30,30, /*32-47*/ \
+ 30,30,34,34,0,33,34,0,34,33,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*64-79*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*80-95*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*96-111*/ \
+ 0,0,0,0,60,0,0,0,0,0,0,0,0,0,0,0, /*112-127*/ \
+ 0,0,0,0,0,0,74,0,0,78,74,78,74,78,78,74, /*128-143*/ \
+ 0,0,78,78,78,78,0,78,0,78,0,0,0,0,88,0, /*144-159*/ \
+ 0,0,0,0,91,92,91,92,90,88,92,90,92,92,0,112, /*160-175*/ \
+ 92,94,96,95,95,112,104,104,112,112,112,112,112,104,112,120, /*176-191*/ \
+ 112,112,112,104,112,120,107,112,120,128,112,112,120,120,120,120, /*192-207*/ \
+ 112,120,120,120,128,128,128,120,128,128,128,128,128,128,128,128, /*208-223*/ \
+ 128,128,120,128,128,128,128,128,128,120,128,128,128,128,128,128, /*224-239*/ \
+ 128,128,128,128,136,128,128,128,128,128,148,136,148,128,136,136, /*240-255*/ \
+ 136,148,148,148,135,156,148,148,135,156,156,148,156,149,160,160, /*256-271*/ \
+ 156,148,156,156,144,160,156,160,148,156,160,156,156,160,156,149, /*272-287*/ \
+ 148,160,160,160,156,156,156,156,154,156,156,156,156,156,156,156, /*288-303*/ \
+ 156,156,156,160,156,156,157,160,160,160,160,160,160,160,184,184, /*304-319*/ \
+ 184,185,184,179,185,184,184,184,184,184,174,174,183,186,184,186, /*320-335*/ \
+ 182,184,185,185,186,186,186,184,208,184,192,208,184,184,184,208, /*336-351*/ \
+ 184,208,184,208,208,209,192,216,209,208,216,208,210,208,208,224, /*352-367*/ \
+ 222,208,208,216,208,224,210,208,222,210,224,224,208,208,210,224, /*368-383*/ \
+ 240,232,208,234,206,240,216,208,208,240,240,224,208,208,208,208, /*384-399*/ \
+ 208,208,224,224,233,208,224,224,208,216,224,224,208,240,224,222, /*400-415*/ \
+ 240,224,224,256,232,216,240,224,234,256,216,256,224,256,256,232, /*416-431*/ \
+ 240,240,240,240,255,224,232,256,256,240,256,256,240,256,240,256, /*432-447*/ \
+ 240,240,256,256,256,240,256,256,256,256,240,256,256,256,256,256, /*448-463*/ \
+ 256,256,256,256,255,256,256,254,256,256,256,256,256,256,256,256, /*464-479*/ \
+ 256,256,255,256,256,256,256,256,256,255,256,256,255,256,256,256, /*480-495*/ \
+ 256,256,256,256,256,256,256,256,256,256,256,256,256,256,280,272, /*496-511*/ \
+ 272,270,280,296,280,276,280,279,280,280,281,280,280,272,272,280, /*512-527*/ \
+ 280,272,280,282,312,272,282,312,280,312,280,280,288,280,281,296, /*528-543*/ \
+ 312,296,312,312,296,296,312,288,312,312,312,315,316,312,312,312, /*544-559*/ \
+ 312,312,312,312,312,318,312,313,312,302,318,312,311,296,312,312, /*560-575*/ \
+ 318,312,312,311,312,296,304,311,312,312,312,312,312,312,312,312, /*576-591*/ \
+ 313,312,312,312,312,312,312,318,312,312,312,312,312,312,311,312, /*592-607*/ \
+ 316,312,320,312,312,312,312,312,312,312,312,312,316,313,313,318, /*608-623*/ \
+ 317,316,317,318,320,318,318,318,320,318,348,368,320,336,372,372, /*624-639*/ \
+ 372,371,367,368,368,372,371,368,372,336,372,368,372,368,364,372, /*640-655*/ \
+ 372,354,384,368,352,368,372,371,348,352,372,366,368,366,372,368, /*656-671*/ \
+ 372,365,368,372,368,372,372,371,372,378,369,371,372,372,369,372, /*672-687*/ \
+ 372,372,370,378,384,372,370,367,416,384,416,416,371,372,420,424, /*688-703*/ \
+ 366,372,372,368,416,420,372,420,432,372,372,416,378,372,416,384, /*704-719*/ \
+ 420,416,420,414,416,416,448,416,419,424,425,416,416,425,432,432, /*720-735*/ \
+ 432,432,432,432,448,424,448,432,444,432,432,444,432,432,448,448, /*736-751*/ \
+ 448,448,448,448,420,416,420,416,448,448,448,420,448,420,432,432, /*752-767*/ \
+ 448,426,448,432,416,420,448,432,448,432,414,432,432,420,417,417, /*768-783*/ \
+ 420,444,416,444,419,424,420,426,432,420,432,416,480,416,420,424, /*784-799*/ \
+ 420,432,419,420,424,424,420,416,425,419,432,448,448,444,448,432, /*800-815*/ \
+ 426,420,432,448,448,448,432,448,512,464,444,448,447,448,448,448, /*816-831*/ \
+ 432,448,448,464,431,467,448,448,448,444,448,432,448,448,448,504, /*832-847*/ \
+ 448,447,432,432,448,512,432,464,448,504,448,448,480,444,448,449, /*848-863*/ \
+ 448,512,448,512,480,444,447,448,449,512,480,448,504,480,448,468, /*864-879*/ \
+ 448,448,448,467,512,464,463,504,480,504,504,448,480,512,512,504, /*880-895*/ \
+ 480,512,503,480,512,480,504,512,512,467,504,512,512,504,512,512, /*896-911*/ \
+ 512,512,504,504,462,480,512,504,512,504,504,504,480,464,480,504, /*912-927*/ \
+ 504,504,504,512,480,504,504,512,504,512,480,504,512,512,512,512, /*928-943*/ \
+ 512,504,480,504,512,504,480,512,512,480,512,480,561,512,504,512, /*944-959*/ \
+ 496,504,512,512,504,512,497,512,504,504,504,512,512,512,504,504, /*960-975*/ \
+ 504,512,512,512,512,512,512,504,512,512,512,512,504,512,512,512, /*976-991*/ \
+ 562,512,504,512,511,512,512,512,512,504,512,512,512,504,512,512, /*992-1007*/ \
+ 512,561,512,512,536,512,512,512,512,512,544,559,561,561,563,544 /*1008-1023*/ \
+
+#define MPFR_MUL_THRESHOLD 17 /* limbs */
+#define MPFR_SQR_THRESHOLD 16 /* limbs */
+#define MPFR_DIV_THRESHOLD 3 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 585 /* bits */
+#define MPFR_EXP_THRESHOLD 11179 /* bits */
+#define MPFR_SINCOS_THRESHOLD 30593 /* bits */
+#define MPFR_AI_THRESHOLD1 -11898 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 1175
+#define MPFR_AI_THRESHOLD3 18856
+/* Tuneup completed successfully, took 705 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/arm/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/arm/mparam.h
index 511df5bcc0f..e0b78e381d6 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/arm/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/arm/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -19,214 +19,215 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Generated by MPFR's tuneup.c, 2010-10-15, gcc 4.4.4 */
-/* gcc57.fsffrance.org (Feroceon 88FR131 rev 1 (v5l)) with gmp 5.0.1 */
-
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 7.3.0 */
+/* calva.loria.fr ARMv7 Processor rev 5 (v7l) with gmp-6.1.2,
+ which defines -march=armv7-a -mfloat-abi=hard -mfpu=neon -mtune=cortex-a7 */
#define MPFR_MULHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 62,76,76,76,76,76,76,76,76,76,76,76,76,76,76,76, \
- 76,76,76,84,84,84,88,88,88,92,88,92,92,92,92,92, \
- 92,92,92,92,92,92,92,92,92,92,92,92,92,92,100,100, \
- 104,108,104,108,108,108,108,108,108,108,108,108,108,108,108,108, \
- 108,108,108,108,108,108,108,108,120,116,120,120,129,129,129,135, \
- 135,135,135,135,135,135,135,135,135,135,135,135,135,135,135,135, \
- 135,135,135,135,135,135,135,147,147,147,147,147,147,153,153,153, \
- 159,159,159,159,159,159,159,159,159,159,159,159,159,159,159,159, \
- 159,159,159,159,159,159,159,159,159,171,171,171,171,177,177,177, \
- 183,177,183,183,183,183,183,183,183,183,183,183,183,183,183,183, \
- 183,183,183,183,183,183,183,183,204,204,204,204,204,204,212,212, \
- 212,212,212,212,212,212,212,212,212,212,212,212,212,212,212,212, \
- 212,212,212,212,212,212,212,212,212,212,212,228,228,228,228,228, \
- 228,228,236,236,236,236,236,244,244,244,244,244,244,244,244,244, \
- 244,244,244,244,244,244,244,244,244,244,244,244,244,244,244,244, \
- 244,244,244,244,260,260,244,244,243,244,244,244,244,244,244,244, \
- 244,244,244,244,244,284,284,284,284,284,284,284,284,300,300,300, \
- 300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300, \
- 300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300, \
- 300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300, \
- 300,300,300,300,300,300,300,300,300,300,300,300,300,300,300,300, \
- 300,332,332,332,332,332,332,332,332,332,332,332,332,332,332,348, \
- 348,348,348,348,348,348,348,348,348,348,348,348,348,348,348,348, \
- 348,364,364,364,364,364,364,364,348,364,364,364,364,348,364,364, \
+ -1,0,0,0,-1,-1,0,-1,-1,-1,-1,-1,0,-1,-1,0, \
+ 0,0,13,14,13,14,17,16,16,17,19,19,20,20,23,23, \
+ 24,25,23,24,25,26,25,26,29,28,29,29,31,32,32,34, \
+ 29,35,31,32,32,32,32,34,35,38,37,38,40,38,38,40, \
+ 40,40,40,40,46,46,46,52,46,46,52,51,52,50,52,51, \
+ 52,51,52,52,56,52,58,58,58,58,64,64,58,62,64,64, \
+ 64,64,64,63,64,64,68,88,64,68,70,70,80,70,76,80, \
+ 80,80,80,80,80,80,80,80,80,80,80,80,80,80,80,80, \
+ 92,92,92,92,92,92,92,92,92,92,104,104,104,104,100,104, \
+ 104,104,104,104,104,104,104,104,104,104,104,104,104,104,104,116, \
+ 104,116,116,104,116,116,116,116,116,116,116,116,116,116,116,116, \
+ 112,128,116,128,128,128,128,128,135,116,128,127,128,128,127,128, \
+ 128,153,124,128,128,135,128,128,128,153,147,153,153,135,128,153, \
+ 153,153,153,138,135,135,153,153,153,153,150,153,152,152,150,153, \
+ 153,153,152,153,152,153,152,153,153,153,152,152,153,153,170,171, \
+ 171,165,170,170,171,170,170,171,168,171,171,171,170,171,170,171, \
+ 170,171,171,170,168,189,186,189,170,189,189,189,189,189,189,189, \
+ 189,189,188,189,188,189,189,189,189,189,189,189,189,189,189,204, \
+ 204,204,204,204,204,204,204,204,204,204,204,204,228,228,228,228, \
+ 228,228,228,228,228,228,228,228,228,228,228,228,228,228,228,228, \
+ 228,228,228,228,228,228,228,228,228,228,228,252,252,252,252,252, \
+ 252,252,252,252,252,252,252,252,252,252,252,252,252,252,252,252, \
+ 252,252,252,251,252,252,252,252,252,252,251,252,252,252,252,252, \
+ 252,252,252,252,252,252,252,252,252,252,252,252,276,252,276,276, \
+ 276,276,275,252,276,276,276,276,276,276,276,276,316,276,276,316, \
+ 316,316,316,316,316,316,316,316,316,315,316,316,316,316,316,316, \
+ 316,316,316,315,316,316,316,315,316,316,315,316,316,316,316,316, \
+ 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316, \
+ 316,316,316,316,316,364,316,316,364,364,363,364,364,364,364,364, \
+ 364,364,364,363,364,364,364,364,364,364,364,364,364,364,364,364, \
+ 364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, \
364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,364, \
- 364,364,364,364,364,364,364,364,366,364,364,364,364,364,364,364, \
- 364,364,390,364,390,390,390,390,390,390,390,390,390,390,390,426, \
- 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
- 426,426,426,426,426,426,426,450,426,450,450,450,450,450,450,450, \
- 450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, \
- 450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, \
- 450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, \
- 450,450,450,450,474,450,474,498,498,498,498,498,498,498,498,498, \
- 498,498,498,498,498,498,498,498,497,498,497,498,498,498,498,498, \
- 498,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, \
- 522,522,522,522,522,522,522,522,522,522,522,522,522,522,522,522, \
- 546,546,546,546,546,546,546,546,546,546,546,546,546,546,546,546, \
- 546,546,546,546,545,546,568,568,568,546,568,568,568,568,568,568, \
- 568,568,568,568,568,600,600,600,600,568,600,600,600,568,568,600, \
- 600,600,600,600,600,600,600,598,600,600,600,600,600,600,600,600, \
- 599,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,600,600,600,632,600,600,600,600, \
- 632,632,600,600,632,632,600,632,664,664,664,664,664,664,664,664, \
- 664,664,664,664,664,664,664,664,664,664,664,664,664,664,664,664, \
- 664,664,664,664,664,664,664,664,664,664,664,664,696,696,696,696, \
- 696,696,696,696,696,696,696,696,696,696,696,696,696,696,696,696, \
- 696,696,696,696,696,696,696,696,695,696,728,696,728,728,727,728, \
- 728,728,728,728,728,727,728,728,727,728,728,728,728,728,727,728, \
- 728,727,728,727,728,728,728,728,728,728,727,728,728,727,727,728, \
- 728,727,728,728,728,728,727,728,728,728,728,728,728,728,728,728, \
- 728,728,728,728,728,727,728,728,727,728,728,728,728,728,728,728, \
- 728,728,728,727,727,728,728,728,728,727,728,728,728,728,728,728, \
- 728,728,728,727,728,728,728,728,728,728,727,728,728,728,728,792, \
- 792,792,792,792,728,728,760,760,760,728,792,792,760,792,792,760, \
- 760,760,824,792,824,792,824,792,824,792,824,824,824,824,824,824, \
- 823,824,824,824,792,792,824,792,824,792,792,792,824,824,792,856 \
+ 364,364,364,364,364,364,364,364,364,364,364,412,412,412,412,412, \
+ 412,412,412,412,412,412,412,412,412,412,412,412,412,412,412,412, \
+ 412,412,412,412,412,412,412,412,412,412,411,412,412,412,411,412, \
+ 412,412,412,412,412,412,412,412,412,474,412,474,474,474,474,474, \
+ 474,473,474,474,474,474,474,474,473,474,474,474,474,474,473,474, \
+ 474,474,474,474,474,474,473,474,474,474,474,474,474,474,474,474, \
+ 474,474,473,474,474,474,474,474,473,474,474,474,474,474,474,474, \
+ 474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474, \
+ 474,474,474,474,474,474,474,474,474,474,474,474,474,474,474,474, \
+ 474,474,504,474,474,504,474,474,474,474,474,504,504,474,474,504, \
+ 504,504,504,504,504,504,504,504,504,504,504,504,504,504,536,504, \
+ 552,552,504,552,504,552,552,552,552,552,552,552,552,552,552,552, \
+ 552,552,552,552,552,552,552,552,552,552,552,552,552,552,552,552, \
+ 552,552,552,552,552,552,552,632,631,631,632,631,632,632,630,631, \
+ 632,632,631,631,632,632,631,632,632,631,632,632,632,632,632,632, \
+ 632,631,632,632,632,632,632,632,632,632,632,632,632,631,632,632, \
+ 632,632,632,632,632,631,631,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,631,632,632,632,632,632,632,632,632,632,632, \
+ 631,632,632,631,632,632,632,632,632,630,631,632,632,631,632,632, \
+ 632,632,632,631,632,631,632,632,632,632,632,728,728,631,632,728, \
+ 728,727,728,728,728,727,728,727,728,727,728,728,728,728,728,728, \
+ 728,727,728,728,728,728,728,728,728,727,728,728,728,727,728,728, \
+ 728,728,728,728,728,727,728,728,728,727,728,728,728,727,728,728, \
+ 728,727,728,728,728,728,728,728,728,727,728,728,728,727,728,728, \
+ 728,727,726,727,728,728,728,728,728,727,728,728,728,727,728,728, \
+ 728,728,728,728,728,728,728,728,728,727,728,728,728,727,728,728, \
+ 728,728,728,728,728,726,728,728,728,824,728,728,727,824,824,728, \
+ 824,824,728,824,824,728,824,824,728,824,824,728,824,824,824,824, \
+ 824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, \
+ 824,824,824,824,824,824,824,824,824,824,824,824,824,824,824,824, \
+ 824,824,824,824,824,824,823,824,824,824,824,824,824,823,824,824 \
#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,12,12,13,13,14,14,15,15,16,16,17,17, \
- 18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25, \
- 26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33, \
- 34,34,35,35,36,36,37,37,38,38,39,39,40,40,41,41, \
- 42,42,43,43,44,44,47,45,46,46,47,47,48,48,49,49, \
- 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57, \
- 58,58,59,59,60,60,61,61,62,62,63,63,64,64,67,65, \
- 66,66,67,67,68,68,69,69,70,70,71,71,73,72,75,73, \
- 74,74,75,77,76,76,82,77,82,82,82,82,82,82,82,82, \
- 82,82,86,86,90,90,90,85,90,90,90,90,90,90,90,94, \
- 90,94,98,94,98,98,98,98,98,98,98,98,98,98,98,102, \
- 106,106,106,102,106,106,106,106,106,106,106,110,106,114,114,110, \
- 110,114,114,114,114,114,114,118,114,114,114,118,122,122,122,118, \
- 122,122,122,122,122,122,122,126,130,130,126,119,130,120,130,121, \
- 122,122,123,123,124,124,125,125,126,126,127,128,128,128,130,130, \
- 130,132,131,132,134,132,141,136,141,138,147,144,147,144,147,144, \
- 147,150,147,150,153,150,153,156,153,156,159,156,159,156,147,145, \
- 147,150,147,150,148,150,153,156,153,156,159,156,159,156,159,162, \
- 159,162,159,162,159,162,165,168,165,168,165,168,171,174,171,174, \
- 171,174,177,174,171,180,177,174,177,180,183,180,183,180,183,186, \
- 183,186,183,186,183,180,189,180,195,180,183,180,183,180,183,186, \
- 183,186,183,186,189,192,195,192,189,192,195,192,195,198,195,198, \
- 195,198,195,198,201,204,201,204,207,204,207,204,207,210,207,210, \
- 207,210,207,210,207,220,224,220,223,228,224,224,224,228,204,228, \
- 204,228,232,228,204,228,232,236,232,236,240,236,240,240,240,244, \
- 240,240,243,244,240,244,228,244,228,248,228,252,228,252,228,256, \
- 228,256,236,256,236,240,240,239,244,240,240,240,240,243,244,248, \
- 244,243,248,248,248,248,252,248,252,256,256,256,256,256,256,256, \
- 256,256,260,259,260,264,260,264,260,267,268,272,268,272,276,248, \
- 252,256,256,256,260,259,256,256,256,255,260,264,260,264,260,267, \
- 260,267,272,272,264,272,272,272,272,272,276,272,276,272,276,275, \
- 276,280,276,280,284,280,284,288,284,280,292,288,288,291,292,287, \
- 288,288,292,296,292,291,292,308,308,304,300,308,300,308,308,308, \
- 308,308,304,308,316,308,316,315,324,324,324,323,324,324,324,324, \
- 324,323,324,323,324,328,324,323,324,323,336,336,342,336,342,336, \
- 342,336,342,348,342,348,348,348,348,323,348,353,348,360,354,360, \
- 360,360,360,360,354,360,366,360,360,360,366,360,366,360,366,372, \
- 366,372,366,372,378,372,372,372,378,384,378,360,378,384,390,384, \
- 384,384,384,384,384,384,384,384,390,396,366,372,372,372,372,372, \
- 378,396,378,384,384,384,384,384,384,384,390,384,424,384,424,423, \
- 424,423,424,423,424,423,424,432,424,432,424,432,432,432,424,432, \
- 432,432,432,448,432,432,440,448,440,432,440,448,424,448,448,448, \
- 448,448,448,432,424,432,432,432,456,432,432,432,432,432,432,432, \
- 440,432,440,448,448,448,448,448,448,448,448,448,456,448,456,448, \
- 456,448,456,464,456,464,456,464,464,464,464,464,472,464,464,464, \
- 464,472,480,464,472,464,480,480,472,480,480,480,480,480,480,480, \
- 480,480,480,480,488,480,488,464,488,487,496,496,504,496,488,496, \
- 496,472,504,496,504,512,512,512,512,512,504,512,512,512,512,512, \
- 512,512,512,512,512,512,512,496,520,488,496,496,496,496,496,496, \
- 503,504,536,504,496,504,511,504,512,504,512,512,512,512,512,512, \
- 544,512,512,512,544,528,552,520,528,520,528,520,528,528,528,520, \
- 528,528,528,536,528,528,528,544,544,536,512,544,544,528,544,544, \
- 544,552,512,552,512,520,512,520,519,520,528,528,528,528,560,520, \
- 528,528,528,520,528,536,528,536,528,544,528,536,544,536,544,544, \
- 544,552,544,552,544,544,544,544,544,544,544,544,560,552,551,560, \
- 560,552,560,552,560,560,560,560,560,568,576,568,576,568,560,568, \
- 576,576,576,576,576,576,576,576,576,576,576,576,576,576,576,584, \
- 576,592,592,584,592,584,592,592,592,544,592,592,592,544,608,600, \
- 616,600,608,608,616,600,616,552,616,616,616,616,608,616,648,616, \
- 616,616,648,632,648,632,576,664,631,632,648,632,648,632,648,648, \
- 647,648,647,648,647,648,647,648,648,648,648,648,647,648,648,648, \
- 648,648,648,648,648,664,648,648,648,664,616,664,663,664,663,664, \
- 608,664,616,664,616,664,616,664,608,632,616,616,680,632,616,632 \
+ -1,0,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, \
+ 12,12,11,12,12,14,15,16,16,16,18,16,20,18,20,20, \
+ 21,20,20,24,22,24,24,25,26,28,28,25,25,27,27,28, \
+ 29,27,28,29,29,28,29,29,31,31,32,33,33,35,35,36, \
+ 37,34,35,36,37,36,39,40,41,42,41,40,42,41,42,44, \
+ 44,42,44,44,45,44,48,48,49,50,48,52,56,56,52,52, \
+ 56,52,56,56,60,56,56,64,64,60,60,64,68,64,68,64, \
+ 68,64,68,68,72,72,72,72,68,72,76,74,72,72,72,80, \
+ 72,72,72,72,70,72,72,74,74,80,76,80,78,80,80,84, \
+ 80,84,84,88,84,88,88,90,88,84,92,80,88,88,88,84, \
+ 84,92,88,88,88,88,88,88,88,88,96,96,92,92,112,96, \
+ 96,92,92,96,104,104,112,104,104,112,112,112,104,104,104,112, \
+ 112,112,112,112,112,112,112,120,120,112,120,112,120,120,120,112, \
+ 128,120,120,128,128,112,128,120,120,120,120,128,120,128,128,128, \
+ 128,128,128,136,128,128,136,136,136,136,136,136,136,136,144,144, \
+ 136,144,144,128,144,144,144,128,144,144,136,144,144,136,136,144, \
+ 144,144,144,144,144,144,144,144,144,144,144,144,144,152,144,152, \
+ 152,144,144,144,160,160,144,160,160,160,160,160,160,160,160,160, \
+ 160,160,160,160,160,177,177,160,160,160,160,160,160,160,177,160, \
+ 160,160,160,160,177,177,177,160,177,177,177,201,177,201,177,201, \
+ 201,177,201,201,201,201,201,177,201,201,201,201,201,201,201,201, \
+ 201,201,201,207,201,201,201,200,201,201,201,201,201,201,201,201, \
+ 201,201,213,201,213,213,213,213,213,213,213,213,213,213,218,218, \
+ 218,219,213,213,213,213,219,213,225,213,218,219,225,219,237,218, \
+ 237,237,237,237,237,237,237,237,237,237,237,237,224,237,249,237, \
+ 237,249,237,237,249,243,237,237,243,243,237,249,249,249,249,248, \
+ 249,249,249,237,249,249,261,249,249,260,261,248,249,249,261,261, \
+ 261,261,261,273,261,249,249,260,261,273,261,261,261,273,284,284, \
+ 273,284,261,284,273,261,292,273,284,292,291,292,292,292,292,284, \
+ 292,292,292,284,291,292,284,292,292,284,292,284,284,292,292,284, \
+ 284,292,284,291,292,308,291,292,292,292,292,284,284,284,284,316, \
+ 292,292,316,284,308,292,292,284,300,316,292,292,316,292,300,316, \
+ 316,316,291,292,292,292,291,292,316,292,308,308,300,316,316,332, \
+ 292,300,316,316,316,316,316,316,332,308,324,316,316,316,332,316, \
+ 316,316,332,316,332,316,332,324,316,324,332,332,332,332,332,332, \
+ 332,332,332,332,332,332,324,316,332,348,324,332,348,348,348,348, \
+ 332,348,332,332,348,348,332,332,348,332,348,364,364,332,348,364, \
+ 348,364,348,348,348,364,348,348,364,348,348,364,364,348,364,364, \
+ 364,364,364,364,364,364,364,364,364,364,364,364,364,364,364,372, \
+ 380,364,380,372,380,364,379,380,364,364,364,380,364,380,402,380, \
+ 364,372,364,380,372,380,402,380,402,402,402,402,402,402,426,402, \
+ 402,426,402,402,402,438,426,438,426,426,426,438,426,438,426,438, \
+ 426,426,426,426,426,426,438,426,426,426,438,426,438,438,438,438, \
+ 438,438,438,426,426,438,438,438,426,426,426,438,426,426,426,438, \
+ 426,426,438,438,426,438,438,438,438,438,474,450,438,474,474,450, \
+ 474,474,474,474,474,474,474,474,474,450,474,474,474,474,450,474, \
+ 486,474,498,474,473,474,474,474,474,474,474,474,498,474,474,498, \
+ 473,474,474,438,474,474,474,498,450,474,474,498,450,498,498,498, \
+ 522,498,498,474,522,498,498,498,498,498,474,522,474,498,474,498, \
+ 474,474,474,474,474,522,474,474,474,522,522,522,474,522,522,522, \
+ 522,522,498,522,522,498,498,498,498,522,498,498,498,498,498,498, \
+ 522,498,498,498,498,498,498,498,498,522,546,522,522,522,522,522, \
+ 522,522,522,546,522,522,522,522,522,546,522,522,522,522,522,522, \
+ 546,546,522,522,546,546,546,546,546,546,546,522,546,546,546,546, \
+ 546,546,546,546,546,546,545,546,546,546,546,546,568,558,546,568, \
+ 546,568,568,546,546,546,546,546,546,546,546,568,546,546,546,545, \
+ 546,584,584,584,546,584,546,584,568,546,568,584,584,568,584,568, \
+ 584,584,600,568,584,600,568,584,568,568,584,600,600,600,600,584, \
+ 600,600,616,584,600,616,632,616,584,616,616,632,632,616,632,632, \
+ 632,631,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,664,632,632,632, \
+ 632,664,664,632,632,664,632,664,664,632,664,664,664,632,664,632, \
+ 632,664,631,664,632,664,664,664,664,664,664,664,664,664,664,664, \
+ 664,664,664,664,664,664,664,664,696,664,696,696,664,696,696,664 \
#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15, \
- 16,17,18,17,18,17,13,16,16,16,19,18,19,19,20,20, \
- 23,24,21,24,25,24,27,25,24,26,25,28,27,29,31,31, \
- 29,31,32,32,32,33,29,34,33,33,34,37,32,36,37,37, \
- 39,36,36,38,41,41,41,42,42,43,43,45,44,44,44,43, \
- 45,45,48,44,47,48,47,52,47,49,51,52,49,52,53,49, \
- 55,57,53,56,57,57,57,59,58,62,56,59,56,63,63,60, \
- 58,65,64,66,64,60,67,67,62,68,66,66,67,69,65,71, \
- 70,73,69,68,73,72,73,69,75,75,71,74,75,73,73,78, \
- 76,75,77,81,80,80,77,77,81,84,85,84,84,80,81,86, \
- 83,85,85,86,88,88,85,91,87,89,89,93,91,89,89,95, \
- 96,95,91,91,92,92,96,93,99,99,96,96,97,96,101,100, \
- 98,107,100,106,104,101,101,101,105,107,109,103,110,107,105,108, \
- 106,109,111,112,114,109,116,109,116,114,113,117,116,114,115,113, \
- 114,116,120,120,121,118,117,122,125,118,120,119,125,120,121,121, \
- 125,125,123,124,125,125,125,125,127,126,127,128,128,131,129,129, \
- 130,130,131,131,132,132,133,133,134,134,135,144,136,143,145,148, \
- 143,144,152,152,152,148,149,152,152,152,151,149,160,152,152,152, \
- 151,151,152,152,168,152,152,150,152,151,152,159,152,160,160,153, \
- 167,176,159,160,168,160,159,168,167,167,167,168,175,160,178,166, \
- 165,168,176,168,167,176,168,176,179,168,184,184,180,176,184,169, \
- 175,175,182,174,175,176,183,184,184,176,192,178,184,183,182,183, \
- 183,183,184,191,183,186,184,192,184,184,191,199,199,200,200,192, \
- 192,192,200,208,199,197,200,202,207,208,208,198,210,208,199,209, \
- 215,208,208,216,208,216,204,215,200,208,211,200,206,207,216,208, \
- 202,207,208,208,216,208,208,207,214,209,216,216,212,208,218,215, \
- 214,216,216,211,216,215,216,216,216,224,216,224,218,216,224,218, \
- 230,224,224,238,222,232,224,226,236,222,228,232,232,238,240,240, \
- 226,240,230,239,240,239,240,239,240,232,240,231,232,240,233,240, \
- 240,239,238,240,240,240,246,258,240,238,239,239,240,255,241,258, \
- 242,254,258,252,253,257,257,252,258,258,252,258,248,254,252,264, \
- 263,257,262,266,256,266,253,258,264,258,258,270,266,262,258,257, \
- 258,258,272,259,264,265,284,304,263,266,264,288,304,304,270,282, \
- 300,304,288,288,288,294,288,292,302,300,286,304,302,288,300,304, \
- 302,298,304,288,304,304,304,300,288,304,316,304,300,314,288,300, \
- 312,302,304,304,306,302,303,300,304,304,311,304,316,300,336,318, \
- 304,318,304,312,316,300,304,308,304,312,320,318,320,336,304,316, \
- 299,336,318,318,318,304,340,336,320,304,304,336,324,348,305,316, \
- 334,316,352,336,336,336,318,336,340,336,354,318,320,352,352,352, \
- 318,336,328,318,352,336,358,330,342,360,366,366,350,334,348,336, \
- 354,350,348,340,336,352,352,352,336,352,332,350,366,336,351,366, \
- 352,366,352,352,352,336,336,348,353,336,351,366,366,360,366,346, \
- 350,362,366,352,366,366,352,364,353,356,348,366,368,352,365,348, \
- 353,366,350,366,352,352,364,372,354,352,372,352,362,352,368,365, \
- 354,354,366,372,366,368,364,370,368,368,366,372,368,368,366,366, \
- 368,405,374,364,366,384,372,366,366,368,367,390,368,400,372,400, \
- 371,392,413,399,380,400,404,417,415,386,384,400,392,400,405,407, \
- 399,421,408,400,406,408,415,421,416,400,419,415,406,416,412,408, \
- 422,408,416,431,416,421,404,416,400,416,417,431,415,392,424,424, \
- 415,432,421,416,432,432,408,399,415,416,400,424,422,408,420,431, \
- 423,432,417,416,415,432,413,414,432,424,424,416,416,432,415,409, \
- 416,424,416,430,415,431,423,432,423,424,424,420,416,431,417,436, \
- 420,430,424,430,428,420,421,424,428,431,464,430,424,439,428,448, \
- 432,431,432,433,436,440,464,469,468,453,431,440,448,440,449,463, \
- 464,439,440,468,480,447,448,463,468,440,472,470,480,464,470,480, \
- 464,471,471,464,479,460,464,461,488,478,468,480,479,464,488,463, \
- 450,478,464,469,464,471,488,465,478,488,477,480,481,472,480,488, \
- 496,468,480,479,488,480,488,469,463,488,480,480,464,477,480,481, \
- 504,472,480,516,504,504,504,478,480,479,488,516,480,483,485,516, \
- 488,488,488,516,504,488,481,484,480,516,512,528,504,480,532,503, \
- 488,504,516,536,488,528,516,488,532,516,528,501,512,504,516,504, \
- 528,492,520,516,516,504,525,496,516,520,516,512,520,532,528,516, \
- 516,524,512,508,520,528,516,532,532,516,533,516,528,504,528,516, \
- 532,576,532,515,516,600,528,517,516,600,600,532,516,600,600,524 \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*32-47*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,0,0,0,0,0,42,41,44,44,45,45,45, /*64-79*/ \
+ 44,44,49,47,47,46,47,46,52,52,52,51,52,52,52,52, /*80-95*/ \
+ 53,51,52,59,58,52,59,64,58,59,62,68,62,57,64,59, /*96-111*/ \
+ 64,59,68,68,70,68,70,70,68,64,70,70,66,64,66,70, /*112-127*/ \
+ 76,67,69,72,70,70,80,80,71,88,76,80,80,76,80,80, /*128-143*/ \
+ 80,88,88,90,92,92,92,90,88,84,92,80,88,80,92,92, /*144-159*/ \
+ 92,92,92,88,88,90,90,92,92,92,95,94,94,92,92,94, /*160-175*/ \
+ 96,104,94,92,92,92,95,102,104,104,103,104,104,104,104,104, /*176-191*/ \
+ 104,104,104,100,104,104,104,104,104,104,104,103,104,112,108,112, /*192-207*/ \
+ 116,116,116,128,116,128,116,128,116,128,128,128,116,128,128,128, /*208-223*/ \
+ 127,128,128,128,128,128,128,136,128,128,136,128,128,140,128,128, /*224-239*/ \
+ 128,140,128,136,128,128,128,128,128,139,128,136,136,138,140,140, /*240-255*/ \
+ 136,136,140,140,140,140,140,138,144,140,136,140,148,142,139,160, /*256-271*/ \
+ 160,140,160,158,160,160,160,148,160,160,160,160,160,160,160,160, /*272-287*/ \
+ 160,160,152,160,160,160,176,176,160,160,176,160,160,168,160,184, /*288-303*/ \
+ 160,160,184,160,160,176,160,160,176,184,184,184,160,184,184,183, /*304-319*/ \
+ 176,184,184,182,184,184,184,184,182,184,184,184,176,208,184,184, /*320-335*/ \
+ 192,184,184,184,184,184,184,184,208,184,184,184,208,208,184,184, /*336-351*/ \
+ 208,208,184,208,208,208,208,208,208,200,208,184,208,208,208,208, /*352-367*/ \
+ 208,208,208,208,208,208,208,208,208,208,208,208,208,204,208,208, /*368-383*/ \
+ 208,208,208,207,208,208,206,208,208,208,208,206,208,208,208,208, /*384-399*/ \
+ 208,208,206,208,208,208,208,208,208,208,208,208,208,208,224,224, /*400-415*/ \
+ 224,224,224,231,232,256,256,224,256,232,232,232,256,256,232,224, /*416-431*/ \
+ 232,256,256,224,232,228,224,256,232,256,256,232,256,256,256,256, /*432-447*/ \
+ 256,256,256,232,256,230,256,256,256,256,256,256,256,256,256,256, /*448-463*/ \
+ 256,248,256,256,256,252,256,256,256,256,255,256,254,256,256,256, /*464-479*/ \
+ 256,256,256,255,256,256,256,256,256,256,256,256,256,248,256,256, /*480-495*/ \
+ 256,256,256,256,256,256,256,256,256,256,256,256,256,270,280,272, /*496-511*/ \
+ 272,280,270,268,280,288,288,288,288,292,280,276,288,270,280,304, /*512-527*/ \
+ 288,304,288,280,280,279,304,280,280,280,280,304,296,280,280,282, /*528-543*/ \
+ 304,320,279,320,288,304,304,288,320,304,320,316,320,304,320,304, /*544-559*/ \
+ 288,304,304,304,320,304,320,320,320,304,304,304,320,318,296,304, /*560-575*/ \
+ 320,320,318,320,318,304,304,320,304,304,320,304,304,304,304,320, /*576-591*/ \
+ 320,320,320,318,320,320,320,318,352,320,320,320,318,352,320,352, /*592-607*/ \
+ 320,320,320,320,320,336,368,336,368,320,320,368,352,352,368,368, /*608-623*/ \
+ 366,320,342,368,320,368,352,350,352,352,320,364,352,366,352,366, /*624-639*/ \
+ 368,367,366,360,364,368,368,366,368,368,368,368,368,366,368,378, /*640-655*/ \
+ 352,376,368,368,352,364,352,368,352,366,366,352,368,384,368,368, /*656-671*/ \
+ 364,366,364,367,368,367,368,368,376,368,368,368,368,367,368,376, /*672-687*/ \
+ 366,364,366,366,368,366,368,368,368,368,384,416,384,376,416,368, /*688-703*/ \
+ 376,378,368,366,368,368,384,368,366,416,368,368,416,376,368,367, /*704-719*/ \
+ 368,384,416,416,368,416,416,416,416,416,416,416,384,384,408,416, /*720-735*/ \
+ 416,416,376,408,408,416,416,408,408,416,416,416,378,416,416,416, /*736-751*/ \
+ 416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,400, /*752-767*/ \
+ 416,416,416,416,416,416,416,416,408,416,416,416,416,416,408,416, /*768-783*/ \
+ 416,416,416,416,416,416,416,416,416,416,416,416,416,416,416,416, /*784-799*/ \
+ 448,416,416,416,416,448,416,456,416,416,416,448,416,416,416,416, /*800-815*/ \
+ 416,448,416,448,416,416,416,416,416,416,416,448,456,416,448,464, /*816-831*/ \
+ 456,448,512,448,464,462,464,464,464,448,448,464,448,448,464,448, /*832-847*/ \
+ 448,448,464,480,512,448,448,448,464,512,448,448,448,456,456,456, /*848-863*/ \
+ 512,512,464,464,456,464,464,512,512,512,512,464,512,512,512,512, /*864-879*/ \
+ 512,512,512,512,512,512,512,512,512,512,512,512,456,512,512,454, /*880-895*/ \
+ 512,512,456,511,464,512,504,504,504,512,512,504,512,464,512,512, /*896-911*/ \
+ 512,512,512,512,464,512,512,512,512,512,512,464,512,512,512,512, /*912-927*/ \
+ 504,512,510,512,512,512,512,512,512,512,512,512,512,512,512,512, /*928-943*/ \
+ 512,512,512,512,512,504,504,512,512,512,512,512,504,512,512,512, /*944-959*/ \
+ 512,512,512,512,512,512,512,512,512,512,512,512,512,512,512,512, /*960-975*/ \
+ 512,512,512,512,512,511,512,512,512,512,512,512,504,512,512,511, /*976-991*/ \
+ 511,512,512,511,512,512,512,512,512,512,512,512,512,511,512,512, /*992-1007*/ \
+ 512,512,512,512,512,512,512,512,512,512,512,512,512,536,544,544 /*1008-1023*/ \
-#define MPFR_MUL_THRESHOLD 16 /* limbs */
-#define MPFR_SQR_THRESHOLD 31 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 469 /* bits */
-#define MPFR_EXP_THRESHOLD 5484 /* bits */
-#define MPFR_SINCOS_THRESHOLD 23806 /* bits */
-#define MPFR_AI_THRESHOLD1 -24060 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 2314
-#define MPFR_AI_THRESHOLD3 40340
-/* Tuneup completed successfully, took 8148 seconds */
+#define MPFR_MUL_THRESHOLD 22 /* limbs */
+#define MPFR_SQR_THRESHOLD 24 /* limbs */
+#define MPFR_DIV_THRESHOLD 3 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 277 /* bits */
+#define MPFR_EXP_THRESHOLD 10666 /* bits */
+#define MPFR_SINCOS_THRESHOLD 28990 /* bits */
+#define MPFR_AI_THRESHOLD1 -28503 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 2972
+#define MPFR_AI_THRESHOLD3 44718
+/* Tuneup completed successfully, took 3001 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/asin.c b/Build/source/libs/mpfr/mpfr-src/src/asin.c
index fbc3604ba99..62cf89b862a 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/asin.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/asin.c
@@ -1,6 +1,6 @@
/* mpfr_asin -- arc-sinus of a floating-point number
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/asinh.c b/Build/source/libs/mpfr/mpfr-src/src/asinh.c
index 0f78bfd2cab..10aa23fc77e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/asinh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/asinh.c
@@ -1,6 +1,6 @@
/* mpfr_asinh -- inverse hyperbolic sine
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -89,7 +89,7 @@ mpfr_asinh (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
for (;;)
{
/* compute asinh */
- mpfr_mul (t, x, x, MPFR_RNDD); /* x^2 */
+ mpfr_sqr (t, x, MPFR_RNDD); /* x^2 */
mpfr_add_ui (t, t, 1, MPFR_RNDD); /* x^2+1 */
mpfr_sqrt (t, t, MPFR_RNDN); /* sqrt(x^2+1) */
(neg ? mpfr_sub : mpfr_add) (t, t, x, MPFR_RNDN); /* sqrt(x^2+1)+x */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/atan.c b/Build/source/libs/mpfr/mpfr-src/src/atan.c
index 6979013520f..0f63416c95e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/atan.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/atan.c
@@ -1,6 +1,6 @@
/* mpfr_atan -- arc-tangent of a floating-point number
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -64,13 +64,14 @@ set_table (mpfr_t y, const mp_limb_t x[3])
mp_limb_t *yp = MPFR_MANT(y);
MPFR_UNSIGNED_MINUS_MODULO (sh, p);
+ MPFR_ASSERTD (n >= 1 && n <= 3);
mpn_copyi (yp, x + 3 - n, n);
yp[0] &= ~MPFR_LIMB_MASK(sh);
MPFR_SET_EXP(y, 0);
}
#endif
-/* If x = p/2^r, put in y an approximation of atan(x)/x using 2^m terms
+/* If x = p/2^r, put in y an approximation to atan(x)/x using 2^m terms
for the series expansion, with an error of at most 1 ulp.
Assumes 0 < x < 1, thus 1 <= p < 2^r.
More precisely, p consists of the floor(r/2) bits of the binary expansion
@@ -98,14 +99,17 @@ mpfr_atan_aux (mpfr_ptr y, mpz_ptr p, unsigned long r, int m, mpz_t *tab)
mpfr_prec_t accu[MPFR_PREC_BITS], log2_nb_terms[MPFR_PREC_BITS];
mpfr_prec_t precy = MPFR_PREC(y);
- MPFR_ASSERTD(mpz_cmp_ui (p, 0) != 0);
- MPFR_ASSERTD (m+1 <= MPFR_PREC_BITS);
+ MPFR_ASSERTD (mpz_sgn (p) > 0);
+ MPFR_ASSERTD (m > 0);
+ MPFR_ASSERTD (m <= MPFR_PREC_BITS - 1);
#if GMP_NUMB_BITS == 64
/* tabulate values for small precision and small value of r (which are the
most expensive to compute) */
if (precy <= 192)
{
+ unsigned long u;
+
switch (r)
{
case 1:
@@ -120,13 +124,15 @@ mpfr_atan_aux (mpfr_ptr y, mpz_ptr p, unsigned long r, int m, mpz_t *tab)
return;
case 4:
/* p has at most 2 bits: 1 <= p <= 3 */
- MPFR_ASSERTD(1 <= mpz_get_ui (p) && mpz_get_ui (p) <= 3);
- set_table (y, atan_table[1 + mpz_get_ui (p)]);
+ u = mpz_get_ui (p);
+ MPFR_ASSERTD(1 <= u && u <= 3);
+ set_table (y, atan_table[1 + u]);
return;
case 8:
/* p has at most 4 bits: 1 <= p <= 15 */
- MPFR_ASSERTD(1 <= mpz_get_ui (p) && mpz_get_ui (p) <= 15);
- set_table (y, atan_table[4 + mpz_get_ui (p)]);
+ u = mpz_get_ui (p);
+ MPFR_ASSERTD(1 <= u && u <= 15);
+ set_table (y, atan_table[4 + u]);
return;
}
}
@@ -150,10 +156,11 @@ mpfr_atan_aux (mpfr_ptr y, mpz_ptr p, unsigned long r, int m, mpz_t *tab)
MPFR_ASSERTD (r > n);
r -= n;
}
- /* since |p/2^r| < 1, and p is a non-zero integer, necessarily r > 0 */
+ /* Since |p/2^r| < 1, and p is a non-zero integer, necessarily r > 0. */
MPFR_ASSERTD (mpz_sgn (p) > 0);
MPFR_ASSERTD (m > 0);
+ MPFR_ASSERTD (r > 0);
/* check if p=1 (special case) */
l = 0;
@@ -486,7 +493,7 @@ mpfr_atan (mpfr_ptr atan, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
mpfr_add (arctgt, arctgt, sk, MPFR_RNDN);
/* argument reduction */
- mpfr_mul_2exp (arctgt, arctgt, red, MPFR_RNDN);
+ mpfr_mul_2ui (arctgt, arctgt, red, MPFR_RNDN);
if (comparison > 0)
{ /* atan(x) = Pi/2-atan(1/x) for x > 0 */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/atan2.c b/Build/source/libs/mpfr/mpfr-src/src/atan2.c
index eb1b25d9a4f..866a8289eab 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/atan2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/atan2.c
@@ -1,6 +1,6 @@
/* mpfr_atan2 -- arc-tan 2 of a floating-point number
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/atanh.c b/Build/source/libs/mpfr/mpfr-src/src/atanh.c
index 8b5adcbae67..db0c8ad141a 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/atanh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/atanh.c
@@ -1,6 +1,6 @@
/* mpfr_atanh -- Inverse Hyperbolic Tangente
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -44,9 +44,9 @@ mpfr_atanh_small (mpfr_ptr y, mpfr_srcptr x)
mpfr_init2 (t, p);
mpfr_init2 (u, p);
mpfr_init2 (x2, p);
- mpfr_set (t, x, MPFR_RNDF); /* t = x * (1 + theta) */
- mpfr_set (y, t, MPFR_RNDF); /* exact */
- mpfr_mul (x2, x, x, MPFR_RNDF); /* x2 = x^2 * (1 + theta) */
+ mpfr_set (t, x, MPFR_RNDF); /* t = x * (1 + theta) */
+ mpfr_set (y, t, MPFR_RNDF); /* exact */
+ mpfr_sqr (x2, x, MPFR_RNDF); /* x2 = x^2 * (1 + theta) */
for (i = 3; ; i += 2)
{
mpfr_mul (t, t, x2, MPFR_RNDF); /* t = x^i * (1 + theta)^i */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/bernoulli.c b/Build/source/libs/mpfr/mpfr-src/src/bernoulli.c
index d32069103bc..3656d80fdc8 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/bernoulli.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/bernoulli.c
@@ -1,6 +1,6 @@
/* bernoulli -- internal function to compute Bernoulli numbers.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -39,7 +39,7 @@ is_prime (unsigned long p)
using Von Staudt–Clausen theorem, which says that the denominator of B[n]
divides the product of all primes p such that p-1 divides n.
Since B[n] = zeta(n) * 2*n!/(2pi)^n, we compute an approximation of
- d * zeta(n) * 2*n!/(2pi)^n and round it to the nearest integer. */
+ (2n+1)! * zeta(n) * 2*n!/(2pi)^n and round it to the nearest integer. */
static void
mpfr_bernoulli_internal (mpz_t *b, unsigned long n)
{
@@ -86,8 +86,9 @@ mpfr_bernoulli_internal (mpz_t *b, unsigned long n)
mpfr_mul_ui (z, z, n, MPFR_RNDU);
p = mpfr_get_ui (z, MPFR_RNDU); /* (n/e/2/pi)^n <= 2^p */
mpfr_clear (z);
- /* the +14 term ensures no rounding failure up to n=10000 */
- prec += p + mpz_sizeinbase (den, 2) + 14;
+ MPFR_INC_PREC (prec, p + mpz_sizeinbase (den, 2));
+ /* the +2 term ensures no rounding failure up to n=10000 */
+ MPFR_INC_PREC (prec, __gmpfr_ceil_log2 (prec) + 2);
}
try_again:
@@ -139,13 +140,13 @@ mpfr_bernoulli_internal (mpz_t *b, unsigned long n)
Since z <= 2^prec * zeta(n) * 2*den*n!,
ulp(z) <= 2*zeta(n) * 2*den*n!, thus
(2^prec * zeta(n)-(p+1)) * 2*den*n! < z <= 2^prec * zeta(n) * 2*den*n! */
- mpfr_div_2exp (z, z, prec, MPFR_RNDZ);
+ mpfr_div_2ui (z, z, prec, MPFR_RNDZ);
/* now (zeta(n) - (p+1)/2^prec) * 2*den*n! < z <= zeta(n) * 2*den*n! */
/* divide by (2pi)^n */
mpfr_init2 (y, prec);
mpfr_const_pi (y, MPFR_RNDU);
/* pi <= y <= pi * (1 + 2^(1-prec)) */
- mpfr_mul_2exp (y, y, 1, MPFR_RNDU);
+ mpfr_mul_2ui (y, y, 1, MPFR_RNDU);
/* 2pi <= y <= 2pi * (1 + 2^(1-prec)) */
mpfr_pow_ui (y, y, n, MPFR_RNDU);
/* (2pi)^n <= y <= (2pi)^n * (1 + 2^(1-prec))^(n+1) */
@@ -184,7 +185,6 @@ mpfr_bernoulli_internal (mpz_t *b, unsigned long n)
mpz_mul_ui (t, t, n + 1);
mpz_divexact (t, t, den); /* t was still n! */
mpz_mul (num, num, t);
- mpz_set_ui (den, 1);
mpfr_clear (y);
mpfr_clear (z);
@@ -194,7 +194,7 @@ mpfr_bernoulli_internal (mpz_t *b, unsigned long n)
if (!ok)
{
- prec += prec / 10;
+ MPFR_INC_PREC (prec, prec / 10);
goto try_again;
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/beta.c b/Build/source/libs/mpfr/mpfr-src/src/beta.c
index 1e9103a0209..c260c42c48c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/beta.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/beta.c
@@ -1,6 +1,6 @@
/* mpfr_beta -- beta function
-Copyright 2017-2019 Free Software Foundation, Inc.
+Copyright 2017-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -94,7 +94,7 @@ mpfr_beta (mpfr_ptr r, mpfr_srcptr z, mpfr_srcptr w, mpfr_rnd_t rnd_mode)
mpfr_clear (t);
MPFR_SAVE_EXPO_FREE (expo);
/* q contains the low bits of trunc(w) where trunc() rounds
- towards zero, thus if q is odd, then -2k-2 < w < -2k-1 */
+ toward zero, thus if q is odd, then -2k-2 < w < -2k-1 */
MPFR_SET_INF(r);
if ((unsigned long) q & 1)
MPFR_SET_NEG(r);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/buildopt.c b/Build/source/libs/mpfr/mpfr-src/src/buildopt.c
index ba362ec4a1a..00d425f1fe2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/buildopt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/buildopt.c
@@ -1,7 +1,7 @@
/* buildopt.c -- functions giving information about options used during the
mpfr library compilation
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cache.c b/Build/source/libs/mpfr/mpfr-src/src/cache.c
index 3e0c83622ea..ece6cf0a06d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cache.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cache.c
@@ -1,6 +1,6 @@
/* mpfr_cache -- cache interface for multiple-precision constants in MPFR.
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -56,8 +56,8 @@ mpfr_clear_cache (mpfr_cache_t cache)
int
mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mpfr_rnd_t rnd)
{
- mpfr_prec_t prec = MPFR_PREC (dest);
- mpfr_prec_t pold;
+ mpfr_prec_t dprec = MPFR_PREC (dest);
+ mpfr_prec_t cprec; /* precision of the cache */
int inexact, sign;
MPFR_SAVE_EXPO_DECL (expo);
@@ -69,33 +69,37 @@ mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mpfr_rnd_t rnd)
/* Get the cache in read-only mode */
MPFR_LOCK_READ(cache->lock);
/* Read the precision within the cache */
- pold = MPFR_PREC (cache->x);
- if (MPFR_UNLIKELY (prec > pold))
+ cprec = MPFR_PREC (cache->x);
+ if (MPFR_UNLIKELY (dprec > cprec))
{
/* Free the cache in read-only mode */
/* And get the cache in read-write mode */
MPFR_LOCK_READ2WRITE(cache->lock);
- /* Retest the precision once we get the lock.
- If there is no lock, there is no harm in this code */
- pold = MPFR_PREC (cache->x);
- if (MPFR_LIKELY (prec > pold))
+ /* Retest the precision once we get the lock (since it might have
+ changed). If there is no lock, there is no harm in this code. */
+ cprec = MPFR_PREC (cache->x);
+ if (MPFR_LIKELY (dprec > cprec))
{
- /* No previous result in the cache or the precision of the previous
- result is not sufficient. We increase the cache size by at least
- 10% to avoid invalidating the cache many times if one performs
- several computations with small increase of precision. */
- if (MPFR_UNLIKELY (pold == 0)) /* No previous result. */
- mpfr_init2 (cache->x, prec); /* as pold = prec below */
+ /* No previous result in the cache or the precision of the
+ previous result is not sufficient. */
+ if (MPFR_UNLIKELY (cprec == 0)) /* No previous result. */
+ {
+ cprec = dprec;
+ mpfr_init2 (cache->x, cprec);
+ }
else
- pold += pold / 10;
-
- /* Update the cache. */
- if (pold < prec)
- pold = prec;
+ {
+ /* We increase the cache size by at least 10% to avoid
+ invalidating the cache many times if one performs
+ several computations with small increase of precision. */
+ cprec += cprec / 10;
+ if (cprec < dprec)
+ cprec = dprec;
+ /* no need to keep the previous value */
+ mpfr_set_prec (cache->x, cprec);
+ }
- /* no need to keep the previous value */
- mpfr_set_prec (cache->x, pold);
cache->inexact = (*cache->func) (cache->x, MPFR_RNDN);
}
@@ -104,9 +108,9 @@ mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mpfr_rnd_t rnd)
MPFR_LOCK_WRITE2READ(cache->lock);
}
- /* now pold >= prec is the precision of cache->x */
- MPFR_ASSERTD (pold >= prec);
- MPFR_ASSERTD (MPFR_PREC (cache->x) == pold);
+ /* now cprec >= dprec is the precision of cache->x */
+ MPFR_ASSERTD (cprec >= dprec);
+ MPFR_ASSERTD (MPFR_PREC (cache->x) == cprec);
/* First, check if the cache has the exact value (unlikely).
Else the exact value is between (assuming x=cache->x > 0):
@@ -120,9 +124,11 @@ mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mpfr_rnd_t rnd)
MPFR_EXP (dest) = MPFR_GET_EXP (cache->x);
MPFR_SET_SIGN (dest, sign);
- /* round cache->x from precision pold down to precision prec */
+ /* round cache->x from precision cprec down to precision dprec;
+ since we are in extended exponent range, for the values considered
+ here, an overflow is not possible (and wouldn't make much sense). */
MPFR_RNDRAW_GEN (inexact, dest,
- MPFR_MANT (cache->x), pold, rnd, sign,
+ MPFR_MANT (cache->x), cprec, rnd, sign,
if (MPFR_UNLIKELY (cache->inexact == 0))
{
if ((_sp[0] & _ulp) == 0)
@@ -140,8 +146,8 @@ mpfr_cache (mpfr_ptr dest, mpfr_cache_t cache, mpfr_rnd_t rnd)
inexact = -sign;
goto trunc_doit;
},
- if (MPFR_UNLIKELY (++MPFR_EXP (dest) > __gmpfr_emax))
- mpfr_overflow (dest, rnd, sign);
+ MPFR_EXP (dest) ++;
+ MPFR_ASSERTD (MPFR_EXP (dest) <= __gmpfr_emax);
);
/* Rather a likely, this is a 100% success rate for
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cbrt.c b/Build/source/libs/mpfr/mpfr-src/src/cbrt.c
index 50301761348..85f6cd2fb91 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cbrt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cbrt.c
@@ -1,6 +1,6 @@
/* mpfr_cbrt -- cube root function.
-Copyright 2002-2019 Free Software Foundation, Inc.
+Copyright 2002-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -23,31 +23,35 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
- /* The computation of y = x^(1/3) is done as follows:
+/* The computation of y = x^(1/3) is done as follows.
- Let x = sign * m * 2^(3*e) where m is an integer
+ Let n = PREC(y), or PREC(y) + 1 if the rounding mode is MPFR_RNDN.
+ We seek to compute an integer cube root in precision n and the
+ associated inexact bit (non-zero iff the remainder is non-zero).
- with 2^(3n-3) <= m < 2^(3n) where n = PREC(y)
+ Let us write x, possibly truncated, under the form sign * m * 2^(3*e)
+ where m is an integer such that 2^(3n-3) <= m < 2^(3n), i.e. m has
+ between 3n-2 and 3n bits.
- and m = s^3 + r where 0 <= r and m < (s+1)^3
+ Let s be the integer cube root of m, i.e. the maximum integer such that
+ m = s^3 + t with t >= 0. Thus 2^(n-1) <= s < 2^n, i.e. s has n bits.
- we want that s has n bits i.e. s >= 2^(n-1), or m >= 2^(3n-3)
- i.e. m must have at least 3n-2 bits
+ Then |x|^(1/3) = s * 2^e or (s+1) * 2^e depending on the rounding mode,
+ the sign, and whether s is "inexact" (i.e. t > 0 or the truncation of x
+ was not equal to x).
- then x^(1/3) = s * 2^e if r=0
- x^(1/3) = (s+1) * 2^e if round up
- x^(1/3) = (s-1) * 2^e if round down
- x^(1/3) = s * 2^e if nearest and r < 3/2*s^2+3/4*s+1/8
- (s+1) * 2^e otherwise
- */
+ Note: The truncation of x was allowed because any breakpoint has n bits
+ and its cube has at most 3n bits. Thus the truncation of x cannot yield
+ a cube root below RNDZ(x^(1/3)) in precision n. [TODO: add details.]
+*/
int
mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
mpz_t m;
- mpfr_exp_t e, r, sh;
- mpfr_prec_t n, size_m, tmp;
- int inexact, negative;
+ mpfr_exp_t e, d, sh;
+ mpfr_prec_t n, size_m;
+ int inexact, inexact2, negative, r;
MPFR_SAVE_EXPO_DECL (expo);
MPFR_LOG_FUNC (
@@ -89,40 +93,55 @@ mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
r = e % 3;
if (r < 0)
r += 3;
+ MPFR_ASSERTD (r >= 0 && r < 3 && (e - r) % 3 == 0);
+
/* x = (m*2^r) * 2^(e-r) = (m*2^r) * 2^(3*q) */
+ MPFR_LOG_MSG (("e=%" MPFR_EXP_FSPEC "d r=%d\n", (mpfr_eexp_t) e, r));
+
MPFR_MPZ_SIZEINBASE2 (size_m, m);
n = MPFR_PREC (y) + (rnd_mode == MPFR_RNDN);
- /* we want 3*n-2 <= size_m + 3*sh + r <= 3*n
- i.e. 3*sh + size_m + r <= 3*n */
- sh = (3 * (mpfr_exp_t) n - (mpfr_exp_t) size_m - r) / 3;
- sh = 3 * sh + r;
- if (sh >= 0)
+ /* We will need to multiply m by 2^(r'), truncated if r' < 0, and
+ subtract r' from e, so that m has between 3n-2 and 3n bits and
+ e becomes a multiple of 3.
+ Since r = e % 3, we write r' = 3 * sh + r.
+ We want 3 * n - 2 <= size_m + 3 * sh + r <= 3 * n.
+ Let d = 3 * n - size_m - r. Thus we want 0 <= d - 3 * sh <= 2,
+ i.e. sh = floor(d/3). */
+ d = 3 * (mpfr_exp_t) n - (mpfr_exp_t) size_m - r;
+ sh = d >= 0 ? d / 3 : - ((2 - d) / 3); /* floor(d/3) */
+ r += 3 * sh; /* denoted r' above */
+
+ e -= r;
+ MPFR_ASSERTD (e % 3 == 0);
+ e /= 3;
+
+ inexact = 0;
+
+ if (r > 0)
{
- mpz_mul_2exp (m, m, sh);
- e = e - sh;
+ mpz_mul_2exp (m, m, r);
}
- else if (r > 0)
+ else if (r < 0)
{
- mpz_mul_2exp (m, m, r);
- e = e - r;
+ r = -r;
+ inexact = mpz_scan1 (m, 0) < r;
+ mpz_fdiv_q_2exp (m, m, r);
}
- /* invariant: x = m*2^e, with e divisible by 3 */
-
/* we reuse the variable m to store the cube root, since it is not needed
any more: we just need to know if the root is exact */
- inexact = mpz_root (m, m, 3) == 0;
+ inexact = ! mpz_root (m, m, 3) || inexact;
- MPFR_MPZ_SIZEINBASE2 (tmp, m);
- sh = tmp - n;
- if (sh > 0) /* we have to flush to 0 the last sh bits from m */
- {
- inexact = inexact || ((mpfr_exp_t) mpz_scan1 (m, 0) < sh);
- mpz_fdiv_q_2exp (m, m, sh);
- e += 3 * sh;
- }
+#if MPFR_WANT_ASSERT > 0
+ {
+ mpfr_prec_t tmp;
+
+ MPFR_MPZ_SIZEINBASE2 (tmp, m);
+ MPFR_ASSERTN (tmp == n);
+ }
+#endif
if (inexact)
{
@@ -130,7 +149,10 @@ mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
rnd_mode = MPFR_INVERT_RND (rnd_mode);
if (rnd_mode == MPFR_RNDU || rnd_mode == MPFR_RNDA
|| (rnd_mode == MPFR_RNDN && mpz_tstbit (m, 0)))
- inexact = 1, mpz_add_ui (m, m, 1);
+ {
+ inexact = 1;
+ mpz_add_ui (m, m, 1);
+ }
else
inexact = -1;
}
@@ -138,8 +160,10 @@ mpfr_cbrt (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
/* either inexact is not zero, and the conversion is exact, i.e. inexact
is not changed; or inexact=0, and inexact is set only when
rnd_mode=MPFR_RNDN and bit (n+1) from m is 1 */
- inexact += mpfr_set_z (y, m, MPFR_RNDN);
- MPFR_SET_EXP (y, MPFR_GET_EXP (y) + e / 3);
+ inexact2 = mpfr_set_z (y, m, MPFR_RNDN);
+ MPFR_ASSERTD (inexact == 0 || inexact2 == 0);
+ inexact += inexact2;
+ MPFR_SET_EXP (y, MPFR_GET_EXP (y) + e);
if (negative)
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/check.c b/Build/source/libs/mpfr/mpfr-src/src/check.c
index d8e4541328b..dedecf52d09 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/check.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/check.c
@@ -1,6 +1,6 @@
/* mpfr_check -- Check if a floating-point number has not been corrupted.
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/clear.c b/Build/source/libs/mpfr/mpfr-src/src/clear.c
index 8e48f5e3a65..05d2c00154c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/clear.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/clear.c
@@ -1,6 +1,6 @@
/* mpfr_clear -- free the memory space allocated for a floating-point number
-Copyright 1999-2001, 2004-2019 Free Software Foundation, Inc.
+Copyright 1999-2001, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/clears.c b/Build/source/libs/mpfr/mpfr-src/src/clears.c
index 38c70605010..c229ddf9de7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/clears.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/clears.c
@@ -1,7 +1,7 @@
/* mpfr_clears -- free the memory space allocated for several
floating-point numbers
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,7 +22,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-# undef HAVE_STDARG
# include "config.h"
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp.c b/Build/source/libs/mpfr/mpfr-src/src/cmp.c
index e584925df59..ecc35057834 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp.c
@@ -1,6 +1,6 @@
/* mpfr_cmp -- compare two floating-point numbers
-Copyright 1999, 2001, 2003-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001, 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp2.c b/Build/source/libs/mpfr/mpfr-src/src/cmp2.c
index 2526d43e66d..6519a5254cc 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp2.c
@@ -1,6 +1,6 @@
/* mpfr_cmp2 -- exponent shift when subtracting two numbers.
-Copyright 1999-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -29,18 +29,24 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
Assumes neither of b or c is NaN, +/- infinity, or +/- 0.
- In other terms, if |b| != |c|, mpfr_cmp2 (b, c) returns
- EXP(max(|b|,|c|)) - EXP(|b| - |c|).
+ In other terms, if |b| != |c|, mpfr_cmp2 (b, c) stores
+ EXP(max(|b|,|c|)) - EXP(|b| - |c|) in *cancel.
+
+ One necessarily has 0 <= cancel <= max(PREC(b),PREC(c)), so that this
+ value is representable in a mpfr_prec_t. Note that in the code, the
+ maximum intermediate value is cancel + 1, but since MPFR_PREC_MAX is
+ not the maximum value of mpfr_prec_t, there is no integer overflow.
*/
int
mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
{
- mp_limb_t *bp, *cp, bb, cc = 0, lastc = 0, dif, high_dif = 0;
+ mp_limb_t *bp, *cp, bb, cc, lastc, dif;
+ int high_dif; /* manipulated like a boolean */
mp_size_t bn, cn;
mpfr_exp_t sdiff_exp;
mpfr_uexp_t diff_exp;
- mpfr_prec_t res = 0;
+ mpfr_prec_t res = 0; /* will be the number of canceled bits (*cancel) */
int sign;
/* b=c should not happen, since cmp2 is called only from agm (with
@@ -55,24 +61,32 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
sdiff_exp = MPFR_UNLIKELY (MPFR_IS_UBF (b) || MPFR_IS_UBF (c)) ?
mpfr_ubf_diff_exp (b, c) : MPFR_GET_EXP (b) - MPFR_GET_EXP (c);
- /* The returned result is restricted to [MPFR_EXP_MIN,MPFR_EXP_MAX],
+ /* The returned result is saturated to [MPFR_EXP_MIN,MPFR_EXP_MAX],
which is the range of the mpfr_exp_t type. But under the condition
- below, the value of cancel will not be affected. */
+ below, since |MPFR_EXP_MIN| >= MPFR_EXP_MAX, the value of cancel
+ will not be affected: by symmetry (as done in the code), assume
+ |b| >= |c|; if EXP(b) - EXP(c) >= MPFR_EXP_MAX, then |c| < ulp(b),
+ so that the value of cancel is 0, or 1 if |b| is a power of 2,
+ whatever the exact value of EXP(b) - EXP(c). */
MPFR_STAT_STATIC_ASSERT (MPFR_EXP_MAX > MPFR_PREC_MAX);
if (sdiff_exp >= 0)
{
- sign = 1;
+ sign = 1; /* assumes |b| > |c|; will be changed if not. */
diff_exp = sdiff_exp;
bp = MPFR_MANT(b);
cp = MPFR_MANT(c);
+ /* index of the most significant limb of b and c */
bn = (MPFR_PREC(b) - 1) / GMP_NUMB_BITS;
- cn = (MPFR_PREC(c) - 1) / GMP_NUMB_BITS; /* # of limbs of c minus 1 */
+ cn = (MPFR_PREC(c) - 1) / GMP_NUMB_BITS;
+ /* If diff_exp != 0, i.e. diff_exp > 0, then |b| > |c|. Otherwise... */
if (diff_exp == 0)
{
+ /* Skip the identical most significant limbs, adding GMP_NUMB_BITS
+ to the number of canceled bits at each iteration. */
while (bn >= 0 && cn >= 0 && bp[bn] == cp[cn])
{
bn--;
@@ -85,11 +99,15 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
if (MPFR_LIKELY (cn < 0)) /* |b| = |c| */
return 0;
- /* b has been read entirely, but not c. Replace b by c for the
- symmetric case below (only the sign differs if not 0). */
+ /* b has been read entirely, but not c. Thus |b| <= |c|.
+ Swap (bp,bn) and (cp,cn), and take the opposite sign
+ for the symmetric case below (simulating a swap).
+ Note: cp will not be used, thus is not assigned; and
+ "cn = -1;" is necessary to enter the following "if"
+ (probably less confusing than a "goto"). */
bp = cp;
bn = cn;
- cn = -1; /* to enter the following "if" */
+ cn = -1;
sign = -1;
}
@@ -100,6 +118,9 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
MPFR_ASSERTD (bn >= 0);
+ /* Skip null limbs of b (= non-represented null limbs of c),
+ adding GMP_NUMB_BITS to the number of canceled bits at
+ each iteration. */
while (bp[bn] == 0)
{
if (--bn < 0) /* |b| = |c| */
@@ -107,7 +128,7 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
res += GMP_NUMB_BITS;
}
- count_leading_zeros (z, bp[bn]); /* bp[bn] <> 0 */
+ count_leading_zeros (z, bp[bn]); /* bp[bn] != 0 */
*cancel = res + z;
return sign;
}
@@ -115,6 +136,9 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
MPFR_ASSERTD (bn >= 0);
MPFR_ASSERTD (cn >= 0);
MPFR_ASSERTD (bp[bn] != cp[cn]);
+
+ /* |b| != |c|. If |b| < |c|: swap (bp,bn) and (cp,cn),
+ and take the opposite sign. */
if (bp[bn] < cp[cn])
{
mp_limb_t *tp;
@@ -128,6 +152,9 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
} /* MPFR_EXP(b) >= MPFR_EXP(c) */
else /* MPFR_EXP(b) < MPFR_EXP(c) */
{
+ /* We necessarily have |b| < |c|. Simulate a swap by reading the
+ parameters so that |(bp,bn)| > |(cp,cn)|. */
+
sign = -1;
diff_exp = - (mpfr_uexp_t) sdiff_exp;
@@ -138,119 +165,178 @@ mpfr_cmp2 (mpfr_srcptr b, mpfr_srcptr c, mpfr_prec_t *cancel)
cn = (MPFR_PREC(b) - 1) / GMP_NUMB_BITS;
}
- /* now we have removed the identical upper limbs of b and c
- (can happen only when diff_exp = 0), and after the possible
- swap, we have |b| > |c|: bp[bn] > cc, bn >= 0, cn >= 0,
- diff_exp = EXP(b) - EXP(c).
- */
+ /* Now we have removed the identical upper limbs of b and c
+ (when diff_exp = 0), and after the possible swap, we have |b| > |c|,
+ where b is represented by (bp,bn) and c is represented by (cp,cn).
+ The value diff_exp = EXP(b) - EXP(c) can be regarded as the number
+ of leading zeros of c, when aligned with b. */
+
+ /* When a limb of c is read from memory, the part that is not taken
+ into account for the operation with a limb bp[bn] of b will be put
+ in lastc, shifted to the leftmost part (for alignment with b):
+ [-------- bp[bn] --------][------- bp[bn-1] -------]
+ [-- old_lastc --][-------- cp[cn] --------]
+ [-- new_lastc --]
+ Note: if diff_exp == 0, then lastc will always remain 0. */
+ lastc = 0;
+
+ /* Compute the next limb difference, which cannot be 0 (dif >= 1). */
if (MPFR_LIKELY (diff_exp < GMP_NUMB_BITS))
{
cc = cp[cn] >> diff_exp;
/* warning: a shift by GMP_NUMB_BITS is not allowed by ISO C */
- if (diff_exp)
+ if (diff_exp != 0)
lastc = cp[cn] << (GMP_NUMB_BITS - diff_exp);
cn--;
}
else
- diff_exp -= GMP_NUMB_BITS; /* cc = 0 */
-
- dif = bp[bn--] - cc; /* necessarily dif >= 1 */
- MPFR_ASSERTD(dif >= 1);
+ {
+ cc = 0;
+ diff_exp -= GMP_NUMB_BITS; /* remove GMP_NUMB_BITS leading zeros */
+ }
- /* now high_dif = 0, dif >= 1, lastc is the neglected part of cp[cn+1] */
+ MPFR_ASSERTD (bp[bn] >= cc); /* no borrow out in subtraction below */
+ dif = bp[bn--] - cc;
+ MPFR_ASSERTD (dif >= 1);
+ high_dif = 0;
+
+ /* The current difference, here and later, is expressed under the form
+ [high_dif][dif], where high_dif is 0 or 1, and dif is a limb.
+ Here, since we have computed a difference of limbs (with b >= c),
+ high_dif = 0. */
+
+ /* One needs to accumulate canceled bits for the remaining case where
+ b and c are close to each other due to a long borrow propagation:
+ b = [common part]1000...000[low(b)]
+ c = [common part]0111...111[low(c)]
+ After eliminating the common part above, we have computed a difference
+ of the most significant parts, which has been stored in [high_dif][dif]
+ with high_dif = 0. We will loop as long as the currently computed
+ difference [high_dif][dif] = 1 (it is >= 1 by construction). The
+ computation of the difference will be:
+ 1bbb...bbb
+ - ccc...ccc
+ where the leading 1 before bbb...bbb corresponds to [high_dif][dif]
+ at the beginning of the loop. We will exit the loop also when c has
+ entirely been taken into account as cancellation is no longer possible
+ in this case (it is no longer possible to cancel the leading 1).
+ Note: We can enter the loop only with diff_exp = 0 (with a non-empty
+ common part, partly or entirely removed) or with diff_exp = 1 (with
+ an empty common part). Indeed, if diff_exp > 1, then no limbs have
+ been skipped, so that bp[bn] had its MSB equal to 1 and the most two
+ significant bits of cc are 0, which implies that dif > 1. */
while (MPFR_UNLIKELY ((cn >= 0 || lastc != 0)
- && (high_dif == 0) && (dif == 1)))
- { /* dif=1 implies diff_exp = 0 or 1 */
- MPFR_ASSERTD (diff_exp <= 1);
- bb = (bn >= 0) ? bp[bn] : 0;
- cc = lastc;
- if (cn >= 0)
+ && high_dif == 0 && dif == 1))
+ {
+ /* Since we consider the next limb, we assume a cancellation of
+ GMP_NUMB_BITS (the new exponent of the difference now being the
+ one of the MSB of the next limb). But if the leading 1 remains
+ 1 in the difference (i.e. high_dif = 1 at the end of the loop),
+ then we will need to decrease res. */
+ res += GMP_NUMB_BITS;
+ MPFR_ASSERTD (diff_exp <= 1); /* see comment before the loop */
+ bb = bn >= 0 ? bp[bn--] : 0; /* next limb of b or non-represented 0 */
+ if (MPFR_UNLIKELY (cn < 0))
{
- if (diff_exp == 0)
- {
- cc += cp[cn];
- }
- else
- {
- MPFR_ASSERTD (diff_exp == 1);
- cc += cp[cn] >> 1;
- lastc = cp[cn] << (GMP_NUMB_BITS - 1);
- }
+ cc = lastc;
+ lastc = 0;
+ }
+ else if (diff_exp == 0)
+ {
+ cc = cp[cn--];
}
else
- lastc = 0;
- high_dif = 1 - mpn_sub_n (&dif, &bb, &cc, 1);
- bn--;
- cn--;
- res += GMP_NUMB_BITS;
+ {
+ MPFR_ASSERTD (diff_exp == 1);
+ MPFR_ASSERTD (lastc == 0 || lastc == MPFR_LIMB_HIGHBIT);
+ cc = lastc + (cp[cn] >> 1);
+ lastc = cp[cn--] << (GMP_NUMB_BITS - 1);
+ }
+ dif = bb - cc;
+ high_dif = bb >= cc;
}
- /* (cn<0 and lastc=0) or (high_dif,dif)<>(0,1) */
+ /* Now, c has entirely been taken into account or [high_dif][dif] > 1.
+ In any case, [high_dif][dif] >= 1 by construction.
+ First, we determine the currently number of canceled bits,
+ corresponding to the exponent of the current difference.
+ The trailing bits of c, if any, can still decrease the exponent of
+ the difference when [high_dif][dif] is a power of two, but since
+ [high_dif][dif] > 1 in this case, by not more than 1. */
- if (MPFR_UNLIKELY (high_dif != 0)) /* high_dif == 1 */
+ if (high_dif != 0) /* high_dif == 1 */
{
- res--;
+ res--; /* see comment at the beginning of the above loop */
MPFR_ASSERTD (res >= 0);
- if (dif != 0)
- {
- *cancel = res;
- return sign;
- }
+ /* Terminate if [high_dif][dif] is not a power of two. */
+ if (MPFR_LIKELY (dif != 0))
+ goto end;
}
else /* high_dif == 0 */
{
int z;
- count_leading_zeros (z, dif); /* dif > 1 here */
+ MPFR_ASSERTD (dif >= 1); /* [high_dif][dif] >= 1 */
+ count_leading_zeros (z, dif);
res += z;
- if (MPFR_LIKELY(dif != (MPFR_LIMB_ONE << (GMP_NUMB_BITS - z - 1))))
- { /* dif is not a power of two */
- *cancel = res;
- return sign;
- }
+ /* Terminate if [high_dif][dif] is not a power of two. */
+ if (MPFR_LIKELY (NOT_POW2 (dif)))
+ goto end;
}
- /* now result is res + (low(b) < low(c)) */
- while (bn >= 0 && (cn >= 0 || lastc != 0))
+ /* Now, the result will be res + (low(b) < low(c)). */
+
+ /* If c has entirely been taken into account, it can no longer modify
+ the current result. */
+ if (cn < 0 && lastc == 0)
+ goto end;
+
+ for (; bn >= 0 ; bn--)
{
if (diff_exp >= GMP_NUMB_BITS)
- diff_exp -= GMP_NUMB_BITS;
- else
+ {
+ diff_exp -= GMP_NUMB_BITS;
+ MPFR_ASSERTD (cc == 0);
+ }
+ else if (MPFR_UNLIKELY (cn < 0))
{
cc = lastc;
- if (cn >= 0)
- {
- cc += cp[cn] >> diff_exp;
- if (diff_exp != 0)
- lastc = cp[cn] << (GMP_NUMB_BITS - diff_exp);
- }
- else
- lastc = 0;
- cn--;
+ lastc = 0;
+ }
+ else if (diff_exp == 0)
+ {
+ cc = cp[cn--];
+ }
+ else
+ {
+ MPFR_ASSERTD (diff_exp >= 1 && diff_exp < GMP_NUMB_BITS);
+ cc = lastc + (cp[cn] >> diff_exp);
+ lastc = cp[cn--] << (GMP_NUMB_BITS - diff_exp);
}
+
if (bp[bn] != cc)
{
- *cancel = res + (bp[bn] < cc);
- return sign;
+ res += bp[bn] < cc;
+ goto end;
}
- bn--;
}
- if (bn < 0)
+ /* b has entirely been read. Determine whether the trailing part of c
+ is non-zero. */
+
+ if (lastc != 0)
+ res++;
+ else
{
- if (lastc != 0)
+ while (cn >= 0 && cp[cn] == 0)
+ cn--;
+ if (cn >= 0)
res++;
- else
- {
- while (cn >= 0 && cp[cn] == 0)
- cn--;
- if (cn >= 0)
- res++;
- }
}
+ end:
*cancel = res;
return sign;
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp_d.c b/Build/source/libs/mpfr/mpfr-src/src/cmp_d.c
index c8e9f56112f..1f72260dd9d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp_d.c
@@ -1,6 +1,6 @@
/* mpfr_cmp_d -- compare a floating-point number with a double
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c b/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
index fbfd3136126..b94979b0daa 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp_ld.c
@@ -1,6 +1,6 @@
/* mpfr_cmp_d -- compare a floating-point number with a long double
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -33,16 +33,14 @@ mpfr_cmp_ld (mpfr_srcptr b, long double d)
MPFR_SAVE_EXPO_MARK (expo);
+#if !HAVE_LDOUBLE_MAYBE_DOUBLE_DOUBLE
mpfr_init2 (tmp, MPFR_LDBL_MANT_DIG);
+#else
+ /* since the smallest value is 2^(-1074) and the largest is < 2^1024,
+ every double-double is exactly representable with 1024 + 1074 bits */
+ mpfr_init2 (tmp, 1024 + 1074);
+#endif
res = mpfr_set_ld (tmp, d, MPFR_RNDN);
- if (res != 0) /* can happen when "long double" is double-double */
- {
- /* since the smallest value is 2^(-1074) and the largest is
- < 2^1024, every double-double is exactly representable with
- 1024 + 1074 bits */
- mpfr_set_prec (tmp, 1024 + 1074);
- res = mpfr_set_ld (tmp, d, MPFR_RNDN);
- }
MPFR_ASSERTD (res == 0);
MPFR_CLEAR_FLAGS ();
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp_si.c b/Build/source/libs/mpfr/mpfr-src/src/cmp_si.c
index 7feb1aaa8f3..a87f261d220 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp_si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp_si.c
@@ -1,7 +1,7 @@
/* mpfr_cmp_si_2exp -- compare a floating-point number with a signed
machine integer multiplied by a power of 2
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -49,6 +49,7 @@ mpfr_cmp_si_2exp (mpfr_srcptr b, long int i, mpfr_exp_t f)
else if (MPFR_SIGN(b) != si || i == 0)
return MPFR_INT_SIGN (b);
else /* b and i are of same sign si */
+#ifdef MPFR_LONG_WITHIN_LIMB
{
mpfr_exp_t e;
unsigned long ai;
@@ -91,6 +92,22 @@ mpfr_cmp_si_2exp (mpfr_srcptr b, long int i, mpfr_exp_t f)
return si;
return 0;
}
+#else
+ {
+ mpfr_t uu;
+ int ret;
+ MPFR_SAVE_EXPO_DECL (expo);
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ /* Warning: i*2^f might be outside the current exponent range! */
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_set_si_2exp (uu, i, f, MPFR_RNDZ);
+ MPFR_SAVE_EXPO_FREE (expo);
+ ret = mpfr_cmp (b, uu);
+ mpfr_clear (uu);
+ return ret;
+ }
+#endif /* MPFR_LONG_WITHIN_LIMB */
}
#undef mpfr_cmp_si
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp_ui.c b/Build/source/libs/mpfr/mpfr-src/src/cmp_ui.c
index f6c9c279ac8..4249a9023a5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmp_ui.c
@@ -1,7 +1,7 @@
/* mpfr_cmp_ui_2exp -- compare a floating-point number with an unsigned
machine integer multiplied by a power of 2
-Copyright 1999, 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -52,6 +52,7 @@ mpfr_cmp_ui_2exp (mpfr_srcptr b, unsigned long int i, mpfr_exp_t f)
else if (MPFR_UNLIKELY(i == 0))
return 1;
else /* b > 0, i > 0 */
+#ifdef MPFR_LONG_WITHIN_LIMB
{
mpfr_exp_t e;
int k;
@@ -91,6 +92,22 @@ mpfr_cmp_ui_2exp (mpfr_srcptr b, unsigned long int i, mpfr_exp_t f)
return 1;
return 0;
}
+#else
+ {
+ mpfr_t uu;
+ int ret;
+ MPFR_SAVE_EXPO_DECL (expo);
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ /* Warning: i*2^f might be outside the current exponent range! */
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_set_ui_2exp (uu, i, f, MPFR_RNDZ);
+ MPFR_SAVE_EXPO_FREE (expo);
+ ret = mpfr_cmp (b, uu);
+ mpfr_clear (uu);
+ return ret;
+ }
+#endif /* MPFR_LONG_WITHIN_LIMB */
}
#undef mpfr_cmp_ui
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cmp_abs.c b/Build/source/libs/mpfr/mpfr-src/src/cmpabs.c
index d6d94c87d07..90642e78daf 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cmp_abs.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmpabs.c
@@ -1,6 +1,6 @@
/* mpfr_cmpabs -- compare the absolute values of two FP numbers
-Copyright 1999, 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -23,7 +23,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
/* Return a positive value if abs(b) > abs(c), 0 if abs(b) = abs(c), and
- a negative value if abs(b) < abs(c). Neither b nor c may be NaN. */
+ a negative value if abs(b) < abs(c). */
int
mpfr_cmpabs (mpfr_srcptr b, mpfr_srcptr c)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_patches.c b/Build/source/libs/mpfr/mpfr-src/src/cmpabs_ui.c
index 92413f7aceb..8ca8f3aace3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_patches.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cmpabs_ui.c
@@ -1,6 +1,6 @@
-/* mpfr_get_patches -- Patches that have been applied
+/* mpfr_cmpabs_ui -- compare the absolute value of FP to an unsigned long
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,8 +22,14 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
-const char *
-mpfr_get_patches (void)
+/* Return a positive value if abs(b) > c, 0 if abs(b) = c, and
+ a negative value if abs(b) < c. */
+
+int
+mpfr_cmpabs_ui (mpfr_srcptr b, unsigned long c)
{
- return "";
+ mpfr_t absb;
+
+ MPFR_TMP_INIT_ABS (absb, b);
+ return mpfr_cmp_ui (absb, c);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/comparisons.c b/Build/source/libs/mpfr/mpfr-src/src/comparisons.c
index 2604aeb593c..5bd7536ae0b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/comparisons.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/comparisons.c
@@ -1,6 +1,6 @@
/* comparison predicates
-Copyright 2002-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/const_catalan.c b/Build/source/libs/mpfr/mpfr-src/src/const_catalan.c
index 3ae040e0809..855e52b7718 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/const_catalan.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/const_catalan.c
@@ -1,6 +1,6 @@
/* mpfr_const_catalan -- compute Catalan's constant.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/const_euler.c b/Build/source/libs/mpfr/mpfr-src/src/const_euler.c
index 677c98584f8..9e3b88ac518 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/const_euler.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/const_euler.c
@@ -1,6 +1,6 @@
/* mpfr_const_euler -- Euler's constant
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by Fredrik Johansson.
This file is part of the GNU MPFR Library.
@@ -192,7 +192,7 @@ mpfr_const_euler_internal (mpfr_t x, mpfr_rnd_t rnd)
MPFR_ZIV_DECL (loop);
prec = mpfr_get_prec (x);
- wp = prec + 24;
+ wp = prec + MPFR_INT_CEIL_LOG2 (prec) + 5;
mpfr_init2 (y, wp);
mpfr_const_euler_bs_init (sum);
@@ -251,9 +251,9 @@ mpfr_const_euler_internal (mpfr_t x, mpfr_rnd_t rnd)
mpfr_set_ui (y, n, MPFR_RNDZ); /* exact */
mpfr_log (y, y, MPFR_RNDZ); /* error < 2^-wp */
- mpfr_mul_2exp (y, y, wp, MPFR_RNDZ);
+ mpfr_mul_2ui (y, y, wp, MPFR_RNDZ);
mpfr_z_sub (y, v, y, MPFR_RNDZ);
- mpfr_div_2exp (y, y, wp, MPFR_RNDZ);
+ mpfr_div_2ui (y, y, wp, MPFR_RNDZ);
/* rounding error from the last subtraction < 2^-wp */
/* so y = gamma with error < 5*2^-wp */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/const_log2.c b/Build/source/libs/mpfr/mpfr-src/src/const_log2.c
index 4f01bfb85a8..1419a0c04e9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/const_log2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/const_log2.c
@@ -1,6 +1,6 @@
/* mpfr_const_log2 -- compute natural logarithm of 2
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -57,21 +57,18 @@ S (mpz_t *T, mpz_t *P, mpz_t *Q, unsigned long n1, unsigned long n2, int need_P)
mpz_set_ui (P[0], n1);
mpz_neg (P[0], P[0]);
}
- if (n1 <= (ULONG_MAX / 4 - 1) / 2)
- mpz_set_ui (Q[0], 4 * (2 * n1 + 1));
- else /* to avoid overflow in 4 * (2 * n1 + 1) */
- {
- mpz_set_ui (Q[0], n1);
- mpz_mul_2exp (Q[0], Q[0], 1);
- mpz_add_ui (Q[0], Q[0], 1);
- mpz_mul_2exp (Q[0], Q[0], 2);
- }
+ /* since n1 <= N, where N is the value from mpfr_const_log2_internal(),
+ and N = w / 3 + 1, where w <= PREC_MAX <= ULONG_MAX, then
+ N <= floor(ULONG_MAX/3) + 1, thus 2*N+1 <= ULONG_MAX */
+ MPFR_STAT_STATIC_ASSERT (MPFR_PREC_MAX <= ULONG_MAX);
+ mpz_set_ui (Q[0], 2 * n1 + 1);
+ mpz_mul_2exp (Q[0], Q[0], 2);
mpz_set (T[0], P[0]);
}
else
{
unsigned long m = (n1 / 2) + (n2 / 2) + (n1 & 1UL & n2);
- unsigned long v, w;
+ mp_bitcnt_t v, w;
S (T, P, Q, n1, m, 1);
S (T + 1, P + 1, Q + 1, m, n2, need_P);
@@ -126,11 +123,7 @@ mpfr_const_log2_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode)
("rnd_mode=%d", rnd_mode),
("x[%Pu]=%.*Rg inex=%d", mpfr_get_prec(x), mpfr_log_prec, x, inexact));
- if (n < 1069)
- w = n + 9; /* ensures correct rounding for the four rounding modes,
- together with N = w / 3 + 1 (see below). */
- else
- w = n + 10; /* idem at least for prec < 300000 */
+ w = n + MPFR_INT_CEIL_LOG2 (n) + 3;
MPFR_TMP_MARK(marker);
MPFR_GROUP_INIT_2(group, w, t, q);
@@ -138,9 +131,7 @@ mpfr_const_log2_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode)
MPFR_ZIV_INIT (loop, w);
for (;;)
{
- N = w / 3 + 1; /* Warning: do not change that (even increasing N!)
- without checking correct rounding in the above
- ranges for n. */
+ N = w / 3 + 1;
/* the following are needed for error analysis (see algorithms.tex) */
MPFR_ASSERTD(w >= 3 && N >= 2);
@@ -169,9 +160,7 @@ mpfr_const_log2_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode)
mpz_clear (Q[i]);
}
- /* for prec < 300000 and all rounding modes we checked by exhaustive
- search that the rounding is correct */
- if (MPFR_LIKELY (n < 300000 || MPFR_CAN_ROUND (t, w - 2, n, rnd_mode)))
+ if (MPFR_CAN_ROUND (t, w - 2, n, rnd_mode))
break;
MPFR_ZIV_NEXT (loop, w);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/const_pi.c b/Build/source/libs/mpfr/mpfr-src/src/const_pi.c
index 71983ccca84..26c55030d28 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/const_pi.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/const_pi.c
@@ -1,6 +1,6 @@
/* mpfr_const_pi -- compute Pi
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -38,6 +38,11 @@ mpfr_const_pi (mpfr_ptr x, mpfr_rnd_t rnd_mode) {
return mpfr_cache (x, __gmpfr_cache_const_pi, rnd_mode);
}
+/* The algorithm used here is taken from Section 8.2.5 of the book
+ "Fast Algorithms: A Multitape Turing Machine Implementation"
+ by A. Schönhage, A. F. W. Grotefeld and E. Vetter, 1994.
+ It is a clever form of Brent-Salamin formula. */
+
/* Don't need to save/restore exponent range: the cache does it */
int
mpfr_const_pi_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode)
@@ -80,7 +85,7 @@ mpfr_const_pi_internal (mpfr_ptr x, mpfr_rnd_t rnd_mode)
mpfr_sqrt (b, B, MPFR_RNDN); /* 1/2 <= b <= 1 */
mpfr_add (ap, a, b, MPFR_RNDN); /* 1 <= ap <= 2 */
mpfr_div_2ui (ap, ap, 1, MPFR_RNDN); /* exact, 1/2 <= ap <= 1 */
- mpfr_mul (Ap, ap, ap, MPFR_RNDN); /* 1/4 <= Ap <= 1 */
+ mpfr_sqr (Ap, ap, MPFR_RNDN); /* 1/4 <= Ap <= 1 */
mpfr_sub (Bp, Ap, S, MPFR_RNDN); /* -1/4 <= Bp <= 3/4 */
mpfr_mul_2ui (Bp, Bp, 1, MPFR_RNDN); /* -1/2 <= Bp <= 3/2 */
mpfr_sub (S, Ap, Bp, MPFR_RNDN);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/constant.c b/Build/source/libs/mpfr/mpfr-src/src/constant.c
index cf1af74e630..34f12c4a123 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/constant.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/constant.c
@@ -1,6 +1,6 @@
/* MPFR internal constant FP numbers
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -29,6 +29,8 @@ const mpfr_t __gmpfr_four ={{2, MPFR_SIGN_POS, 3, (mp_limb_t*)__gmpfr_limb1}};
const mpfr_t __gmpfr_mone ={{2, MPFR_SIGN_NEG, 1, (mp_limb_t*)__gmpfr_limb1}};
#if 0
+#elif GMP_NUMB_BITS == 8
+static const mp_limb_t mpfr_l2_dd__tab[] = { 0xab, 0x79, 0xcf, 0xd1, 0xf7, 0x17, 0x72 , 0xb1 };
#elif GMP_NUMB_BITS == 16
static const mp_limb_t mpfr_l2_dd__tab[] = { 0x79ab, 0xd1cf, 0x17f7, 0xb172 };
#elif GMP_NUMB_BITS == 32
@@ -47,6 +49,8 @@ const mpfr_t __gmpfr_const_log2_RNDD =
{{64, MPFR_SIGN_POS, 0, (mp_limb_t*)mpfr_l2_dd__tab}};
#if 0
+#elif GMP_NUMB_BITS == 8
+static const mp_limb_t mpfr_l2_du__tab[] = { 0xac, 0x79, 0xcf, 0xd1, 0xf7, 0x17, 0x72 , 0xb1 };
#elif GMP_NUMB_BITS == 16
static const mp_limb_t mpfr_l2_du__tab[] = { 0x79ac, 0xd1cf, 0x17f7, 0xb172 };
#elif GMP_NUMB_BITS == 32
diff --git a/Build/source/libs/mpfr/mpfr-src/src/copysign.c b/Build/source/libs/mpfr/mpfr-src/src/copysign.c
index 152a45d2f59..53e1ba6ee08 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/copysign.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/copysign.c
@@ -1,6 +1,6 @@
/* mpfr_copysign -- Produce a value with the magnitude of x and sign bit of y
-Copyright 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cos.c b/Build/source/libs/mpfr/mpfr-src/src/cos.c
index 49162e3fc24..61a9de20b08 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cos.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cos.c
@@ -1,6 +1,6 @@
/* mpfr_cos -- cosine of a floating-point number
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -64,7 +64,9 @@ mpfr_cos2_aux (mpfr_ptr f, mpfr_srcptr r)
mpz_init (t);
ex = mpfr_get_z_2exp (x, r); /* r = x*2^ex */
- /* remove trailing zeroes */
+ /* Remove trailing zeroes.
+ Since x comes from a regular MPFR number, due to the constraints on the
+ exponent and the precision, there can be no integer overflow below. */
l = mpz_scan1 (x, 0);
ex += l;
mpz_fdiv_q_2exp (x, x, l);
@@ -208,10 +210,10 @@ mpfr_cos (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
if (MPFR_IS_ZERO(xr))
goto ziv_next;
/* now |xr| <= 4, thus r <= 16 below */
- mpfr_mul (r, xr, xr, MPFR_RNDU); /* err <= 1 ulp */
+ mpfr_sqr (r, xr, MPFR_RNDU); /* err <= 1 ulp */
}
else
- mpfr_mul (r, x, x, MPFR_RNDU); /* err <= 1 ulp */
+ mpfr_sqr (r, x, MPFR_RNDU); /* err <= 1 ulp */
/* now |x| < 4 (or xr if reduce = 1), thus |r| <= 16 */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cosh.c b/Build/source/libs/mpfr/mpfr-src/src/cosh.c
index c08ca573c7c..4e878331590 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cosh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cosh.c
@@ -1,6 +1,6 @@
/* mpfr_cosh -- hyperbolic cosine
-Copyright 2001-2002, 2004-2019 Free Software Foundation, Inc.
+Copyright 2001-2002, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/cot.c b/Build/source/libs/mpfr/mpfr-src/src/cot.c
index ef4f1e30f67..4adb6396c75 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/cot.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/cot.c
@@ -1,6 +1,6 @@
/* mpfr_cot - cotangent function.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/coth.c b/Build/source/libs/mpfr/mpfr-src/src/coth.c
index 4d68d4fe37e..217904aaaa2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/coth.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/coth.c
@@ -1,6 +1,6 @@
/* mpfr_coth - Hyperbolic cotangent function.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/csc.c b/Build/source/libs/mpfr/mpfr-src/src/csc.c
index 74170155135..6675d8bcd19 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/csc.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/csc.c
@@ -1,6 +1,6 @@
/* mpfr_csc - cosecant function.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/csch.c b/Build/source/libs/mpfr/mpfr-src/src/csch.c
index 04a7576a745..a0c71ef82db 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/csch.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/csch.c
@@ -1,6 +1,6 @@
/* mpfr_csch - Hyperbolic cosecant function.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/d_div.c b/Build/source/libs/mpfr/mpfr-src/src/d_div.c
index c036e782156..99aa3da4f30 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/d_div.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/d_div.c
@@ -1,7 +1,7 @@
/* mpfr_d_div -- divide a machine double precision float
by a multiple precision floating-point number
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/d_sub.c b/Build/source/libs/mpfr/mpfr-src/src/d_sub.c
index 89d58ad2c5f..cead4eb81c4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/d_sub.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/d_sub.c
@@ -1,7 +1,7 @@
/* mpfr_d_sub -- subtract a multiple precision floating-point number
from a machine double precision float
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/digamma.c b/Build/source/libs/mpfr/mpfr-src/src/digamma.c
index 2cae66b4cd7..e9e8389b115 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/digamma.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/digamma.c
@@ -1,6 +1,6 @@
/* mpfr_digamma -- digamma function of a floating-point number
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,6 +22,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
+/* FIXME: Check that MPFR_GET_EXP can only be called on regular values
+ (in r14025, this is not the case) and that there cannot be integer
+ overflows. */
+
/* Put in s an approximation of digamma(x).
Assumes x >= 2.
Assumes s does not overlap with x.
@@ -36,7 +40,7 @@ mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x)
mpfr_exp_t e, exps, f, expu;
unsigned long n;
- MPFR_ASSERTN(MPFR_IS_POS(x) && (MPFR_EXP(x) >= 2));
+ MPFR_ASSERTN (MPFR_IS_POS (x) && MPFR_GET_EXP (x) >= 2);
mpfr_init2 (t, p);
mpfr_init2 (u, p);
@@ -44,15 +48,15 @@ mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x)
mpfr_log (s, x, MPFR_RNDN); /* error <= 1/2 ulp */
mpfr_ui_div (t, 1, x, MPFR_RNDN); /* error <= 1/2 ulp */
- mpfr_div_2exp (t, t, 1, MPFR_RNDN); /* exact */
+ mpfr_div_2ui (t, t, 1, MPFR_RNDN); /* exact */
mpfr_sub (s, s, t, MPFR_RNDN);
/* error <= 1/2 + 1/2*2^(EXP(olds)-EXP(s)) + 1/2*2^(EXP(t)-EXP(s)).
For x >= 2, log(x) >= 2*(1/(2x)), thus olds >= 2t, and olds - t >= olds/2,
thus 0 <= EXP(olds)-EXP(s) <= 1, and EXP(t)-EXP(s) <= 0, thus
error <= 1/2 + 1/2*2 + 1/2 <= 2 ulps. */
e = 2; /* initial error */
- mpfr_mul (invxx, x, x, MPFR_RNDZ); /* invxx = x^2 * (1 + theta)
- for |theta| <= 2^(-p) */
+ mpfr_sqr (invxx, x, MPFR_RNDZ); /* invxx = x^2 * (1 + theta)
+ for |theta| <= 2^(-p) */
mpfr_ui_div (invxx, 1, invxx, MPFR_RNDU); /* invxx = 1/x^2 * (1 + theta)^2 */
/* in the following we note err=xxx when the ratio between the approximation
@@ -74,13 +78,13 @@ mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x)
/* if the terms 'u' are decreasing by a factor two at least,
then the error coming from those is bounded by
sum((10n+4)/2^n, n=1..infinity) = 24 */
- exps = mpfr_get_exp (s);
- expu = mpfr_get_exp (u);
+ exps = MPFR_GET_EXP (s);
+ expu = MPFR_GET_EXP (u);
if (expu < exps - (mpfr_exp_t) p)
break;
mpfr_sub (s, s, u, MPFR_RNDN); /* error <= 24 + n/2 */
- if (mpfr_get_exp (s) < exps)
- e <<= exps - mpfr_get_exp (s);
+ if (MPFR_GET_EXP (s) < exps)
+ e <<= exps - MPFR_GET_EXP (s);
e ++; /* error in mpfr_sub */
f = 10 * n + 4;
while (expu < exps)
@@ -111,9 +115,9 @@ mpfr_digamma_approx (mpfr_ptr s, mpfr_srcptr x)
static int
mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
- mpfr_prec_t p = MPFR_PREC(y) + 10, q;
+ mpfr_prec_t p = MPFR_PREC(y) + 10;
mpfr_t t, u, v;
- mpfr_exp_t e1, expv;
+ mpfr_exp_t e1, expv, expx, q;
int inex;
MPFR_ZIV_DECL (loop);
@@ -125,20 +129,22 @@ mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
q = PREC(x)-EXP(x) is ok, otherwise if -1 <= x < 0, q = PREC(x)-EXP(x)
is ok, otherwise for x < -1, PREC(x) is ok if EXP(x) <= PREC(x),
otherwise we need EXP(x) */
- if (MPFR_EXP(x) < 0)
- q = MPFR_PREC(x) + 1 - MPFR_EXP(x);
- else if (MPFR_EXP(x) <= MPFR_PREC(x))
+ expx = MPFR_GET_EXP (x);
+ if (expx < 0)
+ q = MPFR_PREC(x) + 1 - expx;
+ else if (expx <= MPFR_PREC(x))
q = MPFR_PREC(x) + 1;
else
- q = MPFR_EXP(x);
+ q = expx;
+ MPFR_ASSERTN (q <= MPFR_PREC_MAX);
mpfr_init2 (u, q);
MPFR_DBGRES(inex = mpfr_ui_sub (u, 1, x, MPFR_RNDN));
MPFR_ASSERTN(inex == 0);
/* if x is half an integer, cot(Pi*x) = 0, thus Digamma(x) = Digamma(1-x) */
- mpfr_mul_2exp (u, u, 1, MPFR_RNDN);
+ mpfr_mul_2ui (u, u, 1, MPFR_RNDN);
inex = mpfr_integer_p (u);
- mpfr_div_2exp (u, u, 1, MPFR_RNDN);
+ mpfr_div_2ui (u, u, 1, MPFR_RNDN);
if (inex)
{
inex = mpfr_digamma (y, u, rnd_mode);
@@ -153,10 +159,10 @@ mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
mpfr_const_pi (v, MPFR_RNDN); /* v = Pi*(1+theta) for |theta|<=2^(-p) */
mpfr_mul (t, v, x, MPFR_RNDN); /* (1+theta)^2 */
- e1 = MPFR_EXP(t) - (mpfr_exp_t) p + 1; /* bound for t: err(t) <= 2^e1 */
+ e1 = MPFR_GET_EXP(t) - (mpfr_exp_t) p + 1; /* bound for t: err(t) <= 2^e1 */
mpfr_cot (t, t, MPFR_RNDN);
/* cot(t * (1+h)) = cot(t) - theta * (1 + cot(t)^2) with |theta|<=t*h */
- if (MPFR_EXP(t) > 0)
+ if (MPFR_GET_EXP(t) > 0)
e1 = e1 + 2 * MPFR_EXP(t) + 1;
else
e1 = e1 + 1;
@@ -165,9 +171,9 @@ mpfr_digamma_reflection (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
mpfr_mul (t, t, v, MPFR_RNDN);
e1 ++;
mpfr_digamma (v, u, MPFR_RNDN); /* error <= 1/2 ulp */
- expv = MPFR_EXP(v);
+ expv = MPFR_GET_EXP (v);
mpfr_sub (v, v, t, MPFR_RNDN);
- if (MPFR_EXP(v) < MPFR_EXP(t))
+ if (MPFR_GET_EXP (v) < MPFR_GET_EXP (t))
e1 += MPFR_EXP(t) - MPFR_EXP(v); /* scale error for t wrt new v */
/* now take into account the 1/2 ulp error for v */
if (expv - MPFR_EXP(v) - 1 > e1)
@@ -209,7 +215,7 @@ mpfr_digamma_positive (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
("y[%Pu]=%.*Rg inexact=%d", mpfr_get_prec(y), mpfr_log_prec, y, inex));
/* compute a precision q such that x+1 is exact */
- if (MPFR_PREC(x) < MPFR_EXP(x))
+ if (MPFR_PREC(x) < MPFR_GET_EXP(x))
q = MPFR_EXP(x);
else
q = MPFR_PREC(x) + 1;
@@ -265,11 +271,14 @@ mpfr_digamma_positive (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
}
for (erru = 0; j > 1; erru++, j = (j + 1) / 2);
errt = mpfr_digamma_approx (t, x_plus_j);
- expt = MPFR_EXP(t);
+ expt = MPFR_GET_EXP (t);
mpfr_sub (t, t, u, MPFR_RNDN);
- if (MPFR_EXP(t) < expt)
+ if (MPFR_GET_EXP (t) < expt)
errt += expt - MPFR_EXP(t);
- if (MPFR_EXP(t) < MPFR_EXP(u))
+ /* Warning: if u is zero (which happens when x_plus_j >= min at the
+ beginning of the while loop above), EXP(u) is not defined.
+ In this case we have no error from u. */
+ if (MPFR_NOTZERO(u) && MPFR_GET_EXP (t) < MPFR_GET_EXP (u))
erru += MPFR_EXP(u) - MPFR_EXP(t);
if (errt > erru)
errt = errt + 1;
@@ -352,7 +361,7 @@ mpfr_digamma (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
|y - Digamma(x)| >= 2^(-2n-1)ufp(y), and rounding -1/x gives the correct result.
If x < 2^E, then y > 2^(-E), thus ufp(y) > 2^(-E-1).
A sufficient condition is thus EXP(x) <= -2 MAX(PREC(x),PREC(Y)). */
- if (MPFR_EXP(x) < -2)
+ if (MPFR_GET_EXP (x) < -2)
{
if (MPFR_EXP(x) <= -2 * (mpfr_exp_t) MAX(MPFR_PREC(x), MPFR_PREC(y)))
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/dim.c b/Build/source/libs/mpfr/mpfr-src/src/dim.c
index 1ee9e41885e..29c09b38ced 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/dim.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/dim.c
@@ -1,6 +1,6 @@
/* mpfr_dim -- positive difference
-Copyright 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div.c b/Build/source/libs/mpfr/mpfr-src/src/div.c
index 012a5d7ef28..a04f2539d91 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/div.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/div.c
@@ -1,6 +1,6 @@
/* mpfr_div -- divide two floating-point numbers
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -233,15 +233,20 @@ mpfr_div_1 (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
{
add_one_ulp:
qp[0] += MPFR_LIMB_ONE << sh;
- if (qp[0] == 0)
- {
- qp[0] = MPFR_LIMB_HIGHBIT;
- if (MPFR_UNLIKELY(qx + 1 > __gmpfr_emax))
- return mpfr_overflow (q, rnd_mode, MPFR_SIGN(q));
- MPFR_ASSERTD(qx + 1 <= __gmpfr_emax);
- MPFR_ASSERTD(qx + 1 >= __gmpfr_emin);
- MPFR_SET_EXP (q, qx + 1);
- }
+ MPFR_ASSERTD(qp[0] != 0);
+ /* It is not possible to have an overflow in the addition above.
+ Proof: if p is the precision of the inputs, it would mean we have two
+ integers n and d with 2^(p-1) <= n, d < 2^p, such that the binary
+ expansion of n/d starts with p '1', and has at least one '1' later.
+ We distinguish two cases:
+ (1) if n/d < 1, it would mean 1-2^(-p) < n/d < 1
+ (2) if n/d >= 1, it would mean 2-2^(1-p) < n/d < 1
+ In case (1), multiplying by d we get 1-d/2^p < n < d,
+ which has no integer solution since d/2^p < 1.
+ In case (2), multiplying by d we get 2d-2d/2^p < n < 2d:
+ (2a) if d=2^(p-1), we get 2^p-1 < n < 2^p which has no solution;
+ if d>=2^(p-1)+1, then 2d-2d/2^p >= 2^p+2-2 = 2^p, thus there is
+ solution n < 2^p either. */
MPFR_RET(MPFR_SIGN(q));
}
}
@@ -376,15 +381,9 @@ mpfr_div_1n (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
{
add_one_ulp:
qp[0] += MPFR_LIMB_ONE;
- if (qp[0] == 0)
- {
- qp[0] = MPFR_LIMB_HIGHBIT;
- if (MPFR_UNLIKELY(qx + 1 > __gmpfr_emax))
- return mpfr_overflow (q, rnd_mode, MPFR_SIGN(q));
- MPFR_ASSERTD(qx + 1 <= __gmpfr_emax);
- MPFR_ASSERTD(qx + 1 >= __gmpfr_emin);
- MPFR_SET_EXP (q, qx + 1);
- }
+ /* there can be no overflow in the addition above,
+ see the analysis of mpfr_div_1 */
+ MPFR_ASSERTD(qp[0] != 0);
MPFR_RET(MPFR_SIGN(q));
}
}
@@ -636,16 +635,10 @@ mpfr_div_2 (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
{
add_one_ulp:
qp[0] += MPFR_LIMB_ONE << sh;
- qp[1] += (qp[0] == 0);
- if (qp[1] == 0)
- {
- qp[1] = MPFR_LIMB_HIGHBIT;
- if (MPFR_UNLIKELY(qx + 1 > __gmpfr_emax))
- return mpfr_overflow (q, rnd_mode, MPFR_SIGN(q));
- MPFR_ASSERTD(qx + 1 <= __gmpfr_emax);
- MPFR_ASSERTD(qx + 1 >= __gmpfr_emin);
- MPFR_SET_EXP (q, qx + 1);
- }
+ qp[1] += qp[0] == 0;
+ /* there can be no overflow in the addition above,
+ see the analysis of mpfr_div_1 */
+ MPFR_ASSERTD(qp[1] != 0);
MPFR_RET(MPFR_SIGN(q));
}
}
@@ -739,9 +732,9 @@ mpfr_mpn_sub_aux (mpfr_limb_ptr ap, mpfr_limb_ptr bp, mp_size_t n,
while (n--)
{
- bb = (extra) ? ((bp[1] << (GMP_NUMB_BITS-1)) | (bp[0] >> 1)) : bp[0];
+ bb = (extra) ? (MPFR_LIMB_LSHIFT(bp[1],GMP_NUMB_BITS-1) | (bp[0] >> 1)) : bp[0];
rp = ap[0] - bb - cy;
- cy = (ap[0] < bb) || (cy && ~rp == MPFR_LIMB_ZERO) ?
+ cy = (ap[0] < bb) || (cy && rp == MPFR_LIMB_MAX) ?
MPFR_LIMB_ONE : MPFR_LIMB_ZERO;
ap[0] = rp;
ap ++;
@@ -751,113 +744,6 @@ mpfr_mpn_sub_aux (mpfr_limb_ptr ap, mpfr_limb_ptr bp, mp_size_t n,
return cy;
}
-/* For large precision, mpz_tdiv_q (which computes only quotient)
- is faster than mpn_divrem (which computes also the remainder).
- Unfortunately as of GMP 6.0.0 the corresponding mpn_div_q function
- is not in the public interface, thus we call mpz_tdiv_q.
-
- If this function succeeds in computing the correct rounding, return 1,
- and put the ternary value in inex.
-
- Otherwise return 0 (and inex is undefined).
-*/
-static int
-mpfr_div_with_mpz_tdiv_q (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v,
- mpfr_rnd_t rnd_mode, int *inex)
-{
- mpz_t qm, um, vm;
- mpfr_exp_t ue, ve;
- mpfr_prec_t qp = MPFR_PREC(q), wp = qp + GMP_NUMB_BITS;
- mp_size_t up, vp, k;
- int ok;
-
- mpz_init (qm);
- mpz_init (um);
- mpz_init (vm);
-
- ue = mpfr_get_z_2exp (um, u); /* u = um * 2^ue */
- ve = mpfr_get_z_2exp (vm, v); /* v = vm * 2^ve */
-
- vp = mpz_sizeinbase (vm, 2);
- if (vp > wp)
- {
- k = vp - wp; /* truncate k bits of vm */
- mpz_tdiv_q_2exp (vm, vm, k);
- ve += k;
- vp -= k;
- }
-
- /* we want about qp + GMP_NUMB_BITS bits of the quotient, thus um should
- have qp + GMP_NUMB_BITS more bits than vm */
-
- up = mpz_sizeinbase (um, 2);
- if (up > vp + wp)
- {
- k = up - (vp + wp); /* truncate k bits of um */
- mpz_tdiv_q_2exp (um, um, k);
- ue += k;
- up -= k;
- }
- else if (up < vp + wp) /* we need more bits */
- {
- k = (vp + wp) - up;
- mpz_mul_2exp (um, um, k);
- ue -= k;
- up += k;
- }
-
- /* now um has exactly wp more bits than vp */
- mpz_tdiv_q (qm, um, vm);
- /* qm has either wp or wp+1 bits, and we have:
- (a) um = u/2^ue*(1-tu) with tu=0 if no truncation of um,
- and 0 <= tu < 2^(1-wp) otherwise;
- (b) vm = v/2^ve*(1-tv) with tv=0 if no truncation of vm,
- and 0 <= tv < 2^(1-wp) otherwise;
- (c) um/vm - 1 < qm <= um/vm, thus qm = um/vm*(1-tq) with
- 0 <= tw < 2^(1-wp) since um/vm >= 2^(wp-1)
- Altogether we have:
- q = u/v*2^(ve-ue)*(1-tu)/(1-tv)*(1-tq)
- Thus:
- u/v*2^(ve-ue)*(1-2^(2-wp)) < q < u/v*2^(ve-ue)*(1+2^(2-wp)).
- If q has wp bits, the error is less than 2^(wp-1)*2^(2-wp) <= 2.
- If q has wp+1 bits, the error is less than 2^wp*2^(2-wp) <= 4.
- */
-
- k = mpz_sizeinbase (qm, 2) - wp; /* 0 or 1 */
- /* Assume qm has wp bits (i.e. k=0) and a directed rounding: if the first
- set bit after position 1 has position less than GMP_NUMB_BITS, then
- subtracting 2 to qm will not change the bits beyond the GMP_NUMB_BITS
- low ones, thus we get correct rounding.
- For k=1, we need to start at position 2, and the first set bit has to be
- in posiiton less than GMP_NUMB_BITS+1.
- For rounding to nearest, the first set bit has to be in position less
- than GMP_NUMB_BITS-1 for k=0 (or less than GMP_NUMB_BITS for k=1).
- */
- if (mpz_scan1 (qm, k + 1) < GMP_NUMB_BITS + k - (rnd_mode == MPFR_RNDN) &&
- mpz_scan0 (qm, k + 1) < GMP_NUMB_BITS + k - (rnd_mode == MPFR_RNDN))
- {
- MPFR_SAVE_EXPO_DECL (expo);
- ok = 1;
- MPFR_SAVE_EXPO_MARK (expo);
- *inex = mpfr_set_z (q, qm, rnd_mode);
- MPFR_SAVE_EXPO_FREE (expo);
- /* if we got an underflow or overflow, the result is not valid */
- if (MPFR_IS_SINGULAR(q) || MPFR_EXP(q) == MPFR_EXT_EMIN ||
- MPFR_EXP(q) == MPFR_EXT_EMAX)
- ok = 0;
- MPFR_EXP(q) += ue - ve;
- *inex = mpfr_check_range (q, *inex, rnd_mode);
- }
- else
- ok = 0;
-
- mpz_clear (qm);
- mpz_clear (um);
- mpz_clear (vm);
-
- return ok;
-}
-
MPFR_HOT_FUNCTION_ATTR int
mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
{
@@ -978,12 +864,14 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
* *
**************************************************************************/
- /* when the divisor has one limb, we can use mpfr_div_ui, which should be
- faster, assuming there is no intermediate overflow or underflow.
+ /* When the divisor has one limb and MPFR_LONG_WITHIN_LIMB is defined,
+ we can use mpfr_div_ui, which should be faster, assuming there is no
+ intermediate overflow or underflow.
The divisor interpreted as an integer satisfies
2^(GMP_NUMB_BITS-1) <= vm < 2^GMP_NUMB_BITS, thus the quotient
satisfies 2^(EXP(u)-1-GMP_NUMB_BITS) < u/vm < 2^(EXP(u)-GMP_NUMB_BITS+1)
and its exponent is either EXP(u)-GMP_NUMB_BITS or one more. */
+#ifdef MPFR_LONG_WITHIN_LIMB
if (vsize <= 1 && __gmpfr_emin <= MPFR_EXP(u) - GMP_NUMB_BITS
&& MPFR_EXP(u) - GMP_NUMB_BITS + 1 <= __gmpfr_emax
&& vp[0] <= ULONG_MAX)
@@ -1006,10 +894,7 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
MPFR_EXP(q) += GMP_NUMB_BITS;
return mpfr_check_range (q, inex, rnd_mode);
}
-
- /* for large precisions, try using truncated division first */
- if (q0size >= 32 && mpfr_div_with_mpz_tdiv_q (q, u, v, rnd_mode, &inex))
- return inex;
+#endif
MPFR_TMP_MARK(marker);
@@ -1082,6 +967,7 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
}
qp = MPFR_TMP_LIMBS_ALLOC (n);
+ /* since n = q0size + 1, we have n >= 2 here */
qh = mpfr_divhigh_n (qp, ap, bp, n);
MPFR_ASSERTD (qh == 0 || qh == 1);
/* in all cases, the error is at most (2n+2) ulps on qh*B^n+{qp,n},
@@ -1205,8 +1091,27 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
* *
**************************************************************************/
+ /* In the general case (usize > 2*qsize and vsize > qsize), we have:
+ ______________________________________
+ | | | u1 has 2*qsize limbs
+ | u1 | u0 | u0 has usize-2*qsize limbs
+ |__________________________|___________|
+
+ ____________________
+ | | | v1 has qsize limbs
+ | v1 | v0 | v0 has vsize-qsize limbs
+ |___________|________|
+
+ We divide u1 by v1, with quotient in qh + {qp, qsize} and
+ remainder (denoted r below) stored in place of the low qsize limbs of u1.
+ */
+
/* if Mulders' short division failed, we revert to division with remainder */
qh = mpn_divrem (qp, 0, ap + k, qqsize - k, bp, qsize - k);
+ /* let u1 be the upper part of u, and v1 the upper part of v (with sticky_u
+ and sticky_v representing the lower parts), then the quotient of u1 by v1
+ is now in {qp, qsize}, with possible carry in qh, and the remainder in
+ {ap + k, qsize - k} */
/* warning: qh may be 1 if u1 == v1, but u < v */
k = qsize;
@@ -1279,9 +1184,9 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
sticky = sticky3;
goto case_1;
}
- else /* hard case: we have to compare q1 * v0 and r + low(u),
+ else /* hard case: we have to compare q1 * v0 and r + u0,
where q1 * v0 has qsize + (vsize-qsize) = vsize limbs, and
- r + low(u) has qsize + (usize-2*qsize) = usize-qsize limbs */
+ r + u0 has qsize + (usize-2*qsize) = usize-qsize limbs */
{
mp_size_t l;
mpfr_limb_ptr sp;
@@ -1302,17 +1207,17 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
qh2 = MPFR_LIMB_ZERO;
qp[0] ^= sticky3orig; /* restore truncated quotient */
- /* compare qh2 + {sp, k + qsize} to {ap, qsize} + low(u) */
+ /* compare qh2 + {sp, k + qsize} to {ap, qsize} + u0 */
cmp_s_r = (qh2 != 0) ? 1 : mpn_cmp (sp + k, ap, qsize);
- if (cmp_s_r == 0) /* compare {sp, k} and low(u) */
+ if (cmp_s_r == 0) /* compare {sp, k} and u0 */
{
cmp_s_r = (usize >= qqsize) ?
mpfr_mpn_cmp_aux (sp, k, up, usize - qqsize, extra_bit) :
mpfr_mpn_cmpzero (sp, k);
}
- /* now cmp_s_r > 0 if {sp, vsize} > {ap, qsize} + low(u)
- cmp_s_r = 0 if {sp, vsize} = {ap, qsize} + low(u)
- cmp_s_r < 0 if {sp, vsize} < {ap, qsize} + low(u) */
+ /* now cmp_s_r > 0 if {sp, vsize} > {ap, qsize} + u0
+ cmp_s_r = 0 if {sp, vsize} = {ap, qsize} + u0
+ cmp_s_r < 0 if {sp, vsize} < {ap, qsize} + u0 */
if (cmp_s_r <= 0) /* quotient is in [q1, q1+1) */
{
sticky = (cmp_s_r == 0) ? sticky3 : MPFR_LIMB_ONE;
@@ -1320,11 +1225,11 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
}
else /* cmp_s_r > 0, quotient is < q1: to determine if it is
in [q1-2,q1-1] or in [q1-1,q1], we need to subtract
- the low part u0 of the dividend u0 from q*v0 */
+ the low part u0 of the dividend from q*v0 */
{
mp_limb_t cy = MPFR_LIMB_ZERO;
- /* subtract low(u)>>extra_bit if non-zero */
+ /* subtract u0 >> extra_bit if non-zero */
if (qh2 != 0) /* whatever the value of {up, m + k}, it
will be smaller than qh2 + {sp, k} */
cmp_s_r = 1;
@@ -1333,11 +1238,11 @@ mpfr_div (mpfr_ptr q, mpfr_srcptr u, mpfr_srcptr v, mpfr_rnd_t rnd_mode)
if (low_u != MPFR_LIMB_ZERO)
{
mp_size_t m;
- l = usize - qqsize; /* number of low limbs in u */
+ l = usize - qqsize; /* number of limbs in u0 */
m = (l > k) ? l - k : 0;
cy = (extra_bit) ?
(up[m] & MPFR_LIMB_ONE) : MPFR_LIMB_ZERO;
- if (l >= k) /* u0 has more limbs than s:
+ if (l >= k) /* u0 has at least as many limbs than s:
first look if {up, m} is not zero,
and compare {sp, k} and {up + m, k} */
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div_2exp.c b/Build/source/libs/mpfr/mpfr-src/src/div_2exp.c
index 330ad6d3cf5..eb13204158d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/div_2exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/div_2exp.c
@@ -1,6 +1,6 @@
/* mpfr_div_2exp -- divide a floating-point number by a power of two
-Copyright 1999, 2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div_2si.c b/Build/source/libs/mpfr/mpfr-src/src/div_2si.c
index a62296edfb8..779a2fa893b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/div_2si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/div_2si.c
@@ -1,6 +1,6 @@
/* mpfr_div_2si -- divide a floating-point number by a power of two
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div_2ui.c b/Build/source/libs/mpfr/mpfr-src/src/div_2ui.c
index 60fd9b4eb01..349d8367af3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/div_2ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/div_2ui.c
@@ -1,6 +1,6 @@
/* mpfr_div_2ui -- divide a floating-point number by a power of two
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -40,6 +40,10 @@ mpfr_div_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long n, mpfr_rnd_t rnd_mode)
mpfr_uexp_t diffexp;
MPFR_SETRAW (inexact, y, x, exp, rnd_mode);
+ /* Warning! exp may have increased by 1 due to rounding. Thus the
+ difference below may overflow in a mpfr_exp_t; but mpfr_uexp_t
+ is OK to hold the value, with the difference done in unsigned
+ integer arithmetic in this type. */
diffexp = (mpfr_uexp_t) exp - (mpfr_uexp_t) (__gmpfr_emin - 1);
if (MPFR_UNLIKELY (n >= diffexp)) /* exp - n <= emin - 1 */
{
@@ -50,13 +54,15 @@ mpfr_div_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long n, mpfr_rnd_t rnd_mode)
rnd_mode = MPFR_RNDZ;
return mpfr_underflow (y, rnd_mode, MPFR_SIGN (y));
}
- /* exp - n >= emin (no underflow, no integer overflow) */
- while (n > LONG_MAX)
- {
- n -= LONG_MAX;
- exp -= LONG_MAX; /* note: signed values */
- }
- MPFR_SET_EXP (y, exp - (long) n);
+ /* Now, n < diffexp, i.e. n <= exp - emin, which a difference of
+ * two valid exponents + 0 or 1, thus fits in a mpfr_exp_t (from
+ * the constraints on valid exponents). Moreover, there cannot be
+ * an overflow (if exp had been increased by 1 due to rounding)
+ * since the case n = 0 has been filtered out.
+ */
+ MPFR_ASSERTD (n <= MPFR_EXP_MAX);
+ MPFR_ASSERTD (n >= 1);
+ MPFR_SET_EXP (y, exp - (mpfr_exp_t) n);
}
MPFR_RET (inexact);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div_d.c b/Build/source/libs/mpfr/mpfr-src/src/div_d.c
index 92cb2153a1c..bcd537ac759 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/div_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/div_d.c
@@ -1,7 +1,7 @@
/* mpfr_div_d -- divide a multiple precision floating-point number
by a machine double precision float
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/div_ui.c b/Build/source/libs/mpfr/mpfr-src/src/div_ui.c
index 50a2d5e716d..67001eec4b2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/div_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/div_ui.c
@@ -1,6 +1,6 @@
/* mpfr_div_ui -- divide a floating-point number by a machine integer
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -33,11 +33,14 @@ MPFR_HOT_FUNCTION_ATTR int
mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u,
mpfr_rnd_t rnd_mode)
{
+ int inexact;
+
+#ifdef MPFR_LONG_WITHIN_LIMB
+
int sh;
mp_size_t i, xn, yn, dif;
mp_limb_t *xp, *yp, *tmp, c, d;
mpfr_exp_t exp;
- int inexact;
mp_limb_t rb; /* round bit */
mp_limb_t sb; /* sticky bit */
MPFR_TMP_DECL(marker);
@@ -113,7 +116,6 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u,
from p[0] to p[n-1]. Let B = 2^GMP_NUMB_BITS.
One has: 0 <= {p, n} < B^n. */
- MPFR_STAT_STATIC_ASSERT (MPFR_LIMB_MAX >= ULONG_MAX);
if (dif >= 0)
{
c = mpn_divrem_1 (tmp, dif, xp, xn, u); /* used all the dividend */
@@ -246,7 +248,7 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u,
{
int nexttoinf;
- MPFR_UPDATE2_RND_MODE(rnd_mode, MPFR_SIGN (y));
+ MPFR_UPDATE2_RND_MODE (rnd_mode, MPFR_SIGN (y));
switch (rnd_mode)
{
case MPFR_RNDZ:
@@ -297,6 +299,18 @@ mpfr_div_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u,
/* Set the exponent. Warning! One may still have an underflow. */
MPFR_EXP (y) = exp;
+#else /* MPFR_LONG_WITHIN_LIMB */
+ mpfr_t uu;
+ MPFR_SAVE_EXPO_DECL (expo);
+
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
+ inexact = mpfr_div (y, x, uu, rnd_mode);
+ mpfr_clear (uu);
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
+ MPFR_SAVE_EXPO_FREE (expo);
+#endif
return mpfr_check_range (y, inexact, rnd_mode);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/dot.c b/Build/source/libs/mpfr/mpfr-src/src/dot.c
new file mode 100644
index 00000000000..9b4006c09d1
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/dot.c
@@ -0,0 +1,59 @@
+/* mpfr_dot -- dot product of two array of numbers
+
+Copyright 2018-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "mpfr-impl.h"
+
+/* FIXME: handle intermediate overflows and underflows. */
+
+/* res <- a[0]*b[0] + ... + a[n-1]*b[n-1] */
+int
+mpfr_dot (mpfr_ptr res, const mpfr_ptr *a, const mpfr_ptr *b,
+ unsigned long n, mpfr_rnd_t rnd)
+{
+ mpfr_t *c;
+ size_t i;
+ int inex;
+ mpfr_ptr *tab;
+
+ if (MPFR_UNLIKELY (n == 0))
+ {
+ MPFR_SET_ZERO (res);
+ MPFR_SET_POS (res);
+ MPFR_RET (0);
+ }
+
+ c = (mpfr_t *) mpfr_allocate_func (n * sizeof (mpfr_t));
+ tab = (mpfr_ptr *) mpfr_allocate_func (n * sizeof (mpfr_ptr));
+ for (i = 0; i < n; i++)
+ {
+ mpfr_init2 (c[i], mpfr_get_prec (a[i]) + mpfr_get_prec (b[i]));
+ inex = mpfr_mul (c[i], a[i], b[i], MPFR_RNDZ); /* exact except... */
+ MPFR_ASSERTN (inex == 0); /* failure in case of overflow/underflow */
+ tab[i] = c[i];
+ }
+ inex = mpfr_sum (res, tab, n, rnd);
+ for (i = 0; i < n; i++)
+ mpfr_clear (c[i]);
+ mpfr_free_func (c, n * sizeof (mpfr_t));
+ mpfr_free_func (tab, n * sizeof (mpfr_ptr));
+ return inex;
+}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/dump.c b/Build/source/libs/mpfr/mpfr-src/src/dump.c
index 3d3148070c4..d1f7aacdbf3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/dump.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/dump.c
@@ -1,6 +1,6 @@
/* mpfr_dump, mpfr_fdump -- dump a float (for the tests and debugging purpose)
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -31,7 +31,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
* in such a case, it outputs information between exclamation marks:
* - 'N': the number is not normalized (MSB = 0);
* - 'T': there are non-zero trailing bits (output in square brackets);
- * - 'U': this is a UBF number (internal use only);
+ * - 'U': this is an UBF number (internal use only);
* - '<': the exponent is < the current emin;
* - '>': the exponent is > the current emax.
*
diff --git a/Build/source/libs/mpfr/mpfr-src/src/eint.c b/Build/source/libs/mpfr/mpfr-src/src/eint.c
index d14180e3344..4df65821d6f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/eint.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/eint.c
@@ -1,6 +1,6 @@
/* mpfr_eint, mpfr_eint1 -- the exponential integral
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -31,7 +31,8 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
*/
/* Compute in y an approximation of sum(x^k/k/k!, k=1..infinity),
- and return e such that the absolute error is bound by 2^e ulp(y).
+ assuming x != 0, and return e such that the absolute error is
+ bounded by 2^e ulp(y).
Return PREC(y) when the truncated series does not converge.
*/
static mpfr_exp_t
@@ -45,6 +46,10 @@ mpfr_eint_aux (mpfr_t y, mpfr_srcptr x)
unsigned long k;
MPFR_GROUP_DECL (group);
+ MPFR_LOG_FUNC (
+ ("x[%Pu]=%.*Rg", mpfr_get_prec (x), mpfr_log_prec, x),
+ ("y[%Pu]=%.*Rg", mpfr_get_prec (y), mpfr_log_prec, y));
+
/* for |x| <= 1, we have S := sum(x^k/k/k!, k=1..infinity) = x + R(x)
where |R(x)| <= (x/2)^2/(1-|x|/2) <= 2*(x/2)^2
thus |R(x)/x| <= |x|/2
@@ -61,18 +66,32 @@ mpfr_eint_aux (mpfr_t y, mpfr_srcptr x)
mpz_init (u);
mpz_init (m);
MPFR_GROUP_INIT_3 (group, 31, eps, erru, errs);
- e = mpfr_get_z_2exp (m, x); /* x = m * 2^e */
- MPFR_ASSERTD (mpz_sizeinbase (m, 2) == MPFR_PREC (x));
+ e = mpfr_get_z_2exp (m, x); /* x = m * 2^e with m != 0 */
+ MPFR_LOG_MSG (("e=%" MPFR_EXP_FSPEC "d\n", (mpfr_eexp_t) e));
+ MPFR_ASSERTD (mpz_sizeinbase (m, 2) == MPFR_PREC (x)); /* since m != 0 */
if (MPFR_PREC (x) > w)
{
e += MPFR_PREC (x) - w;
- mpz_tdiv_q_2exp (m, m, MPFR_PREC (x) - w);
+ mpz_tdiv_q_2exp (m, m, MPFR_PREC (x) - w); /* one still has m != 0 */
+ MPFR_LOG_MSG (("e=%" MPFR_EXP_FSPEC "d\n", (mpfr_eexp_t) e));
}
- /* remove trailing zeroes from m: this will speed up much cases where
- x is a small integer divided by a power of 2 */
- k = mpz_scan1 (m, 0);
- mpz_tdiv_q_2exp (m, m, k);
- e += k;
+ /* Remove trailing zeroes from m: this will speed up much cases where
+ x is a small integer divided by a power of 2.
+ Note: As shown above, m != 0. This is needed for the "e += ..." below,
+ otherwise n would take the largest value of mp_bitcnt_t and could be
+ too large. */
+ {
+ mp_bitcnt_t n = mpz_scan1 (m, 0);
+ mpz_tdiv_q_2exp (m, m, n);
+ /* Since one initially has mpz_sizeinbase (m, 2) == MPFR_PREC (x)
+ and m has not increased, one can deduce that n <= MPFR_PREC (x),
+ so that the cast to mpfr_prec_t is valid. This cast is needed to
+ ensure that the operand e of the addition below is not converted
+ to an unsigned integer type, which could yield incorrect results
+ with some C implementations. */
+ MPFR_ASSERTD (n <= MPFR_PREC (x));
+ e += (mpfr_prec_t) n;
+ }
/* initialize t to 2^w */
mpz_set_ui (t, 1);
mpz_mul_2exp (t, t, w);
@@ -145,6 +164,7 @@ mpfr_eint_aux (mpfr_t y, mpfr_srcptr x)
mpz_clear (t);
mpz_clear (u);
mpz_clear (m);
+ MPFR_LOG_MSG (("e=%" MPFR_EXP_FSPEC "d\n", (mpfr_eexp_t) e));
return e;
}
@@ -161,6 +181,10 @@ mpfr_eint_asympt (mpfr_ptr y, mpfr_srcptr x)
unsigned long k;
mpfr_exp_t err_exp;
+ MPFR_LOG_FUNC (
+ ("x[%Pu]=%.*Rg", mpfr_get_prec (x), mpfr_log_prec, x),
+ ("err_exp=%" MPFR_EXP_FSPEC "d", (mpfr_eexp_t) err_exp));
+
mpfr_init2 (t, p);
mpfr_init2 (invx, p);
mpfr_init2 (err, 31); /* error in ulps on y */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/eq.c b/Build/source/libs/mpfr/mpfr-src/src/eq.c
index b3d92afef89..68f69464bd9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/eq.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/eq.c
@@ -1,6 +1,6 @@
/* mpfr_eq -- Compare two floats up to a specified bit #.
-Copyright 1999, 2001, 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001, 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/erandom.c b/Build/source/libs/mpfr/mpfr-src/src/erandom.c
index 03257610594..86c9c4ddc42 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/erandom.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/erandom.c
@@ -2,7 +2,7 @@
mean 1 and round it to the precision of rop according to the given rounding
mode.
-Copyright 2013-2019 Free Software Foundation, Inc.
+Copyright 2013-2020 Free Software Foundation, Inc.
Contributed by Charles Karney <charles@karney.com>, SRI International.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/erf.c b/Build/source/libs/mpfr/mpfr-src/src/erf.c
index 1959d99074d..34884f4346d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/erf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/erf.c
@@ -1,6 +1,6 @@
/* mpfr_erf -- error function of a floating-point number
-Copyright 2001, 2003-2019 Free Software Foundation, Inc.
+Copyright 2001, 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -78,7 +78,7 @@ mpfr_erf (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
mpfr_init2 (l, MPFR_PREC(y) + 17);
mpfr_init2 (h, MPFR_PREC(y) + 17);
/* first compute l */
- mpfr_mul (l, x, x, MPFR_RNDU);
+ mpfr_sqr (l, x, MPFR_RNDU);
mpfr_div_ui (l, l, 3, MPFR_RNDU); /* upper bound on x^2/3 */
mpfr_ui_sub (l, 1, l, MPFR_RNDZ); /* lower bound on 1 - x^2/3 */
mpfr_const_pi (h, MPFR_RNDU); /* upper bound of Pi */
@@ -205,7 +205,7 @@ mpfr_erf_0 (mpfr_ptr res, mpfr_srcptr x, double xf2, mpfr_rnd_t rnd_mode)
mpfr_t tauk;
mpfr_exp_t log2tauk;
- mpfr_mul (y, x, x, MPFR_RNDU); /* err <= 1 ulp */
+ mpfr_sqr (y, x, MPFR_RNDU); /* err <= 1 ulp */
mpfr_set_ui (s, 1, MPFR_RNDN);
mpfr_set_ui (t, 1, MPFR_RNDN);
mpfr_init2 (tauk, 53);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/erfc.c b/Build/source/libs/mpfr/mpfr-src/src/erfc.c
index 2fe0564e5b3..09111039e41 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/erfc.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/erfc.c
@@ -1,6 +1,6 @@
/* mpfr_erfc -- The Complementary Error Function of a floating-point number
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -43,7 +43,7 @@ mpfr_erfc_asympt (mpfr_ptr y, mpfr_srcptr x)
mpfr_init2 (err, 31);
/* let u = 2^(1-p), and let us represent the error as (1+u)^err
with a bound for err */
- mpfr_mul (xx, x, x, MPFR_RNDD); /* err <= 1 */
+ mpfr_sqr (xx, x, MPFR_RNDD); /* err <= 1 */
mpfr_ui_div (xx, 1, xx, MPFR_RNDU); /* upper bound for 1/(2x^2), err <= 2 */
mpfr_div_2ui (xx, xx, 1, MPFR_RNDU); /* exact */
mpfr_set_ui (t, 1, MPFR_RNDN); /* current term, exact */
@@ -72,7 +72,7 @@ mpfr_erfc_asympt (mpfr_ptr y, mpfr_srcptr x)
mpfr_add (y, y, t, MPFR_RNDN);
}
/* the error on y is bounded by err*ulp(y) */
- mpfr_mul (t, x, x, MPFR_RNDU); /* rel. err <= 2^(1-p) */
+ mpfr_sqr (t, x, MPFR_RNDU); /* rel. err <= 2^(1-p) */
mpfr_div_2ui (err, err, 3, MPFR_RNDU); /* err/8 */
mpfr_add (err, err, t, MPFR_RNDU); /* err/8 + xx */
mpfr_mul_2ui (err, err, 3, MPFR_RNDU); /* err + 8*xx */
@@ -97,7 +97,7 @@ mpfr_erfc_asympt (mpfr_ptr y, mpfr_srcptr x)
using the fact that erfc(x) <= exp(-x^2)/sqrt(Pi)/x for x >= 0.
We compute an upper approximation of exp(-x^2)/sqrt(Pi)/x.
*/
- mpfr_mul (t, x, x, MPFR_RNDD); /* t <= x^2 */
+ mpfr_sqr (t, x, MPFR_RNDD); /* t <= x^2 */
mpfr_neg (t, t, MPFR_RNDU); /* -x^2 <= t */
mpfr_exp (t, t, MPFR_RNDU); /* exp(-x^2) <= t */
mpfr_const_pi (xx, MPFR_RNDD); /* xx <= sqrt(Pi), cached */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exceptions.c b/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
index 76ca08752cb..d197bd2c1f9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exceptions.c
@@ -1,6 +1,6 @@
/* Exception flags and utilities. Constructors and destructors (debug).
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -470,3 +470,29 @@ predprint (void)
}
#endif
+
+#if MPFR_WANT_ASSERT >= 2
+
+/* Similar to flags_out in tests/tests.c */
+
+void
+flags_fout (FILE *stream, mpfr_flags_t flags)
+{
+ int none = 1;
+
+ if (flags & MPFR_FLAGS_UNDERFLOW)
+ none = 0, fprintf (stream, " underflow");
+ if (flags & MPFR_FLAGS_OVERFLOW)
+ none = 0, fprintf (stream, " overflow");
+ if (flags & MPFR_FLAGS_NAN)
+ none = 0, fprintf (stream, " nan");
+ if (flags & MPFR_FLAGS_INEXACT)
+ none = 0, fprintf (stream, " inexact");
+ if (flags & MPFR_FLAGS_ERANGE)
+ none = 0, fprintf (stream, " erange");
+ if (none)
+ fprintf (stream, " none");
+ fprintf (stream, " (%u)\n", flags);
+}
+
+#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exp.c b/Build/source/libs/mpfr/mpfr-src/src/exp.c
index 79f27f717e3..c431adb0a8c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exp.c
@@ -1,6 +1,6 @@
/* mpfr_exp -- exponential of a floating-point number
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exp10.c b/Build/source/libs/mpfr/mpfr-src/src/exp10.c
index e7ecc07840a..5ecb29a9079 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exp10.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exp10.c
@@ -1,6 +1,6 @@
/* mpfr_exp10 -- power of 10 function 10^y
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exp2.c b/Build/source/libs/mpfr/mpfr-src/src/exp2.c
index b3c6032c164..087275839c9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exp2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exp2.c
@@ -1,6 +1,6 @@
/* mpfr_exp2 -- power of 2 function 2^y
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exp3.c b/Build/source/libs/mpfr/mpfr-src/src/exp3.c
index 57d33bdc358..679f10305a1 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exp3.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exp3.c
@@ -1,6 +1,6 @@
/* mpfr_exp -- exponential of a floating-point number
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/exp_2.c b/Build/source/libs/mpfr/mpfr-src/src/exp_2.c
index 92857ecd827..ebe721057e5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/exp_2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/exp_2.c
@@ -1,7 +1,7 @@
/* mpfr_exp_2 -- exponential of a floating-point number
using algorithms in O(n^(1/2)*M(n)) and O(n^(1/3)*M(n))
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -21,7 +21,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#define MPFR_NEED_LONGLONG_H /* for count_leading_zeros */
+#define MPFR_NEED_LONGLONG_H /* MPFR_INT_CEIL_LOG2 */
#include "mpfr-impl.h"
static unsigned long
@@ -108,7 +108,10 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
mp_limb_t r_limb[(sizeof (long) -1) / sizeof(mp_limb_t) + 1];
/* Note: we use precision sizeof (long) * CHAR_BIT - 1 here since it is
- more efficient that full limb precision. */
+ more efficient that full limb precision.
+ The value of n will depend on whether MPFR_LONG_WITHIN_LIMB is
+ defined or not. For instance, for r = 0.111E0, one gets n = 0
+ in the former case and n = 1 in the latter case. */
MPFR_TMP_INIT1(r_limb, r, sizeof (long) * CHAR_BIT - 1);
mpfr_div (r, x, __gmpfr_const_log2_RNDD, MPFR_RNDN);
#ifdef MPFR_LONG_WITHIN_LIMB
@@ -116,7 +119,6 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
mp_limb_t a;
mpfr_exp_t exp;
- MPFR_STAT_STATIC_ASSERT (MPFR_LIMB_MAX >= ULONG_MAX);
/* Read the long directly (faster than using mpfr_get_si
since it fits, it is not singular, it can't be zero
and there is no conversion to do) */
@@ -144,9 +146,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) + 1);
- error_r = GMP_NUMB_BITS - error_r;
+ error_r = mpfr_nbits_ulong (SAFE_ABS (unsigned long, n) + 1);
/* we have |x| <= 2^error_r * log(2) */
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/expm1.c b/Build/source/libs/mpfr/mpfr-src/src/expm1.c
index b43a7d75253..cf67f24ca55 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/expm1.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/expm1.c
@@ -1,6 +1,6 @@
/* mpfr_expm1 -- Compute exp(x)-1
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -84,19 +84,22 @@ mpfr_expm1 (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode)
{
mp_limb_t t_limb[(64 - 1) / GMP_NUMB_BITS + 1];
mpfr_t t;
- mpfr_exp_t err;
+ mpfr_eexp_t err;
MPFR_TMP_INIT1(t_limb, t, 64);
+ /* since x < 0, to get an upper bound on x/log(2), we need to divide
+ by an upper bound on log(2) */
mpfr_div (t, x, __gmpfr_const_log2_RNDU, MPFR_RNDU); /* > x / ln(2) */
- err = mpfr_cmp_si (t, MPFR_EMIN_MIN >= -LONG_MAX ?
- MPFR_EMIN_MIN : -LONG_MAX) <= 0 ?
- - (MPFR_EMIN_MIN >= -LONG_MAX ? MPFR_EMIN_MIN : -LONG_MAX) :
- - mpfr_get_si (t, MPFR_RNDU);
+ err = mpfr_get_exp_t (t, MPFR_RNDU);
+ MPFR_ASSERTD (err < 0);
+ err = err < - MPFR_EXP_MAX ? MPFR_EXP_MAX : - err;
+ /* err = -max(ceil(t),-MPFR_EXP_MAX). */
+ MPFR_LOG_MSG (("err=%" MPFR_EXP_FSPEC "d\n", err));
/* exp(x) = 2^(x/ln(2))
- <= 2^max(MPFR_EMIN_MIN,-LONG_MAX,ceil(x/ln(2)+epsilon))
+ <= 2^max(-MPFR_EXP_MAX,ceil(x/ln(2)+epsilon))
with epsilon > 0 */
- MPFR_SMALL_INPUT_AFTER_SAVE_EXPO (y, __gmpfr_mone, err, 0, 0,
- rnd_mode, expo, {});
+ MPFR_SMALL_INPUT_AFTER_SAVE_EXPO (y, __gmpfr_mone, (mpfr_exp_t) err,
+ 0, 0, rnd_mode, expo, {});
}
/* General case */
@@ -129,26 +132,20 @@ mpfr_expm1 (mpfr_ptr y, mpfr_srcptr x , mpfr_rnd_t rnd_mode)
/* exp(x) may overflow and underflow */
MPFR_BLOCK (flags, mpfr_exp (t, x, MPFR_RNDN));
- if (MPFR_OVERFLOW (flags))
+
+ if (MPFR_OVERFLOW (flags)) /* overflow case */
{
inexact = mpfr_overflow (y, rnd_mode, MPFR_SIGN_POS);
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, MPFR_FLAGS_OVERFLOW);
break;
}
- else if (MPFR_UNDERFLOW (flags))
- {
- inexact = mpfr_set_si (y, -1, rnd_mode);
- MPFR_ASSERTD (inexact == 0);
- inexact = -1;
- if (MPFR_IS_LIKE_RNDZ (rnd_mode, 1))
- {
- inexact = 1;
- mpfr_nexttozero (y);
- }
- break;
- }
- exp_te = MPFR_GET_EXP (t); /* FIXME: exp(x) may overflow! */
+ /* To get an underflow in exp(x), we need exp(x) < 0.5*2^MPFR_EMIN_MIN
+ thus x/log(2) < MPFR_EMIN_MIN-1. But in that case the above
+ MPFR_SMALL_INPUT_AFTER_SAVE_EXPO() will return the result. */
+ MPFR_ASSERTD(!MPFR_UNDERFLOW (flags));
+
+ exp_te = MPFR_GET_EXP (t);
mpfr_sub_ui (t, t, 1, MPFR_RNDN); /* exp(x)-1 */
/* error estimate */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/extract.c b/Build/source/libs/mpfr/mpfr-src/src/extract.c
index 841c30a1327..28b216e6f80 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/extract.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/extract.c
@@ -1,6 +1,6 @@
/* mpfr_extract -- bit-extraction function for the binary splitting algorithm
-Copyright 2000-2002, 2004-2019 Free Software Foundation, Inc.
+Copyright 2000-2002, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/factorial.c b/Build/source/libs/mpfr/mpfr-src/src/factorial.c
index fe190d52a6c..49b45f355a5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/factorial.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/factorial.c
@@ -1,6 +1,6 @@
/* mpfr_fac_ui -- factorial of a nonnegative integer
-Copyright 2001, 2004-2019 Free Software Foundation, Inc.
+Copyright 2001, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_intmax.c b/Build/source/libs/mpfr/mpfr-src/src/fits_intmax.c
index c5f7f6873c6..b00d2c37a2c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_intmax.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_intmax.c
@@ -1,6 +1,6 @@
/* mpfr_fits_intmax_p -- test whether an mpfr fits an intmax_t.
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,11 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
#ifdef _MPFR_H_HAVE_INTMAX_T
@@ -63,13 +59,13 @@ mpfr_fits_intmax_p (mpfr_srcptr f, mpfr_rnd_t rnd)
{
uintmax_t s;
/* In C89, the division on negative integers isn't well-defined. */
- s = SAFE_ABS (uintmax_t, MPFR_INTMAX_MIN);
+ s = SAFE_ABS (uintmax_t, INTMAX_MIN);
for (prec = 0; s != 0; s /= 2, prec ++);
}
else
{
intmax_t s;
- s = MPFR_INTMAX_MAX;
+ s = INTMAX_MAX;
for (prec = 0; s != 0; s /= 2, prec ++);
}
@@ -95,7 +91,7 @@ mpfr_fits_intmax_p (mpfr_srcptr f, mpfr_rnd_t rnd)
if (neg)
{
mpfr_init2 (y, prec);
- mpfr_set_sj (y, MPFR_INTMAX_MIN, MPFR_RNDN);
+ mpfr_set_sj (y, INTMAX_MIN, MPFR_RNDN);
res = mpfr_cmp (x, y) >= 0;
mpfr_clear (y);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_s.h b/Build/source/libs/mpfr/mpfr-src/src/fits_s.h
index 50eb5f2c61d..7d713651cac 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_s.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_s.h
@@ -1,6 +1,6 @@
/* mpfr_fits_*_p -- test whether an mpfr fits a C signed type.
-Copyright 2003-2019 Free Software Foundation, Inc.
+Copyright 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_sint.c b/Build/source/libs/mpfr/mpfr-src/src/fits_sint.c
index 72d889db9c9..4a091757633 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_sint.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_sint.c
@@ -1,6 +1,6 @@
/* mpfr_fits_sint_p -- test whether an mpfr fits an int.
-Copyright 2003, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_slong.c b/Build/source/libs/mpfr/mpfr-src/src/fits_slong.c
index 6fde368b69f..a2a54100c2e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_slong.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_slong.c
@@ -1,6 +1,6 @@
/* mpfr_fits_slong_p -- test whether an mpfr fits a long.
-Copyright 2003, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_sshort.c b/Build/source/libs/mpfr/mpfr-src/src/fits_sshort.c
index 39061ac919b..7c1c848d7d2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_sshort.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_sshort.c
@@ -1,6 +1,6 @@
/* mpfr_fits_sshort_p -- test whether an mpfr fits a short.
-Copyright 2003, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_u.h b/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
index 56006876f8b..7a24cac9887 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_u.h
@@ -1,6 +1,6 @@
/* mpfr_fits_*_p -- test whether an mpfr fits a C unsigned type.
-Copyright 2003-2019 Free Software Foundation, Inc.
+Copyright 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_uint.c b/Build/source/libs/mpfr/mpfr-src/src/fits_uint.c
index 501038f950c..f002e2e9c85 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_uint.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_uint.c
@@ -1,6 +1,6 @@
/* mpfr_fits_uint_p -- test whether an mpfr fits an unsigned int.
-Copyright 2003, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_uintmax.c b/Build/source/libs/mpfr/mpfr-src/src/fits_uintmax.c
index 56935e94364..e100be19052 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_uintmax.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_uintmax.c
@@ -1,6 +1,6 @@
/* mpfr_fits_uintmax_p -- test whether an mpfr fits an uintmax_t.
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,11 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
/* Note: though mpfr-impl.h is included in fits_u.h, we also include it
@@ -37,7 +33,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifdef _MPFR_H_HAVE_INTMAX_T
#define FUNCTION mpfr_fits_uintmax_p
-#define MAXIMUM MPFR_UINTMAX_MAX
+#define MAXIMUM UINTMAX_MAX
#define TYPE uintmax_t
#include "fits_u.h"
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_ulong.c b/Build/source/libs/mpfr/mpfr-src/src/fits_ulong.c
index e83d197fe88..c2afa3f27c0 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_ulong.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_ulong.c
@@ -1,6 +1,6 @@
/* mpfr_fits_ulong_p -- test whether an mpfr fits an unsigned long.
-Copyright 2003, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fits_ushort.c b/Build/source/libs/mpfr/mpfr-src/src/fits_ushort.c
index b574c682a5a..654a21105b7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fits_ushort.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fits_ushort.c
@@ -1,6 +1,6 @@
/* mpfr_fits_ushort_p -- test whether an mpfr fits an unsigned short.
-Copyright 2003, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fma.c b/Build/source/libs/mpfr/mpfr-src/src/fma.c
index e54c3f4a354..44a50553b2b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fma.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fma.c
@@ -1,6 +1,6 @@
/* mpfr_fma -- Floating multiply-add
-Copyright 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fmma.c b/Build/source/libs/mpfr/mpfr-src/src/fmma.c
index 27d31c1299b..492e545e58f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fmma.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fmma.c
@@ -1,6 +1,6 @@
/* mpfr_fmma, mpfr_fmms -- Compute a*b +/- c*d
-Copyright 2014-2019 Free Software Foundation, Inc.
+Copyright 2014-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,6 +22,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
+/* compute a*b+c*d if neg=0 (fmma), a*b-c*d otherwise (fmms) */
static int
mpfr_fmma_aux (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
mpfr_srcptr d, mpfr_rnd_t rnd, int neg)
@@ -52,19 +53,19 @@ mpfr_fmma_aux (mpfr_ptr z, mpfr_srcptr a, mpfr_srcptr b, mpfr_srcptr c,
mpfr_ubf_mul_exact (u, a, b);
mpfr_ubf_mul_exact (v, c, d);
- if (neg)
- MPFR_CHANGE_SIGN (v);
if (prec_z == MPFR_PREC(a) && prec_z == MPFR_PREC(b) &&
prec_z == MPFR_PREC(c) && prec_z == MPFR_PREC(d) &&
un == MPFR_PREC2LIMBS(2 * prec_z))
{
MPFR_TMP_INIT (zp, zz, 2 * prec_z, un);
MPFR_PREC(u) = MPFR_PREC(v) = 2 * prec_z;
- inex = mpfr_add (zz, (mpfr_srcptr) u, (mpfr_srcptr) v, rnd);
+ inex = (neg == 0) ? mpfr_add (zz, (mpfr_srcptr) u, (mpfr_srcptr) v, rnd)
+ : mpfr_sub (zz, (mpfr_srcptr) u, (mpfr_srcptr) v, rnd);
inex = mpfr_set_1_2 (z, zz, rnd, inex);
}
else
- inex = mpfr_add (z, (mpfr_srcptr) u, (mpfr_srcptr) v, rnd);
+ inex = (neg == 0) ? mpfr_add (z, (mpfr_srcptr) u, (mpfr_srcptr) v, rnd)
+ : mpfr_sub (z, (mpfr_srcptr) u, (mpfr_srcptr) v, rnd);
MPFR_UBF_CLEAR_EXP (u);
MPFR_UBF_CLEAR_EXP (v);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fms.c b/Build/source/libs/mpfr/mpfr-src/src/fms.c
index 9ee70d49baf..c3fc311c14c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fms.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fms.c
@@ -1,6 +1,6 @@
/* mpfr_fms -- Floating multiply-subtract
-Copyright 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/fpif.c b/Build/source/libs/mpfr/mpfr-src/src/fpif.c
index 16d58d5a28e..df775dbd7ae 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/fpif.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/fpif.c
@@ -1,7 +1,7 @@
/* mpfr_fpif -- Binary export & import of MPFR numbers
(floating-point interchange format)
-Copyright 2012-2019 Free Software Foundation, Inc.
+Copyright 2012-2020 Free Software Foundation, Inc.
Contributed by Olivier Demengeon.
This file is part of the GNU MPFR Library.
@@ -46,7 +46,8 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
where s is the sign bit and E = [eeeeeee] such that:
* If 0 <= E <= 94, then the exponent e is E-47 (-47 <= e <= 47).
* If 95 <= E <= 110, the exponent is stored in the next E-94 bytes
- (1 to 16 bytes) in sign + absolute value representation.
+ (1 to 16 bytes) in sign + absolute value representation,
+ where the absolute value is increased by 47 (e <= -47 or 47 <= e).
* If 111 <= E <= 118, the exponent size S is stored in the next
E-110 bytes (1 to 8), then the exponent itself is stored in the
next S bytes. [Not implemented yet]
@@ -90,11 +91,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
{ \
(buffer) = (unsigned char *) mpfr_reallocate_func \
((buffer), *(buffer_size), (wanted_size)); \
- if ((buffer) == NULL) \
- { \
- *(buffer_size) = 0; \
- return NULL; \
- } \
+ MPFR_ASSERTN((buffer) != 0); \
} \
*(buffer_size) = (wanted_size); \
} \
@@ -248,13 +245,23 @@ mpfr_fpif_read_precision_from_file (FILE *fh)
if (fread (buffer, precision_size, 1, fh) != 1)
return 0;
+ /* Justification of the #if below. */
+ MPFR_ASSERTD (precision_size <= MPFR_MAX_PRECSIZE + 1);
+
+#if (MPFR_MAX_PRECSIZE + 1) * CHAR_BIT > MPFR_PREC_BITS
while (precision_size > sizeof(mpfr_prec_t))
{
if (buffer[precision_size-1] != 0)
return 0; /* the read precision doesn't fit in a mpfr_prec_t */
precision_size--;
}
+#endif
+
+ /* To detect bugs affecting particular platforms (thus MPFR_ASSERTN)... */
+ MPFR_ASSERTN (precision_size <= sizeof(mpfr_prec_t));
+ /* Since mpfr_prec_t is signed, one also needs to check that the
+ most significant bit of the corresponding unsigned value is 0. */
if (precision_size == sizeof(mpfr_prec_t) &&
buffer[precision_size-1] >= 0x80)
return 0; /* the read precision doesn't fit in a mpfr_prec_t */
@@ -356,7 +363,7 @@ mpfr_fpif_store_exponent (unsigned char *buffer, size_t *buffer_size, mpfr_t x)
/*
* x : OUT : MPFR number extracted from the binary buffer
- * fh : IN : file handler
+ * fh : IN : file handler (should not be NULL)
* return 0 if successful
*/
/* TODO
@@ -373,8 +380,7 @@ mpfr_fpif_read_exponent_from_file (mpfr_t x, FILE * fh)
int sign;
unsigned char buffer[sizeof(mpfr_exp_t)];
- if (fh == NULL)
- return 1;
+ MPFR_ASSERTD(fh != NULL);
if (fread (buffer, 1, 1, fh) != 1)
return 1;
@@ -481,31 +487,22 @@ mpfr_fpif_store_limbs (unsigned char *buffer, size_t *buffer_size, mpfr_t x)
/*
* x : OUT : MPFR number extracted from the binary buffer, should have the same
* precision than the number in the binary format
- * buffer : IN : limb of the MPFR number x in a binary format,
- * buffer_size : IN/OUT : size of the buffer => size used in the buffer
- * return 0 if successful
+ * buffer : IN : limb of the MPFR number x in a binary format
+ * nb_byte : IN : size of the buffer (in bytes)
+ * Assume buffer is not NULL.
*/
-static int
-mpfr_fpif_read_limbs (mpfr_t x, unsigned char *buffer, size_t *buffer_size)
+static void
+mpfr_fpif_read_limbs (mpfr_t x, unsigned char *buffer, size_t nb_byte)
{
- mpfr_prec_t precision;
- size_t nb_byte;
size_t mp_bytes_per_limb;
size_t nb_partial_byte;
size_t i, j;
- precision = mpfr_get_prec (x);
- nb_byte = (precision + 7) >> 3;
+ MPFR_ASSERTD (buffer != NULL);
+
mp_bytes_per_limb = mp_bits_per_limb >> 3;
nb_partial_byte = nb_byte % mp_bytes_per_limb;
- if ((buffer == NULL) || (*buffer_size < nb_byte))
- {
- *buffer_size = 0;
- return 1;
- }
- *buffer_size = nb_byte;
-
if (nb_partial_byte > 0)
{
memset (MPFR_MANT(x), 0, sizeof(mp_limb_t));
@@ -516,8 +513,6 @@ mpfr_fpif_read_limbs (mpfr_t x, unsigned char *buffer, size_t *buffer_size)
i += mp_bytes_per_limb, j++)
getLittleEndianData ((unsigned char*) (MPFR_MANT(x) + j), buffer + i,
sizeof(mp_limb_t), sizeof(mp_limb_t));
-
- return 0;
}
/* External Function */
@@ -539,8 +534,7 @@ mpfr_fpif_export (FILE *fh, mpfr_t x)
buf_size = MAX_VARIABLE_STORAGE(sizeof(mpfr_exp_t), mpfr_get_prec (x));
buf = (unsigned char*) mpfr_allocate_func (buf_size);
- if (buf == NULL)
- return -1;
+ MPFR_ASSERTN(buf != NULL);
used_size = buf_size;
buf = mpfr_fpif_store_precision (buf, &used_size, mpfr_get_prec (x));
@@ -553,11 +547,8 @@ mpfr_fpif_export (FILE *fh, mpfr_t x)
}
used_size = buf_size;
bufResult = mpfr_fpif_store_exponent (buf, &used_size, x);
- if (bufResult == NULL)
- {
- mpfr_free_func (buf, buf_size);
- return -1;
- }
+ /* bufResult cannot be NULL: if reallocation failed in
+ mpfr_fpif_store_exponent, an assertion failed */
buf = bufResult;
used_size > buf_size ? buf_size = used_size : 0;
status = fwrite (buf, used_size, 1, fh);
@@ -601,6 +592,7 @@ mpfr_fpif_import (mpfr_t x, FILE *fh)
precision = mpfr_fpif_read_precision_from_file (fh);
if (precision == 0) /* precision = 0 means an error */
return -1;
+ MPFR_ASSERTD(fh != NULL); /* checked by mpfr_fpif_read_precision_from_file */
if (precision > MPFR_PREC_MAX)
return -1;
MPFR_STAT_STATIC_ASSERT (MPFR_PREC_MIN == 1); /* as specified */
@@ -626,11 +618,7 @@ mpfr_fpif_import (mpfr_t x, FILE *fh)
MPFR_STAT_STATIC_ASSERT ((MPFR_PREC_MAX + 7) >> 3 <= (size_t) -1);
used_size = (precision + 7) >> 3; /* ceil(precision/8) */
buffer = (unsigned char*) mpfr_allocate_func (used_size);
- if (buffer == NULL)
- {
- mpfr_set_nan (x);
- return -1;
- }
+ MPFR_ASSERTN(buffer != NULL);
status = fread (buffer, used_size, 1, fh);
if (status != 1)
{
@@ -638,13 +626,8 @@ mpfr_fpif_import (mpfr_t x, FILE *fh)
mpfr_set_nan (x);
return -1;
}
- status = mpfr_fpif_read_limbs (x, buffer, &used_size);
+ mpfr_fpif_read_limbs (x, buffer, used_size);
mpfr_free_func (buffer, used_size);
- if (status != 0)
- {
- mpfr_set_nan (x);
- return -1;
- }
}
return 0;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/frac.c b/Build/source/libs/mpfr/mpfr-src/src/frac.c
index 2646775e71e..bf82cc6d46b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/frac.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/frac.c
@@ -1,6 +1,6 @@
/* mpfr_frac -- Fractional part of a floating-point number.
-Copyright 2002-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/free_cache.c b/Build/source/libs/mpfr/mpfr-src/src/free_cache.c
index db0637a0d98..7671949a337 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/free_cache.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/free_cache.c
@@ -1,6 +1,6 @@
/* mpfr_free_cache... - Free cache/pool memory used by MPFR.
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,7 +22,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
-/* Theses caches may be global to all threads or local to the current one. */
+/* These caches may be global to all threads or local to the current one. */
static void
mpfr_free_const_caches (void)
{
@@ -39,7 +39,7 @@ mpfr_free_const_caches (void)
mpfr_clear_cache (__gmpfr_cache_const_catalan);
}
-/* Theses caches/pools are always local to a thread. */
+/* These caches/pools are always local to a thread. */
static void
mpfr_free_local_cache (void)
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/frexp.c b/Build/source/libs/mpfr/mpfr-src/src/frexp.c
index adc369cf0a9..17470429cb4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/frexp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/frexp.c
@@ -1,6 +1,6 @@
/* mpfr_frexp -- convert to integral and fractional parts
-Copyright 2011-2019 Free Software Foundation, Inc.
+Copyright 2011-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/gamma.c b/Build/source/libs/mpfr/mpfr-src/src/gamma.c
index e9e8e042ea8..861bb0dfaaa 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/gamma.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/gamma.c
@@ -1,6 +1,6 @@
/* mpfr_gamma -- gamma function
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -138,6 +138,8 @@ mpfr_gamma (mpfr_ptr gamma, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
if (MPFR_IS_NEG (x))
{
+ /* gamma(x) has a pole at negative integers, thus even if it goes to zero
+ for other values, we return NaN */
MPFR_SET_NAN (gamma);
MPFR_RET_NAN;
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/gamma_inc.c b/Build/source/libs/mpfr/mpfr-src/src/gamma_inc.c
index 8822559350b..ec9bda4fdc3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/gamma_inc.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/gamma_inc.c
@@ -1,6 +1,6 @@
/* mpfr_gamma_inc -- incomplete gamma function
-Copyright 2016-2019 Free Software Foundation, Inc.
+Copyright 2016-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -103,10 +103,10 @@ mpfr_gamma_inc (mpfr_ptr y, mpfr_srcptr a, mpfr_srcptr x, mpfr_rnd_t rnd)
}
else /* a = -Inf */
{
- /* gamma_inc(-Inf, x) = NaN for x < 0
- +Inf for 0 <= x < 1
+ /* gamma_inc(-Inf, x) = NaN for x <= 0
+ +Inf for 0 < x < 1
+0 for 1 <= x */
- if (mpfr_cmp_ui (x, 0) < 0)
+ if (mpfr_cmp_ui (x, 0) <= 0)
{
MPFR_SET_NAN (y);
MPFR_RET_NAN;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/gammaonethird.c b/Build/source/libs/mpfr/mpfr-src/src/gammaonethird.c
index 5994b063601..0804fda60f8 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/gammaonethird.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/gammaonethird.c
@@ -1,6 +1,6 @@
/* Functions for evaluating Gamma(1/3) and Gamma(2/3). Used by mpfr_ai.
-Copyright 2010-2019 Free Software Foundation, Inc.
+Copyright 2010-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/gen_inverse.h b/Build/source/libs/mpfr/mpfr-src/src/gen_inverse.h
index 9bd2a8f3bae..a1761019f68 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/gen_inverse.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/gen_inverse.h
@@ -1,6 +1,6 @@
/* generic inverse of a function.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/generic/coverage/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/generic/coverage/mparam.h
index 847526e9978..37c23e2c6b6 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/generic/coverage/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/generic/coverage/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/generic/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/generic/mparam.h
index 65097c75d56..18b28654972 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/generic/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/generic/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -28,7 +28,8 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#endif
#ifndef MPFR_DIVHIGH_TAB
-# define MPFR_DIVHIGH_TAB 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16
+/* the value of divhigh_ktab[n] should be 0 or < n-1 */
+# define MPFR_DIVHIGH_TAB 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
#endif
#ifndef MPFR_MUL_THRESHOLD
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_d.c b/Build/source/libs/mpfr/mpfr-src/src/get_d.c
index 5b4d85ff97c..8721c023543 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_d.c
@@ -1,7 +1,7 @@
/* mpfr_get_d, mpfr_get_d_2exp -- convert a multiple precision floating-point
number to a machine double precision float
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -89,7 +89,6 @@ mpfr_get_d (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
else
{
int nbits;
- mp_size_t np, i;
mp_limb_t tp[ MPFR_LIMBS_PER_DOUBLE ];
int carry;
@@ -97,17 +96,22 @@ mpfr_get_d (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
if (MPFR_UNLIKELY (e < -1021))
/*In the subnormal case, compute the exact number of significant bits*/
{
- nbits += (1021 + e);
- MPFR_ASSERTD (nbits >= 1);
+ nbits += 1021 + e;
+ MPFR_ASSERTD (1 <= nbits && nbits < IEEE_DBL_MANT_DIG);
}
- np = MPFR_PREC2LIMBS (nbits);
- MPFR_ASSERTD ( np <= MPFR_LIMBS_PER_DOUBLE );
carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative,
nbits, rnd_mode);
if (MPFR_UNLIKELY(carry))
d = 1.0;
else
{
+#if MPFR_LIMBS_PER_DOUBLE == 1
+ d = (double) tp[0] / MP_BASE_AS_DOUBLE;
+#else
+ mp_size_t np, i;
+ MPFR_ASSERTD (nbits <= IEEE_DBL_MANT_DIG);
+ np = MPFR_PREC2LIMBS (nbits);
+ MPFR_ASSERTD ( np <= MPFR_LIMBS_PER_DOUBLE );
/* The following computations are exact thanks to the previous
mpfr_round_raw. */
d = (double) tp[0] / MP_BASE_AS_DOUBLE;
@@ -115,6 +119,7 @@ mpfr_get_d (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
d = (d + tp[i]) / MP_BASE_AS_DOUBLE;
/* d is the mantissa (between 1/2 and 1) of the argument rounded
to 53 bits */
+#endif
}
d = mpfr_scale2 (d, e);
if (negative)
@@ -154,28 +159,23 @@ mpfr_get_d_2exp (long *expptr, mpfr_srcptr src, mpfr_rnd_t rnd_mode)
MPFR_ALIAS (tmp, src, MPFR_SIGN (src), 0);
ret = mpfr_get_d (tmp, rnd_mode);
- if (MPFR_IS_PURE_FP(src))
- {
- exp = MPFR_GET_EXP (src);
-
- /* rounding can give 1.0, adjust back to 0.5 <= abs(ret) < 1.0 */
- if (ret == 1.0)
- {
- ret = 0.5;
- exp++;
- }
- else if (ret == -1.0)
- {
- ret = -0.5;
- exp++;
- }
+ exp = MPFR_GET_EXP (src);
- MPFR_ASSERTN ((ret >= 0.5 && ret < 1.0)
- || (ret <= -0.5 && ret > -1.0));
- MPFR_ASSERTN (exp >= LONG_MIN && exp <= LONG_MAX);
+ /* rounding can give 1.0, adjust back to 0.5 <= abs(ret) < 1.0 */
+ if (ret == 1.0)
+ {
+ ret = 0.5;
+ exp++;
}
- else
- exp = 0;
+ else if (ret == -1.0)
+ {
+ ret = -0.5;
+ exp++;
+ }
+
+ MPFR_ASSERTN ((ret >= 0.5 && ret < 1.0)
+ || (ret <= -0.5 && ret > -1.0));
+ MPFR_ASSERTN (exp >= LONG_MIN && exp <= LONG_MAX);
*expptr = exp;
return ret;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_d128.c b/Build/source/libs/mpfr/mpfr-src/src/get_d128.c
new file mode 100644
index 00000000000..69b1d206458
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_d128.c
@@ -0,0 +1,441 @@
+/* mpfr_get_decimal128 -- convert a multiple precision floating-point number
+ to an IEEE 754-2008 decimal128 float
+
+See https://gcc.gnu.org/legacy-ml/gcc/2006-06/msg00691.html,
+https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html,
+and TR 24732 <http://www.open-std.org/jtc1/sc22/wg14/www/projects#24732>.
+
+Copyright 2006-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "mpfr-impl.h"
+#include "ieee_floats.h"
+
+#define ISDIGIT(c) ('0' <= c && c <= '9')
+
+#ifdef MPFR_WANT_DECIMAL_FLOATS
+
+#ifndef DEC128_MAX
+# define DEC128_MAX 9.999999999999999999999999999999999E6144dl
+#endif
+
+/* construct a decimal128 NaN */
+static _Decimal128
+get_decimal128_nan (void)
+{
+ return (_Decimal128) MPFR_DBL_NAN;
+}
+
+/* construct the decimal128 Inf with given sign */
+static _Decimal128
+get_decimal128_inf (int negative)
+{
+ return (_Decimal128) (negative ? MPFR_DBL_INFM : MPFR_DBL_INFP);
+}
+
+/* construct the decimal128 zero with given sign */
+static _Decimal128
+get_decimal128_zero (int negative)
+{
+ _Decimal128 zero = 0;
+ return (_Decimal128) (negative ? -zero : zero);
+}
+
+/* construct the decimal128 smallest non-zero with given sign:
+ it is 10^emin * 10^(1-p). Since emax = 6144, emin = 1-emax = -6143,
+ and p = 34, we get 10^(-6176) */
+static _Decimal128
+get_decimal128_min (int negative)
+{
+ return negative ? - 1E-6176dl : 1E-6176dl;
+}
+
+/* construct the decimal128 largest finite number with given sign */
+static _Decimal128
+get_decimal128_max (int negative)
+{
+ return negative ? - DEC128_MAX : DEC128_MAX;
+}
+
+/* one-to-one conversion:
+ s is a decimal string representing a number x = m * 10^e which must be
+ exactly representable in the decimal128 format, i.e.
+ (a) the mantissa m has at most 34 decimal digits
+ (b1) -6143 <= e <= 6144 with m integer multiple of 10^(-33), |m| < 10
+ (b2) or -6176 <= e <= 6111 with m integer, |m| < 10^34.
+ Assumes s is neither NaN nor +Inf nor -Inf.
+ s = [-][0-9]+E[-][0-9]+
+
+ The decimal128 format (cf table 3.6 of IEEE 754-2008) has the following
+ parameters:
+ * k = 128 (number of bits of storage)
+ * p = 34 (precision in digits)
+ * emax = 6144
+ * bias = E-q = 6176
+ * sign bit has 1 bit
+ * w+5 = 17 bits (combination field width)
+ * t = 110 bits (trailing significand width)
+ We have k = 1 + 5 + w + t = 128.
+*/
+static _Decimal128
+string_to_Decimal128 (char *s) /* portable version */
+{
+ long int exp = 0;
+ char m[35];
+ long n = 0; /* mantissa length */
+ char *endptr[1];
+ _Decimal128 x = 0;
+ int sign = 0;
+
+ /* read sign */
+ if (*s == '-')
+ {
+ sign = 1;
+ s ++;
+ }
+ /* read mantissa */
+ while (ISDIGIT (*s))
+ m[n++] = *s++;
+
+ /* as constructed in mpfr_get_decimal128, s cannot have any '.' separator */
+
+ /* we will consider an integer mantissa m*10^exp */
+ MPFR_ASSERTN(n <= 34);
+ /* s always has an exponent separator 'E' */
+ MPFR_ASSERTN(*s == 'E');
+ exp = strtol (s + 1, endptr, 10);
+ MPFR_ASSERTN(**endptr == '\0');
+ MPFR_ASSERTN(-6176 <= exp && exp <= (long) (6145 - n));
+ while (n < 34)
+ {
+ m[n++] = '0';
+ exp --;
+ }
+ /* now n=34 and -6176 <= exp <= 6111, cf (b2) */
+ m[n] = '\0';
+
+ /* the number to convert is m[] * 10^exp where the mantissa is a 34-digit
+ integer */
+
+ /* compute biased exponent */
+ exp += 6176;
+
+ MPFR_ASSERTN(exp >= -33);
+ if (exp < 0)
+ {
+ int i;
+ n = -exp;
+ /* check the last n digits of the mantissa are zero */
+ for (i = 1; i <= n; i++)
+ MPFR_ASSERTN(m[34 - n] == '0');
+ /* shift the first (34-n) digits to the right */
+ for (i = 34 - n - 1; i >= 0; i--)
+ m[i + n] = m[i];
+ /* zero the first n digits */
+ for (i = 0; i < n; i ++)
+ m[i] = '0';
+ exp = 0;
+ }
+
+ /* the number to convert is m[] * 10^(exp-6176) */
+ exp -= 6176;
+
+ for (n = 0; n < 34; n++)
+ x = (_Decimal128) 10 * x + (_Decimal128) (m[n] - '0');
+
+ /* multiply by 10^exp */
+ if (exp > 0)
+ {
+ _Decimal128 ten = 10;
+ _Decimal128 ten2 = ten * ten;
+ _Decimal128 ten4 = ten2 * ten2;
+ _Decimal128 ten8 = ten4 * ten4;
+ _Decimal128 ten16 = ten8 * ten8;
+ _Decimal128 ten32 = ten16 * ten16;
+ _Decimal128 ten64 = ten32 * ten32;
+ _Decimal128 ten128 = ten64 * ten64;
+ _Decimal128 ten256 = ten128 * ten128;
+ _Decimal128 ten512 = ten256 * ten256;
+ _Decimal128 ten1024 = ten512 * ten512;
+ _Decimal128 ten2048 = ten1024 * ten1024;
+ _Decimal128 ten4096 = ten2048 * ten2048;
+
+ if (exp >= 4096)
+ {
+ x *= ten4096;
+ exp -= 4096;
+ }
+ if (exp >= 2048)
+ {
+ x *= ten2048;
+ exp -= 2048;
+ }
+ if (exp >= 1024)
+ {
+ x *= ten1024;
+ exp -= 1024;
+ }
+ if (exp >= 512)
+ {
+ x *= ten512;
+ exp -= 512;
+ }
+ if (exp >= 256)
+ {
+ x *= ten256;
+ exp -= 256;
+ }
+ if (exp >= 128)
+ {
+ x *= ten128;
+ exp -= 128;
+ }
+ if (exp >= 64)
+ {
+ x *= ten64;
+ exp -= 64;
+ }
+ if (exp >= 32)
+ {
+ x *= ten32;
+ exp -= 32;
+ }
+ if (exp >= 16)
+ {
+ x *= ten16;
+ exp -= 16;
+ }
+ if (exp >= 8)
+ {
+ x *= ten8;
+ exp -= 8;
+ }
+ if (exp >= 4)
+ {
+ x *= ten4;
+ exp -= 4;
+ }
+ if (exp >= 2)
+ {
+ x *= ten2;
+ exp -= 2;
+ }
+ if (exp >= 1)
+ {
+ x *= ten;
+ exp -= 1;
+ }
+ }
+ else if (exp < 0)
+ {
+ _Decimal128 ten = 10;
+ _Decimal128 ten2 = ten * ten;
+ _Decimal128 ten4 = ten2 * ten2;
+ _Decimal128 ten8 = ten4 * ten4;
+ _Decimal128 ten16 = ten8 * ten8;
+ _Decimal128 ten32 = ten16 * ten16;
+ _Decimal128 ten64 = ten32 * ten32;
+ _Decimal128 ten128 = ten64 * ten64;
+ _Decimal128 ten256 = ten128 * ten128;
+ _Decimal128 ten512 = ten256 * ten256;
+ _Decimal128 ten1024 = ten512 * ten512;
+ _Decimal128 ten2048 = ten1024 * ten1024;
+ _Decimal128 ten4096 = ten2048 * ten2048;
+
+ if (exp <= -4096)
+ {
+ x /= ten4096;
+ exp += 4096;
+ }
+ if (exp <= -2048)
+ {
+ x /= ten2048;
+ exp += 2048;
+ }
+ if (exp <= -1024)
+ {
+ x /= ten1024;
+ exp += 1024;
+ }
+ if (exp <= -512)
+ {
+ x /= ten512;
+ exp += 512;
+ }
+ if (exp <= -256)
+ {
+ x /= ten256;
+ exp += 256;
+ }
+ if (exp <= -128)
+ {
+ x /= ten128;
+ exp += 128;
+ }
+ if (exp <= -64)
+ {
+ x /= ten64;
+ exp += 64;
+ }
+ if (exp <= -32)
+ {
+ x /= ten32;
+ exp += 32;
+ }
+ if (exp <= -16)
+ {
+ x /= ten16;
+ exp += 16;
+ }
+ if (exp <= -8)
+ {
+ x /= ten8;
+ exp += 8;
+ }
+ if (exp <= -4)
+ {
+ x /= ten4;
+ exp += 4;
+ }
+ if (exp <= -2)
+ {
+ x /= ten2;
+ exp += 2;
+ }
+ if (exp <= -1)
+ {
+ x /= ten;
+ exp += 1;
+ }
+ }
+
+ if (sign)
+ x = -x;
+
+ return x;
+}
+
+_Decimal128
+mpfr_get_decimal128 (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
+{
+ int negative;
+ mpfr_exp_t e;
+
+ if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (src)))
+ {
+ if (MPFR_IS_NAN (src))
+ return get_decimal128_nan ();
+
+ negative = MPFR_IS_NEG (src);
+
+ if (MPFR_IS_INF (src))
+ return get_decimal128_inf (negative);
+
+ MPFR_ASSERTD (MPFR_IS_ZERO(src));
+ return get_decimal128_zero (negative);
+ }
+
+ e = MPFR_GET_EXP (src);
+ negative = MPFR_IS_NEG (src);
+
+ MPFR_UPDATE2_RND_MODE (rnd_mode, MPFR_SIGN (src));
+
+ /* now rnd_mode is RNDN, RNDF, RNDA or RNDZ */
+
+ /* the smallest decimal128 number is 10^(-6176),
+ with 2^(-20517) < 10^(-6176) < 2^(-20516) */
+ if (MPFR_UNLIKELY (e < -20517)) /* src <= 2^(-20518) < 1/2*10^(-6176) */
+ {
+ if (rnd_mode != MPFR_RNDA)
+ return get_decimal128_zero (negative);
+ else /* RNDA: return the smallest non-zero number */
+ return get_decimal128_min (negative);
+ }
+ /* the largest decimal128 number is just below 10^6145 < 2^20414 */
+ else if (MPFR_UNLIKELY (e > 20414)) /* then src >= 2^20414 */
+ {
+ if (rnd_mode == MPFR_RNDZ)
+ return get_decimal128_max (negative);
+ else /* RNDN, RNDA, RNDF: round away */
+ return get_decimal128_inf (negative);
+ }
+ else
+ {
+ /* we need to store the sign (1 character), the significand (at most 34
+ characters), the exponent part (at most 6 characters for "E-6176"),
+ and the terminating null character, thus we need at least 42
+ characters in s. */
+ char s[42];
+ mpfr_get_str (s, &e, 10, 34, src, rnd_mode);
+ /* the smallest normal number is 1.000...000E-6143,
+ which corresponds to s=[0.]1000...000 and e=-6142 */
+ if (e < -6142)
+ {
+ /* the smallest subnormal number is 0.000...001E-6143 = 1E-6176,
+ which corresponds to s=[0.]1000...000 and e=-6175 */
+ if (e < -6175)
+ {
+ if (rnd_mode == MPFR_RNDN && e == -6176)
+ {
+ /* If 0.5E-6176 < |src| < 1E-6176 (smallest subnormal),
+ src should round to +/- 1E-6176 in MPFR_RNDN. */
+ mpfr_get_str (s, &e, 10, 1, src, MPFR_RNDA);
+ return e == -6176 && s[negative] <= '5' ?
+ get_decimal128_zero (negative) :
+ get_decimal128_min (negative);
+ }
+ if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDN)
+ return get_decimal128_zero (negative);
+ else /* RNDA or RNDF: return the smallest non-zero number */
+ return get_decimal128_min (negative);
+ }
+ else
+ {
+ mpfr_exp_t e2;
+ long digits = 34 - (-6142 - e);
+ /* if e = -6175 then 34 - (-6142 - e) = 1 */
+ mpfr_get_str (s, &e2, 10, digits, src, rnd_mode);
+ /* Warning: we can have e2 = e + 1 here, when rounding to
+ nearest or away from zero. */
+ s[negative + digits] = 'E';
+ sprintf (s + negative + digits + 1, "%ld",
+ (long int)e2 - digits);
+ return string_to_Decimal128 (s);
+ }
+ }
+ /* the largest number is 9.999...999E+6144,
+ which corresponds to s=[0.]9999...999 and e=6145 */
+ else if (e > 6145)
+ {
+ if (rnd_mode == MPFR_RNDZ)
+ return get_decimal128_max (negative);
+ else /* RNDN, RNDA, RNDF: round away */
+ return get_decimal128_inf (negative);
+ }
+ else /* -6142 <= e <= 6145 */
+ {
+ s[34 + negative] = 'E';
+ sprintf (s + 35 + negative, "%ld", (long int) e - 34);
+ return string_to_Decimal128 (s);
+ }
+ }
+}
+
+#endif /* MPFR_WANT_DECIMAL_FLOATS */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_d64.c b/Build/source/libs/mpfr/mpfr-src/src/get_d64.c
index 0546f6fccd1..2f030314f65 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_d64.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_d64.c
@@ -1,11 +1,11 @@
/* mpfr_get_decimal64 -- convert a multiple precision floating-point number
to an IEEE 754-2008 decimal64 float
-See https://gcc.gnu.org/ml/gcc/2006-06/msg00691.html,
+See https://gcc.gnu.org/legacy-ml/gcc/2006-06/msg00691.html,
https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html,
and TR 24732 <http://www.open-std.org/jtc1/sc22/wg14/www/projects#24732>.
-Copyright 2006-2019 Free Software Foundation, Inc.
+Copyright 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -31,8 +31,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifdef MPFR_WANT_DECIMAL_FLOATS
-#if _MPFR_IEEE_FLOATS
-#else
+#if ! _MPFR_IEEE_FLOATS
#include "ieee_floats.h"
#endif
@@ -40,7 +39,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
# define DEC64_MAX 9.999999999999999E384dd
#endif
-#ifdef DPD_FORMAT
+#ifdef DECIMAL_DPD_FORMAT
static const int T[1000] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 32,
33, 34, 35, 36, 37, 38, 39, 40, 41, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,
@@ -111,6 +110,9 @@ static const int T[1000] = {
#endif
/* construct a decimal64 NaN */
+/* FIXME: In the _MPFR_IEEE_FLOATS case, possible issue due to the fact
+ that not all bitfields are initialized. Moreover, is there an advantage
+ of this code compared to the generic one? */
static _Decimal64
get_decimal64_nan (void)
{
@@ -127,6 +129,9 @@ get_decimal64_nan (void)
}
/* construct the decimal64 Inf with given sign */
+/* FIXME: In the _MPFR_IEEE_FLOATS case, possible issue due to the fact
+ that not all bitfields are initialized. Moreover, is there an advantage
+ of this code compared to the generic one? */
static _Decimal64
get_decimal64_inf (int negative)
{
@@ -147,14 +152,12 @@ get_decimal64_inf (int negative)
static _Decimal64
get_decimal64_zero (int negative)
{
- union ieee_double_decimal64 y;
-
- /* zero has the same representation in binary64 and decimal64 */
- y.d = negative ? DBL_NEG_ZERO : 0.0;
- return y.d64;
+ return negative ? -0.0dd : 0.0dd;
}
-/* construct the decimal64 smallest non-zero with given sign */
+/* construct the decimal64 smallest non-zero with given sign:
+ it is 10^emin * 10^(1-p). Since emax = 384, emin = 1-emax = -383,
+ and p = 16, we get 10^(-398) */
static _Decimal64
get_decimal64_min (int negative)
{
@@ -175,18 +178,21 @@ get_decimal64_max (int negative)
(b1) -383 <= e <= 384 with m integer multiple of 10^(-15), |m| < 10
(b2) or -398 <= e <= 369 with m integer, |m| < 10^16.
Assumes s is neither NaN nor +Inf nor -Inf.
+ s = [-][0-9]+E[-][0-9]+
*/
-#if _MPFR_IEEE_FLOATS
+
+#if _MPFR_IEEE_FLOATS && !defined(DECIMAL_GENERIC_CODE)
+
static _Decimal64
string_to_Decimal64 (char *s)
{
- long int exp = 0;
+ long int exp;
char m[17];
long n = 0; /* mantissa length */
char *endptr[1];
union mpfr_ieee_double_extract x;
union ieee_double_decimal64 y;
-#ifdef DPD_FORMAT
+#ifdef DECIMAL_DPD_FORMAT
unsigned int G, d1, d2, d3, d4, d5;
#endif
@@ -202,19 +208,15 @@ string_to_Decimal64 (char *s)
while (ISDIGIT (*s))
m[n++] = *s++;
exp = n;
- if (*s == '.')
- {
- s ++;
- while (ISDIGIT (*s))
- m[n++] = *s++;
- }
+
+ /* as constructed in mpfr_get_decimal64, s cannot have any '.' separator */
+
/* we have exp digits before decimal point, and a total of n digits */
exp -= n; /* we will consider an integer mantissa */
MPFR_ASSERTN(n <= 16);
- if (*s == 'E' || *s == 'e')
- exp += strtol (s + 1, endptr, 10);
- else
- *endptr = s;
+ /* s always have an exponent separator 'E' */
+ MPFR_ASSERTN(*s == 'E');
+ exp += strtol (s + 1, endptr, 10);
MPFR_ASSERTN(**endptr == '\0');
MPFR_ASSERTN(-398 <= exp && exp <= (long) (385 - n));
while (n < 16)
@@ -246,7 +248,7 @@ string_to_Decimal64 (char *s)
}
/* now convert to DPD or BID */
-#ifdef DPD_FORMAT
+#ifdef DECIMAL_DPD_FORMAT
#define CH(d) (d - '0')
if (m[0] >= '8')
G = (3 << 11) | ((exp & 768) << 1) | ((CH(m[0]) & 1) << 8);
@@ -263,21 +265,38 @@ string_to_Decimal64 (char *s)
x.s.manh = ((G & 3) << 18) | (d1 << 8) | (d2 >> 2);
x.s.manl = (d2 & 3) << 30;
x.s.manl |= (d3 << 20) | (d4 << 10) | d5;
-#else /* BID format */
+#else /* BID */
{
- mp_size_t rn;
- mp_limb_t rp[2];
+ unsigned int rp[2]; /* rp[0] and rp[1] should contain at least 32 bits */
+#define NLIMBS (64 / GMP_NUMB_BITS)
+ mp_limb_t sp[NLIMBS];
+ mp_size_t sn;
int case_i = strcmp (m, "9007199254740992") < 0;
for (n = 0; n < 16; n++)
m[n] -= '0';
- rn = mpn_set_str (rp, (unsigned char *) m, 16, 10);
- if (rn == 1)
- rp[1] = 0;
-#if GMP_NUMB_BITS > 32
- rp[1] = rp[1] << (GMP_NUMB_BITS - 32);
- rp[1] |= rp[0] >> 32;
- rp[0] &= 4294967295UL;
+ sn = mpn_set_str (sp, (unsigned char *) m, 16, 10);
+ while (sn < NLIMBS)
+ sp[sn++] = 0;
+ /* now convert {sp, sn} to {rp, 2} */
+#if GMP_NUMB_BITS >= 64
+ MPFR_ASSERTD(sn <= 1);
+ rp[0] = sp[0] & 4294967295UL;
+ rp[1] = sp[0] >> 32;
+#elif GMP_NUMB_BITS == 32
+ MPFR_ASSERTD(sn <= 2);
+ rp[0] = sp[0];
+ rp[1] = sp[1];
+#elif GMP_NUMB_BITS == 16
+ rp[0] = sp[0] | ((unsigned int) sp[1] << 16);
+ rp[1] = sp[2] | ((unsigned int) sp[3] << 16);
+#elif GMP_NUMB_BITS == 8
+ rp[0] = sp[0] | ((unsigned int) sp[1] << 8)
+ | ((unsigned int) sp[2] << 16) | ((unsigned int) sp[3] << 24);
+ rp[1] = sp[4] | ((unsigned int) sp[5] << 8)
+ | ((unsigned int) sp[6] << 16) | ((unsigned int) sp[7] << 24);
+#else
+#error "GMP_NUMB_BITS should be 8, 16, 32, or >= 64"
#endif
if (case_i)
{ /* s < 2^53: case i) */
@@ -293,12 +312,13 @@ string_to_Decimal64 (char *s)
x.s.manh = (rp[1] ^ 2097152) | ((exp & 1) << 19);
}
}
-#endif /* DPD_FORMAT */
+#endif /* DPD or BID */
y.d = x.d;
return y.d64;
}
-#else
-/* portable version */
+
+#else /* portable version */
+
static _Decimal64
string_to_Decimal64 (char *s)
{
@@ -306,11 +326,8 @@ string_to_Decimal64 (char *s)
char m[17];
long n = 0; /* mantissa length */
char *endptr[1];
- _Decimal64 x = 0.0;
+ _Decimal64 x = 0;
int sign = 0;
-#ifdef DPD_FORMAT
- unsigned int G, d1, d2, d3, d4, d5;
-#endif
/* read sign */
if (*s == '-')
@@ -321,20 +338,14 @@ string_to_Decimal64 (char *s)
/* read mantissa */
while (ISDIGIT (*s))
m[n++] = *s++;
- exp = n;
- if (*s == '.')
- {
- s ++;
- while (ISDIGIT (*s))
- m[n++] = *s++;
- }
- /* we have exp digits before decimal point, and a total of n digits */
- exp -= n; /* we will consider an integer mantissa */
+
+ /* as constructed in mpfr_get_decimal64, s cannot have any '.' separator */
+
+ /* we will consider an integer mantissa m*10^exp */
MPFR_ASSERTN(n <= 16);
- if (*s == 'E' || *s == 'e')
- exp += strtol (s + 1, endptr, 10);
- else
- *endptr = s;
+ /* s always has an exponent separator 'E' */
+ MPFR_ASSERTN(*s == 'E');
+ exp = strtol (s + 1, endptr, 10);
MPFR_ASSERTN(**endptr == '\0');
MPFR_ASSERTN(-398 <= exp && exp <= (long) (385 - n));
while (n < 16)
@@ -489,7 +500,8 @@ string_to_Decimal64 (char *s)
return x;
}
-#endif
+
+#endif /* definition of string_to_Decimal64 (DPD, BID, or portable) */
_Decimal64
mpfr_get_decimal64 (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
@@ -515,34 +527,32 @@ mpfr_get_decimal64 (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
e = MPFR_GET_EXP (src);
negative = MPFR_IS_NEG (src);
- if (MPFR_UNLIKELY(rnd_mode == MPFR_RNDA))
- rnd_mode = negative ? MPFR_RNDD : MPFR_RNDU;
+ MPFR_UPDATE2_RND_MODE (rnd_mode, MPFR_SIGN (src));
+
+ /* now rnd_mode is RNDN, RNDF, RNDA or RNDZ */
/* the smallest decimal64 number is 10^(-398),
with 2^(-1323) < 10^(-398) < 2^(-1322) */
if (MPFR_UNLIKELY (e < -1323)) /* src <= 2^(-1324) < 1/2*10^(-398) */
{
- if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDN
- || (rnd_mode == MPFR_RNDD && negative == 0)
- || (rnd_mode == MPFR_RNDU && negative != 0))
+ if (rnd_mode != MPFR_RNDA)
return get_decimal64_zero (negative);
- else /* return the smallest non-zero number */
+ else /* RNDA: return the smallest non-zero number */
return get_decimal64_min (negative);
}
- /* the largest decimal64 number is just below 10^(385) < 2^1279 */
+ /* the largest decimal64 number is just below 10^385 < 2^1279 */
else if (MPFR_UNLIKELY (e > 1279)) /* then src >= 2^1279 */
{
- if (rnd_mode == MPFR_RNDZ
- || (rnd_mode == MPFR_RNDU && negative != 0)
- || (rnd_mode == MPFR_RNDD && negative == 0))
+ if (rnd_mode == MPFR_RNDZ)
return get_decimal64_max (negative);
- else
+ else /* RNDN, RNDA, RNDF: round away */
return get_decimal64_inf (negative);
}
else
{
- /* we need to store the sign (1), the mantissa (16), and the terminating
- character, thus we need at least 18 characters in s */
+ /* we need to store the sign (1 character), the significand (at most 16
+ characters), the exponent part (at most 5 characters for "E-398"),
+ and the terminating character, thus we need at least 23 characters */
char s[23];
mpfr_get_str (s, &e, 10, 16, src, rnd_mode);
/* the smallest normal number is 1.000...000E-383,
@@ -562,11 +572,9 @@ mpfr_get_decimal64 (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
get_decimal64_zero (negative) :
get_decimal64_min (negative);
}
- if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDN
- || (rnd_mode == MPFR_RNDD && negative == 0)
- || (rnd_mode == MPFR_RNDU && negative != 0))
+ if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDN)
return get_decimal64_zero (negative);
- else /* return the smallest non-zero number */
+ else /* RNDA or RNDF: return the smallest non-zero number */
return get_decimal64_min (negative);
}
else
@@ -587,11 +595,9 @@ mpfr_get_decimal64 (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
which corresponds to s=[0.]9999...999 and e=385 */
else if (e > 385)
{
- if (rnd_mode == MPFR_RNDZ
- || (rnd_mode == MPFR_RNDU && negative != 0)
- || (rnd_mode == MPFR_RNDD && negative == 0))
+ if (rnd_mode == MPFR_RNDZ)
return get_decimal64_max (negative);
- else
+ else /* RNDN, RNDA, RNDF: round away */
return get_decimal64_inf (negative);
}
else /* -382 <= e <= 385 */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_exp.c b/Build/source/libs/mpfr/mpfr-src/src/get_exp.c
index 6260a9a35fa..a766994379a 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_exp.c
@@ -1,6 +1,6 @@
/* mpfr_get_exp - get the exponent of a floating-point number
-Copyright 2002-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_f.c b/Build/source/libs/mpfr/mpfr-src/src/get_f.c
index 98f23072508..afe4e5c8b1e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_f.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_f.c
@@ -1,6 +1,6 @@
/* mpfr_get_f -- convert a MPFR number to a GNU MPF number
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_float128.c b/Build/source/libs/mpfr/mpfr-src/src/get_float128.c
index e5bfc778984..981f9ca82b6 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_float128.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_float128.c
@@ -1,7 +1,7 @@
/* mpfr_get_float128 -- convert a multiple precision floating-point
- number to a __float128 number
+ number to a _Float128 number
-Copyright 2012-2019 Free Software Foundation, Inc.
+Copyright 2012-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -26,16 +26,16 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifdef MPFR_WANT_FLOAT128
/* generic code */
-__float128
+_Float128
mpfr_get_float128 (mpfr_srcptr x, mpfr_rnd_t rnd_mode)
{
if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
- return (__float128) mpfr_get_d (x, rnd_mode);
+ return (_Float128) mpfr_get_d (x, rnd_mode);
else /* now x is a normal non-zero number */
{
- __float128 r; /* result */
- __float128 m;
+ _Float128 r; /* result */
+ _Float128 m;
mpfr_exp_t e; /* exponent of x (before rounding) */
mpfr_exp_t sh; /* exponent shift, so that x/2^sh is in the double range */
const int emin = -16381;
@@ -62,7 +62,7 @@ mpfr_get_float128 (mpfr_srcptr x, mpfr_rnd_t rnd_mode)
MPFR_SAVE_EXPO_MARK (expo);
- /* First round x to the target __float128 precision, taking the
+ /* First round x to the target _Float128 precision, taking the
reduced precision of the subnormals into account, so that all
subsequent operations are exact (this avoids double rounding
problems). */
@@ -83,7 +83,7 @@ mpfr_get_float128 (mpfr_srcptr x, mpfr_rnd_t rnd_mode)
always work if GMP_NUMB_BITS > IEEE_FLOAT128_MANT_DIG.
MPFR_LIMB_HIGHBIT has the advantage to fit on 1 bit. */
r += yp[i];
- r *= 1 / (2 * (__float128) MPFR_LIMB_HIGHBIT);
+ r *= 1 / (2 * (_Float128) MPFR_LIMB_HIGHBIT);
}
mpfr_clear (y);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_flt.c b/Build/source/libs/mpfr/mpfr-src/src/get_flt.c
index 87416b6e022..1b8685e1c60 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_flt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_flt.c
@@ -1,6 +1,6 @@
/* mpfr_get_flt -- convert a mpfr_t to a machine single precision float
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -86,7 +86,6 @@ mpfr_get_flt (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
else /* -148 <= e <= 127 */
{
int nbits;
- mp_size_t np, i;
mp_limb_t tp[MPFR_LIMBS_PER_FLT];
int carry;
double dd;
@@ -95,11 +94,9 @@ mpfr_get_flt (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
if (MPFR_UNLIKELY (e < -125))
/*In the subnormal case, compute the exact number of significant bits*/
{
- nbits += (125 + e);
- MPFR_ASSERTD (nbits >= 1);
+ nbits += 125 + e;
+ MPFR_ASSERTD (1 <= nbits && nbits < 24);
}
- np = MPFR_PREC2LIMBS (nbits);
- MPFR_ASSERTD(np <= MPFR_LIMBS_PER_FLT);
carry = mpfr_round_raw_4 (tp, MPFR_MANT(src), MPFR_PREC(src), negative,
nbits, rnd_mode);
/* we perform the reconstruction using the 'double' type here,
@@ -108,6 +105,12 @@ mpfr_get_flt (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
dd = 1.0;
else
{
+#if MPFR_LIMBS_PER_FLT == 1
+ dd = (double) tp[0] / MP_BASE_AS_DOUBLE;
+#else
+ mp_size_t np, i;
+ np = MPFR_PREC2LIMBS (nbits);
+ MPFR_ASSERTD(np <= MPFR_LIMBS_PER_FLT);
/* The following computations are exact thanks to the previous
mpfr_round_raw. */
dd = (double) tp[0] / MP_BASE_AS_DOUBLE;
@@ -115,6 +118,7 @@ mpfr_get_flt (mpfr_srcptr src, mpfr_rnd_t rnd_mode)
dd = (dd + tp[i]) / MP_BASE_AS_DOUBLE;
/* dd is the mantissa (between 1/2 and 1) of the argument rounded
to 24 bits */
+#endif
}
dd = mpfr_scale2 (dd, e);
if (negative)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_ld.c b/Build/source/libs/mpfr/mpfr-src/src/get_ld.c
index d5f987ee410..6b6a5b9df6c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_ld.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_ld.c
@@ -1,7 +1,7 @@
/* mpfr_get_ld, mpfr_get_ld_2exp -- convert a multiple precision floating-point
number to a machine long double
-Copyright 2002-2019 Free Software Foundation, Inc.
+Copyright 2002-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -94,8 +94,73 @@ mpfr_get_ld (mpfr_srcptr x, mpfr_rnd_t rnd_mode)
ld.s.manl = tmpmant[1] >> (denorm - 32);
ld.s.manh = 0;
}
+#elif GMP_NUMB_BITS == 16
+ if (MPFR_LIKELY (denorm == 0))
+ {
+ /* manl = tmpmant[1] | tmpmant[0]
+ manh = tmpmant[3] | tmpmant[2] */
+ ld.s.manl = tmpmant[0] | ((unsigned long) tmpmant[1] << 16);
+ ld.s.manh = tmpmant[2] | ((unsigned long) tmpmant[3] << 16);
+ }
+ else if (denorm < 16)
+ {
+ /* manl = low(mant[2],denorm) | mant[1] | high(mant[0],16-denorm)
+ manh = mant[3] | high(mant[2],16-denorm) */
+ ld.s.manl = (tmpmant[0] >> denorm)
+ | ((unsigned long) tmpmant[1] << (16 - denorm))
+ | ((unsigned long) tmpmant[2] << (32 - denorm));
+ ld.s.manh = (tmpmant[2] >> denorm)
+ | ((unsigned long) tmpmant[3] << (16 - denorm));
+ }
+ else if (denorm == 16)
+ {
+ /* manl = tmpmant[2] | tmpmant[1]
+ manh = 0000000000 | tmpmant[3] */
+ ld.s.manl = tmpmant[1] | ((unsigned long) tmpmant[2] << 16);
+ ld.s.manh = tmpmant[3];
+ }
+ else if (denorm < 32)
+ {
+ /* manl = low(mant[3],denorm-16) | mant[2] | high(mant[1],32-denorm)
+ manh = high(mant[3],32-denorm) */
+ ld.s.manl = (tmpmant[1] >> (denorm - 16))
+ | ((unsigned long) tmpmant[2] << (32 - denorm))
+ | ((unsigned long) tmpmant[3] << (48 - denorm));
+ ld.s.manh = tmpmant[3] >> (denorm - 16);
+ }
+ else if (denorm == 32)
+ {
+ /* manl = tmpmant[3] | tmpmant[2]
+ manh = 0 */
+ ld.s.manl = tmpmant[2] | ((unsigned long) tmpmant[3] << 16);
+ ld.s.manh = 0;
+ }
+ else if (denorm < 48)
+ {
+ /* manl = zero(denorm-32) | tmpmant[3] | high(tmpmant[2],48-denorm)
+ manh = 0 */
+ ld.s.manl = (tmpmant[2] >> (denorm - 32))
+ | ((unsigned long) tmpmant[3] << (48 - denorm));
+ ld.s.manh = 0;
+ }
+ else /* 48 <= denorm < 64 */
+ {
+ /* we assume a right shift of 0 is identity */
+ ld.s.manl = tmpmant[3] >> (denorm - 48);
+ ld.s.manh = 0;
+ }
+#elif GMP_NUMB_BITS == 8
+ {
+ unsigned long long mant = 0;
+ int i;
+ for (i = 0; i < 8; i++)
+ mant |= ((unsigned long) tmpmant[i] << (8*i));
+ mant >>= denorm;
+ ld.s.manl = mant;
+ ld.s.manh = mant >> 32;
+ }
#else
-# error "GMP_NUMB_BITS must be 32 or >= 64"
+# error "GMP_NUMB_BITS must be 16, 32 or >= 64"
/* Other values have never been supported anyway. */
#endif
if (MPFR_LIKELY (denorm == 0))
@@ -251,28 +316,23 @@ mpfr_get_ld_2exp (long *expptr, mpfr_srcptr src, mpfr_rnd_t rnd_mode)
MPFR_ALIAS (tmp, src, MPFR_SIGN (src), 0);
ret = mpfr_get_ld (tmp, rnd_mode);
- if (MPFR_IS_PURE_FP(src))
- {
- exp = MPFR_GET_EXP (src);
+ exp = MPFR_GET_EXP (src);
- /* rounding can give 1.0, adjust back to 0.5 <= abs(ret) < 1.0 */
- if (ret == 1.0)
- {
- ret = 0.5;
- exp ++;
- }
- else if (ret == -1.0)
- {
- ret = -0.5;
- exp ++;
- }
-
- MPFR_ASSERTN ((ret >= 0.5 && ret < 1.0)
- || (ret <= -0.5 && ret > -1.0));
- MPFR_ASSERTN (exp >= LONG_MIN && exp <= LONG_MAX);
+ /* rounding can give 1.0, adjust back to 0.5 <= abs(ret) < 1.0 */
+ if (ret == 1.0)
+ {
+ ret = 0.5;
+ exp ++;
}
- else
- exp = 0;
+ else if (ret == -1.0)
+ {
+ ret = -0.5;
+ exp ++;
+ }
+
+ MPFR_ASSERTN ((ret >= 0.5 && ret < 1.0)
+ || (ret <= -0.5 && ret > -1.0));
+ MPFR_ASSERTN (exp >= LONG_MIN && exp <= LONG_MAX);
*expptr = exp;
return ret;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_q.c b/Build/source/libs/mpfr/mpfr-src/src/get_q.c
index 2de4374d953..a7c659b5639 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_q.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_q.c
@@ -1,7 +1,7 @@
/* mpfr_get_q -- get a multiple-precision rational from
a floating-point number
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_si.c b/Build/source/libs/mpfr/mpfr-src/src/get_si.c
index 68d56573f97..a78b4a4fde7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_si.c
@@ -1,6 +1,6 @@
/* mpfr_get_si -- convert a floating-point number to a signed long.
-Copyright 2003-2019 Free Software Foundation, Inc.
+Copyright 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -57,19 +57,31 @@ mpfr_get_si (mpfr_srcptr f, mpfr_rnd_t rnd)
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
/* warning: if x=0, taking its exponent is illegal */
- if (MPFR_UNLIKELY (MPFR_IS_ZERO(x)))
+ if (MPFR_IS_ZERO (x))
s = 0;
else
{
- mp_limb_t a;
+ unsigned long u = 0;
mp_size_t n;
mpfr_exp_t exp;
- /* 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] >> (GMP_NUMB_BITS - exp);
- s = MPFR_IS_POS (f) ? a : a <= LONG_MAX ? - (long) a : LONG_MIN;
+ exp = MPFR_GET_EXP (x);
+ MPFR_ASSERTD (exp >= 1); /* since |x| >= 1 */
+ n = MPFR_LIMB_SIZE (x);
+#ifdef MPFR_LONG_WITHIN_LIMB
+ MPFR_ASSERTD (exp <= GMP_NUMB_BITS);
+#else
+ while (exp > GMP_NUMB_BITS)
+ {
+ MPFR_ASSERTD (n > 0);
+ u += (unsigned long) MPFR_MANT(x)[n - 1] << (exp - GMP_NUMB_BITS);
+ n--;
+ exp -= GMP_NUMB_BITS;
+ }
+#endif
+ MPFR_ASSERTD (n > 0);
+ u += MPFR_MANT(x)[n - 1] >> (GMP_NUMB_BITS - exp);
+ s = MPFR_IS_POS (f) ? u : u <= LONG_MAX ? - (long) u : LONG_MIN;
}
mpfr_clear (x);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_sj.c b/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
index 2e217787ca4..05274848c24 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_sj.c
@@ -1,6 +1,6 @@
/* mpfr_get_sj -- convert a MPFR number to a huge machine signed integer
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,11 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
#ifdef _MPFR_H_HAVE_INTMAX_T
@@ -41,7 +37,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
{
MPFR_SET_ERANGEFLAG ();
return MPFR_IS_NAN (f) ? 0 :
- MPFR_IS_NEG (f) ? MPFR_INTMAX_MIN : MPFR_INTMAX_MAX;
+ MPFR_IS_NEG (f) ? INTMAX_MIN : INTMAX_MAX;
}
if (MPFR_IS_ZERO (f))
@@ -50,7 +46,7 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
/* Determine the precision of intmax_t. |INTMAX_MIN| may have one
more bit as an integer, but in this case, this is a power of 2,
thus fits in a precision-prec floating-point number. */
- for (r = MPFR_INTMAX_MAX, prec = 0; r != 0; r /= 2, prec++)
+ for (r = INTMAX_MAX, prec = 0; r != 0; r /= 2, prec++)
{ }
MPFR_ASSERTD (r == 0);
@@ -68,24 +64,31 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
if (MPFR_NOTZERO (x))
{
mp_limb_t *xp;
- int sh, n; /* An int should be sufficient in this context. */
+ int sh; /* An int should be sufficient in this context. */
xp = MPFR_MANT (x);
sh = MPFR_GET_EXP (x);
MPFR_ASSERTN ((mpfr_prec_t) sh <= prec + 1);
- if (MPFR_INTMAX_MIN + MPFR_INTMAX_MAX != 0
+ if (INTMAX_MIN + INTMAX_MAX != 0
&& MPFR_UNLIKELY ((mpfr_prec_t) sh > prec))
{
/* 2's complement and x <= INTMAX_MIN: in the case mp_limb_t
has the same size as intmax_t, we cannot use the code in
the for loop since the operations would be performed in
unsigned arithmetic. */
- MPFR_ASSERTN (MPFR_IS_NEG (x) && mpfr_powerof2_raw (x));
- r = MPFR_INTMAX_MIN;
+ MPFR_ASSERTD (MPFR_IS_NEG (x) && mpfr_powerof2_raw (x));
+ r = INTMAX_MIN;
}
- else if (MPFR_IS_POS (x))
+ /* sh is the number of bits that remain to be considered in {xp, xn} */
+ else
{
- /* Note: testing the condition sh >= 0 is necessary to avoid
+#ifdef MPFR_INTMAX_WITHIN_LIMB
+ MPFR_ASSERTD (sh > 0 && sh < GMP_NUMB_BITS);
+ r = xp[0] >> (GMP_NUMB_BITS - sh);
+#else
+ int n;
+
+ /* Note: testing the condition sh > 0 is necessary to avoid
an undefined behavior on xp[n] >> S when S >= GMP_NUMB_BITS
(even though xp[n] == 0 in such a case). This can happen if
sizeof(mp_limb_t) < sizeof(intmax_t) and |x| is small enough
@@ -101,22 +104,15 @@ mpfr_get_sj (mpfr_srcptr f, mpfr_rnd_t rnd)
mp_limb_t is unsigned, therefore not representable as an
intmax_t when the MSB is 1 (this is the case here). */
MPFR_ASSERTD (-sh < GMP_NUMB_BITS);
- r += (sh >= 0
- ? (intmax_t) xp[n] << sh
- : (intmax_t) (xp[n] >> (-sh)));
- }
- }
- else
- {
- /* See the comments for the case x positive. */
- for (n = MPFR_LIMB_SIZE (x) - 1; n >= 0 && sh > 0; n--)
- {
- sh -= GMP_NUMB_BITS;
- MPFR_ASSERTD (-sh < GMP_NUMB_BITS);
- r -= (sh >= 0
- ? (intmax_t) xp[n] << sh
- : (intmax_t) (xp[n] >> (-sh)));
+ /* each limb should be shifted by sh bits to the left if sh>=0,
+ and by sh bits to the right if sh < 0 */
+ r += sh >= 0
+ ? (intmax_t) xp[n] << sh
+ : (intmax_t) (xp[n] >> (-sh));
}
+#endif
+ if (MPFR_IS_NEG(x))
+ r = -r;
}
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_str.c b/Build/source/libs/mpfr/mpfr-src/src/get_str.c
index 2da6bb8840c..7c530ec7a61 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_str.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_str.c
@@ -1,6 +1,6 @@
/* mpfr_get_str -- output a floating-point number to a string
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -21,7 +21,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#define MPFR_NEED_LONGLONG_H
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
static int mpfr_get_str_aux (char *const, mpfr_exp_t *const, mp_limb_t *const,
@@ -253,6 +253,8 @@ mpfr_get_str_aux (char *const str, mpfr_exp_t *const exp, mp_limb_t *const r,
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x00, 0x00, 0x80 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x0000, 0x8000 };
#elif GMP_NUMB_BITS == 32
@@ -268,6 +270,8 @@ const mp_limb_t mpfr_l2b_2_0__tab[] = { 0x80000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x8000 };
#elif GMP_NUMB_BITS == 32
@@ -283,6 +287,8 @@ const mp_limb_t mpfr_l2b_2_1__tab[] = { 0x80000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_3_0__tab[] = { 0x0e, 0xe0, 0xca };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_3_0__tab[] = { 0x0e00, 0xcae0 };
#elif GMP_NUMB_BITS == 32
@@ -298,6 +304,8 @@ const mp_limb_t mpfr_l2b_3_0__tab[] = { 0xcae00e00000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_3_1__tab[] = { 0x48, 0x04, 0x4e, 0xe9, 0xa9, 0xa9, 0xc1, 0x9c, 0x84, 0xa1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_3_1__tab[] = { 0x0448, 0xe94e, 0xa9a9, 0x9cc1, 0xa184 };
#elif GMP_NUMB_BITS == 32
@@ -313,6 +321,8 @@ const mp_limb_t mpfr_l2b_3_1__tab[] = { 0xa1849cc1a9a9e94e0448000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x00, 0x00, 0x80 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x0000, 0x8000 };
#elif GMP_NUMB_BITS == 32
@@ -328,6 +338,8 @@ const mp_limb_t mpfr_l2b_4_0__tab[] = { 0x80000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x8000 };
#elif GMP_NUMB_BITS == 32
@@ -343,6 +355,8 @@ const mp_limb_t mpfr_l2b_4_1__tab[] = { 0x80000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x7a, 0x9a, 0x94 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x7a00, 0x949a };
#elif GMP_NUMB_BITS == 32
@@ -358,6 +372,8 @@ const mp_limb_t mpfr_l2b_5_0__tab[] = { 0x949a7a00000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_5_1__tab[] = { 0xb8, 0x67, 0x28, 0x97, 0x7b, 0x28, 0x48, 0xa3, 0x81, 0xdc };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_5_1__tab[] = { 0x67b8, 0x9728, 0x287b, 0xa348, 0xdc81 };
#elif GMP_NUMB_BITS == 32
@@ -373,6 +389,8 @@ const mp_limb_t mpfr_l2b_5_1__tab[] = { 0xdc81a348287b972867b8000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_6_0__tab[] = { 0x08, 0x70, 0xa5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_6_0__tab[] = { 0x0800, 0xa570 };
#elif GMP_NUMB_BITS == 32
@@ -388,6 +406,8 @@ const mp_limb_t mpfr_l2b_6_0__tab[] = { 0xa5700800000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_6_1__tab[] = { 0x10, 0xff, 0xe9, 0xf9, 0x54, 0xe0, 0x36, 0x92, 0x11, 0xc6 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xff10, 0xf9e9, 0xe054, 0x9236, 0xc611 };
#elif GMP_NUMB_BITS == 32
@@ -403,6 +423,8 @@ const mp_limb_t mpfr_l2b_6_1__tab[] = { 0xc6119236e054f9e9ff10000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb4, 0xab, 0xb3 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb400, 0xb3ab };
#elif GMP_NUMB_BITS == 32
@@ -418,6 +440,8 @@ const mp_limb_t mpfr_l2b_7_0__tab[] = { 0xb3abb400000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_7_1__tab[] = { 0xb8, 0x37, 0x11, 0xa7, 0x4d, 0x75, 0xd6, 0xc9, 0x60, 0xb6 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_7_1__tab[] = { 0x37b8, 0xa711, 0x754d, 0xc9d6, 0xb660 };
#elif GMP_NUMB_BITS == 32
@@ -433,6 +457,8 @@ const mp_limb_t mpfr_l2b_7_1__tab[] = { 0xb660c9d6754da71137b8000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_8_0__tab[] = { 0x00, 0x00, 0xc0 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_8_0__tab[] = { 0x0000, 0xc000 };
#elif GMP_NUMB_BITS == 32
@@ -448,6 +474,8 @@ const mp_limb_t mpfr_l2b_8_0__tab[] = { 0xc0000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xb0, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaab0, 0xaaaa, 0xaaaa, 0xaaaa, 0xaaaa };
#elif GMP_NUMB_BITS == 32
@@ -463,6 +491,8 @@ const mp_limb_t mpfr_l2b_8_1__tab[] = { 0xaaaaaaaaaaaaaaaaaab0000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_9_0__tab[] = { 0x0e, 0xe0, 0xca };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_9_0__tab[] = { 0x0e00, 0xcae0 };
#elif GMP_NUMB_BITS == 32
@@ -478,6 +508,8 @@ const mp_limb_t mpfr_l2b_9_0__tab[] = { 0xcae00e00000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_9_1__tab[] = { 0x48, 0x04, 0x4e, 0xe9, 0xa9, 0xa9, 0xc1, 0x9c, 0x84, 0xa1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_9_1__tab[] = { 0x0448, 0xe94e, 0xa9a9, 0x9cc1, 0xa184 };
#elif GMP_NUMB_BITS == 32
@@ -493,6 +525,8 @@ const mp_limb_t mpfr_l2b_9_1__tab[] = { 0xa1849cc1a9a9e94e0448000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_10_0__tab[] = { 0x7a, 0x9a, 0xd4 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_10_0__tab[] = { 0x7a00, 0xd49a };
#elif GMP_NUMB_BITS == 32
@@ -508,6 +542,8 @@ const mp_limb_t mpfr_l2b_10_0__tab[] = { 0xd49a7a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x90, 0x8f, 0x98, 0xf7, 0xcf, 0xfb, 0x84, 0x9a, 0x20, 0x9a };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x8f90, 0xf798, 0xfbcf, 0x9a84, 0x9a20 };
#elif GMP_NUMB_BITS == 32
@@ -523,6 +559,8 @@ const mp_limb_t mpfr_l2b_10_1__tab[] = { 0x9a209a84fbcff7988f9000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_11_0__tab[] = { 0x54, 0x67, 0xdd };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_11_0__tab[] = { 0x5400, 0xdd67 };
#elif GMP_NUMB_BITS == 32
@@ -538,6 +576,8 @@ const mp_limb_t mpfr_l2b_11_0__tab[] = { 0xdd67540000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_11_1__tab[] = { 0x70, 0xe1, 0x10, 0x9d, 0x22, 0xeb, 0x0e, 0x4e, 0x00, 0x94 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_11_1__tab[] = { 0xe170, 0x9d10, 0xeb22, 0x4e0e, 0x9400 };
#elif GMP_NUMB_BITS == 32
@@ -553,6 +593,8 @@ const mp_limb_t mpfr_l2b_11_1__tab[] = { 0x94004e0eeb229d10e17000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_12_0__tab[] = { 0x08, 0x70, 0xe5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_12_0__tab[] = { 0x0800, 0xe570 };
#elif GMP_NUMB_BITS == 32
@@ -568,6 +610,8 @@ const mp_limb_t mpfr_l2b_12_0__tab[] = { 0xe570080000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_12_1__tab[] = { 0x28, 0xfe, 0x24, 0x1c, 0x03, 0x0b, 0x1a, 0x9c, 0xd1, 0x8e };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_12_1__tab[] = { 0xfe28, 0x1c24, 0x0b03, 0x9c1a, 0x8ed1 };
#elif GMP_NUMB_BITS == 32
@@ -583,6 +627,8 @@ const mp_limb_t mpfr_l2b_12_1__tab[] = { 0x8ed19c1a0b031c24fe2800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_13_0__tab[] = { 0x02, 0xd4, 0xec };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_13_0__tab[] = { 0x0200, 0xecd4 };
#elif GMP_NUMB_BITS == 32
@@ -598,6 +644,8 @@ const mp_limb_t mpfr_l2b_13_0__tab[] = { 0xecd4020000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_13_1__tab[] = { 0xf8, 0x57, 0xb4, 0xf7, 0x20, 0xcb, 0xc6, 0xa7, 0x5c, 0x8a };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x57f8, 0xf7b4, 0xcb20, 0xa7c6, 0x8a5c };
#elif GMP_NUMB_BITS == 32
@@ -613,6 +661,8 @@ const mp_limb_t mpfr_l2b_13_1__tab[] = { 0x8a5ca7c6cb20f7b457f800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xb4, 0xab, 0xf3 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xb400, 0xf3ab };
#elif GMP_NUMB_BITS == 32
@@ -628,6 +678,8 @@ const mp_limb_t mpfr_l2b_14_0__tab[] = { 0xf3abb40000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_14_1__tab[] = { 0xa8, 0x85, 0xab, 0x5c, 0xb5, 0x96, 0xf6, 0xff, 0x79, 0x86 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x85a8, 0x5cab, 0x96b5, 0xfff6, 0x8679 };
#elif GMP_NUMB_BITS == 32
@@ -643,6 +695,8 @@ const mp_limb_t mpfr_l2b_14_1__tab[] = { 0x8679fff696b55cab85a800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_15_0__tab[] = { 0x80, 0x0a, 0xfa };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_15_0__tab[] = { 0x8000, 0xfa0a };
#elif GMP_NUMB_BITS == 32
@@ -658,6 +712,8 @@ const mp_limb_t mpfr_l2b_15_0__tab[] = { 0xfa0a800000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x80, 0x6f, 0xaa, 0xa6, 0xf0, 0x69, 0x23, 0xee, 0x0c, 0x83 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x6f80, 0xa6aa, 0x69f0, 0xee23, 0x830c };
#elif GMP_NUMB_BITS == 32
@@ -673,6 +729,8 @@ const mp_limb_t mpfr_l2b_15_1__tab[] = { 0x830cee2369f0a6aa6f8000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x00, 0x00, 0x80 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x0000, 0x8000 };
#elif GMP_NUMB_BITS == 32
@@ -688,6 +746,8 @@ const mp_limb_t mpfr_l2b_16_0__tab[] = { 0x8000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x0000, 0x0000, 0x0000, 0x0000, 0x8000 };
#elif GMP_NUMB_BITS == 32
@@ -703,6 +763,8 @@ const mp_limb_t mpfr_l2b_16_1__tab[] = { 0x8000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x80, 0xcc, 0x82 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x8000, 0x82cc };
#elif GMP_NUMB_BITS == 32
@@ -718,6 +780,8 @@ const mp_limb_t mpfr_l2b_17_0__tab[] = { 0x82cc800000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_17_1__tab[] = { 0x20, 0x87, 0x9b, 0x25, 0xc4, 0x62, 0xf5, 0xab, 0x85, 0xfa };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_17_1__tab[] = { 0x8720, 0x259b, 0x62c4, 0xabf5, 0xfa85 };
#elif GMP_NUMB_BITS == 32
@@ -733,6 +797,8 @@ const mp_limb_t mpfr_l2b_17_1__tab[] = { 0xfa85abf562c4259b872000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x08, 0x70, 0x85 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x0800, 0x8570 };
#elif GMP_NUMB_BITS == 32
@@ -748,6 +814,8 @@ const mp_limb_t mpfr_l2b_18_0__tab[] = { 0x8570080000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_18_1__tab[] = { 0x98, 0x36, 0x78, 0x13, 0x37, 0x55, 0x34, 0x66, 0x91, 0xf5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_18_1__tab[] = { 0x3698, 0x1378, 0x5537, 0x6634, 0xf591 };
#elif GMP_NUMB_BITS == 32
@@ -763,6 +831,8 @@ const mp_limb_t mpfr_l2b_18_1__tab[] = { 0xf591663455371378369800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x06, 0xef, 0x87 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x0600, 0x87ef };
#elif GMP_NUMB_BITS == 32
@@ -778,6 +848,8 @@ const mp_limb_t mpfr_l2b_19_0__tab[] = { 0x87ef060000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_19_1__tab[] = { 0xb8, 0x0d, 0x8c, 0x55, 0xed, 0x62, 0xc0, 0x08, 0x0f, 0xf1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_19_1__tab[] = { 0x0db8, 0x558c, 0x62ed, 0x08c0, 0xf10f };
#elif GMP_NUMB_BITS == 32
@@ -793,6 +865,8 @@ const mp_limb_t mpfr_l2b_19_1__tab[] = { 0xf10f08c062ed558c0db800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x3e, 0x4d, 0x8a };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x3e00, 0x8a4d };
#elif GMP_NUMB_BITS == 32
@@ -808,6 +882,8 @@ const mp_limb_t mpfr_l2b_20_0__tab[] = { 0x8a4d3e0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_20_1__tab[] = { 0x40, 0x0b, 0x1c, 0xa7, 0xc1, 0x1c, 0x0a, 0x69, 0xee, 0xec };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_20_1__tab[] = { 0x0b40, 0xa71c, 0x1cc1, 0x690a, 0xecee };
#elif GMP_NUMB_BITS == 32
@@ -823,6 +899,8 @@ const mp_limb_t mpfr_l2b_20_1__tab[] = { 0xecee690a1cc1a71c0b4000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_21_0__tab[] = { 0xde, 0x8d, 0x8c };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_21_0__tab[] = { 0xde00, 0x8c8d };
#elif GMP_NUMB_BITS == 32
@@ -838,6 +916,8 @@ const mp_limb_t mpfr_l2b_21_0__tab[] = { 0x8c8dde0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_21_1__tab[] = { 0x08, 0x41, 0x26, 0x6b, 0xd0, 0xb3, 0xc1, 0x63, 0x22, 0xe9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_21_1__tab[] = { 0x4108, 0x6b26, 0xb3d0, 0x63c1, 0xe922 };
#elif GMP_NUMB_BITS == 32
@@ -853,6 +933,8 @@ const mp_limb_t mpfr_l2b_21_1__tab[] = { 0xe92263c1b3d06b26410800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_22_0__tab[] = { 0xaa, 0xb3, 0x8e };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_22_0__tab[] = { 0xaa00, 0x8eb3 };
#elif GMP_NUMB_BITS == 32
@@ -868,6 +950,8 @@ const mp_limb_t mpfr_l2b_22_0__tab[] = { 0x8eb3aa0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xe8, 0xdb, 0x61, 0xf0, 0xb9, 0x60, 0x4d, 0x2c, 0xa0, 0xe5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xdbe8, 0xf061, 0x60b9, 0x2c4d, 0xe5a0 };
#elif GMP_NUMB_BITS == 32
@@ -883,6 +967,8 @@ const mp_limb_t mpfr_l2b_22_1__tab[] = { 0xe5a02c4d60b9f061dbe800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x06, 0xc1, 0x90 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x0600, 0x90c1 };
#elif GMP_NUMB_BITS == 32
@@ -898,6 +984,8 @@ const mp_limb_t mpfr_l2b_23_0__tab[] = { 0x90c1060000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xe0, 0xc3, 0x6a, 0x58, 0xb9, 0x46, 0xdd, 0xca, 0x5e, 0xe2 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xc3e0, 0x586a, 0x46b9, 0xcadd, 0xe25e };
#elif GMP_NUMB_BITS == 32
@@ -913,6 +1001,8 @@ const mp_limb_t mpfr_l2b_23_1__tab[] = { 0xe25ecadd46b9586ac3e000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x04, 0xb8, 0x92 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x0400, 0x92b8 };
#elif GMP_NUMB_BITS == 32
@@ -928,6 +1018,8 @@ const mp_limb_t mpfr_l2b_24_0__tab[] = { 0x92b8040000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_24_1__tab[] = { 0x68, 0x36, 0x63, 0x72, 0xc6, 0xc7, 0x44, 0xbb, 0x56, 0xdf };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_24_1__tab[] = { 0x3668, 0x7263, 0xc7c6, 0xbb44, 0xdf56 };
#elif GMP_NUMB_BITS == 32
@@ -943,6 +1035,8 @@ const mp_limb_t mpfr_l2b_24_1__tab[] = { 0xdf56bb44c7c67263366800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x7a, 0x9a, 0x94 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x7a00, 0x949a };
#elif GMP_NUMB_BITS == 32
@@ -958,6 +1052,8 @@ const mp_limb_t mpfr_l2b_25_0__tab[] = { 0x949a7a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_25_1__tab[] = { 0xb8, 0x67, 0x28, 0x97, 0x7b, 0x28, 0x48, 0xa3, 0x81, 0xdc };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_25_1__tab[] = { 0x67b8, 0x9728, 0x287b, 0xa348, 0xdc81 };
#elif GMP_NUMB_BITS == 32
@@ -973,6 +1069,8 @@ const mp_limb_t mpfr_l2b_25_1__tab[] = { 0xdc81a348287b972867b800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x02, 0x6a, 0x96 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x0200, 0x966a };
#elif GMP_NUMB_BITS == 32
@@ -988,6 +1086,8 @@ const mp_limb_t mpfr_l2b_26_0__tab[] = { 0x966a020000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_26_1__tab[] = { 0x58, 0x64, 0xa4, 0x78, 0x83, 0x75, 0xf9, 0x19, 0xda, 0xd9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_26_1__tab[] = { 0x6458, 0x78a4, 0x7583, 0x19f9, 0xd9da };
#elif GMP_NUMB_BITS == 32
@@ -1003,6 +1103,8 @@ const mp_limb_t mpfr_l2b_26_1__tab[] = { 0xd9da19f9758378a4645800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x0a, 0x28, 0x98 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x0a00, 0x9828 };
#elif GMP_NUMB_BITS == 32
@@ -1018,6 +1120,8 @@ const mp_limb_t mpfr_l2b_27_0__tab[] = { 0x98280a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_27_1__tab[] = { 0x08, 0x5b, 0xbd, 0xe1, 0x37, 0xe2, 0xac, 0x7b, 0x5b, 0xd7 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_27_1__tab[] = { 0x5b08, 0xe1bd, 0xe237, 0x7bac, 0xd75b };
#elif GMP_NUMB_BITS == 32
@@ -1033,6 +1137,8 @@ const mp_limb_t mpfr_l2b_27_1__tab[] = { 0xd75b7bace237e1bd5b0800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_28_0__tab[] = { 0xda, 0xd5, 0x99 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_28_0__tab[] = { 0xda00, 0x99d5 };
#elif GMP_NUMB_BITS == 32
@@ -1048,6 +1154,8 @@ const mp_limb_t mpfr_l2b_28_0__tab[] = { 0x99d5da0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xb8, 0xde, 0xb8, 0xe8, 0xdf, 0x71, 0x58, 0xc7, 0x01, 0xd5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xdeb8, 0xe8b8, 0x71df, 0xc758, 0xd501 };
#elif GMP_NUMB_BITS == 32
@@ -1063,6 +1171,8 @@ const mp_limb_t mpfr_l2b_28_1__tab[] = { 0xd501c75871dfe8b8deb800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x96, 0x74, 0x9b };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9600, 0x9b74 };
#elif GMP_NUMB_BITS == 32
@@ -1078,6 +1188,8 @@ const mp_limb_t mpfr_l2b_29_0__tab[] = { 0x9b74960000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xc8, 0xcc, 0xb3, 0x62, 0x6c, 0x9c, 0x15, 0x83, 0xc9, 0xd2 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xccc8, 0x62b3, 0x9c6c, 0x8315, 0xd2c9 };
#elif GMP_NUMB_BITS == 32
@@ -1093,6 +1205,8 @@ const mp_limb_t mpfr_l2b_29_1__tab[] = { 0xd2c983159c6c62b3ccc800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x40, 0x05, 0x9d };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x4000, 0x9d05 };
#elif GMP_NUMB_BITS == 32
@@ -1108,6 +1222,8 @@ const mp_limb_t mpfr_l2b_30_0__tab[] = { 0x9d05400000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_30_1__tab[] = { 0x88, 0x35, 0x32, 0x17, 0xad, 0x5c, 0x19, 0xa6, 0xaf, 0xd0 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_30_1__tab[] = { 0x3588, 0x1732, 0x5cad, 0xa619, 0xd0af };
#elif GMP_NUMB_BITS == 32
@@ -1123,6 +1239,8 @@ const mp_limb_t mpfr_l2b_30_1__tab[] = { 0xd0afa6195cad1732358800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_31_0__tab[] = { 0xc8, 0x88, 0x9e };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_31_0__tab[] = { 0xc800, 0x9e88 };
#elif GMP_NUMB_BITS == 32
@@ -1138,6 +1256,8 @@ const mp_limb_t mpfr_l2b_31_0__tab[] = { 0x9e88c80000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_31_1__tab[] = { 0x78, 0xd5, 0xca, 0xf7, 0xee, 0x63, 0xe6, 0x86, 0xb1, 0xce };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xd578, 0xf7ca, 0x63ee, 0x86e6, 0xceb1 };
#elif GMP_NUMB_BITS == 32
@@ -1153,6 +1273,8 @@ const mp_limb_t mpfr_l2b_31_1__tab[] = { 0xceb186e663eef7cad57800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_32_0__tab[] = { 0x00, 0x00, 0xa0 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_32_0__tab[] = { 0x0000, 0xa000 };
#elif GMP_NUMB_BITS == 32
@@ -1168,6 +1290,8 @@ const mp_limb_t mpfr_l2b_32_0__tab[] = { 0xa000000000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xd0, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccd0, 0xcccc, 0xcccc, 0xcccc, 0xcccc };
#elif GMP_NUMB_BITS == 32
@@ -1183,6 +1307,8 @@ const mp_limb_t mpfr_l2b_32_1__tab[] = { 0xccccccccccccccccccd000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xae, 0x6b, 0xa1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xae00, 0xa16b };
#elif GMP_NUMB_BITS == 32
@@ -1198,6 +1324,8 @@ const mp_limb_t mpfr_l2b_33_0__tab[] = { 0xa16bae0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_33_1__tab[] = { 0x88, 0x08, 0x87, 0xa1, 0x04, 0x53, 0x04, 0x64, 0xff, 0xca };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_33_1__tab[] = { 0x0888, 0xa187, 0x5304, 0x6404, 0xcaff };
#elif GMP_NUMB_BITS == 32
@@ -1213,6 +1341,8 @@ const mp_limb_t mpfr_l2b_33_1__tab[] = { 0xcaff64045304a187088800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_34_0__tab[] = { 0x80, 0xcc, 0xa2 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_34_0__tab[] = { 0x8000, 0xa2cc };
#elif GMP_NUMB_BITS == 32
@@ -1228,6 +1358,8 @@ const mp_limb_t mpfr_l2b_34_0__tab[] = { 0xa2cc800000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_34_1__tab[] = { 0x50, 0xfb, 0xca, 0x17, 0x79, 0x5a, 0xd8, 0x73, 0x47, 0xc9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xfb50, 0x17ca, 0x5a79, 0x73d8, 0xc947 };
#elif GMP_NUMB_BITS == 32
@@ -1243,6 +1375,8 @@ const mp_limb_t mpfr_l2b_34_1__tab[] = { 0xc94773d85a7917cafb5000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_35_0__tab[] = { 0x18, 0x23, 0xa4 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_35_0__tab[] = { 0x1800, 0xa423 };
#elif GMP_NUMB_BITS == 32
@@ -1258,6 +1392,8 @@ const mp_limb_t mpfr_l2b_35_0__tab[] = { 0xa423180000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_35_1__tab[] = { 0x60, 0x69, 0xc2, 0x18, 0x37, 0x60, 0x7c, 0x56, 0xa3, 0xc7 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_35_1__tab[] = { 0x6960, 0x18c2, 0x6037, 0x567c, 0xc7a3 };
#elif GMP_NUMB_BITS == 32
@@ -1273,6 +1409,8 @@ const mp_limb_t mpfr_l2b_35_1__tab[] = { 0xc7a3567c603718c2696000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_36_0__tab[] = { 0x08, 0x70, 0xa5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_36_0__tab[] = { 0x0800, 0xa570 };
#elif GMP_NUMB_BITS == 32
@@ -1288,6 +1426,8 @@ const mp_limb_t mpfr_l2b_36_0__tab[] = { 0xa570080000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_36_1__tab[] = { 0x10, 0xff, 0xe9, 0xf9, 0x54, 0xe0, 0x36, 0x92, 0x11, 0xc6 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xff10, 0xf9e9, 0xe054, 0x9236, 0xc611 };
#elif GMP_NUMB_BITS == 32
@@ -1303,6 +1443,8 @@ const mp_limb_t mpfr_l2b_36_1__tab[] = { 0xc6119236e054f9e9ff1000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xd8, 0xb3, 0xa6 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xd800, 0xa6b3 };
#elif GMP_NUMB_BITS == 32
@@ -1318,6 +1460,8 @@ const mp_limb_t mpfr_l2b_37_0__tab[] = { 0xa6b3d80000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_37_1__tab[] = { 0x18, 0x16, 0x36, 0x6b, 0xd7, 0x70, 0xa2, 0xd3, 0x90, 0xc4 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_37_1__tab[] = { 0x1618, 0x6b36, 0x70d7, 0xd3a2, 0xc490 };
#elif GMP_NUMB_BITS == 32
@@ -1333,6 +1477,8 @@ const mp_limb_t mpfr_l2b_37_1__tab[] = { 0xc490d3a270d76b36161800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_38_0__tab[] = { 0x06, 0xef, 0xa7 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_38_0__tab[] = { 0x0600, 0xa7ef };
#elif GMP_NUMB_BITS == 32
@@ -1348,6 +1494,8 @@ const mp_limb_t mpfr_l2b_38_0__tab[] = { 0xa7ef060000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xe0, 0xa3, 0x05, 0x95, 0x82, 0x51, 0xd2, 0xe8, 0x1f, 0xc3 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xa3e0, 0x9505, 0x5182, 0xe8d2, 0xc31f };
#elif GMP_NUMB_BITS == 32
@@ -1363,6 +1511,8 @@ const mp_limb_t mpfr_l2b_38_1__tab[] = { 0xc31fe8d251829505a3e000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_39_0__tab[] = { 0x04, 0x22, 0xa9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_39_0__tab[] = { 0x0400, 0xa922 };
#elif GMP_NUMB_BITS == 32
@@ -1378,6 +1528,8 @@ const mp_limb_t mpfr_l2b_39_0__tab[] = { 0xa922040000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xf8, 0xfc, 0xb5, 0xf1, 0xca, 0x10, 0x32, 0xbd, 0xbd, 0xc1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xfcf8, 0xf1b5, 0x10ca, 0xbd32, 0xc1bd };
#elif GMP_NUMB_BITS == 32
@@ -1393,6 +1545,8 @@ const mp_limb_t mpfr_l2b_39_1__tab[] = { 0xc1bdbd3210caf1b5fcf800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_40_0__tab[] = { 0x3e, 0x4d, 0xaa };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_40_0__tab[] = { 0x3e00, 0xaa4d };
#elif GMP_NUMB_BITS == 32
@@ -1408,6 +1562,8 @@ const mp_limb_t mpfr_l2b_40_0__tab[] = { 0xaa4d3e0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xe8, 0xdc, 0x48, 0x49, 0xf7, 0xef, 0xff, 0x55, 0x69, 0xc0 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xdce8, 0x4948, 0xeff7, 0x55ff, 0xc069 };
#elif GMP_NUMB_BITS == 32
@@ -1423,6 +1579,8 @@ const mp_limb_t mpfr_l2b_40_1__tab[] = { 0xc06955ffeff74948dce800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_41_0__tab[] = { 0x12, 0x71, 0xab };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_41_0__tab[] = { 0x1200, 0xab71 };
#elif GMP_NUMB_BITS == 32
@@ -1438,6 +1596,8 @@ const mp_limb_t mpfr_l2b_41_0__tab[] = { 0xab71120000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_41_1__tab[] = { 0x28, 0xdc, 0xef, 0x7c, 0x95, 0xf6, 0x47, 0xcf, 0x21, 0xbf };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xdc28, 0x7cef, 0xf695, 0xcf47, 0xbf21 };
#elif GMP_NUMB_BITS == 32
@@ -1453,6 +1613,8 @@ const mp_limb_t mpfr_l2b_41_1__tab[] = { 0xbf21cf47f6957cefdc2800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xde, 0x8d, 0xac };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xde00, 0xac8d };
#elif GMP_NUMB_BITS == 32
@@ -1468,6 +1630,8 @@ const mp_limb_t mpfr_l2b_42_0__tab[] = { 0xac8dde0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_42_1__tab[] = { 0x10, 0xba, 0x25, 0x71, 0x9b, 0x93, 0x4a, 0x59, 0xe6, 0xbd };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xba10, 0x7125, 0x939b, 0x594a, 0xbde6 };
#elif GMP_NUMB_BITS == 32
@@ -1483,6 +1647,8 @@ const mp_limb_t mpfr_l2b_42_1__tab[] = { 0xbde6594a939b7125ba1000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xf6, 0xa3, 0xad };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xf600, 0xada3 };
#elif GMP_NUMB_BITS == 32
@@ -1498,6 +1664,8 @@ const mp_limb_t mpfr_l2b_43_0__tab[] = { 0xada3f60000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_43_1__tab[] = { 0x60, 0x95, 0xb5, 0x2a, 0x18, 0x91, 0x3d, 0x36, 0xb6, 0xbc };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_43_1__tab[] = { 0x9560, 0x2ab5, 0x9118, 0x363d, 0xbcb6 };
#elif GMP_NUMB_BITS == 32
@@ -1513,6 +1681,8 @@ const mp_limb_t mpfr_l2b_43_1__tab[] = { 0xbcb6363d91182ab5956000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaa, 0xb3, 0xae };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaa00, 0xaeb3 };
#elif GMP_NUMB_BITS == 32
@@ -1528,6 +1698,8 @@ const mp_limb_t mpfr_l2b_44_0__tab[] = { 0xaeb3aa0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_44_1__tab[] = { 0x90, 0x15, 0x90, 0x4e, 0x3d, 0x3a, 0x59, 0xb8, 0x90, 0xbb };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_44_1__tab[] = { 0x1590, 0x4e90, 0x3a3d, 0xb859, 0xbb90 };
#elif GMP_NUMB_BITS == 32
@@ -1543,6 +1715,8 @@ const mp_limb_t mpfr_l2b_44_1__tab[] = { 0xbb90b8593a3d4e90159000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_45_0__tab[] = { 0x44, 0xbd, 0xaf };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_45_0__tab[] = { 0x4400, 0xafbd };
#elif GMP_NUMB_BITS == 32
@@ -1558,6 +1732,8 @@ const mp_limb_t mpfr_l2b_45_0__tab[] = { 0xafbd440000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_45_1__tab[] = { 0x78, 0x1e, 0xf5, 0x76, 0x10, 0x10, 0x26, 0x40, 0x75, 0xba };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_45_1__tab[] = { 0x1e78, 0x76f5, 0x1010, 0x4026, 0xba75 };
#elif GMP_NUMB_BITS == 32
@@ -1573,6 +1749,8 @@ const mp_limb_t mpfr_l2b_45_1__tab[] = { 0xba754026101076f51e7800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_46_0__tab[] = { 0x06, 0xc1, 0xb0 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_46_0__tab[] = { 0x0600, 0xb0c1 };
#elif GMP_NUMB_BITS == 32
@@ -1588,6 +1766,8 @@ const mp_limb_t mpfr_l2b_46_0__tab[] = { 0xb0c1060000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_46_1__tab[] = { 0x70, 0xb6, 0x12, 0x05, 0xaa, 0x69, 0x01, 0x3b, 0x63, 0xb9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb670, 0x0512, 0x69aa, 0x3b01, 0xb963 };
#elif GMP_NUMB_BITS == 32
@@ -1603,6 +1783,8 @@ const mp_limb_t mpfr_l2b_46_1__tab[] = { 0xb9633b0169aa0512b67000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_47_0__tab[] = { 0x32, 0xbf, 0xb1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_47_0__tab[] = { 0x3200, 0xb1bf };
#elif GMP_NUMB_BITS == 32
@@ -1618,6 +1800,8 @@ const mp_limb_t mpfr_l2b_47_0__tab[] = { 0xb1bf320000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_47_1__tab[] = { 0x18, 0x51, 0x33, 0x41, 0xe4, 0xfb, 0xd0, 0x21, 0x5a, 0xb8 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_47_1__tab[] = { 0x5118, 0x4133, 0xfbe4, 0x21d0, 0xb85a };
#elif GMP_NUMB_BITS == 32
@@ -1633,6 +1817,8 @@ const mp_limb_t mpfr_l2b_47_1__tab[] = { 0xb85a21d0fbe44133511800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_48_0__tab[] = { 0x04, 0xb8, 0xb2 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_48_0__tab[] = { 0x0400, 0xb2b8 };
#elif GMP_NUMB_BITS == 32
@@ -1648,6 +1834,8 @@ const mp_limb_t mpfr_l2b_48_0__tab[] = { 0xb2b8040000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_48_1__tab[] = { 0x90, 0x04, 0x3d, 0x66, 0x0d, 0x96, 0xde, 0x77, 0x59, 0xb7 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_48_1__tab[] = { 0x0490, 0x663d, 0x960d, 0x77de, 0xb759 };
#elif GMP_NUMB_BITS == 32
@@ -1663,6 +1851,8 @@ const mp_limb_t mpfr_l2b_48_1__tab[] = { 0xb75977de960d663d049000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb4, 0xab, 0xb3 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb400, 0xb3ab };
#elif GMP_NUMB_BITS == 32
@@ -1678,6 +1868,8 @@ const mp_limb_t mpfr_l2b_49_0__tab[] = { 0xb3abb40000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_49_1__tab[] = { 0xb8, 0x37, 0x11, 0xa7, 0x4d, 0x75, 0xd6, 0xc9, 0x60, 0xb6 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_49_1__tab[] = { 0x37b8, 0xa711, 0x754d, 0xc9d6, 0xb660 };
#elif GMP_NUMB_BITS == 32
@@ -1693,6 +1885,8 @@ const mp_limb_t mpfr_l2b_49_1__tab[] = { 0xb660c9d6754da71137b800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_50_0__tab[] = { 0x7a, 0x9a, 0xb4 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_50_0__tab[] = { 0x7a00, 0xb49a };
#elif GMP_NUMB_BITS == 32
@@ -1708,6 +1902,8 @@ const mp_limb_t mpfr_l2b_50_0__tab[] = { 0xb49a7a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_50_1__tab[] = { 0xf0, 0x27, 0x32, 0xe5, 0x44, 0x73, 0xe3, 0xac, 0x6f, 0xb5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_50_1__tab[] = { 0x27f0, 0xe532, 0x7344, 0xace3, 0xb56f };
#elif GMP_NUMB_BITS == 32
@@ -1723,6 +1919,8 @@ const mp_limb_t mpfr_l2b_50_1__tab[] = { 0xb56face37344e53227f000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_51_0__tab[] = { 0x84, 0x84, 0xb5 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_51_0__tab[] = { 0x8400, 0xb584 };
#elif GMP_NUMB_BITS == 32
@@ -1738,6 +1936,8 @@ const mp_limb_t mpfr_l2b_51_0__tab[] = { 0xb584840000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_51_1__tab[] = { 0x00, 0x40, 0xa9, 0xe9, 0x8a, 0x0f, 0xe5, 0xbd, 0x85, 0xb4 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_51_1__tab[] = { 0x4000, 0xe9a9, 0x0f8a, 0xbde5, 0xb485 };
#elif GMP_NUMB_BITS == 32
@@ -1753,6 +1953,8 @@ const mp_limb_t mpfr_l2b_51_1__tab[] = { 0xb485bde50f8ae9a9400000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_52_0__tab[] = { 0x02, 0x6a, 0xb6 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_52_0__tab[] = { 0x0200, 0xb66a };
#elif GMP_NUMB_BITS == 32
@@ -1768,6 +1970,8 @@ const mp_limb_t mpfr_l2b_52_0__tab[] = { 0xb66a020000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_52_1__tab[] = { 0x08, 0x46, 0xb3, 0xfc, 0xcf, 0xee, 0xbb, 0xa0, 0xa2, 0xb3 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_52_1__tab[] = { 0x4608, 0xfcb3, 0xeecf, 0xa0bb, 0xb3a2 };
#elif GMP_NUMB_BITS == 32
@@ -1783,6 +1987,8 @@ const mp_limb_t mpfr_l2b_52_1__tab[] = { 0xb3a2a0bbeecffcb3460800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_53_0__tab[] = { 0x20, 0x4b, 0xb7 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_53_0__tab[] = { 0x2000, 0xb74b };
#elif GMP_NUMB_BITS == 32
@@ -1798,6 +2004,8 @@ const mp_limb_t mpfr_l2b_53_0__tab[] = { 0xb74b200000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_53_1__tab[] = { 0x60, 0xa3, 0xcb, 0x8c, 0x5f, 0xeb, 0xa9, 0xff, 0xc5, 0xb2 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xa360, 0x8ccb, 0xeb5f, 0xffa9, 0xb2c5 };
#elif GMP_NUMB_BITS == 32
@@ -1813,6 +2021,8 @@ const mp_limb_t mpfr_l2b_53_1__tab[] = { 0xb2c5ffa9eb5f8ccba36000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_54_0__tab[] = { 0x0a, 0x28, 0xb8 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_54_0__tab[] = { 0x0a00, 0xb828 };
#elif GMP_NUMB_BITS == 32
@@ -1828,6 +2038,8 @@ const mp_limb_t mpfr_l2b_54_0__tab[] = { 0xb8280a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_54_1__tab[] = { 0x68, 0xf3, 0x40, 0xe9, 0x86, 0x3e, 0xc3, 0x8a, 0xef, 0xb1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xf368, 0xe940, 0x3e86, 0x8ac3, 0xb1ef };
#elif GMP_NUMB_BITS == 32
@@ -1843,6 +2055,8 @@ const mp_limb_t mpfr_l2b_54_1__tab[] = { 0xb1ef8ac33e86e940f36800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xe8, 0x00, 0xb9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xe800, 0xb900 };
#elif GMP_NUMB_BITS == 32
@@ -1858,6 +2072,8 @@ const mp_limb_t mpfr_l2b_55_0__tab[] = { 0xb900e80000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_55_1__tab[] = { 0x40, 0x7a, 0x8e, 0xd1, 0xb5, 0xa4, 0x6e, 0xf7, 0x1e, 0xb1 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_55_1__tab[] = { 0x7a40, 0xd18e, 0xa4b5, 0xf76e, 0xb11e };
#elif GMP_NUMB_BITS == 32
@@ -1873,6 +2089,8 @@ const mp_limb_t mpfr_l2b_55_1__tab[] = { 0xb11ef76ea4b5d18e7a4000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xda, 0xd5, 0xb9 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xda00, 0xb9d5 };
#elif GMP_NUMB_BITS == 32
@@ -1888,6 +2106,8 @@ const mp_limb_t mpfr_l2b_56_0__tab[] = { 0xb9d5da0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_56_1__tab[] = { 0x18, 0xe8, 0x7b, 0x4c, 0x2c, 0xaa, 0xf2, 0xff, 0x53, 0xb0 };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xe818, 0x4c7b, 0xaa2c, 0xfff2, 0xb053 };
#elif GMP_NUMB_BITS == 32
@@ -1903,6 +2123,8 @@ const mp_limb_t mpfr_l2b_56_1__tab[] = { 0xb053fff2aa2c4c7be81800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_57_0__tab[] = { 0x0a, 0xa7, 0xba };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_57_0__tab[] = { 0x0a00, 0xbaa7 };
#elif GMP_NUMB_BITS == 32
@@ -1918,6 +2140,8 @@ const mp_limb_t mpfr_l2b_57_0__tab[] = { 0xbaa70a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xb0, 0xef, 0x4f, 0x81, 0x2f, 0x8e, 0x0e, 0x63, 0x8e, 0xaf };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xefb0, 0x814f, 0x8e2f, 0x630e, 0xaf8e };
#elif GMP_NUMB_BITS == 32
@@ -1933,6 +2157,8 @@ const mp_limb_t mpfr_l2b_57_1__tab[] = { 0xaf8e630e8e2f814fefb000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_58_0__tab[] = { 0x96, 0x74, 0xbb };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_58_0__tab[] = { 0x9600, 0xbb74 };
#elif GMP_NUMB_BITS == 32
@@ -1948,6 +2174,8 @@ const mp_limb_t mpfr_l2b_58_0__tab[] = { 0xbb74960000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_58_1__tab[] = { 0x18, 0x5d, 0xa1, 0x41, 0x14, 0x61, 0x9d, 0xe3, 0xcd, 0xae };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_58_1__tab[] = { 0x5d18, 0x41a1, 0x6114, 0xe39d, 0xaecd };
#elif GMP_NUMB_BITS == 32
@@ -1963,6 +2191,8 @@ const mp_limb_t mpfr_l2b_58_1__tab[] = { 0xaecde39d611441a15d1800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_59_0__tab[] = { 0x9e, 0x3e, 0xbc };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_59_0__tab[] = { 0x9e00, 0xbc3e };
#elif GMP_NUMB_BITS == 32
@@ -1978,6 +2208,8 @@ const mp_limb_t mpfr_l2b_59_0__tab[] = { 0xbc3e9e0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_59_1__tab[] = { 0x00, 0xd0, 0xdf, 0x97, 0x97, 0x2f, 0x42, 0x48, 0x12, 0xae };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xd000, 0x97df, 0x2f97, 0x4842, 0xae12 };
#elif GMP_NUMB_BITS == 32
@@ -1993,6 +2225,8 @@ const mp_limb_t mpfr_l2b_59_1__tab[] = { 0xae1248422f9797dfd00000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_60_0__tab[] = { 0x40, 0x05, 0xbd };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_60_0__tab[] = { 0x4000, 0xbd05 };
#elif GMP_NUMB_BITS == 32
@@ -2008,6 +2242,8 @@ const mp_limb_t mpfr_l2b_60_0__tab[] = { 0xbd05400000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_60_1__tab[] = { 0x58, 0xfe, 0x6d, 0x20, 0x55, 0x35, 0x1c, 0x5b, 0x5b, 0xad };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xfe58, 0x206d, 0x3555, 0x5b1c, 0xad5b };
#elif GMP_NUMB_BITS == 32
@@ -2023,6 +2259,8 @@ const mp_limb_t mpfr_l2b_60_1__tab[] = { 0xad5b5b1c3555206dfe5800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_61_0__tab[] = { 0x9a, 0xc8, 0xbd };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_61_0__tab[] = { 0x9a00, 0xbdc8 };
#elif GMP_NUMB_BITS == 32
@@ -2038,6 +2276,8 @@ const mp_limb_t mpfr_l2b_61_0__tab[] = { 0xbdc89a0000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_61_1__tab[] = { 0xf8, 0x4d, 0x57, 0x77, 0xcb, 0x31, 0x82, 0xe9, 0xa8, 0xac };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_61_1__tab[] = { 0x4df8, 0x7757, 0x31cb, 0xe982, 0xaca8 };
#elif GMP_NUMB_BITS == 32
@@ -2053,6 +2293,8 @@ const mp_limb_t mpfr_l2b_61_1__tab[] = { 0xaca8e98231cb77574df800000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xc8, 0x88, 0xbe };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xc800, 0xbe88 };
#elif GMP_NUMB_BITS == 32
@@ -2068,6 +2310,8 @@ const mp_limb_t mpfr_l2b_62_0__tab[] = { 0xbe88c80000000000000000000000000000000
#endif
#if 0
+#elif GMP_NUMB_BITS == 8
+const mp_limb_t mpfr_l2b_62_1__tab[] = { 0xf8, 0x74, 0x05, 0xf9, 0x31, 0x18, 0xc4, 0xc3, 0xfa, 0xab };
#elif GMP_NUMB_BITS == 16
const mp_limb_t mpfr_l2b_62_1__tab[] = { 0x74f8, 0xf905, 0x1831, 0xc3c4, 0xabfa };
#elif GMP_NUMB_BITS == 32
@@ -2229,6 +2473,78 @@ mpfr_ceil_mul (mpfr_exp_t e, int beta, int i)
return r;
}
+/* take at least 1 + ceil(p*log(2)/log(b)) digits, where p is the
+ number of bits of the mantissa, to ensure back conversion from
+ the output gives the same floating-point.
+
+ Warning: if b = 2^k, this may be too large. The worst case is when
+ the first base-b digit contains only one bit, so we take
+ 1 + ceil((p-1)/k) instead.
+*/
+size_t
+mpfr_get_str_ndigits (int b, mpfr_prec_t p)
+{
+ MPFR_ASSERTN (2 <= b && b <= 62);
+
+ /* deal first with power of two bases, since even for those, mpfr_ceil_mul
+ might return a value too large by 1 */
+ if (IS_POW2(b)) /* 1 + ceil((p-1)/k) = 2 + floor((p-2)/k) */
+ {
+ int k;
+
+ count_leading_zeros (k, (mp_limb_t) b);
+ k = GMP_NUMB_BITS - k - 1; /* now b = 2^k */
+ return 1 + (p + k - 2) / k;
+ }
+
+ /* the value returned by mpfr_ceil_mul is guaranteed to be
+ 1 + ceil(p*log(2)/log(b)) for p < 186564318007 (it returns one more
+ for p=186564318007 and b=7 or 49) */
+ MPFR_STAT_STATIC_ASSERT (MPFR_PREC_BITS >= 64 || MPFR_PREC_BITS <= 32);
+#if MPFR_PREC_BITS >= 64
+ /* 64-bit numbers are supported by the C implementation, so that we can
+ use the large constant below. If MPFR_PREC_BITS <= 32, the condition
+ is always satisfied, so that we do not need any test. */
+ if (MPFR_LIKELY (p < 186564318007))
+#endif
+ return 1 + mpfr_ceil_mul (IS_POW2(b) ? p - 1 : p, b, 1);
+
+ /* Now p is large and b is not a power of two. The code below works for any
+ value of p and b, as long as b is not a power of two. Indeed, in such a
+ case, p*log(2)/log(b) cannot be exactly an integer, and thus Ziv's loop
+ will terminate. */
+ {
+ mpfr_prec_t w = 77; /* mpfr_ceil_mul used a 77-bit upper approximation of
+ log(2)/log(b) */
+ mpfr_t d, u;
+ size_t ret = 0;
+ while (ret == 0)
+ {
+ w = 2 * w;
+ mpfr_init2 (d, w); /* lower approximation */
+ mpfr_init2 (u, w); /* upper approximation */
+ mpfr_set_ui (d, b, MPFR_RNDU);
+ mpfr_set_ui (u, b, MPFR_RNDD);
+ mpfr_log2 (d, d, MPFR_RNDU);
+ mpfr_log2 (u, u, MPFR_RNDD);
+ /* The code below requires that the precision fit in an unsigned long,
+ which we currently guarantee (see _MPFR_PREC_FORMAT). */
+ MPFR_STAT_STATIC_ASSERT (MPFR_PREC_MAX <= ULONG_MAX);
+ /* u <= log(b)/log(2) <= d (***) */
+ mpfr_ui_div (d, p, d, MPFR_RNDD);
+ mpfr_ui_div (u, p, u, MPFR_RNDU);
+ /* d <= p*log(2)/log(b) <= u */
+ mpfr_ceil (d, d);
+ mpfr_ceil (u, u);
+ if (mpfr_cmp (d, u) == 0)
+ ret = mpfr_get_ui (d, MPFR_RNDU);
+ mpfr_clear (d);
+ mpfr_clear (u);
+ }
+ return 1 + ret;
+ }
+}
+
/* prints the mantissa of x in the string s, and writes the corresponding
exponent in e.
x is rounded with direction rnd, m is the number of digits of the mantissa,
@@ -2243,7 +2559,7 @@ mpfr_ceil_mul (mpfr_exp_t e, int beta, int i)
Important: when you call this function with s=NULL, don't forget to free
the memory space allocated, with mpfr_free_str.
*/
-char*
+char *
mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
mpfr_rnd_t rnd)
{
@@ -2314,19 +2630,7 @@ mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
MPFR_SAVE_EXPO_MARK (expo); /* needed for mpfr_ceil_mul (at least) */
if (m == 0)
- {
-
- /* take at least 1 + ceil(n*log(2)/log(b)) digits, where n is the
- number of bits of the mantissa, to ensure back conversion from
- the output gives the same floating-point.
-
- Warning: if b = 2^k, this may be too large. The worst case is when
- the first base-b digit contains only one bit, so we get
- 1 + ceil((n-1)/k) = 2 + floor((n-2)/k) instead.
- */
- m = 1 +
- mpfr_ceil_mul (IS_POW2(b) ? MPFR_PREC(x) - 1 : MPFR_PREC(x), b, 1);
- }
+ m = mpfr_get_str_ndigits (b, MPFR_PREC(x));
MPFR_LOG_MSG (("m=%zu\n", m));
@@ -2361,7 +2665,7 @@ mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
int inexp;
count_leading_zeros (pow2, (mp_limb_t) b);
- pow2 = GMP_NUMB_BITS - pow2 - 1; /* base = 2^pow2 */
+ pow2 = GMP_NUMB_BITS - pow2 - 1; /* b = 2^pow2 */
/* set MPFR_EXP(x) = f*pow2 + r, 1 <= r <= pow2 */
f = (MPFR_GET_EXP (x) - 1) / pow2;
@@ -2430,6 +2734,7 @@ mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
g = mpfr_ceil_mul (MPFR_GET_EXP (x) - 1, b, 1);
exact = 1;
+ /* prec is the radix-2 precision necessary to get m digits in radix b */
prec = mpfr_ceil_mul (m, b, 0) + 1;
exp = ((mpfr_exp_t) m < g) ? g - (mpfr_exp_t) m : (mpfr_exp_t) m - g;
prec += MPFR_INT_CEIL_LOG2 (prec); /* number of guard bits */
@@ -2473,7 +2778,7 @@ mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
x1 = (nx >= n) ? xp + nx - n : xp;
nx1 = (nx >= n) ? n : nx; /* nx1 = min(n, nx) */
- /* test si exact */
+ /* test if exact */
if (nx > n)
exact = (exact &&
((mpn_scan1 (xp, 0) >= (nx - n) * GMP_NUMB_BITS)));
@@ -2499,7 +2804,7 @@ mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
else
MPN_COPY (a, result + nx1, n);
}
- else
+ else /* m < g: divide by b^exp */
{
mp_limb_t *x1;
@@ -2508,15 +2813,23 @@ mpfr_get_str (char *s, mpfr_exp_t *e, int b, size_t m, mpfr_srcptr x,
exact = (err == -1);
/* allocate memory for x1, result and reste */
- x1 = MPFR_TMP_LIMBS_ALLOC (2 * n);
result = MPFR_TMP_LIMBS_ALLOC (n + 1);
reste = MPFR_TMP_LIMBS_ALLOC (n);
- /* initialize x1 = x */
- MPN_COPY2 (x1, 2 * n, xp, nx);
- if ((exact) && (nx > 2 * n) &&
- (mpn_scan1 (xp, 0) < (nx - 2 * n) * GMP_NUMB_BITS))
- exact = 0;
+ if (2 * n <= nx)
+ {
+ x1 = xp + nx - 2 * n;
+ /* we ignored the low nx - 2 * n limbs from x */
+ if (exact && mpn_scan1 (xp, 0) < (nx - 2 * n) * GMP_NUMB_BITS)
+ exact = 0;
+ }
+ else
+ {
+ /* copy the nx most significant limbs of x into those of x1 */
+ x1 = MPFR_TMP_LIMBS_ALLOC (2 * n);
+ MPN_ZERO (x1, 2 * n - nx);
+ MPN_COPY (x1 + 2 * n - nx, xp, nx);
+ }
/* result = x / a */
mpn_tdiv_qr (result, reste, 0, x1, 2 * n, a, n);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_ui.c b/Build/source/libs/mpfr/mpfr-src/src/get_ui.c
index 2288e73f4e9..3bed73c8586 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_ui.c
@@ -1,6 +1,6 @@
/* mpfr_get_ui -- convert a floating-point number to an unsigned long.
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -56,14 +56,24 @@ mpfr_get_ui (mpfr_srcptr f, mpfr_rnd_t rnd)
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
/* warning: if x=0, taking its exponent is illegal */
- if (MPFR_IS_ZERO(x))
- s = 0;
- else
+ if (MPFR_NOTZERO (x))
{
- /* 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] >> (GMP_NUMB_BITS - exp);
+ exp = MPFR_GET_EXP (x);
+ MPFR_ASSERTD (exp >= 1); /* since |x| >= 1 */
+ n = MPFR_LIMB_SIZE (x);
+#ifdef MPFR_LONG_WITHIN_LIMB
+ MPFR_ASSERTD (exp <= GMP_NUMB_BITS);
+#else
+ while (exp > GMP_NUMB_BITS)
+ {
+ MPFR_ASSERTD (n > 0);
+ s += (unsigned long) MPFR_MANT(x)[n - 1] << (exp - GMP_NUMB_BITS);
+ n--;
+ exp -= GMP_NUMB_BITS;
+ }
+#endif
+ MPFR_ASSERTD (n > 0);
+ s += MPFR_MANT(x)[n - 1] >> (GMP_NUMB_BITS - exp);
}
mpfr_clear (x);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_uj.c b/Build/source/libs/mpfr/mpfr-src/src/get_uj.c
index 5f1c9168758..ca6c16829ee 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_uj.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_uj.c
@@ -1,6 +1,6 @@
/* mpfr_get_uj -- convert a MPFR number to a huge machine unsigned integer
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,11 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
#ifdef _MPFR_H_HAVE_INTMAX_T
@@ -41,14 +37,14 @@ mpfr_get_uj (mpfr_srcptr f, mpfr_rnd_t rnd)
{
MPFR_SET_ERANGEFLAG ();
return MPFR_IS_NAN (f) || MPFR_IS_NEG (f) ?
- (uintmax_t) 0 : MPFR_UINTMAX_MAX;
+ (uintmax_t) 0 : UINTMAX_MAX;
}
if (MPFR_IS_ZERO (f))
return (uintmax_t) 0;
/* determine the precision of uintmax_t */
- for (r = MPFR_UINTMAX_MAX, prec = 0; r != 0; r /= 2, prec++)
+ for (r = UINTMAX_MAX, prec = 0; r != 0; r /= 2, prec++)
{ }
MPFR_ASSERTD (r == 0);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_z.c b/Build/source/libs/mpfr/mpfr-src/src/get_z.c
index 3366d7eed06..ce55183f0d2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_z.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_z.c
@@ -1,7 +1,7 @@
/* mpfr_get_z -- get a multiple-precision integer from
a floating-point number
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/get_z_exp.c b/Build/source/libs/mpfr/mpfr-src/src/get_z_exp.c
index 1d2135abc9b..eda94e4c8a2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/get_z_exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/get_z_exp.c
@@ -1,7 +1,7 @@
/* mpfr_get_z_2exp -- get a multiple-precision integer and an exponent
from a floating-point number
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -39,6 +39,15 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
* for consistency. The erange flag is set.
*/
+/* MPFR_LARGE_EXP can be defined when mpfr_exp_t is guaranteed to have
+ at least 64 bits (in a portable way). */
+#if GMP_NUMB_BITS >= 64
+/* Now, we know that the constant below is supported by the compiler. */
+# if _MPFR_EXP_FORMAT >= 3 && LONG_MAX >= 9223372036854775807
+# define MPFR_LARGE_EXP 1
+# endif
+#endif
+
mpfr_exp_t
mpfr_get_z_2exp (mpz_ptr z, mpfr_srcptr f)
{
@@ -70,6 +79,10 @@ mpfr_get_z_2exp (mpz_ptr z, mpfr_srcptr f)
SIZ(z) = MPFR_IS_NEG (f) ? -fn : fn;
+#ifndef MPFR_LARGE_EXP
+ /* If mpfr_exp_t has 64 bits, then MPFR_GET_EXP(f) >= MPFR_EMIN_MIN = 1-2^62
+ and MPFR_EXP_MIN <= 1-2^63, thus the following implies PREC(f) > 2^62,
+ which is impossible due to memory constraints. */
if (MPFR_UNLIKELY ((mpfr_uexp_t) MPFR_GET_EXP (f) - MPFR_EXP_MIN
< (mpfr_uexp_t) MPFR_PREC (f)))
{
@@ -77,6 +90,7 @@ mpfr_get_z_2exp (mpz_ptr z, mpfr_srcptr f)
MPFR_SET_ERANGEFLAG ();
return MPFR_EXP_MIN;
}
+#endif
return MPFR_GET_EXP (f) - MPFR_PREC (f);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/gmp_op.c b/Build/source/libs/mpfr/mpfr-src/src/gmp_op.c
index b794e23dc5a..74cbec14d8b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/gmp_op.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/gmp_op.c
@@ -1,6 +1,6 @@
/* Implementations of operations between mpfr and mpz/mpq data
-Copyright 2001, 2003-2019 Free Software Foundation, Inc.
+Copyright 2001, 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -152,7 +152,15 @@ mpfr_cmp_z (mpfr_srcptr x, mpz_srcptr z)
flags = __gmpfr_flags;
if (mpfr_set_z (t, z, MPFR_RNDN))
{
- /* overflow (t is an infinity) or underflow */
+ /* overflow (t is an infinity) or underflow: z does not fit in the
+ current exponent range.
+ If overflow, then z is larger than the largest *integer* < +Inf
+ (if z > 0), thus we get t = +Inf (or -Inf), and the value of
+ mpfr_cmp (x, t) below is correct.
+ If underflow, then z is smaller than the smallest number > 0,
+ which is necessarily an integer, say xmin.
+ If z > xmin/2, then t is xmin, and we divide t by 2 to ensure t
+ is zero, and then the value of mpfr_cmp (x, t) below is correct. */
mpfr_div_2ui (t, t, 2, MPFR_RNDZ); /* if underflow, set t to zero */
__gmpfr_flags = flags; /* restore the flags */
/* The real value of t (= z), which falls outside the exponent range,
@@ -452,6 +460,9 @@ mpfr_cmp_q (mpfr_srcptr x, mpq_srcptr q)
mpfr_prec_t p;
MPFR_SAVE_EXPO_DECL (expo);
+ /* GMP allows the user to set the denominator to 0. This is interpreted
+ by MPFR as the value being an infinity or NaN (probably better than
+ an assertion failure). */
if (MPFR_UNLIKELY (mpz_sgn (mpq_denref (q)) == 0))
{
/* q is an infinity or NaN */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/grandom.c b/Build/source/libs/mpfr/mpfr-src/src/grandom.c
index 37f58cdc85a..03e1b49edaf 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/grandom.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/grandom.c
@@ -3,7 +3,7 @@
distribution and round it to the precision of rop1, rop2 according
to the given rounding mode.
-Copyright 2011-2019 Free Software Foundation, Inc.
+Copyright 2011-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -40,13 +40,9 @@ mpfr_grandom (mpfr_ptr rop1, mpfr_ptr rop2, gmp_randstate_t rstate,
inex2 = inex1 = 0;
if (rop2 == NULL) /* only one output requested. */
- {
- tprec0 = MPFR_PREC (rop1);
- }
+ tprec0 = MPFR_PREC (rop1);
else
- {
- tprec0 = MAX (MPFR_PREC (rop1), MPFR_PREC (rop2));
- }
+ tprec0 = MAX (MPFR_PREC (rop1), MPFR_PREC (rop2));
tprec0 += 11;
@@ -87,21 +83,29 @@ mpfr_grandom (mpfr_ptr rop1, mpfr_ptr rop2, gmp_randstate_t rstate,
mpz_mul (b, yp, yp);
mpz_add (s, a, b);
}
- while (mpz_sizeinbase (s, 2) > tprec * 2); /* x^2 + y^2 <= 2^{2tprec} */
+ while (mpz_sizeinbase (s, 2) > tprec * 2);
+
+ /* now s = x^2 + y^2 < 2^{2tprec} */
for (;;)
{
- /* FIXME: compute s as s += 2x + 2y + 2 */
- mpz_add_ui (a, xp, 1);
- mpz_add_ui (b, yp, 1);
- mpz_mul (a, a, a);
- mpz_mul (b, b, b);
- mpz_add (s, a, b);
- if ((mpz_sizeinbase (s, 2) <= 2 * tprec) ||
- ((mpz_sizeinbase (s, 2) == 2 * tprec + 1) &&
- (mpz_scan1 (s, 0) == 2 * tprec)))
+ /* we compute (xp+1)^2 + (yp+1)^2 as s + 2xp + 2yp + 2 */
+ mpz_addmul_ui (s, xp, 2);
+ mpz_addmul_ui (s, yp, 2);
+ mpz_add_ui (s, s, 2);
+ /* The case s = 2^(2*tprec) is not possible:
+ (a) if xp and yp have different parities, s is odd
+ (b) if xp and yp are even, (xp+1)^2 and (yp+1)^2 are 1 mod 4,
+ thus s = 2 mod 4 (and tprec >= 1);
+ (c) if xp and yp are odd, if we note x = xp+1, y = yp+1 and
+ p = tprec, we would have x^2 + y^2 = 2^(2p) with x and y even
+ 0 < x, y <= 2^p, thus if x' = x/2, y' = y/2 and p'=p-1,
+ we would have x'^2 + y'^2 = 2^(2p') with
+ 0 < x', y' <= 2^p', and we conclude by induction. */
+ if (mpz_sizeinbase (s, 2) <= 2 * tprec)
goto yeepee;
- /* Extend by 32 bits */
+ /* Extend by 32 bits: for tprec=12, the probability we get here
+ is 8191/13180825, i.e., about 0.000621 */
mpz_mul_2exp (xp, xp, 32);
mpz_mul_2exp (yp, yp, 32);
mpz_urandomb (x, rstate, 32);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/hppa/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/hppa/mparam.h
deleted file mode 100644
index e7024eb6cc7..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/hppa/mparam.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.3.2 */
-/* generated on gcc61.fsffrance.org (HP PA-8600) with GMP 5.0.2 */
-
-
-#define MPFR_MULHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,48,47,48,47,48,47,48,47, \
- 48,47,64,63,64,63,64,63,64,63,64,63,64,63,64,63, \
- 64,63,64,63,64,63,64,63,64,63,64,63,64,63,64,63, \
- 64,63,64,72,64,72,64,93,64,93,64,93,92,93,92,93, \
- 92,93,92,93,92,93,92,93,92,93,92,93,92,93,92,93, \
- 92,93,92,93,105,93,105,93,105,93,105,93,105,105,105,108, \
- 105,105,105,105,108,105,105,105,108,108,108,117,108,117,108,141, \
- 140,141,140,141,140,141,140,141,140,141,140,141,140,141,140,141, \
- 140,141,140,141,140,141,140,141,140,141,140,141,140,141,140,141, \
- 140,141,140,141,140,141,140,141,141,153,140,141,140,141,140,140, \
- 144,140,140,141,140,139,140,141,140,141,140,141,188,188,188,187, \
- 188,187,188,188,188,188,188,188,188,188,188,188,188,188,188,187, \
- 187,187,188,188,188,188,188,188,210,188,210,188,188,210,188,188, \
- 188,188,188,188,188,188,188,188,188,188,186,188,210,188,188,187, \
- 188,188,210,210,210,210,210,210,210,210,210,210,210,210,210,210, \
- 210,210,210,210,210,210,210,208,210,209,210,210,210,210,210,233, \
- 234,234,234,233,232,234,234,234,234,234,234,234,234,234,234,276, \
- 234,276,234,276,234,276,276,276,276,276,276,276,282,276,282,276, \
- 282,276,276,276,276,276,282,281,276,276,276,276,276,276,276,276, \
- 276,276,276,276,276,276,282,276,282,276,282,276,282,281,282,281, \
- 282,281,282,281,282,281,282,281,282,281,282,306,282,306,282,306, \
- 306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306, \
- 306,372,306,371,306,372,372,372,372,372,372,371,372,372,372,372, \
- 372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, \
- 372,371,372,372,372,372,372,372,372,372,372,372,372,372,372,372, \
- 372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, \
- 372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, \
- 372,372,372,372,372,372,372,372,372,372,372,372,372,372,372,372, \
- 372,372,372,372,372,372,372,372,426,372,426,426,426,426,426,426, \
- 426,426,426,426,426,425,426,425,426,426,426,426,426,426,426,426, \
- 426,426,426,426,426,424,426,426,426,426,426,426,426,426,426,426, \
- 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
- 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,503, \
- 504,503,504,503,504,503,504,503,504,503,504,503,504,503,504,503, \
- 504,503,504,503,504,503,504,503,502,503,504,503,504,503,504,503, \
- 504,496,504,503,504,503,504,503,504,503,504,503,504,503,504,503, \
- 504,503,504,503,504,503,504,503,504,503,568,568,568,568,568,568, \
- 568,567,568,568,568,567,568,567,568,567,568,568,568,567,568,568, \
- 568,568,568,568,568,567,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,567,568,568,568,568,568,567,568,567,568,568,568,567, \
- 568,567,568,567,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,567,568,568,568,568,568,568,632,568,568,568,568,631,568,568, \
- 568,568,568,568,568,567,568,567,568,568,568,568,632,632,632,631, \
- 632,631,632,631,632,632,632,631,632,632,632,631,632,632,632,728, \
- 728,727,728,727,728,728,728,727,728,727,728,727,728,727,728,728, \
- 728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728, \
- 728,728,728,728,728,728,728,728,728,728,728,728,728,728,728,728, \
- 728,752,728,752,728,752,728,752,752,752,728,752,752,752,752,752, \
- 752,752,752,752,752,752,752,752,752,752,752,752,752,751,752,751, \
- 752,751,752,751,728,728,728,728,752,728,728,728,728,728,728,728, \
- 728,752,832,751,832,752,832,752,832,752,832,752,832,752,832,751, \
- 832,831,832,752,832,831,832,832,832,832,832,832,832,824,832,832, \
- 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
- 832,832,832,832,832,832,832,831,832,831,832,831,832,831,832,831, \
- 832,831,832,832,832,831,832,831,832,831,832,831,832,831,832,831, \
- 832,832,832,831,832,832,832,832,832,831,832,832,832,832,832,832 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,7,0,8,9,9, \
- 10,10,11,11,12,13,14,13,14,15,16,15,16,17,18,17, \
- 18,19,20,19,20,21,22,21,22,23,24,23,24,25,26,25, \
- 26,27,28,27,28,29,30,29,30,31,32,31,32,33,34,33, \
- 34,35,36,35,36,37,38,37,38,39,40,39,40,41,42,41, \
- 42,43,44,43,44,47,48,47,48,47,48,47,48,51,52,51, \
- 52,51,52,51,56,55,56,55,56,55,56,59,60,59,60,59, \
- 60,63,60,63,64,63,64,63,68,63,68,67,68,67,68,71, \
- 68,71,72,71,72,71,72,75,76,75,76,75,76,79,80,79, \
- 80,79,80,75,76,83,84,79,80,79,80,79,80,83,84,83, \
- 84,83,84,83,88,93,88,93,88,93,96,93,88,93,96,99, \
- 96,93,92,93,92,93,96,93,96,99,96,99,96,99,98,99, \
- 102,99,102,99,102,105,102,105,102,105,104,105,108,111,108,111, \
- 108,117,114,117,116,117,116,117,116,117,120,117,120,123,120,123, \
- 120,123,128,129,126,129,128,129,132,129,132,141,138,141,140,141, \
- 140,141,140,141,140,141,140,141,140,153,152,153,152,153,152,153, \
- 152,153,152,153,152,153,152,153,164,165,164,165,164,165,164,165, \
- 164,165,164,165,164,177,176,177,176,177,176,177,176,177,176,177, \
- 176,177,180,177,165,189,165,189,165,189,165,164,165,164,165,164, \
- 165,164,177,176,177,176,177,176,177,176,177,176,177,176,177,188, \
- 189,188,189,188,189,188,189,188,189,188,189,188,189,188,189,200, \
- 189,200,201,200,201,200,201,200,201,200,201,212,213,212,213,212, \
- 213,212,213,212,213,212,213,212,213,212,213,212,213,224,225,213, \
- 225,213,225,213,225,213,225,213,225,213,237,225,237,225,237,225, \
- 201,225,201,200,201,201,201,252,201,201,201,201,201,212,213,213, \
- 213,213,213,212,213,213,213,212,213,213,213,213,213,213,225,225, \
- 225,225,225,225,225,225,225,225,225,225,225,237,237,237,237,237, \
- 237,236,237,237,237,252,252,252,252,252,252,252,252,252,252,252, \
- 252,252,252,252,252,252,252,252,268,268,268,268,268,268,268,268, \
- 268,266,268,268,268,268,268,268,268,268,275,268,275,268,275,268, \
- 275,294,294,294,294,294,294,294,300,294,300,294,300,300,300,300, \
- 300,300,300,300,300,300,318,318,318,318,318,318,318,318,318,318, \
- 318,318,318,318,324,318,318,318,318,324,324,318,324,324,330,330, \
- 330,330,342,342,342,342,342,342,342,342,342,342,342,342,342,342, \
- 342,348,348,348,348,348,348,348,348,348,348,366,366,366,366,366, \
- 366,366,366,366,372,366,372,366,372,372,366,372,372,372,372,372, \
- 372,372,372,372,372,372,378,390,378,390,390,390,390,390,390,390, \
- 390,390,396,390,396,390,366,390,396,396,372,396,372,396,372,396, \
- 378,414,366,414,366,414,366,414,366,414,372,414,372,414,372,414, \
- 372,372,372,395,396,395,396,390,390,390,390,390,390,390,390,390, \
- 390,390,366,390,396,365,366,371,396,396,372,371,372,390,378,414, \
- 378,414,378,414,414,414,414,414,390,414,390,389,390,389,390,395, \
- 396,395,396,395,396,396,402,414,402,395,396,395,396,389,414,413, \
- 414,413,414,413,414,413,414,414,420,395,420,419,420,395,396,401, \
- 396,419,420,419,414,413,414,413,414,413,414,413,414,413,414,413, \
- 414,413,420,419,420,419,420,419,420,419,426,425,426,437,438,437, \
- 438,437,438,437,438,437,444,437,444,443,438,443,444,443,444,443, \
- 444,443,444,443,444,461,462,461,462,461,462,461,462,461,462,461, \
- 462,461,462,467,468,467,468,467,468,467,468,467,468,467,474,473, \
- 486,485,486,485,486,485,414,485,486,485,486,491,492,491,492,519, \
- 520,491,504,503,420,503,504,437,504,503,504,437,504,437,438,437, \
- 520,443,444,519,520,519,520,519,520,519,520,519,520,527,520,527, \
- 528,527,528,461,528,461,528,461,462,461,462,467,468,467,468,467, \
- 468,551,552,551,552,551,552,551,552,551,560,551,552,551,552,551, \
- 552,551,552,559,560,559,560,559,560,503,568,567,504,503,504,503, \
- 504,503,504,519,520,519,520,519,520,519,520,520,520,519,520,519, \
- 520,519,520,519,520,527,528,527,528,527,528,527,528,527,528,527, \
- 528,535,552,551,552,551,552,551,552,552,552,551,552,551,552,551, \
- 552,551,552,551,552,551,552,551,552,559,560,551,560,559,560,559, \
- 560,567,568,567,568,583,568,567,584,583,584,583,584,583,584,583, \
- 584,583,584,583,584,583,584,583,584,583,592,591,592,591,592,591, \
- 592,591,592,591,592,615,616,519,520,615,520,519,520,615,616,615, \
- 616,615,528,615,616,615,528,527,528,615,528,623,624,623,536,552, \
- 552,551,552,551,552,551,552,551,552,551,552,551,552,551,552,551 \
-
-#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,6,7,10,11,10,11,12,13, \
- 10,11,11,11,12,12,14,15,14,14,16,16,16,16,18,17, \
- 22,19,22,23,22,23,26,27,26,23,30,29,26,27,26,27, \
- 30,31,30,31,30,35,30,35,30,35,34,31,34,35,38,35, \
- 34,36,38,39,38,39,38,43,38,40,42,43,42,44,42,43, \
- 42,44,46,47,46,44,46,51,50,48,50,51,54,52,54,52, \
- 50,51,54,55,58,55,54,56,58,56,62,60,58,63,58,63, \
- 62,64,62,64,62,64,62,64,62,67,66,71,66,67,74,71, \
- 70,67,70,71,74,72,74,75,70,76,74,79,74,75,74,79, \
- 74,79,78,80,78,76,78,80,78,79,82,84,82,80,82,87, \
- 86,84,86,84,86,84,86,88,90,88,90,92,90,88,94,96, \
- 90,92,94,92,94,92,94,96,94,102,98,96,100,102,98,102, \
- 98,104,100,102,102,104,104,102,102,102,104,104,104,104,108,112, \
- 128,110,128,110,128,128,128,128,128,128,128,128,128,128,128,128, \
- 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, \
- 128,128,128,128,128,128,128,128,128,128,128,128,128,128,142,142, \
- 142,142,140,142,144,144,144,142,144,142,140,142,140,142,142,144, \
- 140,142,140,142,140,144,144,144,144,144,144,144,144,144,148,146, \
- 148,160,148,150,148,158,156,158,156,160,156,158,160,160,156,160, \
- 164,158,156,160,164,160,164,182,180,182,164,184,182,184,182,182, \
- 180,182,182,182,182,186,184,182,180,182,184,184,184,185,182,184, \
- 182,185,182,185,182,185,184,185,184,185,182,185,184,184,184,182, \
- 184,185,184,186,184,185,182,182,184,184,184,184,184,184,186,185, \
- 186,206,200,206,188,206,196,198,196,208,196,198,196,198,196,206, \
- 200,206,208,206,196,198,200,208,200,206,200,206,200,208,216,208, \
- 208,206,208,206,216,208,216,208,216,208,216,208,216,208,216,220, \
- 216,210,216,220,256,220,216,220,216,224,216,222,256,250,248,254, \
- 256,256,256,254,256,254,256,254,256,254,256,254,256,256,256,256, \
- 256,254,256,254,256,256,256,254,256,254,256,254,256,256,256,254, \
- 256,254,256,254,256,254,256,256,256,254,256,254,256,256,256,254, \
- 256,254,256,256,256,254,256,254,256,254,256,256,256,254,256,254, \
- 256,254,256,254,256,254,256,254,256,282,280,256,256,256,282,284, \
- 282,284,282,288,280,281,282,288,282,288,282,282,280,281,280,282, \
- 282,287,288,288,280,282,282,288,282,288,282,288,282,288,282,288, \
- 282,284,282,288,280,288,282,288,282,284,282,288,282,288,282,288, \
- 282,288,288,288,288,288,288,288,288,288,288,288,288,288,296,300, \
- 296,304,296,304,298,300,296,300,296,300,312,302,296,306,312,300, \
- 312,320,312,300,312,370,312,320,312,302,312,320,312,370,312,371, \
- 312,371,312,369,372,371,372,371,368,370,372,370,372,370,372,370, \
- 371,369,372,370,368,370,372,370,372,370,372,370,370,370,364,370, \
- 371,370,372,370,370,370,372,370,372,370,372,370,370,370,372,370, \
- 370,372,370,370,372,370,372,370,372,370,368,370,370,372,372,370, \
- 370,370,372,370,372,372,372,370,372,370,370,366,372,370,370,370, \
- 372,368,368,370,370,370,372,370,370,370,372,370,372,370,368,370, \
- 372,370,372,370,369,370,372,370,372,369,372,370,372,371,372,370, \
- 372,370,368,372,372,371,372,369,372,371,370,371,372,370,372,372, \
- 372,370,372,372,372,372,376,416,376,416,376,416,414,416,416,420, \
- 384,416,415,416,414,416,415,416,392,420,400,416,420,420,392,420, \
- 400,416,416,416,416,420,416,412,416,416,416,416,418,416,414,416, \
- 418,420,418,420,418,416,416,416,418,420,414,420,418,420,420,420, \
- 416,416,418,420,418,418,416,416,420,416,418,416,432,420,432,420, \
- 416,416,416,420,416,420,432,420,418,420,432,420,418,416,418,420, \
- 420,420,432,420,420,420,432,468,464,512,432,468,432,444,432,444, \
- 512,508,432,468,512,512,464,510,432,510,512,512,512,512,512,512, \
- 512,512,512,512,512,508,512,508,512,512,512,508,512,510,512,512, \
- 512,512,512,512,512,512,512,508,512,512,512,508,512,512,512,512, \
- 512,512,512,512,512,512,512,512,512,512,512,508,512,512,512,512, \
- 512,512,512,512,512,508,512,512,512,512,512,468,464,512,564,468, \
- 512,564,512,512,564,512,512,512,564,508,564,508,564,503,564,508, \
- 512,508,512,512,564,508,512,508,564,512,512,512,512,512,512,508, \
- 512,510,512,512,512,512,512,512,512,512,512,512,512,512,512,512, \
- 512,508,512,508,512,512,512,512,512,512,512,512,512,512,512,512, \
- 512,512,512,512,512,512,512,512,512,564,562,564,560,512,564,564, \
- 562,564,560,564,564,564,560,564,564,564,564,564,564,564,564,562 \
-
-#define MPFR_MUL_THRESHOLD 6 /* limbs */
-#define MPFR_SQR_THRESHOLD 8 /* limbs */
-#define MPFR_DIV_THRESHOLD 23 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 530 /* bits */
-#define MPFR_EXP_THRESHOLD 2918 /* bits */
-#define MPFR_SINCOS_THRESHOLD 28251 /* bits */
-#define MPFR_AI_THRESHOLD1 -21852 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 2256
-#define MPFR_AI_THRESHOLD3 34310
-/* Tuneup completed successfully, took 8236 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/hypot.c b/Build/source/libs/mpfr/mpfr-src/src/hypot.c
index 44cb6b3e357..d219d6f4515 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/hypot.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/hypot.c
@@ -1,6 +1,6 @@
/* mpfr_hypot -- Euclidean distance
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -29,7 +29,8 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
int
mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode)
{
- int inexact, exact;
+ int inexact;
+ unsigned int exact; /* Warning: 0 will mean "exact" */
mpfr_t t, te, ti; /* auxiliary variables */
mpfr_prec_t N, Nz; /* size variables */
mpfr_prec_t Nt; /* precision of the intermediary variable */
@@ -69,6 +70,8 @@ mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode)
return mpfr_abs (z, x, rnd_mode);
}
+ /* TODO: It may be sufficient to just compare the exponents.
+ The error analysis would need to be updated. */
if (mpfr_cmpabs (x, y) < 0)
{
mpfr_srcptr u;
@@ -155,20 +158,17 @@ mpfr_hypot (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode)
round toward zero. Using a larger sh wouldn't guarantee an absence
of overflow. Note that the scaling of y can underflow only when the
target precision is huge, otherwise the case would already have been
- handled by the diff_exp > threshold code.
- FIXME: Friedland in "Algorithm 312: Absolute Value and Square Root of a
- Complex Number" (Communications of the ACM, 1967) avoids overflow by
- computing |x|*sqrt(1+(y/x)^2) if |x| >= |y|, and |y|*sqrt(1+(x/y)^2)
- otherwise.
- [VL] This trick (which is a scaling by a non-power of 2, thus doesn't
- really bring new behavior w.r.t. overflow/underflow exceptions) may be
- useful for hardware floating-point formats because a whole power-of-2
- scaling code is likely to take more time than the additional division,
- but in the context of multiple-precision, I doubt that it is a good
- idea. Ideally scaling by a power of 2 could be done in a constant time,
- e.g. with MPFR_ALIAS; but one needs to be very careful... */
+ handled by the diff_exp > threshold code; but this case is avoided
+ thanks to a FMA (this problem is transferred to the FMA code). */
sh = (mpfr_get_emax () - 1) / 2 - Ex;
+ /* FIXME: ti is subject to underflow. Solution: x and y could be
+ aliased with MPFR_ALIAS, and if need be, the aliases be pre-scaled
+ exactly as UBF, so that x^2 + y^2 is in range. Then call mpfr_fmma
+ and the square root, and scale the result. The error analysis would
+ be simpler.
+ Note: mpfr_fmma is currently not optimized. */
+
MPFR_ZIV_INIT (loop, Nt);
for (;;)
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ia64/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/ia64/mparam.h
deleted file mode 100644
index e99cceda626..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/ia64/mparam.h
+++ /dev/null
@@ -1,233 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.4.5 */
-/* gcc60.fsffrance.org (Madison) with gmp 5.0.2 */
-
-
-#define MPFR_MULHIGH_TAB \
- -1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1, \
- -1,-1,14,16,16,17,18,19,20,20,22,22,20,21,22,23, \
- 24,23,24,25,24,25,30,30,30,31,32,32,32,33,32,33, \
- 32,33,34,37,36,37,38,35,36,40,36,39,40,41,40,43, \
- 48,48,42,43,48,41,48,50,48,48,48,50,48,60,48,50, \
- 60,64,60,60,60,60,60,66,64,64,64,63,64,65,68,64, \
- 64,64,64,63,64,64,68,68,64,68,64,64,64,64,76,76, \
- 80,76,76,72,72,80,76,76,76,82,80,80,80,80,80,80, \
- 84,93,88,96,96,96,90,99,96,93,96,99,96,93,96,99, \
- 96,96,102,105,108,99,108,105,108,105,108,111,108,111,108,111, \
- 108,117,120,117,120,117,117,117,120,120,120,117,120,120,120,123, \
- 120,117,120,123,120,120,126,141,120,141,141,141,140,141,144,141, \
- 140,141,141,141,144,141,144,147,144,141,156,141,140,141,156,165, \
- 164,165,156,165,164,165,165,165,164,165,164,165,164,165,165,165, \
- 164,165,164,165,168,177,180,177,165,177,177,177,176,177,180,177, \
- 180,177,180,177,176,177,180,165,168,189,180,189,192,189,186,189, \
- 188,189,176,177,192,189,180,177,192,189,180,201,192,177,192,189, \
- 192,189,189,189,188,213,212,213,192,213,200,201,192,213,200,201, \
- 212,213,192,201,200,213,212,213,212,213,200,213,212,213,210,201, \
- 212,213,236,212,212,213,212,213,216,213,236,213,236,235,236,252, \
- 236,225,236,251,236,233,236,235,236,240,252,252,236,235,252,252, \
- 236,249,252,251,252,252,252,251,256,256,256,251,252,251,252,251, \
- 252,252,252,267,268,265,268,267,268,265,268,267,268,265,268,267, \
- 268,267,268,283,268,281,284,283,284,281,268,283,284,281,284,283, \
- 284,284,284,283,284,283,284,283,284,283,284,283,284,281,300,284, \
- 284,284,300,300,300,316,284,315,284,313,300,315,316,284,316,315, \
- 316,299,300,284,316,284,316,315,300,315,316,315,316,300,316,316, \
- 316,313,316,315,316,313,316,315,316,316,316,315,320,316,316,315, \
- 354,354,354,315,354,354,354,354,354,354,354,354,354,353,378,378, \
- 354,354,354,378,354,354,354,354,354,377,378,354,354,377,378,378, \
- 378,378,378,378,378,377,378,378,378,378,378,378,378,377,378,378, \
- 378,378,378,378,378,377,378,378,378,378,378,378,378,378,378,378, \
- 378,377,378,378,378,378,378,402,378,378,378,378,402,378,378,378, \
- 402,426,426,426,426,402,426,426,402,402,426,426,402,402,426,426, \
- 426,426,426,426,426,425,426,426,426,402,426,426,426,426,426,426, \
- 426,426,426,426,426,426,426,426,472,472,426,426,472,426,472,472, \
- 472,426,426,426,472,471,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,472,472,472,472,472,472,472,472,472,504,504,472,472, \
- 504,504,504,472,472,472,472,504,472,472,472,472,504,472,504,504, \
- 504,504,504,504,504,504,536,504,504,504,504,504,504,504,504,504, \
- 504,504,536,535,536,504,536,536,536,504,536,536,504,504,504,504, \
- 504,504,536,536,536,536,536,536,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,536,536,568,536,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,600,600,568,600,600,600,600,568,600,600, \
- 600,600,600,600,600,600,600,600,600,600,599,600,600,600,600,600, \
- 600,600,600,600,600,600,600,599,600,600,600,600,600,600,632,600, \
- 600,600,600,600,632,600,600,600,632,600,632,632,632,632,632,632, \
- 632,632,632,632,632,632,632,632,632,600,632,600,632,632,632,600, \
- 664,632,664,664,632,632,664,664,664,664,632,664,664,632,664,664, \
- 664,632,664,664,664,664,664,664,664,664,664,664,631,632,632,632, \
- 664,632,664,664,664,664,663,664,664,664,736,664,736,664,664,664, \
- 736,736,736,664,736,735,736,735,736,736,736,735,736,735,736,735, \
- 736,736,664,735,736,736,736,736,736,735,736,735,736,735,736,736, \
- 736,736,736,735,736,736,736,735,736,736,736,735,736,735,736,736, \
- 736,736,760,760,736,760,760,760,760,760,784,760,760,783,784,760, \
- 760,760,760,760,784,760,760,760,760,784,784,784,784,784,784,784, \
- 736,760,784,784,784,784,784,783,784,783,784,783,784,783,784,784, \
- 784,760,784,784,784,784,784,784,784,784,784,784,784,784,784,760, \
- 784,784,784,784,784,783,784,831,784,784,784,784,784,784,784,831, \
- 832,784,832,831,784,831,832,831,832,784,784,831,832,783,784,831, \
- 832,784,832,831,832,784,856,856,856,856,856,856,856,856,856,856 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,-1,-1,-1,6,-1,8,8,8,10,10, \
- 10,12,11,11,12,12,14,14,14,14,16,15,16,16,18,19, \
- 18,18,19,20,20,20,22,22,22,22,24,24,24,28,26,30, \
- 28,32,30,28,28,28,30,30,30,30,32,34,34,34,36,36, \
- 36,38,38,40,36,38,38,40,38,42,42,44,44,44,42,44, \
- 44,46,46,48,44,50,46,52,48,54,50,52,48,54,50,52, \
- 54,50,56,52,56,52,58,56,56,56,58,58,60,60,62,62, \
- 60,64,62,62,68,68,66,66,64,68,66,70,72,72,66,68, \
- 68,70,70,70,72,74,74,74,80,78,78,76,80,80,82,84, \
- 84,82,86,80,82,82,84,84,86,86,88,92,88,90,86,92, \
- 84,94,86,90,88,92,90,94,86,86,88,98,92,88,90,90, \
- 94,92,92,94,96,92,94,94,96,100,98,98,96,100,102,102, \
- 100,98,102,100,100,102,102,102,104,106,106,108,108,104,106,110, \
- 108,106,114,108,108,124,110,110,116,110,114,116,112,114,114,128, \
- 128,114,118,120,128,128,118,120,132,132,132,120,120,128,124,124, \
- 128,144,124,128,128,128,140,136,132,132,128,136,136,128,136,140, \
- 132,140,166,136,160,161,140,140,136,140,166,154,144,168,166,154, \
- 154,155,142,142,160,167,166,166,148,166,178,167,160,154,154,179, \
- 172,167,167,154,156,148,156,160,172,172,166,166,167,166,154,155, \
- 168,167,166,162,172,168,167,178,166,178,167,178,180,174,173,184, \
- 180,190,178,172,178,178,190,178,178,190,191,184,178,190,190,172, \
- 191,184,178,192,180,180,191,184,192,190,190,190,184,190,190,190, \
- 192,190,214,203,204,202,190,214,202,190,190,190,204,191,190,208, \
- 204,216,196,203,216,208,215,212,209,214,214,216,215,220,215,216, \
- 214,216,216,214,220,216,214,216,220,214,214,240,228,226,226,232, \
- 226,234,228,238,233,238,226,226,232,220,238,240,244,239,239,214, \
- 240,232,238,250,227,232,250,250,233,238,240,226,232,234,238,226, \
- 252,232,238,244,239,240,238,238,239,240,238,262,246,256,250,246, \
- 252,244,262,252,252,262,251,262,262,264,275,262,264,258,233,262, \
- 268,234,263,236,263,240,239,270,238,244,239,244,240,240,249,244, \
- 243,244,245,252,249,244,251,250,257,258,255,250,262,264,257,258, \
- 250,262,262,258,257,262,262,274,274,262,273,262,263,274,275,274, \
- 275,264,263,276,274,268,275,288,281,286,288,288,264,274,281,274, \
- 295,274,296,300,293,274,275,296,295,288,292,280,311,312,300,304, \
- 307,302,300,308,312,304,315,314,299,316,320,316,303,320,318,320, \
- 315,312,320,320,318,320,307,336,316,334,313,332,327,336,312,334, \
- 316,320,313,340,316,320,315,344,332,315,332,315,316,328,335,318, \
- 332,320,331,308,332,331,326,315,316,331,345,332,347,344,347,347, \
- 315,329,335,331,348,345,327,320,331,334,348,352,378,378,334,378, \
- 351,390,332,378,348,390,390,378,377,390,377,378,390,377,329,402, \
- 356,390,402,378,378,390,378,390,378,390,401,378,378,390,390,414, \
- 388,426,401,426,378,401,378,426,389,390,402,426,402,402,426,414, \
- 402,414,402,426,425,426,437,414,402,438,402,426,426,401,426,426, \
- 426,390,426,390,426,425,426,414,426,426,402,426,426,426,426,426, \
- 426,438,426,426,426,426,438,414,402,438,450,426,426,402,426,438, \
- 426,426,426,426,437,438,426,426,438,438,450,426,426,438,426,426, \
- 437,438,426,426,425,426,438,460,474,438,449,438,426,474,426,474, \
- 425,438,426,425,486,462,438,474,438,462,450,474,426,426,426,474, \
- 438,474,462,474,450,474,438,474,473,438,474,474,474,536,426,474, \
- 486,486,474,486,474,474,536,474,474,536,474,474,474,536,462,536, \
- 486,536,474,536,536,536,536,536,536,536,536,536,474,536,536,536, \
- 535,536,535,536,536,536,536,536,536,536,536,536,536,536,536,536, \
- 536,536,535,535,536,536,536,535,536,536,535,535,536,536,536,536, \
- 536,536,536,536,536,552,536,535,536,535,536,535,536,536,536,535, \
- 536,536,536,536,536,584,536,536,536,535,536,535,536,536,568,535, \
- 552,536,568,536,536,584,536,535,536,536,536,536,536,536,600,535, \
- 536,536,536,584,536,584,536,535,536,536,536,535,536,600,600,535, \
- 536,600,568,536,568,568,536,584,536,536,536,536,600,584,567,584, \
- 600,584,583,599,584,584,600,584,600,568,600,599,600,600,600,584, \
- 616,600,600,600,600,600,600,599,600,600,600,600,600,600,600,599, \
- 600,600,615,599,616,616,584,599,600,616,600,600,600,600,600,599, \
- 616,616,600,600,616,616,600,600,600,616,600,599,600,600,600,599, \
- 600,616,616,599,616,616,616,599,616,616,616,599,616,616,600,599, \
- 616,616,600,616,616,616,632,648,664,648,616,648,600,600,632,664 \
-
-#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,13, \
- 16,17,18,19,18,21,22,23,22,25,17,17,20,23,25,22, \
- 24,25,21,21,24,29,29,31,28,28,26,31,30,28,29,30, \
- 31,37,38,37,36,40,37,37,40,37,41,37,36,39,38,46, \
- 42,43,42,43,40,37,42,43,44,49,42,43,40,45,46,47, \
- 49,49,50,43,44,45,50,46,54,53,53,55,50,51,50,50, \
- 54,56,54,52,55,53,57,55,56,57,58,58,56,62,66,59, \
- 62,65,64,59,60,65,66,77,76,73,70,73,68,65,72,73, \
- 76,69,72,71,70,81,72,85,76,77,74,77,80,81,76,77, \
- 84,85,84,79,82,81,84,77,84,83,80,85,82,81,96,83, \
- 96,85,85,91,96,84,92,95,92,100,92,96,88,98,96,99, \
- 96,96,100,100,96,95,100,100,102,96,100,95,96,98,100,99, \
- 109,100,100,100,104,112,104,117,104,109,120,117,108,110,124,109, \
- 112,114,112,115,120,120,112,117,118,116,116,115,112,120,124,127, \
- 128,127,120,116,120,127,125,129,120,123,120,131,131,129,132,136, \
- 132,125,136,131,136,125,144,144,136,144,144,147,144,128,152,144, \
- 148,149,132,144,150,145,147,145,152,151,144,143,152,164,152,152, \
- 152,152,152,149,152,159,152,152,152,159,144,155,160,144,164,160, \
- 152,152,168,163,148,160,168,160,155,164,170,152,152,160,160,164, \
- 168,160,166,168,168,170,168,162,164,168,164,168,168,160,163,176, \
- 168,166,176,167,168,168,169,176,168,190,186,176,192,171,184,192, \
- 192,190,192,186,176,172,176,176,176,192,192,186,192,192,198,191, \
- 192,198,192,198,192,192,192,216,192,192,192,191,192,191,216,198, \
- 198,198,192,192,192,198,197,192,192,192,198,198,208,224,208,198, \
- 198,216,198,198,216,208,216,208,216,222,216,215,208,209,234,224, \
- 240,221,234,216,216,240,232,233,216,222,233,232,216,239,240,218, \
- 224,234,240,240,240,240,224,232,240,240,216,240,224,233,230,240, \
- 224,233,240,234,240,234,224,232,240,233,233,240,230,230,234,240, \
- 240,232,240,240,240,228,240,240,235,240,240,232,240,238,240,240, \
- 240,240,240,240,240,244,246,240,256,240,240,240,244,288,250,250, \
- 256,288,288,256,246,282,288,288,256,288,256,288,248,293,254,288, \
- 288,256,264,256,257,265,288,257,255,288,288,288,256,288,288,281, \
- 292,280,288,292,288,287,280,288,287,280,288,282,288,294,288,288, \
- 288,288,288,288,288,288,288,288,294,304,288,304,288,288,288,292, \
- 294,288,288,288,280,294,292,294,292,328,288,282,328,288,288,291, \
- 288,288,288,288,300,288,317,304,288,329,304,292,304,320,304,318, \
- 327,325,324,326,304,312,336,304,329,320,328,330,328,330,336,320, \
- 328,327,330,318,316,319,330,336,328,336,352,336,320,326,352,320, \
- 336,325,326,324,342,329,327,328,336,336,336,336,336,328,352,330, \
- 320,328,336,326,320,335,335,326,352,352,342,336,352,326,336,336, \
- 336,352,329,328,342,328,342,336,326,336,384,352,384,329,352,336, \
- 384,352,384,352,336,336,334,384,384,384,384,384,384,352,351,384, \
- 384,384,383,372,384,372,384,384,352,368,384,384,382,396,384,372, \
- 384,384,352,384,384,383,384,384,384,384,384,384,384,384,384,384, \
- 372,384,384,396,384,384,384,384,384,384,384,384,384,384,384,384, \
- 384,396,384,384,384,384,384,372,384,384,384,396,384,384,384,432, \
- 384,383,384,384,384,396,384,384,384,396,382,384,384,396,394,384, \
- 384,384,384,383,392,396,400,384,384,401,384,384,396,432,396,432, \
- 392,408,432,396,396,396,416,396,416,432,448,428,424,420,394,395, \
- 432,432,432,396,432,432,432,432,432,426,432,432,448,448,444,464, \
- 416,440,432,425,432,430,448,432,432,432,432,432,432,432,442,432, \
- 432,432,432,447,472,432,432,480,432,468,480,480,448,465,450,432, \
- 480,465,448,464,480,448,472,467,468,480,438,479,464,465,468,472, \
- 468,469,480,448,480,480,464,480,468,469,464,467,468,432,472,480, \
- 464,480,472,468,480,468,472,472,468,477,480,471,472,467,448,480, \
- 448,496,488,464,470,480,480,480,480,469,472,448,480,479,480,512, \
- 492,477,480,469,480,464,480,480,464,480,500,480,472,480,472,479, \
- 488,468,500,480,512,472,504,467,480,472,480,480,464,469,480,480, \
- 480,472,496,500,480,480,480,480,472,480,480,496,480,576,480,480, \
- 480,497,576,500,480,516,504,504,498,480,504,480,504,480,504,576, \
- 512,496,512,508,576,529,512,500,576,534,534,504,512,515,528,576, \
- 560,528,576,512,528,513,512,528,528,576,576,496,528,576,576,511, \
- 512,504,576,576,560,512,576,504,576,576,576,576,564,576,564,576, \
- 576,562,576,576,576,576,576,560,576,576,564,528,532,576,576,576 \
-
-#define MPFR_MUL_THRESHOLD 26 /* limbs */
-#define MPFR_SQR_THRESHOLD 19 /* limbs */
-#define MPFR_DIV_THRESHOLD 44 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 1092 /* bits */
-#define MPFR_EXP_THRESHOLD 5435 /* bits */
-#define MPFR_SINCOS_THRESHOLD 24855 /* bits */
-#define MPFR_AI_THRESHOLD1 -9637 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 922
-#define MPFR_AI_THRESHOLD3 16031
-/* Tuneup completed successfully, took 1058 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ieee_floats.h b/Build/source/libs/mpfr/mpfr-src/src/ieee_floats.h
index 5a890a051c9..d0c6bb52c41 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ieee_floats.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/ieee_floats.h
@@ -1,6 +1,6 @@
/* auxiliary data to generate special IEEE floats (NaN, +Inf, -Inf)
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/init.c b/Build/source/libs/mpfr/mpfr-src/src/init.c
index 1e41b8d7ae8..ecb174cfa48 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/init.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/init.c
@@ -1,6 +1,6 @@
/* mpfr_init -- initialize a floating-point number
-Copyright 1999, 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/init2.c b/Build/source/libs/mpfr/mpfr-src/src/init2.c
index 0fb1d9c63b5..7cd0b15d351 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/init2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/init2.c
@@ -1,6 +1,6 @@
/* mpfr_init2 -- initialize a floating-point number with given precision
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -33,8 +33,8 @@ mpfr_init2 (mpfr_ptr x, mpfr_prec_t p)
MPFR_STAT_STATIC_ASSERT( MP_SIZE_T_MAX >= (MPFR_PREC_MAX/MPFR_BYTES_PER_MP_LIMB) );
/* Check for correct GMP_NUMB_BITS and MPFR_BYTES_PER_MP_LIMB */
- MPFR_STAT_STATIC_ASSERT( GMP_NUMB_BITS == MPFR_BYTES_PER_MP_LIMB * CHAR_BIT
- && sizeof(mp_limb_t) == MPFR_BYTES_PER_MP_LIMB );
+ MPFR_STAT_STATIC_ASSERT(GMP_NUMB_BITS == MPFR_BYTES_PER_MP_LIMB * CHAR_BIT);
+ MPFR_STAT_STATIC_ASSERT(sizeof(mp_limb_t) == MPFR_BYTES_PER_MP_LIMB);
/* Check for mp_bits_per_limb (a global variable inside GMP library) */
MPFR_ASSERTN (mp_bits_per_limb == GMP_NUMB_BITS);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/inits.c b/Build/source/libs/mpfr/mpfr-src/src/inits.c
index a48f573d1d2..d0090516040 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/inits.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/inits.c
@@ -1,6 +1,6 @@
/* mpfr_inits -- initialize several floating-point numbers
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -21,7 +21,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-# undef HAVE_STDARG
# include "config.h"
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/inits2.c b/Build/source/libs/mpfr/mpfr-src/src/inits2.c
index 14701936699..76ca4b8045e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/inits2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/inits2.c
@@ -1,7 +1,7 @@
/* mpfr_inits2 -- initialize several floating-point numbers with given
precision
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,7 +22,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
#ifdef HAVE_CONFIG_H
-# undef HAVE_STDARG
# include "config.h"
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/inp_str.c b/Build/source/libs/mpfr/mpfr-src/src/inp_str.c
index 8fae2e0fc87..e5b27ace139 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/inp_str.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/inp_str.c
@@ -1,7 +1,7 @@
/* mpfr_inp_str -- input a number in base BASE from stdio stream STREAM
and store the result in ROP
-Copyright 1999, 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -42,7 +42,7 @@ mpfr_inp_str (mpfr_ptr rop, FILE *stream, int base, mpfr_rnd_t rnd_mode)
str_size = 0;
nread = 0;
- /* Skip whitespace. */
+ /* Skip whitespace. EOF will be detected later. */
do
{
c = getc (stream);
@@ -54,33 +54,56 @@ mpfr_inp_str (mpfr_ptr rop, FILE *stream, int base, mpfr_rnd_t rnd_mode)
for (;;)
{
+ MPFR_ASSERTD (str_size < (size_t) -1);
if (str_size >= alloc_size)
{
size_t old_alloc_size = alloc_size;
- alloc_size = alloc_size * 3 / 2;
+ alloc_size = alloc_size / 2 * 3;
+ /* Handle overflow in unsigned integer arithmetic... */
+ if (MPFR_UNLIKELY (alloc_size <= old_alloc_size))
+ alloc_size = (size_t) -1;
+ MPFR_ASSERTD (str_size < alloc_size);
str = (unsigned char *)
mpfr_reallocate_func (str, old_alloc_size, alloc_size);
}
if (c == EOF || isspace (c))
break;
str[str_size++] = (unsigned char) c;
+ if (str_size == (size_t) -1)
+ break;
c = getc (stream);
}
ungetc (c, stream);
- /* number of characters read is nread + str_size - 1 */
+ if (MPFR_UNLIKELY (str_size == (size_t) -1 || str_size == 0 ||
+ (c == EOF && ! feof (stream))))
+ {
+ /* size_t overflow or I/O error */
+ retval = -1;
+ }
+ else
+ {
+ /* number of characters read is nread + str_size - 1 */
+
+ /* We exited the "for" loop by the first break instruction,
+ then necessarily str_size >= alloc_size was checked, so
+ now str_size < alloc_size. */
+ MPFR_ASSERTD (str_size < alloc_size);
- /* we can exit the for loop only by the break instruction,
- then necessarily str_size >= alloc_size was checked, so
- now str_size < alloc_size */
+ str[str_size] = '\0';
- str[str_size] = '\0';
+ retval = mpfr_set_str (rop, (char *) str, base, rnd_mode);
+ }
- retval = mpfr_set_str (rop, (char *) str, base, rnd_mode);
mpfr_free_func (str, alloc_size);
if (retval == -1)
return 0; /* error */
- return str_size + nread - 1;
+ MPFR_ASSERTD (nread >= 1);
+ str_size += nread - 1;
+ if (MPFR_UNLIKELY (str_size < nread - 1)) /* size_t overflow */
+ return 0; /* however rop has been set successfully */
+ else
+ return str_size;
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/int_ceil_log2.c b/Build/source/libs/mpfr/mpfr-src/src/int_ceil_log2.c
index 6de29de6a70..fdb0650e4ce 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/int_ceil_log2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/int_ceil_log2.c
@@ -1,6 +1,6 @@
/* __gmpfr_int_ceil_log2 -- Integer ceil of log2(x)
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -29,6 +29,7 @@ __gmpfr_int_ceil_log2 (unsigned long n)
if (MPFR_UNLIKELY (n == 1))
return 0;
else
+#ifdef MPFR_LONG_WITHIN_LIMB
{
int b;
mp_limb_t limb;
@@ -37,6 +38,11 @@ __gmpfr_int_ceil_log2 (unsigned long n)
limb = n - 1;
MPFR_ASSERTN (limb == n - 1);
count_leading_zeros (b, limb);
- return GMP_NUMB_BITS - b;
+ b = GMP_NUMB_BITS - b;
+ MPFR_ASSERTD (b >= 0);
+ return b;
}
+#else
+ return mpfr_nbits_ulong (n - 1);
+#endif
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/invert_limb.h b/Build/source/libs/mpfr/mpfr-src/src/invert_limb.h
index e0fad49bdd7..158fd9b8f99 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/invert_limb.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/invert_limb.h
@@ -1,6 +1,6 @@
/* __gmpfr_invert_limb -- implement GMP's invert_limb (which is not in GMP API)
-Copyright 2016-2019 Free Software Foundation, Inc.
+Copyright 2016-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -29,12 +29,13 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* umul_hi(h, x, y) puts in h the high part of x*y */
#ifdef HAVE_MULX_U64
#include <immintrin.h>
-#define umul_hi(h, x, y) _mulx_u64 (x, y, (unsigned long long *) &h)
+#define umul_hi(h, x, y) _mulx_u64 (x, y, (unsigned long long *) &(h))
#else
#define umul_hi(h, x, y) \
do { \
mp_limb_t _l; \
umul_ppmm (h, _l, x, y); \
+ (void) _l; /* unused variable */ \
} while (0)
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/invsqrt_limb.h b/Build/source/libs/mpfr/mpfr-src/src/invsqrt_limb.h
index d6d1744b30a..4593372d54a 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/invsqrt_limb.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/invsqrt_limb.h
@@ -1,6 +1,6 @@
/* __gmpfr_invsqrt_limb_approx -- reciprocal approximate square root of a limb
-Copyright 2017-2019 Free Software Foundation, Inc.
+Copyright 2017-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -231,17 +231,18 @@ static const mp_limb_t T3[768] =
/* umul_hi(h, x, y) puts in h the high part of x*y */
#ifdef HAVE_MULX_U64
#include <immintrin.h>
-#define umul_hi(h, x, y) _mulx_u64 (x, y, (unsigned long long *) &h)
+#define umul_hi(h, x, y) _mulx_u64 (x, y, (unsigned long long *) &(h))
#else
#define umul_hi(h, x, y) \
do { \
mp_limb_t _l; \
umul_ppmm (h, _l, x, y); \
+ (void) _l; /* unused variable */ \
} while (0)
#endif
/* given 2^62 <= d < 2^64, put in r an approximation of
- s = floor(2^96/sqrt(r)) - 2^64, with r <= s <= r + 15 */
+ s = floor(2^96/sqrt(d)) - 2^64, with r <= s <= r + 15 */
#define __gmpfr_invsqrt_limb_approx(r, d) \
do { \
mp_limb_t _d, _i, _v0, _e0, _d37, _v1, _e1, _h, _v2, _e2; \
@@ -285,7 +286,7 @@ static const mp_limb_t T3[768] =
} while (0)
/* given 2^62 <= n < 2^64, put in s an approximation of sqrt(2^64*n),
- with: s <= floor(sqrt(2^64*u)) <= s + 7 */
+ with: s <= floor(sqrt(2^64*n)) <= s + 7 */
#define __gmpfr_sqrt_limb_approx(s, n) \
do { \
mp_limb_t _n, _x, _y, _z, _t; \
diff --git a/Build/source/libs/mpfr/mpfr-src/src/isinf.c b/Build/source/libs/mpfr/mpfr-src/src/isinf.c
index a8cb44d9775..7e1ce96090d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/isinf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/isinf.c
@@ -1,6 +1,6 @@
/* mpfr_inf_p -- check for infinities
-Copyright 2000-2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2001, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/isinteger.c b/Build/source/libs/mpfr/mpfr-src/src/isinteger.c
index 2cfa2f12ed3..770cdf77441 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/isinteger.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/isinteger.c
@@ -1,6 +1,6 @@
/* mpfr_integer_p -- test if a mpfr variable is integer.
-Copyright 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -50,7 +50,7 @@ mpfr_integer_p (mpfr_srcptr x)
xp = MPFR_MANT(x);
MPFR_ASSERTN(xn >= 0);
- if (xp[xn] << (expo % GMP_NUMB_BITS) != 0)
+ if (MPFR_LIMB_LSHIFT(xp[xn], expo % GMP_NUMB_BITS) != 0)
return 0;
while (--xn >= 0)
if (xp[xn] != 0)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/isnan.c b/Build/source/libs/mpfr/mpfr-src/src/isnan.c
index 54852bd3db2..af9f0b65d24 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/isnan.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/isnan.c
@@ -1,6 +1,6 @@
/* mpfr_nan_p -- check for NaN
-Copyright 2000-2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2001, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/isnum.c b/Build/source/libs/mpfr/mpfr-src/src/isnum.c
index 8a12963f1b6..ff95b4c500b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/isnum.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/isnum.c
@@ -1,6 +1,6 @@
/* mpfr_number_p -- check for ordinary numbers
-Copyright 2000-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/isqrt.c b/Build/source/libs/mpfr/mpfr-src/src/isqrt.c
index cd67b4611d0..f3d827eff47 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/isqrt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/isqrt.c
@@ -1,6 +1,6 @@
/* __gmpfr_isqrt && __gmpfr_cuberoot -- Integer square root and cube root
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/isregular.c b/Build/source/libs/mpfr/mpfr-src/src/isregular.c
index 7e88e63083b..5838ec2bc87 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/isregular.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/isregular.c
@@ -1,6 +1,6 @@
/* mpfr_regular_p -- check for regular number (neither NaN, Inf or zero)
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/iszero.c b/Build/source/libs/mpfr/mpfr-src/src/iszero.c
index f9662443a46..cbb0311235b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/iszero.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/iszero.c
@@ -1,6 +1,6 @@
/* mpfr_zero_p -- check for zero
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/jn.c b/Build/source/libs/mpfr/mpfr-src/src/jn.c
index 9c9a5352dfc..9ab7743aa3b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/jn.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/jn.c
@@ -1,7 +1,7 @@
/* mpfr_j0, mpfr_j1, mpfr_jn -- Bessel functions of 1st kind, integer order.
http://www.opengroup.org/onlinepubs/009695399/functions/j0.html
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -245,7 +245,7 @@ mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
MPFR_GROUP_REPREC_3 (g, prec, y, s, t);
MPFR_BLOCK (flags, {
mpfr_pow_ui (t, z, absn, MPFR_RNDN); /* z^|n| */
- mpfr_mul (y, z, z, MPFR_RNDN); /* z^2 */
+ mpfr_sqr (y, z, MPFR_RNDN); /* z^2 */
MPFR_CLEAR_ERANGEFLAG ();
zz = mpfr_get_ui (y, MPFR_RNDU);
/* FIXME: The error analysis is incorrect in case of range error. */
@@ -315,7 +315,7 @@ mpfr_jn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
most probably there is a cancellation in the series, thus we add
err - k0 bits to prec */
if (err > k0)
- prec = MPFR_ADD_PREC (prec, err - k0);
+ MPFR_INC_PREC (prec, err - k0);
MPFR_ZIV_NEXT (loop, prec);
}
MPFR_ZIV_FREE (loop);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/jyn_asympt.c b/Build/source/libs/mpfr/mpfr-src/src/jyn_asympt.c
index e333e46fb5d..9fa603246f1 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/jyn_asympt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/jyn_asympt.c
@@ -1,6 +1,6 @@
/* mpfr_jn_asympt, mpfr_yn_asympt -- shared code for mpfr_jn and mpfr_yn
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -49,7 +49,20 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_exp_t err2, err;
MPFR_ZIV_DECL (loop);
- mpfr_init (c);
+ mpfr_init2 (c, 64);
+
+ /* The terms of the asymptotic expansion grow like mu^(2k)/(8z)^(2k), where
+ mu = 4n^2, thus we need mu < 8|z| so that it converges,
+ i.e., n^2/2 < |z| */
+ MPFR_ASSERTD (n >= 0);
+ mpfr_set_ui (c, n, MPFR_RNDU);
+ mpfr_mul_ui (c, c, n, MPFR_RNDU);
+ mpfr_div_2ui (c, c, 1, MPFR_RNDU);
+ if (mpfr_cmpabs (c, z) >= 0)
+ {
+ mpfr_clear (c);
+ return 0; /* asymptotic expansion failed */
+ }
w = MPFR_PREC(res) + MPFR_INT_CEIL_LOG2(MPFR_PREC(res)) + 4;
@@ -92,6 +105,7 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
for (k = 1, stop = 0; stop < 4; k++)
{
/* compute next term: t(k)/t(k-1) = (2n+2k-1)(2n-2k+1)/(8kz) */
+ MPFR_LOG_MSG (("loop (k,stop) = (%ld,%d)\n", k, stop));
mpfr_mul_si (t, t, 2 * (n + k) - 1, MPFR_RNDN); /* err <= err_k + 1 */
mpfr_mul_si (t, t, 2 * (n - k) + 1, MPFR_RNDN); /* err <= err_k + 2 */
mpfr_div_ui (t, t, k, MPFR_RNDN); /* err <= err_k + 3 */
@@ -127,7 +141,7 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
/* check if the next term is smaller than ulp(Q): if EXP(err_u)
<= EXP(Q), since the current term is bounded by
err_u * 2^(-w), it is bounded by ulp(Q) */
- if (MPFR_EXP(err_u) <= MPFR_EXP(Q))
+ if (MPFR_GET_EXP (err_u) <= MPFR_GET_EXP (Q))
stop ++;
else
stop = 0;
@@ -140,7 +154,7 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
else
mpfr_sub (P, P, t, MPFR_RNDN);
/* check if the next term is smaller than ulp(P) */
- if (MPFR_EXP(err_u) <= MPFR_EXP(P))
+ if (MPFR_GET_EXP (err_u) <= MPFR_GET_EXP (P))
stop ++;
else
stop = 0;
@@ -176,9 +190,9 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_mul (c, c, P, MPFR_RNDN); /* P * (sin - cos) */
mpfr_mul (s, s, Q, MPFR_RNDN); /* Q * (sin + cos) */
#endif
- err = MPFR_EXP(c);
- if (MPFR_EXP(s) > err)
- err = MPFR_EXP(s);
+ err = MPFR_GET_EXP (c);
+ if (MPFR_GET_EXP (s) > err)
+ err = MPFR_EXP (s);
#ifdef MPFR_JN
mpfr_sub (s, s, c, MPFR_RNDN);
#else
@@ -195,9 +209,9 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_mul (c, c, Q, MPFR_RNDN); /* Q * (sin - cos) */
mpfr_mul (s, s, P, MPFR_RNDN); /* P * (sin + cos) */
#endif
- err = MPFR_EXP(c);
- if (MPFR_EXP(s) > err)
- err = MPFR_EXP(s);
+ err = MPFR_GET_EXP (c);
+ if (MPFR_GET_EXP (s) > err)
+ err = MPFR_EXP (s);
#ifdef MPFR_JN
mpfr_add (s, s, c, MPFR_RNDN);
#else
@@ -206,15 +220,16 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
}
if ((n & 2) != 0)
mpfr_neg (s, s, MPFR_RNDN);
- if (MPFR_EXP(s) > err)
- err = MPFR_EXP(s);
+ if (MPFR_GET_EXP (s) > err)
+ err = MPFR_EXP (s);
/* the absolute error on s is bounded by P*err(s/c) + Q*err(s/c)
+ err(P)*(s/c) + err(Q)*(s/c) + 3 * 2^(err - w - 1)
<= (|P|+|Q|) * 2^(1-w) + err_s * 2^(1-w) + 2^err * 2^(1-w),
since |c|, |old_s| <= 2. */
- err2 = (MPFR_EXP(P) >= MPFR_EXP(Q)) ? MPFR_EXP(P) + 2 : MPFR_EXP(Q) + 2;
+ err2 = (MPFR_GET_EXP (P) >= MPFR_GET_EXP (Q))
+ ? MPFR_EXP (P) + 2 : MPFR_EXP (Q) + 2;
/* (|P| + |Q|) * 2^(1 - w) <= 2^(err2 - w) */
- err = MPFR_EXP(err_s) >= err ? MPFR_EXP(err_s) + 2 : err + 2;
+ err = MPFR_GET_EXP (err_s) >= err ? MPFR_EXP (err_s) + 2 : err + 2;
/* err_s * 2^(1-w) + 2^old_err * 2^(1-w) <= 2^err * 2^(-w) */
err2 = (err >= err2) ? err + 1 : err2 + 1;
/* now the absolute error on s is bounded by 2^(err2 - w) */
@@ -229,13 +244,14 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_abs (err_t, err_t, MPFR_RNDU);
mpfr_mul_ui (err_t, err_t, 3, MPFR_RNDU);
/* 3*2^(-w)*|old_c|*|s| [see below] is bounded by err_t * 2^(-w) */
- err2 += MPFR_EXP(c);
+ err2 += MPFR_GET_EXP (c);
/* |old_c| * 2^(err2 - w) [see below] is bounded by 2^(err2-w) */
mpfr_mul (c, c, s, MPFR_RNDN); /* the absolute error on c is bounded by
1/2 ulp(c) + 3*2^(-w)*|old_c|*|s|
+ |old_c| * 2^(err2 - w) */
/* compute err_t * 2^(-w) + 1/2 ulp(c) = (err_t + 2^EXP(c)) * 2^(-w) */
- err = (MPFR_EXP(err_t) > MPFR_EXP(c)) ? MPFR_EXP(err_t) + 1 : MPFR_EXP(c) + 1;
+ err = (MPFR_GET_EXP (err_t) > MPFR_GET_EXP (c)) ?
+ MPFR_EXP (err_t) + 1 : MPFR_EXP (c) + 1;
/* err_t * 2^(-w) + 1/2 ulp(c) <= 2^(err - w) */
/* now err_t * 2^(-w) bounds 1/2 ulp(c) + 3*2^(-w)*|old_c|*|s| */
err = (err >= err2) ? err + 1 : err2 + 1;
@@ -250,7 +266,7 @@ FUNCTION (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_clear (err_s);
mpfr_clear (err_u);
- err -= MPFR_EXP(c);
+ err -= MPFR_GET_EXP (c);
if (MPFR_LIKELY (MPFR_CAN_ROUND (c, w - err, MPFR_PREC(res), r)))
break;
if (diverge != 0)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/li2.c b/Build/source/libs/mpfr/mpfr-src/src/li2.c
index 07e32c36f82..7a4113bc25f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/li2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/li2.c
@@ -1,6 +1,6 @@
/* mpfr_li2 -- Dilogarithm.
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/lngamma.c b/Build/source/libs/mpfr/mpfr-src/src/lngamma.c
index 7d0468ef758..8edc2ddc161 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/lngamma.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/lngamma.c
@@ -1,6 +1,6 @@
/* mpfr_lngamma -- lngamma function
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -275,7 +275,7 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd)
mpfr_const_euler (g, MPFR_IS_POS(z0) ? MPFR_RNDD : MPFR_RNDU); /* cached */
mpfr_mul (g, g, z0, MPFR_RNDU);
mpfr_sub (h, h, g, MPFR_RNDD);
- mpfr_mul (g, z0, z0, MPFR_RNDU);
+ mpfr_sqr (g, z0, MPFR_RNDU);
mpfr_add (h, h, g, MPFR_RNDU);
inex1 = mpfr_prec_round (l, MPFR_PREC(y), rnd);
inex2 = mpfr_prec_round (h, MPFR_PREC(y), rnd);
@@ -494,7 +494,7 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd)
mpfr_set (v, t, MPFR_RNDN); /* (1+u)^2, v < 2^(-5) */
mpfr_add (s, s, v, MPFR_RNDN); /* (1+u)^15 */
- mpfr_mul (u, u, u, MPFR_RNDN); /* 1/z^2 * (1+u)^3 */
+ mpfr_sqr (u, u, MPFR_RNDN); /* 1/z^2 * (1+u)^3 */
/* m <= maxm ensures that 2*m*(2*m+1) <= ULONG_MAX */
maxm = 1UL << (sizeof(unsigned long) * CHAR_BIT / 2 - 1);
@@ -628,7 +628,7 @@ GAMMA_FUNC (mpfr_ptr y, mpfr_srcptr z0, mpfr_rnd_t rnd)
/* now t: (1+u)^(2k-1) */
/* instead of computing log(sqrt(2*Pi)/t), we compute
1/2*log(2*Pi/t^2), which trades a square root for a square */
- mpfr_mul (t, t, t, MPFR_RNDN); /* (z0*...*(z0+k-1))^2, (1+u)^(4k-1) */
+ mpfr_sqr (t, t, MPFR_RNDN); /* (z0*...*(z0+k-1))^2, (1+u)^(4k-1) */
mpfr_div (v, v, t, MPFR_RNDN);
/* 2*Pi/(z0*...*(z0+k-1))^2 (1+u)^(4k+1) */
#ifdef IS_GAMMA
diff --git a/Build/source/libs/mpfr/mpfr-src/src/log.c b/Build/source/libs/mpfr/mpfr-src/src/log.c
index 21257286201..30e8cb2fe76 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/log.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/log.c
@@ -1,6 +1,6 @@
/* mpfr_log -- natural logarithm of a floating-point number
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/log10.c b/Build/source/libs/mpfr/mpfr-src/src/log10.c
index 974b74b05f9..d89516c2435 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/log10.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/log10.c
@@ -1,6 +1,6 @@
/* mpfr_log10 -- logarithm in base 10.
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/log1p.c b/Build/source/libs/mpfr/mpfr-src/src/log1p.c
index 6f92bd69b63..6f5605fdb0e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/log1p.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/log1p.c
@@ -1,6 +1,6 @@
/* mpfr_log1p -- Compute log(1+x)
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/log2.c b/Build/source/libs/mpfr/mpfr-src/src/log2.c
index ddc14f01b2e..41cd33c7ee1 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/log2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/log2.c
@@ -1,6 +1,6 @@
/* mpfr_log2 -- log base 2
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/log_ui.c b/Build/source/libs/mpfr/mpfr-src/src/log_ui.c
index 64b2239213e..c2ca6d7e322 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/log_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/log_ui.c
@@ -1,6 +1,6 @@
/* mpfr_log_ui -- compute natural logarithm of an unsigned long
-Copyright 2014-2019 Free Software Foundation, Inc.
+Copyright 2014-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -193,7 +193,7 @@ mpfr_log_ui (mpfr_ptr x, unsigned long n, mpfr_rnd_t rnd_mode)
mpfr_set_z (t, T[0], MPFR_RNDN); /* t = P[0] * (1 + theta_1) */
mpfr_set_z (q, B[0], MPFR_RNDN); /* q = B[0] * (1 + theta_2) */
- mpfr_mul_2exp (q, q, q0, MPFR_RNDN); /* B[0]*Q[0] */
+ mpfr_mul_2ui (q, q, q0, MPFR_RNDN); /* B[0]*Q[0] */
mpfr_div (t, t, q, MPFR_RNDN); /* t = T[0]/(B[0]*Q[0])*(1 + theta_3)^3
= log(n/2^k) * (1 + theta_4)^4
for |theta_i| < 2^(-w) */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/logging.c b/Build/source/libs/mpfr/mpfr-src/src/logging.c
index cbbe822f41a..f9cbd9590e3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/logging.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/logging.c
@@ -1,6 +1,6 @@
/* MPFR Logging functions.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/min_prec.c b/Build/source/libs/mpfr/mpfr-src/src/min_prec.c
index 87b192d262d..fbe3a38e846 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/min_prec.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/min_prec.c
@@ -1,6 +1,6 @@
/* mpfr_min_prec -- minimal size in bits to hold the mantissa
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/minmax.c b/Build/source/libs/mpfr/mpfr-src/src/minmax.c
index 44ce0729410..c484c0ac153 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/minmax.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/minmax.c
@@ -1,6 +1,6 @@
/* mpfr_min -- min and max of x, y
-Copyright 2001, 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001, 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mips/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/mips/mparam.h
index a1c49d64602..32a84777876 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mips/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mips/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -19,216 +19,215 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Generated by MPFR's tuneup.c, 2012-03-05, gcc 4.4.6
- on gcc49.fsffrance.org (Loongson 3A) with GMP 5.0.4
- configured with ac_cv_func_getrusage=no */
-
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 4.6.3
+ on gcc22.fsffrance.org (Cavium Octeon II V0.1) with GMP 6.1.2,
+ which defines CFLAGS='-O2 -pedantic -mabi=n32' */
#define MPFR_MULHIGH_TAB \
-1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,16,16,16,16,16,16,18,18,18, \
- 18,20,20,20,20,22,22,22,24,32,32,32,32,32,32,32, \
- 32,32,32,32,32,36,36,36,36,32,36,36,36,36,36,36, \
- 36,40,40,40,40,40,44,44,44,44,44,44,48,64,64,64, \
- 64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64, \
- 64,64,64,64,64,64,72,72,72,72,64,64,64,64,64,64, \
- 64,64,64,72,72,72,72,93,93,93,93,93,93,93,93,93, \
- 93,93,93,93,93,93,93,93,93,93,93,93,93,93,96,93, \
- 96,93,96,105,105,105,105,105,105,105,105,105,105,105,105,105, \
- 105,105,108,105,117,117,117,117,117,117,117,117,117,117,117,117, \
- 117,117,117,117,117,117,117,117,129,129,129,129,129,129,129,129, \
- 129,129,129,129,129,129,129,129,129,129,141,141,117,117,117,117, \
- 117,117,129,129,128,129,129,129,189,189,189,189,189,189,189,189, \
- 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, \
- 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, \
- 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, \
- 189,189,189,189,189,189,189,188,189,189,192,189,189,189,189,189, \
- 189,189,189,189,189,189,213,213,213,213,213,213,213,213,213,213, \
- 213,213,213,213,213,213,213,212,213,213,213,213,213,213,213,213, \
- 213,213,213,213,213,213,237,237,237,213,213,237,276,237,276,275, \
- 276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,283, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,32,32,32,36,36,36,36,36,36,36,36,36,36,36,40, \
+ 40,40,44,44,44,44,44,44,44,44,44,48,48,52,52,52, \
+ 52,52,52,52,52,52,52,64,64,64,64,64,64,64,64,64, \
+ 72,72,72,72,72,72,72,72,72,72,72,72,72,72,72,72, \
+ 72,80,80,80,80,80,80,80,80,72,72,72,72,72,72,72, \
+ 72,80,80,80,80,105,105,105,105,105,105,105,105,105,105,105, \
+ 105,105,105,105,105,105,105,105,103,104,105,105,105,105,105,105, \
+ 105,105,105,105,105,105,105,117,117,117,117,117,117,117,117,117, \
+ 117,117,117,120,129,129,129,129,129,129,129,129,129,129,129,129, \
+ 129,129,129,129,129,129,129,129,141,141,141,141,141,141,141,141, \
+ 153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153, \
+ 153,153,153,153,153,153,153,153,153,153,153,165,165,165,165,165, \
+ 165,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, \
+ 189,189,189,189,189,189,189,189,189,189,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,237,237,237,237,237,237,237,237,237,237, \
+ 237,237,237,237,237,237,237,237,237,237,237,276,276,276,276,276, \
276,276,276,276,276,276,276,276,276,276,276,276,276,276,276,276, \
- 276,275,276,276,276,276,285,283,283,283,285,283,283,285,285,285, \
- 285,285,378,377,378,378,378,378,378,378,378,378,378,378,378,378, \
- 378,377,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
- 378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
- 378,378,378,378,378,378,377,378,378,378,378,378,378,378,378,378, \
- 378,378,378,378,378,378,378,378,378,377,378,378,378,378,378,378, \
- 378,378,376,378,378,378,378,378,378,378,378,378,378,378,378,378, \
+ 276,276,276,316,316,316,316,316,316,316,316,316,316,316,316,316, \
+ 316,316,316,316,316,316,316,316,316,316,316,316,316,316,316,316, \
+ 316,316,316,354,354,354,354,354,354,354,354,354,354,354,354,354, \
+ 354,354,354,354,354,354,354,354,354,354,354,354,378,378,378,378, \
378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
- 378,378,378,378,504,504,504,503,504,504,504,504,504,503,504,504, \
+ 378,378,378,378,378,378,378,378,378,378,378,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,456,456,456,456,456,456,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 568,504,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 504,504,504,504,504,504,504,504,504,504,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,566,566,568,568,568,568,568,568, \
- 568,632,568,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
- 632,632,632,632,632,632,632,632,632,632,736,736,736,735,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,735, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,736,736,736,736, \
736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,735,736,736,736,736,736,736,736, \
- 736,736,736,736,735,736,736,736,736,736,736,736,736,736,736,736, \
- 736,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760, \
- 760,760,760,760,760,760,760,760,760,760,760,760,760,760,760,760, \
- 760,760,760,760,760,760,832,760,832,832,832,832,832,832,832,832, \
- 832,832,832,831,832,832,832,832,832,832,832,831,832,832,832,832, \
- 832,831,832,832,832,832,831,832,832,832,832,832,832,832,832,832, \
+ 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
+ 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
+ 736,736,736,736,736,736,736,736,736,736,736,832,832,832,832,832, \
+ 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
+ 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
+ 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
- 832,832,831,832,832,832,832,832,832,832,832,832,832,832,832,832, \
- 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832 \
+ 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
+ 832,832,832,832,832,832,832,832,832,832,832,832,832,832,856,832 \
#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,0,0,6,6,7,7,8,8,9,9, \
- 10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17, \
- 18,18,20,19,20,20,22,21,22,23,24,23,24,25,32,32, \
- 32,32,32,32,32,32,32,32,32,32,32,32,32,32,34,34, \
- 34,34,36,36,36,36,38,38,38,38,40,40,40,40,42,42, \
- 42,44,44,44,44,44,46,45,46,46,48,47,48,48,64,64, \
- 64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64, \
- 64,64,64,64,64,64,64,64,64,64,64,68,68,64,68,72, \
- 68,68,68,68,72,72,72,72,72,72,72,72,72,76,76,98, \
- 98,98,98,99,98,99,98,99,98,99,98,99,98,99,98,99, \
- 98,99,98,99,98,99,98,99,102,99,102,99,102,105,102,105, \
- 102,105,98,99,98,99,98,99,98,99,98,99,98,99,98,99, \
- 102,102,102,105,104,105,104,105,108,105,108,111,110,111,114,111, \
- 114,117,116,117,117,117,120,117,120,123,120,123,122,123,126,129, \
- 126,117,116,117,120,117,120,123,123,123,126,126,126,129,126,129, \
- 122,129,123,123,126,126,126,126,129,126,129,128,129,129,129,129, \
- 132,132,135,132,135,132,135,135,135,134,135,138,141,138,141,141, \
- 141,189,189,189,192,189,192,189,192,189,192,192,192,192,192,192, \
- 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, \
- 192,192,192,192,192,192,192,192,192,192,192,192,192,192,192,192, \
- 192,192,192,192,192,192,189,192,192,192,192,192,192,192,192,192, \
- 192,192,192,192,192,192,192,192,192,192,192,192,192,192,201,201, \
- 201,201,201,201,201,201,201,201,201,201,201,213,213,213,213,213, \
- 213,213,213,213,213,213,213,216,213,213,213,213,213,213,213,213, \
- 213,213,213,213,213,216,213,213,213,225,225,225,225,225,225,224, \
- 225,225,225,237,237,237,237,237,237,237,237,294,294,294,294,294, \
- 294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, \
- 294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, \
- 294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, \
+ -1,0,0,0,0,0,0,0,0,0,0,0,8,8,9,10, \
+ 10,10,11,11,12,12,13,14,14,14,15,15,16,16,17,18, \
+ 18,18,19,19,20,20,21,22,22,22,23,23,24,24,25,25, \
+ 26,26,27,27,28,28,29,30,32,32,32,32,32,36,36,36, \
+ 36,36,36,36,36,36,40,40,40,40,40,42,44,44,44,44, \
+ 44,44,44,44,44,48,48,48,48,52,52,52,52,52,52,52, \
+ 64,64,64,64,64,64,64,64,64,64,64,64,64,64,68,72, \
+ 72,64,64,64,64,64,64,64,64,64,64,68,68,68,72,72, \
+ 72,72,72,72,72,72,72,72,72,72,72,72,72,80,80,80, \
+ 80,80,80,84,80,80,80,88,88,84,88,88,88,88,88,99, \
+ 99,99,105,99,99,105,105,99,99,105,105,105,105,105,105,105, \
+ 105,105,105,105,105,105,105,105,105,105,105,105,105,111,111,111, \
+ 111,111,117,117,117,117,117,117,117,117,123,123,123,123,105,105, \
+ 117,129,129,111,111,111,117,117,117,117,117,117,123,123,123,123, \
+ 123,123,123,123,129,129,129,129,129,129,129,129,129,129,135,135, \
+ 135,135,141,141,141,141,141,141,141,141,141,147,147,147,147,147, \
+ 153,153,153,153,153,153,153,153,153,153,153,153,153,153,153,153, \
+ 153,153,153,153,153,153,141,141,147,147,147,147,147,147,189,189, \
+ 189,189,189,189,189,189,189,189,189,189,189,189,189,189,189,189, \
+ 189,189,201,201,201,201,201,201,201,189,201,201,201,201,213,213, \
+ 213,213,213,189,189,189,189,189,189,189,189,189,189,189,189,189, \
+ 201,201,201,201,201,201,201,201,201,201,189,189,189,213,213,213, \
+ 213,213,213,213,213,213,213,213,201,201,201,201,201,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,213,213,213,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,237,237,237,237,237,237,237,237,237,237,237,237, \
+ 237,237,237,237,237,237,237,237,237,237,237,237,237,237,237,249, \
+ 249,261,261,261,261,261,261,294,294,294,294,294,261,261,261,294, \
294,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, \
- 294,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, \
+ 294,294,294,294,294,294,294,294,294,312,312,312,294,294,294,294, \
+ 294,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312, \
+ 312,312,312,402,402,402,402,402,402,402,402,402,402,402,402,402, \
402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, \
402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, \
402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, \
- 402,402,402,402,402,402,402,402,402,402,402,402,400,402,402,402, \
402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, \
402,402,402,402,402,402,402,402,402,402,402,402,402,402,402,402, \
- 402,402,402,402,402,402,402,402,402,402,402,426,426,426,504,504, \
- 504,503,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,503,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,503,504, \
+ 402,402,402,402,402,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,426,426,426,426,426,426,426, \
+ 426,426,426,426,426,426,426,426,426,456,504,426,426,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 503,504,504,504,504,504,504,504,504,504,504,504,504,504,504,503, \
- 504,504,503,504,504,504,504,536,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,536,536,536,536,536,536,535, \
- 536,536,535,536,536,536,536,536,568,568,568,568,568,568,568,568, \
- 568,568,568,568,567,568,568,568,568,568,568,568,568,568,568,567, \
- 568,568,567,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,599, \
- 600,600,568,600,600,568,600,600,600,600,568,600,568,600,504,504, \
- 504,504,504,504,504,503,503,503,504,503,504,504,504,504,502,504, \
+ 504,504,504,504,504,504,504,504,536,504,504,504,504,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,503,503,504,504,504,504,504,504,504,503,504,504,504,504,504, \
- 504,504,504,536,536,536,536,536,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,536,535,536,536,536,536,536, \
- 536,536,536,536,568,568,568,568,552,568,568,568,568,568,568,536 \
+ 504,504,504,504,504,504,504,504,504,536,536,504,536,536,536,536, \
+ 504,536,536,536,536,536,536,536,536,536,536,536,536,536,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,600,600,600,600,600,600,600,600,600,600, \
+ 600,600,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,624,632,632,632,632,632,632,632,632,632,632,632,632,632,632, \
+ 632,632,632,632,664,632,664,664,664,664,664,664,664,664,664,664, \
+ 664,664,664,664,664,664,664,696,664,696,696,696,696,696,696,696, \
+ 696,696,696,696,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,536,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568 \
#define MPFR_DIVHIGH_TAB \
- 0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*32-47*/ \
- 0,0,0,27,0,28,0,29,30,30,31,32,32,33,34,33, /*48-63*/ \
- 34,35,36,35,36,36,37,37,38,39,39,39,40,40,41,41, /*64-79*/ \
- 50,51,50,50,52,50,50,52,51,52,50,51,50,50,52,50, /*80-95*/ \
- 52,50,52,52,52,52,56,55,56,64,64,64,64,64,64,64, /*96-111*/ \
- 64,64,64,64,64,64,64,64,64,64,64,64,64,64,72,66, /*112-127*/ \
- 66,71,72,71,72,71,72,69,72,72,72,72,72,72,78,80, /*128-143*/ \
- 78,79,78,80,80,80,80,80,80,79,80,80,80,80,88,84, /*144-159*/ \
- 88,88,88,88,88,84,87,85,86,86,88,87,88,88,104,89, /*160-175*/ \
- 104,100,102,104,104,102,100,100,102,103,100,103,128,103,100,104, /*176-191*/ \
- 128,103,100,100,104,103,104,103,128,102,104,128,104,128,128,128, /*192-207*/ \
- 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /*208-223*/ \
- 128,128,128,128,128,128,128,128,128,128,128,128,128,128,128,128, /*224-239*/ \
- 128,128,127,127,128,128,127,128,128,128,140,128,144,128,144,132, /*240-255*/ \
- 144,135,143,144,144,143,144,143,144,144,142,143,144,144,140,144, /*256-271*/ \
- 138,141,144,144,144,143,144,143,144,144,144,144,144,144,160,160, /*272-287*/ \
- 160,160,148,152,156,157,160,160,160,158,159,160,160,160,160,159, /*288-303*/ \
- 160,160,160,159,159,160,160,159,159,160,160,161,176,160,162,181, /*304-319*/ \
- 182,185,186,184,185,186,185,176,185,186,200,192,186,208,184,208, /*320-335*/ \
- 185,206,200,200,203,200,208,204,204,206,208,208,209,208,208,208, /*336-351*/ \
- 206,208,206,206,200,204,204,208,208,208,208,208,208,208,208,208, /*352-367*/ \
- 207,204,206,207,208,208,208,206,208,208,208,208,208,208,208,206, /*368-383*/ \
- 208,208,208,208,206,208,208,208,256,256,208,256,256,206,256,256, /*384-399*/ \
- 256,256,256,208,255,256,256,256,256,256,256,256,256,256,256,256, /*400-415*/ \
- 256,256,256,256,256,256,256,256,256,256,256,256,256,256,256,256, /*416-431*/ \
- 256,256,255,256,256,256,256,256,256,256,256,254,256,255,256,256, /*432-447*/ \
- 256,256,256,256,256,256,255,255,256,256,256,255,254,254,256,253, /*448-463*/ \
- 256,256,256,256,256,256,256,256,256,255,255,256,256,256,256,256, /*464-479*/ \
- 256,256,256,255,256,256,255,256,256,256,256,255,254,256,256,255, /*480-495*/ \
- 256,256,256,256,255,256,255,255,255,256,255,256,256,256,257,264, /*496-511*/ \
- 272,264,269,281,277,281,280,268,269,281,282,282,279,264,288,288, /*512-527*/ \
- 287,280,281,280,288,288,288,282,287,288,287,288,287,288,282,287, /*528-543*/ \
- 281,282,288,288,280,288,288,282,281,288,280,282,287,288,287,288, /*544-559*/ \
- 282,288,288,288,287,285,288,287,288,288,288,288,288,288,289,292, /*560-575*/ \
- 296,293,304,304,304,312,304,306,304,305,303,304,312,304,305,316, /*576-591*/ \
- 315,318,318,312,316,316,318,316,316,320,318,318,320,320,371,370, /*592-607*/ \
- 371,372,373,372,372,373,376,376,378,377,378,378,384,373,377,372, /*608-623*/ \
- 378,372,378,378,378,378,377,384,378,384,378,372,378,378,378,378, /*624-639*/ \
- 372,377,378,378,377,378,378,378,377,371,384,384,378,378,378,378, /*640-655*/ \
- 378,377,378,378,378,378,378,378,378,384,384,384,383,384,417,384, /*656-671*/ \
- 378,378,378,378,377,378,378,401,378,400,378,378,400,408,384,412, /*672-687*/ \
- 384,384,414,408,416,417,411,416,384,414,414,414,416,416,417,414, /*688-703*/ \
- 416,420,400,412,412,412,416,413,416,414,414,416,416,416,412,412, /*704-719*/ \
- 416,416,414,416,416,416,417,416,416,416,416,414,415,416,416,416, /*720-735*/ \
- 414,378,378,377,384,378,378,384,384,384,384,384,384,384,414,384, /*736-751*/ \
- 415,416,416,413,414,416,416,413,414,414,416,416,415,416,416,400, /*752-767*/ \
- 412,408,417,411,412,416,415,416,416,412,416,417,416,414,416,416, /*768-783*/ \
- 416,416,416,416,416,416,416,414,416,416,416,400,415,416,416,401, /*784-799*/ \
- 416,420,412,408,408,412,416,407,408,416,415,412,416,414,416,415, /*800-815*/ \
- 414,412,413,416,412,414,413,416,416,416,418,416,416,416,417,417, /*816-831*/ \
- 419,418,420,419,420,420,426,421,424,426,424,432,426,425,426,426, /*832-847*/ \
- 426,426,432,432,432,432,432,432,432,432,436,432,432,432,433,435, /*848-863*/ \
- 440,438,440,438,436,440,440,438,448,444,444,448,440,444,448,446, /*864-879*/ \
- 444,448,444,443,444,446,446,448,448,449,448,448,448,449,450,468, /*880-895*/ \
- 466,468,460,457,458,460,463,456,460,456,464,467,462,473,512,458, /*896-911*/ \
- 488,468,512,473,512,468,512,510,512,512,510,510,512,508,512,512, /*912-927*/ \
- 512,512,510,512,512,510,512,510,474,511,486,512,512,512,512,512, /*928-943*/ \
- 509,510,510,512,512,512,512,512,512,512,514,512,512,511,508,512, /*944-959*/ \
- 512,510,512,511,512,508,512,512,512,511,512,512,510,512,512,510, /*960-975*/ \
- 512,510,510,512,512,511,512,512,512,512,512,512,512,512,549,512, /*976-991*/ \
- 512,512,545,512,512,512,510,512,512,512,512,512,512,512,510,512, /*992-1007*/ \
- 512,512,551,510,545,512,550,512,552,545,511,557,545,512,544,551 /*1008-1023*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*64-79*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*80-95*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,59, /*96-111*/ \
+ 58,59,62,60,60,60,62,62,62,62,63,72,72,72,72,72, /*112-127*/ \
+ 72,72,72,72,72,70,72,72,72,72,72,72,72,72,78,80, /*128-143*/ \
+ 80,84,80,80,79,80,80,88,80,80,88,87,80,80,88,88, /*144-159*/ \
+ 87,88,88,88,88,88,86,88,96,88,88,88,88,88,96,104, /*160-175*/ \
+ 104,96,96,96,96,96,96,104,96,104,104,104,104,104,104,100, /*176-191*/ \
+ 104,104,102,104,102,104,104,104,104,104,104,112,104,104,112,107, /*192-207*/ \
+ 112,112,112,112,112,112,112,120,112,112,128,112,112,128,124,122, /*208-223*/ \
+ 124,114,120,122,116,128,125,128,119,120,144,120,120,123,144,128, /*224-239*/ \
+ 144,126,144,128,144,144,144,144,144,144,144,144,144,144,144,144, /*240-255*/ \
+ 144,144,144,144,144,144,141,144,144,144,144,144,144,144,144,144, /*256-271*/ \
+ 144,144,144,144,144,159,144,144,144,144,144,144,144,144,160,160, /*272-287*/ \
+ 158,159,159,160,160,159,158,158,160,160,160,160,164,160,160,160, /*288-303*/ \
+ 160,159,160,160,160,160,160,158,160,160,160,160,160,160,174,176, /*304-319*/ \
+ 176,176,175,176,176,176,176,174,176,175,176,176,176,176,176,176, /*320-335*/ \
+ 176,176,173,176,176,176,186,192,176,184,176,208,191,176,192,192, /*336-351*/ \
+ 185,207,192,208,192,191,192,207,206,208,192,207,208,208,208,208, /*352-367*/ \
+ 208,208,207,208,208,208,209,208,209,209,209,208,208,208,208,208, /*368-383*/ \
+ 208,208,208,207,208,208,216,208,208,208,208,208,208,208,208,208, /*384-399*/ \
+ 208,208,209,224,207,208,208,208,208,209,208,207,208,224,224,223, /*400-415*/ \
+ 224,216,221,222,233,216,221,224,234,224,224,224,224,240,224,232, /*416-431*/ \
+ 240,240,239,243,247,224,240,246,246,240,256,256,240,256,248,256, /*432-447*/ \
+ 250,256,256,256,240,240,256,256,256,256,252,256,256,240,253,246, /*448-463*/ \
+ 254,252,256,255,255,256,256,254,256,256,256,256,288,288,256,287, /*464-479*/ \
+ 256,288,248,256,246,288,288,256,288,288,256,288,288,288,256,282, /*480-495*/ \
+ 288,288,288,256,288,288,256,256,288,256,288,288,256,256,287,288, /*496-511*/ \
+ 285,284,288,288,288,304,287,288,288,288,288,288,282,288,288,288, /*512-527*/ \
+ 288,288,288,287,286,288,288,288,288,288,288,287,288,286,287,288, /*528-543*/ \
+ 288,288,288,288,288,288,304,288,288,287,287,286,288,288,287,288, /*544-559*/ \
+ 288,288,288,287,288,287,288,288,288,288,288,288,288,288,290,320, /*560-575*/ \
+ 318,320,304,320,302,320,304,304,305,320,305,318,318,320,320,320, /*576-591*/ \
+ 318,320,319,317,320,312,316,320,318,319,320,320,320,320,318,312, /*592-607*/ \
+ 316,312,319,318,320,328,318,318,320,320,336,320,316,318,319,319, /*608-623*/ \
+ 320,318,319,320,320,320,320,319,352,350,351,352,352,352,324,351, /*624-639*/ \
+ 352,352,351,336,351,372,371,350,378,336,336,368,372,378,351,372, /*640-655*/ \
+ 378,384,384,352,352,352,378,383,352,352,384,371,384,384,372,351, /*656-671*/ \
+ 384,352,368,384,384,372,352,382,384,378,376,384,370,383,372,384, /*672-687*/ \
+ 372,384,384,378,378,417,414,417,416,384,416,416,384,416,378,416, /*688-703*/ \
+ 417,384,372,414,416,416,384,415,414,417,416,416,415,416,416,384, /*704-719*/ \
+ 417,416,416,416,416,416,416,416,416,416,416,415,416,416,416,418, /*720-735*/ \
+ 417,417,419,416,416,417,418,418,417,416,414,416,414,414,418,416, /*736-751*/ \
+ 415,418,417,416,420,416,418,416,416,416,416,417,384,416,420,417, /*752-767*/ \
+ 414,416,418,415,416,416,416,414,417,418,413,418,416,417,416,417, /*768-783*/ \
+ 417,416,418,416,416,414,416,418,417,420,414,416,415,416,416,417, /*784-799*/ \
+ 416,418,418,414,418,416,417,416,416,416,416,416,415,415,417,415, /*800-815*/ \
+ 418,420,414,418,415,416,419,415,416,416,416,415,416,417,418,418, /*816-831*/ \
+ 420,426,420,419,431,424,426,432,431,431,426,430,432,426,432,426, /*832-847*/ \
+ 426,432,432,432,432,440,432,432,448,432,432,448,432,432,444,449, /*848-863*/ \
+ 448,464,438,474,444,444,444,440,449,473,480,441,446,480,448,474, /*864-879*/ \
+ 448,448,471,466,472,448,448,447,479,472,474,448,480,448,464,449, /*880-895*/ \
+ 468,456,467,480,466,468,474,461,455,467,473,473,466,466,468,473, /*896-911*/ \
+ 480,474,471,468,462,468,467,480,478,479,480,474,479,480,478,474, /*912-927*/ \
+ 478,474,473,480,480,480,480,480,480,480,472,471,474,480,480,474, /*928-943*/ \
+ 474,480,480,480,479,492,480,479,479,480,480,480,491,480,504,512, /*944-959*/ \
+ 493,512,492,512,513,512,497,494,488,492,512,512,499,512,507,510, /*960-975*/ \
+ 504,494,512,510,512,511,512,511,512,512,512,512,513,512,512,508, /*976-991*/ \
+ 512,504,528,512,511,512,512,513,511,504,512,512,515,504,552,552, /*992-1007*/ \
+ 510,576,512,512,512,508,512,576,514,512,512,576,576,570,575,576 /*1008-1023*/ \
-#define MPFR_MUL_THRESHOLD 6 /* limbs */
-#define MPFR_SQR_THRESHOLD 9 /* limbs */
-#define MPFR_DIV_THRESHOLD 6 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 530 /* bits */
-#define MPFR_EXP_THRESHOLD 12546 /* bits */
-#define MPFR_SINCOS_THRESHOLD 22043 /* bits */
-#define MPFR_AI_THRESHOLD1 -17975 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 1889
-#define MPFR_AI_THRESHOLD3 28004
-/* Tuneup completed successfully, took 13753 seconds */
+#define MPFR_MUL_THRESHOLD 5 /* limbs */
+#define MPFR_SQR_THRESHOLD 8 /* limbs */
+#define MPFR_DIV_THRESHOLD 5 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 215 /* bits */
+#define MPFR_EXP_THRESHOLD 12405 /* bits */
+#define MPFR_SINCOS_THRESHOLD 20831 /* bits */
+#define MPFR_AI_THRESHOLD1 -19332 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 2329
+#define MPFR_AI_THRESHOLD3 28997
+/* Tuneup completed successfully, took 6568 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/modf.c b/Build/source/libs/mpfr/mpfr-src/src/modf.c
index c98a957a2be..5187c658967 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/modf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/modf.c
@@ -1,6 +1,6 @@
/* mpfr_modf -- Integral and fractional part.
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,9 +22,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
-#define INEXPOS(y) ((y) == 0 ? 0 : (((y) > 0) ? 1 : 2))
-#define INEX(y,z) (INEXPOS(y) | (INEXPOS(z) << 2))
-
/* Set iop to the integral part of op and fop to its fractional part */
int
mpfr_modf (mpfr_ptr iop, mpfr_ptr fop, mpfr_srcptr op, mpfr_rnd_t rnd_mode)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mp_clz_tab.c b/Build/source/libs/mpfr/mpfr-src/src/mp_clz_tab.c
index d0af3494949..7ca11f5c83a 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mp_clz_tab.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mp_clz_tab.c
@@ -3,7 +3,7 @@
THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND MAY CHANGE
INCOMPATIBLY OR DISAPPEAR IN A FUTURE GNU MPFR RELEASE.
-Copyright 1991, 1993-1994, 1996-1997, 2000-2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1991, 1993-1994, 1996-1997, 2000-2001, 2004, 2006-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
It has been copied and adapted from the GNU MP Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mparam_h.in b/Build/source/libs/mpfr/mpfr-src/src/mparam_h.in
index bb34727e69d..6dbff467690 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mparam_h.in
+++ b/Build/source/libs/mpfr/mpfr-src/src/mparam_h.in
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -29,67 +29,53 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "generic/coverage/mparam.h"
/* Note: the different macros used here are those defined by gcc,
- for example with gcc -dM -E -xc /dev/null
- As of gcc 4.2, you can also use: -march=native or -mtune=native */
+ for example with gcc -mtune=native -dM -E -xc /dev/null */
#elif 1 /* no processor specific optimization for TeX Live */
#define MPFR_TUNE_CASE "default"
-#elif defined (__tune_pentium4__) /* Threshold for Pentium 4 */
-#define MPFR_TUNE_CASE "src/x86_64/pentium4/mparam.h"
-#include "x86_64/pentium4/mparam.h"
-
#elif (defined (__tune_core2__) || defined (__tune_nocona__)) && defined (__x86_64) /* 64-bit Core 2 or Xeon */
#define MPFR_TUNE_CASE "src/x86_64/core2/mparam.h"
#include "x86_64/core2/mparam.h"
-#elif defined (__tune_core2__) && defined (__i386) /* 32-bit Core 2,
- for example a 64-bit machine with gmp/mpfr compiled with ABI=32 */
-#define MPFR_TUNE_CASE "src/x86/core2/mparam.h"
-#include "x86/core2/mparam.h"
-
-#elif defined (__tune_k8__) && defined (__amd64__) /* AMD K8 */
-#define MPFR_TUNE_CASE "src/amd/k8/mparam.h"
-#include "amd/k8/mparam.h"
-
-#elif defined (__tune_athlon__) /* Threshold for Athlon */
-#define MPFR_TUNE_CASE "src/amd/athlon/mparam.h"
-#include "amd/athlon/mparam.h"
-
-#elif defined (__tune_pentiumpro__) || defined (__tune_i686__) || defined (__i386) /* we consider all other 386's here */
+/* Put that before __x86_64__ since __x86_64__ is also defined on AMD 64,
+ We also have to define __tune_k8__ since __amd64__ is also defined on
+ Intel x86_64! Ignore Clang as it defines both of these macros even on
+ Intel x86_64, and it does not seem to be possible to provide tuning
+ information when compiling with Clang, so that it is better to select
+ generic parameters for x86_64. */
+#elif defined (__amd64__) && (defined (__tune_k8__) || defined (__tune_znver1__)) && ! defined (__clang__) /* AMD 64 */
+#define MPFR_TUNE_CASE "src/amd/mparam.h"
+#include "amd/mparam.h"
+
+/* _M_X64 is for the Microsoft compiler, see
+ https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros */
+#elif defined (__x86_64__) || defined (_M_X64)
+/* generic parameters for x86_64 */
+#define MPFR_TUNE_CASE "src/x86_64/mparam.h"
+#include "x86_64/mparam.h"
+
+#elif defined (__i386) || defined(_M_IX86)
+/* we consider all other 386's here,
+ including a 64-bit machine with gmp/mpfr compiled with ABI=32 */
#define MPFR_TUNE_CASE "src/x86/mparam.h"
#include "x86/mparam.h"
-#elif defined (__ia64) || defined (__itanium__) || defined (__tune_ia64__)
-/* Threshold for IA64 */
-#define MPFR_TUNE_CASE "src/ia64/mparam.h"
-#include "ia64/mparam.h"
-
-#elif defined (__arm__) /* Threshold for ARM */
-#define MPFR_TUNE_CASE "src/arm/mparam.h"
-#include "arm/mparam.h"
-
-#elif defined (__PPC64__) /* Threshold for 64-bit PowerPC, test it before
- 32-bit PowerPC since _ARCH_PPC is also defined
- on 64-bit PowerPC */
+#elif defined (__PPC64__) /* Threshold for 64-bit PowerPC */
#define MPFR_TUNE_CASE "src/powerpc64/mparam.h"
#include "powerpc64/mparam.h"
-#elif defined (_ARCH_PPC) /* Threshold for 32-bit PowerPC */
-#define MPFR_TUNE_CASE "src/powerpc32/mparam.h"
-#include "powerpc32/mparam.h"
-
-#elif defined (__sparc_v9__) /* Threshold for 64-bits Sparc */
+#elif defined (__sparc_v9__) /* Threshold for 64-bit Sparc */
#define MPFR_TUNE_CASE "src/sparc64/mparam.h"
#include "sparc64/mparam.h"
-#elif defined (__hppa__) /* Threshold for HPPA */
-#define MPFR_TUNE_CASE "src/hppa/mparam.h"
-#include "hppa/mparam.h"
-
#elif defined (__mips__) /* MIPS */
#define MPFR_TUNE_CASE "src/mips/mparam.h"
#include "mips/mparam.h"
+#elif defined (__arm__) || defined (_M_ARM) /* ARM */
+#define MPFR_TUNE_CASE "src/arm/mparam.h"
+#include "arm/mparam.h"
+
#else
#define MPFR_TUNE_CASE "default"
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpf2mpfr.h b/Build/source/libs/mpfr/mpfr-src/src/mpf2mpfr.h
index c4808331827..f0985fb65be 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpf2mpfr.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpf2mpfr.h
@@ -1,6 +1,6 @@
/* mpf2mpfr.h -- Compatibility include file with mpf.
-Copyright 1999-2002, 2004-2019 Free Software Foundation, Inc.
+Copyright 1999-2002, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-cvers.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-cvers.h
index 7b7654f9583..50da831955e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-cvers.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-cvers.h
@@ -1,6 +1,6 @@
/* Utilities for MPFR developers, not exported.
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.c b/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.c
index 49feedc4e45..a20ce5bc50f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.c
@@ -1,7 +1,7 @@
/* mpfr_gmp -- Limited gmp-impl emulator
Modified version of the GMP files.
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -300,7 +300,7 @@ mpfr_assert_fail (const char *filename, int linenum,
abort();
}
-/* Performing a concentration for theses indirect functions may be
+/* Performing a concentration for these indirect functions may be
good for performance since branch prediction for indirect calls
is not well supported by a lot of CPU's (typically they can only
predict a limited number of indirections). */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.h
index 242ce44d3a6..f7bc57df233 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-gmp.h
@@ -1,6 +1,6 @@
/* Uniform Interface to GMP.
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -64,11 +64,15 @@ extern "C" {
# error "MPFR doesn't support nonzero values of GMP_NAIL_BITS"
#endif
-#if (GMP_NUMB_BITS<32) || (GMP_NUMB_BITS & (GMP_NUMB_BITS - 1))
-# error "GMP_NUMB_BITS must be a power of 2, and >= 32"
+#if (GMP_NUMB_BITS<8) || (GMP_NUMB_BITS & (GMP_NUMB_BITS - 1))
+# error "GMP_NUMB_BITS must be a power of 2, and >= 8"
#endif
-#if GMP_NUMB_BITS == 32
+#if GMP_NUMB_BITS == 8
+# define MPFR_LOG2_GMP_NUMB_BITS 3
+#elif GMP_NUMB_BITS == 16
+# define MPFR_LOG2_GMP_NUMB_BITS 4
+#elif GMP_NUMB_BITS == 32
# define MPFR_LOG2_GMP_NUMB_BITS 5
#elif GMP_NUMB_BITS == 64
# define MPFR_LOG2_GMP_NUMB_BITS 6
@@ -94,27 +98,6 @@ extern "C" {
#else /* without gmp build (gmp-impl.h replacement) */
-/* The following tries to get a good version of alloca.
- See gmp-impl.h for implementation details and original version */
-/* FIXME: the autoconf manual gives a different piece of code under the
- documentation of the AC_FUNC_ALLOCA macro. Should we switch to it? */
-#ifndef alloca
-# if defined ( __GNUC__ )
-# define alloca __builtin_alloca
-# elif defined (__DECC)
-# define alloca(x) __ALLOCA(x)
-# elif defined (_MSC_VER)
-# include <malloc.h>
-# define alloca _alloca
-# elif defined (HAVE_ALLOCA_H)
-# include <alloca.h>
-# elif defined (_AIX) || defined (_IBMR2)
-# pragma alloca
-# else
-void *alloca (size_t);
-# endif
-#endif
-
/* Define some macros */
#define ULONG_HIGHBIT (ULONG_MAX ^ ((unsigned long) ULONG_MAX >> 1))
@@ -130,7 +113,9 @@ void *alloca (size_t);
#define MP_SIZE_T_MIN LONG_MIN
#endif
-/* MP_LIMB macros */
+/* MP_LIMB macros.
+ Note: GMP now also has the MPN_FILL macro, and GMP's MPN_ZERO(dst,n) is
+ defined as "if (n) MPN_FILL(dst, n, 0);". */
#define MPN_ZERO(dst, n) memset((dst), 0, (n)*MPFR_BYTES_PER_MP_LIMB)
#define MPN_COPY(dst,src,n) \
do \
@@ -177,6 +162,10 @@ void *alloca (size_t);
#define MPN_SAME_OR_DECR_P(dst, src, size) \
MPN_SAME_OR_DECR2_P(dst, size, src, size)
+#ifndef MUL_FFT_THRESHOLD
+#define MUL_FFT_THRESHOLD 8448
+#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))
@@ -259,28 +248,6 @@ __MPFR_DECLSPEC extern const struct bases mpfr_bases[257];
#define MIN(l,o) ((l) < (o) ? (l) : (o))
#define MAX(h,i) ((h) > (i) ? (h) : (i))
-/* Size of an array, safe version but not a constant expression:
- Since an array can silently be converted to a pointer, we check
- that this macro is applied on an array, not a pointer. */
-#undef numberof
-#if 0
-/* The following should work with GCC as documented in its manual,
- but fails: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38377#c10
- Thus disabled for now. */
-# define numberof(x) \
- ( __extension__ ({ \
- int is_array = (void *) &(x) == (void *) &(x)[0]; \
- MPFR_STAT_STATIC_ASSERT (__builtin_constant_p (is_array) ? \
- is_array : 1); \
- MPFR_ASSERTN (is_array); \
- numberof_const (x); \
- }) )
-#else
-# define numberof(x) \
- (MPFR_ASSERTN ((void *) &(x) == (void *) &(x)[0]), \
- numberof_const (x))
-#endif
-
__MPFR_DECLSPEC void * mpfr_allocate_func (size_t);
__MPFR_DECLSPEC void * mpfr_reallocate_func (void *, size_t, size_t);
__MPFR_DECLSPEC void mpfr_free_func (void *, size_t);
@@ -298,7 +265,14 @@ __MPFR_DECLSPEC mp_limb_t __gmpn_invert_limb (mp_limb_t);
#endif
#endif
-/* Temp memory allocate */
+#if defined(WANT_GMP_INTERNALS) && defined(HAVE___GMPN_RSBLSH1_N)
+#ifndef __gmpn_rsblsh1_n
+__MPFR_DECLSPEC mp_limb_t __gmpn_rsblsh1_n (mp_limb_t*, mp_limb_t*, mp_limb_t*, mp_size_t);
+#endif
+#endif
+
+/* Definitions related to temporary memory allocation */
+
struct tmp_marker
{
void *ptr;
@@ -310,16 +284,62 @@ __MPFR_DECLSPEC void *mpfr_tmp_allocate (struct tmp_marker **,
size_t);
__MPFR_DECLSPEC void mpfr_tmp_free (struct tmp_marker *);
-/* Can be overridden at configure time. Useful for checking buffer overflow. */
+/* Default MPFR_ALLOCA_MAX value. It can be overridden at configure time;
+ with some tools, by giving a low value such as 0, this is useful for
+ checking buffer overflow, which may not be possible with alloca.
+ If HAVE_ALLOCA is not defined, then alloca() is not available, so that
+ MPFR_ALLOCA_MAX needs to be 0 (see the definition of TMP_ALLOC below);
+ if the user has explicitly given a non-zero value, this will probably
+ yield an error at link time or at run time. */
#ifndef MPFR_ALLOCA_MAX
-# define MPFR_ALLOCA_MAX 16384
+# ifdef HAVE_ALLOCA
+# define MPFR_ALLOCA_MAX 16384
+# else
+# define MPFR_ALLOCA_MAX 0
+# endif
#endif
/* Do not define TMP_SALLOC (see the test in mpfr-impl.h)! */
-#define TMP_ALLOC(n) (MPFR_LIKELY ((n) <= MPFR_ALLOCA_MAX) ? \
+
+#if MPFR_ALLOCA_MAX != 0
+
+/* The following tries to get a good version of alloca.
+ See gmp-impl.h for implementation details and original version */
+/* FIXME: the autoconf manual gives a different piece of code under the
+ documentation of the AC_FUNC_ALLOCA macro. Should we switch to it?
+ But note that the HAVE_ALLOCA test in it seems wrong.
+ https://lists.gnu.org/archive/html/bug-autoconf/2019-01/msg00009.html */
+#ifndef alloca
+# if defined ( __GNUC__ )
+# define alloca __builtin_alloca
+# elif defined (__DECC)
+# define alloca(x) __ALLOCA(x)
+# elif defined (_MSC_VER)
+# include <malloc.h>
+# define alloca _alloca
+# elif defined (HAVE_ALLOCA_H)
+# include <alloca.h>
+# elif defined (_AIX) || defined (_IBMR2)
+# pragma alloca
+# else
+void *alloca (size_t);
+# endif
+#endif
+
+#define TMP_ALLOC(n) (MPFR_ASSERTD ((n) > 0), \
+ MPFR_LIKELY ((n) <= MPFR_ALLOCA_MAX) ? \
alloca (n) : mpfr_tmp_allocate (&tmp_marker, (n)))
+
+#else /* MPFR_ALLOCA_MAX == 0, alloca() not needed */
+
+#define TMP_ALLOC(n) (mpfr_tmp_allocate (&tmp_marker, (n)))
+
+#endif
+
#define TMP_DECL(m) struct tmp_marker *tmp_marker
+
#define TMP_MARK(m) (tmp_marker = 0)
+
/* Note about TMP_FREE: For small precisions, tmp_marker is null as
the allocation is done on the stack (see TMP_ALLOC above). */
#define TMP_FREE(m) \
@@ -335,6 +355,84 @@ __MPFR_DECLSPEC void mpfr_tmp_free (struct tmp_marker *);
****** interfaces. *****
******************************************************/
+#ifndef MPFR_LONG_WITHIN_LIMB
+
+/* the following routines assume that an unsigned long has at least twice the
+ size of an mp_limb_t */
+
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ unsigned long _p = (unsigned long) (m0) * (unsigned long) (m1); \
+ (ph) = (mp_limb_t) (_p >> GMP_NUMB_BITS); \
+ (pl) = (mp_limb_t) (_p & MPFR_LIMB_MAX); \
+ } while (0)
+
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ unsigned long _a = ((unsigned long) (ah) << GMP_NUMB_BITS) + (al); \
+ unsigned long _b = ((unsigned long) (bh) << GMP_NUMB_BITS) + (bl); \
+ unsigned long _s = _a + _b; \
+ (sh) = (mp_limb_t) (_s >> GMP_NUMB_BITS); \
+ (sl) = (mp_limb_t) (_s & MPFR_LIMB_MAX); \
+ } while (0)
+
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ unsigned long _a = ((unsigned long) (ah) << GMP_NUMB_BITS) + (al); \
+ unsigned long _b = ((unsigned long) (bh) << GMP_NUMB_BITS) + (bl); \
+ unsigned long _s = _a - _b; \
+ (sh) = (mp_limb_t) (_s >> GMP_NUMB_BITS); \
+ (sl) = (mp_limb_t) (_s & MPFR_LIMB_MAX); \
+ } while (0)
+
+#define count_leading_zeros(count,x) \
+ do { \
+ int _c = 0; \
+ mp_limb_t _x = (mp_limb_t) (x); \
+ while (GMP_NUMB_BITS > 16 && (_x >> (GMP_NUMB_BITS - 16)) == 0) \
+ { \
+ _c += 16; \
+ _x = (mp_limb_t) (_x << 16); \
+ } \
+ if (GMP_NUMB_BITS > 8 && (_x >> (GMP_NUMB_BITS - 8)) == 0) \
+ { \
+ _c += 8; \
+ _x = (mp_limb_t) (_x << 8); \
+ } \
+ if (GMP_NUMB_BITS > 4 && (_x >> (GMP_NUMB_BITS - 4)) == 0) \
+ { \
+ _c += 4; \
+ _x = (mp_limb_t) (_x << 4); \
+ } \
+ if (GMP_NUMB_BITS > 2 && (_x >> (GMP_NUMB_BITS - 2)) == 0) \
+ { \
+ _c += 2; \
+ _x = (mp_limb_t) (_x << 2); \
+ } \
+ if ((_x & MPFR_LIMB_HIGHBIT) == 0) \
+ _c ++; \
+ (count) = _c; \
+ } while (0)
+
+#define invert_limb(invxl,xl) \
+ do { \
+ unsigned long _num; \
+ MPFR_ASSERTD ((xl) != 0); \
+ _num = (unsigned long) (mp_limb_t) ~(xl); \
+ _num = (_num << GMP_NUMB_BITS) | MPFR_LIMB_MAX; \
+ (invxl) = _num / (xl); \
+ } while (0)
+
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ unsigned long _num; \
+ _num = ((unsigned long) (n1) << GMP_NUMB_BITS) | (n0); \
+ (q) = _num / (d); \
+ (r) = _num % (d); \
+ } while (0)
+
+#endif
+
/* If mpn_sqr is not defined, use mpn_mul_n instead
(mpn_sqr was called mpn_sqr_n (internal) in older versions of GMP). */
#ifndef mpn_sqr
@@ -399,7 +497,10 @@ __MPFR_DECLSPEC void mpfr_tmp_free (struct tmp_marker *);
} while (0)
#endif
-/* invert_pi1 macro adapted from GMP 5 */
+/* invert_pi1 macro adapted from GMP 5, this computes in (dinv).inv32
+ the value of floor((beta^3 - 1)/(d1*beta+d0)) - beta,
+ cf "Improved Division by Invariant Integers" by Niels Möller and
+ Torbjörn Granlund */
typedef struct {mp_limb_t inv32;} mpfr_pi1_t;
#ifndef invert_pi1
#define invert_pi1(dinv, d1, d0) \
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h
index 805e3cb4ac5..c9c792a2132 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-impl.h
@@ -1,6 +1,6 @@
/* Utilities for MPFR developers, not exported.
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -51,12 +51,11 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#endif
/* Since <stdio.h> (<cstdio> for C++) is unconditionally included... */
-#ifndef MPFR_DONT_USE_FILE
-# define MPFR_USE_FILE
-#endif
+#define MPFR_USE_FILE
#include <stdlib.h>
#include <limits.h>
+#include <float.h> /* for FLT_RADIX, etc., tested below */
/******************************************************
@@ -70,6 +69,11 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#if defined(_MPFR_EXP_FORMAT) && _MPFR_EXP_FORMAT == 4
/* mpfr_exp_t will be defined as intmax_t */
+# undef MPFR_NEED_INTMAX_H
+# define MPFR_NEED_INTMAX_H 1
+#endif
+
+#ifdef MPFR_NEED_INTMAX_H
# include "mpfr-intmax.h"
#endif
@@ -88,9 +92,35 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#endif
#include "mpfr-thread.h"
+#ifndef MPFR_USE_MINI_GMP
+#include "gmp.h"
+#else
+#include "mini-gmp.h"
+#endif
+
+/* With the current code, MPFR_LONG_WITHIN_LIMB must be defined if an
+ unsigned long fits in a limb. Since one cannot rely on the configure
+ tests entirely (in particular when GMP is involved) and some platforms
+ may not use configure, handle this definition here. A limb (mp_limb_t)
+ is normally defined as an unsigned long, but this may not be the case
+ with mini-gmp (and we can't rely on __GMP_SHORT_LIMB for this reason).
+ So, concerning mp_limb_t, we can only test GMP_NUMB_BITS.
+ Chosen heuristic: define MPFR_LONG_WITHIN_LIMB only when
+ * mp_limb_t and unsigned long have both 32 bits exactly, or
+ * mp_limb_t has at least 64 bits.
+ Since we require that mp_limb_t have a size that is a power of 2, we
+ can currently be wrong only if mini-gmp is used and unsigned long has
+ more than 64 bits, which is unlikely to occur. */
+#if GMP_NUMB_BITS >= 64 || (GMP_NUMB_BITS == 32 && ULONG_MAX == 0xffffffff)
+# undef MPFR_LONG_WITHIN_LIMB
+# define MPFR_LONG_WITHIN_LIMB 1
+#endif
+
#ifdef MPFR_HAVE_GMP_IMPL /* Build with gmp internals */
-# include "gmp.h"
+# ifdef MPFR_USE_MINI_GMP
+# error "MPFR_HAVE_GMP_IMPL and MPFR_USE_MINI_GMP must not be both defined"
+# endif
# include "gmp-impl.h"
# ifdef MPFR_NEED_LONGLONG_H
# include "longlong.h"
@@ -100,16 +130,17 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#else /* Build without gmp internals */
-# include "gmp.h"
/* if using mini-gmp, include missing definitions in mini-gmp */
# ifdef MPFR_USE_MINI_GMP
# include "mpfr-mini-gmp.h"
# endif
# include "mpfr.h"
# include "mpfr-gmp.h"
-# ifdef MPFR_NEED_LONGLONG_H
-# define LONGLONG_STANDALONE
-# include "mpfr-longlong.h"
+# ifdef MPFR_LONG_WITHIN_LIMB /* longlong.h is not valid otherwise */
+# ifdef MPFR_NEED_LONGLONG_H
+# define LONGLONG_STANDALONE
+# include "mpfr-longlong.h"
+# endif
# endif
#endif
@@ -118,26 +149,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/******************************************************
- ***************** (U)INTMAX_MAX ********************
- ******************************************************/
-
-/* Let's try to fix UINTMAX_MAX and INTMAX_MAX if these macros don't work
- (e.g. with gcc -ansi -pedantic-errors in 32-bit mode under GNU/Linux),
- see <https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582698>. */
-#ifdef _MPFR_H_HAVE_INTMAX_T
-# ifdef MPFR_HAVE_INTMAX_MAX
-# define MPFR_UINTMAX_MAX UINTMAX_MAX
-# define MPFR_INTMAX_MAX INTMAX_MAX
-# define MPFR_INTMAX_MIN INTMAX_MIN
-# else
-# define MPFR_UINTMAX_MAX ((uintmax_t) -1)
-# define MPFR_INTMAX_MAX ((intmax_t) (MPFR_UINTMAX_MAX >> 1))
-# define MPFR_INTMAX_MIN (INT_MIN + INT_MAX - MPFR_INTMAX_MAX)
-# endif
-#endif
-
-
-/******************************************************
************* Attribute definitions ****************
******************************************************/
@@ -162,9 +173,9 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#endif
#if __MPFR_GNUC(3,0) || __MPFR_ICC(8,1,0)
-# define MPFR_CONST_ATTR __attribute__ ((const))
+# define MPFR_CONST_FUNCTION_ATTR __attribute__ ((const))
#else
-# define MPFR_CONST_ATTR
+# define MPFR_CONST_FUNCTION_ATTR
#endif
#if __MPFR_GNUC(3,0) || __MPFR_ICC(8,1,0)
@@ -197,6 +208,15 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_MAYBE_UNUSED
#endif
+/* This MPFR_FALLTHROUGH macro allows one to make fallthrough in switch case
+ explicit. Use this macro at the end of a switch case if it falls through,
+ in order to avoid a -Wimplicit-fallthrough warning. */
+#if __MPFR_GNUC(7,0)
+#define MPFR_FALLTHROUGH __attribute__ ((fallthrough))
+#else
+#define MPFR_FALLTHROUGH
+#endif
+
/******************************************************
@@ -458,6 +478,9 @@ __MPFR_DECLSPEC extern const mpfr_t __gmpfr_const_log2_RNDU;
MPFR_DBGRES(assignment): to be used when the result is tested only
in an MPFR_ASSERTD expression (in order to avoid a warning, e.g.
with GCC's -Wunused-but-set-variable, in non-debug mode).
+ Note: WG14/N2270 proposed a maybe_unused attribute, which could
+ be useful to avoid MPFR_DBGRES. See:
+ http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2270.pdf
Note: Evaluating expr might yield side effects, but such side effects
must not change the results (except by yielding an assertion failure).
*/
@@ -591,6 +614,11 @@ __MPFR_DECLSPEC extern const mpfr_t __gmpfr_const_log2_RNDU;
# undef _MPFR_IEEE_FLOATS
# endif
# define _MPFR_IEEE_FLOATS 0
+# undef HAVE_LDOUBLE_IS_DOUBLE
+# undef HAVE_LDOUBLE_IEEE_EXT_LITTLE
+# undef HAVE_LDOUBLE_IEEE_EXT_BIG
+# undef HAVE_LDOUBLE_IEEE_QUAD_BIG
+# undef HAVE_LDOUBLE_IEEE_QUAD_LITTLE
#endif
#ifndef IEEE_DBL_MANT_DIG
@@ -646,10 +674,10 @@ static double double_zero = 0.0;
(with Xcode 2.4.1, i.e. the latest one). */
#define LVALUE(x) (&(x) == &(x) || &(x) != &(x))
#define DOUBLE_ISINF(x) (LVALUE(x) && ((x) > DBL_MAX || (x) < -DBL_MAX))
-/* The DOUBLE_ISNAN(x) macro is also valid on long double x
- (assuming that the compiler isn't too broken). */
-#ifdef MPFR_NANISNAN
-/* Avoid MIPSpro / IRIX64 / gcc -ffast-math (incorrect) optimizations.
+/* The DOUBLE_ISNAN(x) macro must be valid with any real floating type,
+ thus constants must be of integer type (e.g. 0). */
+#if defined(MPFR_NANISNAN) || (__MPFR_GNUC(1,0) && !defined(__STRICT_ANSI__))
+/* Avoid MIPSpro / IRIX64 / GCC (incorrect) optimizations.
The + must not be replaced by a ||. With gcc -ffast-math, NaN is
regarded as a positive number or something like that; the second
test catches this case.
@@ -657,9 +685,19 @@ static double double_zero = 0.0;
-ffinite-math-only; such options are not supported, but this makes
difficult to test MPFR assuming x == x optimization to 1. Anyway
support of functions/tests of using native FP and special values for
- non-IEEE-754 environment will always be on a case-by-case basis. */
+ non-IEEE-754 environment will always be on a case-by-case basis.
+ [2018-06-02] Let's use this macro instead of the usual (x) != (x) test
+ with all GCC versions except in ISO C mode[*], as due to
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=323
+ there is no guarantee that (x) != (x) will be true only for NaN.
+ Testing __STRICT_ANSI__ is suggested in:
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85995
+ but this is not safe if the user adds a -f option affecting conformance,
+ in which case this would be a user error (however, note that the
+ configure test associated with MPFR_NANISNAN will catch some issues).
+*/
# define DOUBLE_ISNAN(x) \
- (LVALUE(x) && !((((x) >= 0.0) + ((x) <= 0.0)) && -(x)*(x) <= 0.0))
+ (LVALUE(x) && !((((x) >= 0) + ((x) <= 0)) && -(x)*(x) <= 0))
#else
# define DOUBLE_ISNAN(x) (LVALUE(x) && (x) != (x))
#endif
@@ -692,8 +730,6 @@ static double double_zero = 0.0;
# define MPFR_LDBL_MANT_DIG \
(sizeof(long double)*GMP_NUMB_BITS/sizeof(mp_limb_t))
#endif
-#define MPFR_LIMBS_PER_LONG_DOUBLE \
- ((sizeof(long double)-1)/sizeof(mp_limb_t)+1)
/* LONGDOUBLE_NAN_ACTION executes the code "action" if x is a NaN. */
@@ -753,16 +789,15 @@ static double double_zero = 0.0;
if ((x) != __x) \
{ action; } \
} while (0)
-# define WANT_LONGDOUBLE_VOLATILE 1
-#endif
-/* If we don't have a proper "volatile" then volatile is #defined to empty,
- in this case call through an external function to stop the compiler
- optimizing anything. */
-#ifdef WANT_LONGDOUBLE_VOLATILE
+/* Some compilers do not have a proper "volatile" and #define volatile
+ to empty (to avoid a build failure with programs using "volatile"),
+ i.e. "volatile" is just ignored and will not prevent optimizations
+ that could potentially break the IEEE rules. In this case, call an
+ external function, hoping that the compiler will not optimize. */
# ifdef volatile
__MPFR_DECLSPEC long double
- __gmpfr_longdouble_volatile (long double) MPFR_CONST_ATTR;
+ __gmpfr_longdouble_volatile (long double) MPFR_CONST_FUNCTION_ATTR;
# define LONGDOUBLE_VOLATILE(x) (__gmpfr_longdouble_volatile (x))
# define WANT_GMPFR_LONGDOUBLE_VOLATILE 1
# else
@@ -784,18 +819,13 @@ typedef union {
} s;
} mpfr_long_double_t;
-/* #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)/GMP_NUMB_BITS+1)
-
-#endif
+#endif /* HAVE_LDOUBLE_IEEE_EXT_LITTLE */
#endif /* long double macros and typedef */
/******************************************************
- **************** __float128 support ****************
+ ***************** _Float128 support ****************
******************************************************/
/* This is standardized by IEEE 754-2008. */
@@ -803,12 +833,105 @@ typedef union {
/******************************************************
- **************** _Decimal64 support ****************
+ ****************** Decimal support *****************
******************************************************/
#ifdef MPFR_WANT_DECIMAL_FLOATS
-/* to cast between binary64 and decimal64 */
+
+#if defined(__GNUC__) && \
+ __FLT64_DECIMAL_DIG__ == 17 && \
+ __FLT128_DECIMAL_DIG__ == 36
+
+/* GCC has standard _Decimal64 and _Decimal128 support.
+ We may be able to detect the encoding here at compile time.
+
+ Note: GCC may define __FLT64_DECIMAL_DIG__ and __FLT128_DECIMAL_DIG__
+ even when it does not support _Decimal64 and _Decimal128, e.g. on
+ aarch64 and sparc64. But since MPFR_WANT_DECIMAL_FLOATS has been
+ defined, we already know that these types should be supported.
+
+ Determining which encoding is used via macros is not documented, and
+ there is the risk of being wrong. Currently __DECIMAL_BID_FORMAT__ is
+ defined on x86, where the BID encoding is used. But on PowerPC, where
+ the DPD encoding is used, nothing indicating the encoding is defined.
+ A possible reason may be that the decimal support is provided by the
+ hardware (in this case), so that GCC does not need to care about the
+ encoding. Thus the absence of a __DECIMAL_BID_FORMAT__ macro would
+ not necessarily imply DPD, as similarly in the future, GCC could
+ support an ISA-level implementation using the BID encoding. */
+
+#ifdef __DECIMAL_BID_FORMAT__
+
+#if defined(DECIMAL_DPD_FORMAT)
+# error "Decimal encoding mismatch (DPD assumed, BID detected)"
+#elif !defined(DECIMAL_GENERIC_CODE)
+# define DECIMAL_BID_FORMAT 1
+#endif
+
+#endif /* __DECIMAL_BID_FORMAT__ */
+
+#endif /* __GNUC__ */
+
+#if defined(DECIMAL_GENERIC_CODE)
+# if defined(DECIMAL_BID_FORMAT)
+# error "DECIMAL_BID_FORMAT and DECIMAL_GENERIC_CODE both defined"
+# endif
+# if defined(DECIMAL_DPD_FORMAT)
+# error "DECIMAL_DPD_FORMAT and DECIMAL_GENERIC_CODE both defined"
+# endif
+#elif defined(DECIMAL_BID_FORMAT) || defined(DECIMAL_DPD_FORMAT)
+# if defined(DECIMAL_BID_FORMAT) && defined(DECIMAL_DPD_FORMAT)
+# error "DECIMAL_BID_FORMAT and DECIMAL_DPD_FORMAT both defined"
+# endif
+#else
+# define DECIMAL_GENERIC_CODE 1
+#endif
+
+/* TODO: The following is ugly and possibly wrong on some platforms.
+ Do something like union ieee_decimal128. */
union ieee_double_decimal64 { double d; _Decimal64 d64; };
+
+/* FIXME: There's no reason to make the _Decimal128 code depend on
+ whether _MPFR_IEEE_FLOATS is defined or not, as _MPFR_IEEE_FLOATS
+ is about binary IEEE-754 floating point only. */
+#if _MPFR_IEEE_FLOATS
+/* TODO: It would be better to define a different structure for DPD,
+ where the t* bit-fields correspond to the declets. And to avoid
+ confusion and detect coding errors, these bit-fields should have
+ different names for BID and DPD. */
+union ieee_decimal128
+{
+ struct
+ {
+ /* Assume little-endian double implies little-endian for bit-field
+ allocation (C99 says: "The order of allocation of bit-fields
+ within a unit (high-order to low-order or low-order to high-order)
+ is implementation-defined.") */
+#if defined(HAVE_DECIMAL128_IEEE_LITTLE_ENDIAN)
+#define HAVE_DECIMAL128_IEEE 1
+ unsigned int t3:32;
+ unsigned int t2:32;
+ unsigned int t1:32;
+ unsigned int t0:14;
+ unsigned int comb:17;
+ unsigned int sig:1;
+#elif defined(HAVE_DECIMAL128_IEEE_BIG_ENDIAN)
+#define HAVE_DECIMAL128_IEEE 1
+ unsigned int sig:1;
+ unsigned int comb:17;
+ unsigned int t0:14;
+ unsigned int t1:32;
+ unsigned int t2:32;
+ unsigned int t3:32;
+#else /* unknown bit-field ordering */
+ /* This will not be used as HAVE_DECIMAL128_IEEE is not defined. */
+ unsigned int dummy;
+#endif
+ } s;
+ _Decimal128 d128;
+};
+#endif /* _MPFR_IEEE_FLOATS */
+
#endif /* MPFR_WANT_DECIMAL_FLOATS */
@@ -937,6 +1060,8 @@ typedef uintmax_t mpfr_ueexp_t;
# define MPFR_SET_INVALID_EXP(x) ((void) 0)
#endif
+/* Compare the exponents of two numbers, which can be either MPFR numbers
+ or UBF numbers. */
#define MPFR_UBF_EXP_LESS_P(x,y) \
(MPFR_UNLIKELY (MPFR_IS_UBF (x) || MPFR_IS_UBF (y)) ? \
mpfr_ubf_exp_less_p (x, y) : MPFR_GET_EXP (x) < MPFR_GET_EXP (y))
@@ -966,6 +1091,7 @@ typedef uintmax_t mpfr_ueexp_t;
(MPFR_LIMB_MSB (MPFR_MANT(x)[MPFR_LAST_LIMB(x)]) != 0)
#define MPFR_IS_FP(x) (!MPFR_IS_NAN(x) && !MPFR_IS_INF(x))
+
/* Note: contrary to the MPFR_IS_PURE_*(x) macros, the MPFR_IS_SINGULAR*(x)
macros may be used even when x is being constructed, i.e. its exponent
field is already set (possibly out-of-range), but its significand field
@@ -973,6 +1099,12 @@ typedef uintmax_t mpfr_ueexp_t;
equivalent to !MPFR_IS_SINGULAR(x); see the code below. */
#define MPFR_IS_SINGULAR(x) (MPFR_EXP(x) <= MPFR_EXP_INF)
#define MPFR_IS_SINGULAR_OR_UBF(x) (MPFR_EXP(x) <= MPFR_EXP_UBF)
+
+/* The following two macros return true iff the value is a regular number,
+ i.e. it is not a singular number. In debug mode, the format is also
+ checked: valid exponent, but potentially out of range; normalized value.
+ In contexts where UBF's are not accepted or not possible, MPFR_IS_PURE_FP
+ is preferable. If UBF's are accepted, MPFR_IS_PURE_UBF must be used. */
#define MPFR_IS_PURE_FP(x) \
(!MPFR_IS_SINGULAR(x) && \
(MPFR_ASSERTD (MPFR_EXP (x) >= MPFR_EMIN_MIN && \
@@ -985,9 +1117,9 @@ typedef uintmax_t mpfr_ueexp_t;
MPFR_EXP (x) <= MPFR_EMAX_MAX)) && \
MPFR_IS_NORMALIZED (x)), 1))
+/* Ditto for 2 numbers. */
#define MPFR_ARE_SINGULAR(x,y) \
(MPFR_UNLIKELY(MPFR_IS_SINGULAR(x)) || MPFR_UNLIKELY(MPFR_IS_SINGULAR(y)))
-
#define MPFR_ARE_SINGULAR_OR_UBF(x,y) \
(MPFR_UNLIKELY(MPFR_IS_SINGULAR_OR_UBF(x)) || \
MPFR_UNLIKELY(MPFR_IS_SINGULAR_OR_UBF(y)))
@@ -1033,8 +1165,15 @@ typedef uintmax_t mpfr_ueexp_t;
/* Special inexact value */
#define MPFR_EVEN_INEX 2
-/* Macros for functions returning two inexact values in an 'int' */
-#define INEXPOS(y) ((y) == 0 ? 0 : (((y) > 0) ? 1 : 2))
+/* Note: the addition/subtraction of 2 comparisons below instead of the
+ use of the ?: operator allows GCC and Clang to generate better code
+ in general; this is the case at least with GCC on x86 (32 & 64 bits),
+ PowerPC and Aarch64 (64-bit ARM), and with Clang on x86_64.
+ VSIGN code based on mini-gmp's GMP_CMP macro; adapted for INEXPOS. */
+
+/* Macros for functions returning two inexact values in an 'int'
+ (exact = 0, positive = 1, negative = 2) */
+#define INEXPOS(y) (((y) != 0) + ((y) < 0))
#define INEX(y,z) (INEXPOS(y) | (INEXPOS(z) << 2))
/* When returning the ternary inexact value, ALWAYS use one of the
@@ -1045,7 +1184,7 @@ typedef uintmax_t mpfr_ueexp_t;
#define MPFR_RET_NAN return (__gmpfr_flags |= MPFR_FLAGS_NAN), 0
/* Sign of a native value. */
-#define VSIGN(I) ((I) < 0 ? -1 : (I) > 0)
+#define VSIGN(I) (((I) > 0) - ((I) < 0))
#define SAME_SIGN(I1,I2) (VSIGN (I1) == VSIGN (I2))
@@ -1093,7 +1232,8 @@ typedef uintmax_t mpfr_ueexp_t;
} while (0)
/* Transform RNDU and RNDD to RNDZ or RNDA according to sign,
- leave the other modes unchanged */
+ leave the other modes unchanged.
+ Usage: MPFR_UPDATE2_RND_MODE (rnd_mode, MPFR_SIGN (x)) */
#define MPFR_UPDATE2_RND_MODE(rnd, sign) \
do { \
if (rnd == MPFR_RNDU) \
@@ -1107,18 +1247,43 @@ typedef uintmax_t mpfr_ueexp_t;
****************** Limb macros *********************
******************************************************/
+/* MPFR_LIMB: Cast to mp_limb_t, assuming that x is based on mp_limb_t
+ variables (needed when mp_limb_t is defined as an integer type shorter
+ than int, due to the integer promotion rules, which is possible only
+ if MPFR_LONG_WITHIN_LIMB is not defined). Warning! This will work
+ only when the computed value x is congruent to the expected value
+ modulo MPFR_LIMB_MAX + 1. Be aware that this macro may not solve all
+ the problems related to the integer promotion rules, because it won't
+ have an influence on the evaluation of x itself. Hence the need for...
+
+ MPFR_LIMB_LSHIFT: Left shift by making sure that the shifted argument
+ is unsigned (use unsigned long due to the MPFR_LONG_WITHIN_LIMB test).
+ For instance, due to the integer promotion rules, if mp_limb_t is
+ defined as a 16-bit unsigned short and an int has 32 bits, then a
+ mp_limb_t will be converted to an int, which is signed.
+*/
+#ifdef MPFR_LONG_WITHIN_LIMB
+#define MPFR_LIMB(x) (x)
+#define MPFR_LIMB_LSHIFT(x,c) ((x) << (c))
+#else
+#define MPFR_LIMB(x) ((mp_limb_t) (x))
+#define MPFR_LIMB_LSHIFT(x,c) MPFR_LIMB((unsigned long) (x) << (c))
+#endif
+
/* Definition of simple mp_limb_t constants */
#define MPFR_LIMB_ZERO ((mp_limb_t) 0)
#define MPFR_LIMB_ONE ((mp_limb_t) 1)
-#define MPFR_LIMB_HIGHBIT (MPFR_LIMB_ONE << (GMP_NUMB_BITS - 1))
+#define MPFR_LIMB_HIGHBIT MPFR_LIMB_LSHIFT (MPFR_LIMB_ONE, GMP_NUMB_BITS - 1)
#define MPFR_LIMB_MAX ((mp_limb_t) -1)
/* Mask to get the Most Significant Bit of a limb */
-#define MPFR_LIMB_MSB(l) ((l) & MPFR_LIMB_HIGHBIT)
+#define MPFR_LIMB_MSB(l) ((mp_limb_t) ((l) & MPFR_LIMB_HIGHBIT))
/* Mask for the low 's' bits of a limb */
-#define MPFR_LIMB_MASK(s) ((MPFR_LIMB_ONE << (s)) - MPFR_LIMB_ONE)
-
+#define MPFR_LIMB_MASK(s) \
+ (MPFR_ASSERTD (s >= 0 && s <= GMP_NUMB_BITS), \
+ s == GMP_NUMB_BITS ? MPFR_LIMB_MAX : \
+ (mp_limb_t) (MPFR_LIMB_LSHIFT (MPFR_LIMB_ONE, s) - MPFR_LIMB_ONE))
/******************************************************
********************** Memory **********************
@@ -1136,6 +1301,13 @@ typedef uintmax_t mpfr_ueexp_t;
The goal of the mpfr_size_limb_t union is to make sure that
size and alignment requirements are satisfied if mp_size_t and
mp_limb_t have different sizes and/or alignment requirements.
+ And the casts to void * prevents the compiler from emitting a
+ warning (or error), such as:
+ cast increases required alignment of target type
+ with the -Wcast-align GCC option. Correct alignment is checked
+ by MPFR_SET_MANT_PTR (when setting MPFR_MANT(x), the MPFR code
+ should use this macro or guarantee a correct alignment at this
+ time).
Moreover, pointer conversions are not fully specified by the
C standard, and the use of a union (and the double casts below)
might help even if mp_size_t and mp_limb_t have the same size
@@ -1145,15 +1317,15 @@ typedef uintmax_t mpfr_ueexp_t;
*/
typedef union { mp_size_t s; mp_limb_t l; } mpfr_size_limb_t;
#define MPFR_GET_ALLOC_SIZE(x) \
- (((mp_size_t *) (mpfr_size_limb_t *) MPFR_MANT(x))[-1] + 0)
+ (((mp_size_t *) (void *) MPFR_MANT(x))[-1] + 0)
#define MPFR_SET_ALLOC_SIZE(x, n) \
- (((mp_size_t *) (mpfr_size_limb_t *) MPFR_MANT(x))[-1] = (n))
+ (((mp_size_t *) (void *) MPFR_MANT(x))[-1] = (n))
#define MPFR_MALLOC_SIZE(s) \
(sizeof(mpfr_size_limb_t) + MPFR_BYTES_PER_MP_LIMB * (size_t) (s))
#define MPFR_SET_MANT_PTR(x,p) \
(MPFR_MANT(x) = (mp_limb_t *) ((mpfr_size_limb_t *) (p) + 1))
#define MPFR_GET_REAL_PTR(x) \
- ((mp_limb_t *) ((mpfr_size_limb_t *) MPFR_MANT(x) - 1))
+ ((void *) ((mpfr_size_limb_t *) (void *) MPFR_MANT(x) - 1))
/* Temporary memory handling */
#ifndef TMP_SALLOC
@@ -1172,7 +1344,6 @@ typedef union { mp_size_t s; mp_limb_t l; } mpfr_size_limb_t;
#define MPFR_TMP_LIMBS_ALLOC(N) \
((mp_limb_t *) MPFR_TMP_ALLOC ((size_t) (N) * MPFR_BYTES_PER_MP_LIMB))
-/* temporary allocate 1 limb at xp, and initialize mpfr variable x */
/* The temporary var doesn't have any size field, but it doesn't matter
* since only functions dealing with the Heap care about it */
#define MPFR_TMP_INIT1(xp, x, p) \
@@ -1185,17 +1356,24 @@ typedef union { mp_size_t s; mp_limb_t l; } mpfr_size_limb_t;
(xp = MPFR_TMP_LIMBS_ALLOC(s), \
MPFR_TMP_INIT1(xp, x, p))
-#define MPFR_TMP_INIT_ABS(d, s) \
- ( MPFR_PREC(d) = MPFR_PREC(s), \
- MPFR_MANT(d) = MPFR_MANT(s), \
- MPFR_SET_POS(d), \
- MPFR_EXP(d) = MPFR_EXP(s))
+/* Set y to s*significand(x)*2^e, for example MPFR_ALIAS(y,x,1,MPFR_EXP(x))
+ sets y to |x|, and MPFR_ALIAS(y,x,MPFR_SIGN(x),0) sets y to x*2^f such
+ that 1/2 <= |y| < 1. Does not check y is in the valid exponent range.
+ WARNING! x and y share the same mantissa. So, some operations are
+ not valid if x has been provided via an argument, e.g., trying to
+ modify the mantissa of y, even temporarily, or calling mpfr_clear on y.
+*/
+#define MPFR_ALIAS(y,x,s,e) \
+ (MPFR_PREC(y) = MPFR_PREC(x), \
+ MPFR_SIGN(y) = (s), \
+ MPFR_EXP(y) = (e), \
+ MPFR_MANT(y) = MPFR_MANT(x))
+
+#define MPFR_TMP_INIT_ABS(y,x) \
+ MPFR_ALIAS (y, x, MPFR_SIGN_POS, MPFR_EXP (x))
-#define MPFR_TMP_INIT_NEG(d, s) \
- ( MPFR_PREC(d) = MPFR_PREC(s), \
- MPFR_MANT(d) = MPFR_MANT(s), \
- MPFR_SET_OPPOSITE_SIGN(d,s), \
- MPFR_EXP(d) = MPFR_EXP(s))
+#define MPFR_TMP_INIT_NEG(y,x) \
+ MPFR_ALIAS (y, x, - MPFR_SIGN (x), MPFR_EXP (x))
/******************************************************
@@ -1224,6 +1402,9 @@ typedef union { mp_size_t s; mp_limb_t l; } mpfr_size_limb_t;
But: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80454
2. Use designated initializers when supported. But this needs a
configure test.
+ Using a diagnostic pragma to ignore the warning in this particular case
+ is not really possible, because the warning occurs when the macro is
+ expanded and one cannot put a pragma in the contents of a #define.
*/
#define MPFR_DECL_INIT_CACHE(_cache,_func) \
MPFR_DEFERRED_INIT_MASTER_DECL(_func, \
@@ -1246,7 +1427,18 @@ typedef union { mp_size_t s; mp_limb_t l; } mpfr_size_limb_t;
****************** Useful macros *******************
******************************************************/
-/* Theses macros help the compiler to determine if a test is
+/* The MAX, MIN and ABS macros may already be defined if gmp-impl.h has
+ been included. They have the same semantics as in gmp-impl.h, but the
+ expressions may be slightly different. So, it's better to undefine
+ them first, as required by the ISO C standard. */
+#undef MAX
+#undef MIN
+#undef ABS
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#define MIN(a, b) (((a) < (b)) ? (a) : (b))
+#define ABS(x) (((x)>0) ? (x) : -(x))
+
+/* These macros help the compiler to determine if a test is
likely or unlikely. The !! is necessary in case x is larger
than a long. */
#if defined MPFR_DEBUG_PREDICTION && __MPFR_GNUC(3,0)
@@ -1338,6 +1530,7 @@ asm (".section predict_data, \"aw\"; .previous\n"
with some build options; a loop could be used if x > ULONG_MAX. If
the type of x is <= unsigned long, then no additional code will be
generated thanks to obvious compiler optimization. */
+#ifdef MPFR_LONG_WITHIN_LIMB
# define MPFR_INT_CEIL_LOG2(x) \
(MPFR_UNLIKELY ((x) == 1) ? 0 : \
__extension__ ({ int _b; mp_limb_t _limb; \
@@ -1345,11 +1538,26 @@ asm (".section predict_data, \"aw\"; .previous\n"
_limb = (x) - 1; \
MPFR_ASSERTN (_limb == (x) - 1); \
count_leading_zeros (_b, _limb); \
- (GMP_NUMB_BITS - _b); }))
+ _b = GMP_NUMB_BITS - _b; \
+ MPFR_ASSERTD (_b >= 0); \
+ _b; }))
+#else
+# define MPFR_INT_CEIL_LOG2(x) \
+ (MPFR_UNLIKELY ((x) == 1) ? 0 : \
+ __extension__ ({ int _c = 0; unsigned long _x = (x) - 1; \
+ MPFR_ASSERTN ((x) > 1); \
+ while (_x != 0) \
+ { \
+ _x = _x >> 1; \
+ _c ++; \
+ }; \
+ MPFR_ASSERTD (_c >= 0); \
+ _c; }))
+#endif /* MPFR_LONG_WITHIN_LIMB */
#else
# define MPFR_INT_CEIL_LOG2(x) \
(MPFR_ASSERTN (x <= ULONG_MAX), __gmpfr_int_ceil_log2(x))
-#endif
+#endif /* __MPFR_GNUC(2,95) || __MPFR_ICC(8,1,0) */
/* Add two integers with overflow handling */
/* Example: MPFR_SADD_OVERFLOW (c, a, b, long, unsigned long,
@@ -1471,26 +1679,35 @@ do { \
#define MPFR_THOUSANDS_SEPARATOR ((char) '\0')
#endif
-
-/* Set y to s*significand(x)*2^e, for example MPFR_ALIAS(y,x,1,MPFR_EXP(x))
- sets y to |x|, and MPFR_ALIAS(y,x,MPFR_SIGN(x),0) sets y to x*2^f such
- that 1/2 <= |y| < 1. Does not check y is in the valid exponent range.
- WARNING! x and y share the same mantissa. So, some operations are
- not valid if x has been provided via an argument, e.g., trying to
- modify the mantissa of y, even temporarily, or calling mpfr_clear on y.
-*/
-#define MPFR_ALIAS(y,x,s,e) \
- do \
- { \
- MPFR_PREC(y) = MPFR_PREC(x); \
- MPFR_SIGN(y) = (s); \
- MPFR_EXP(y) = (e); \
- MPFR_MANT(y) = MPFR_MANT(x); \
- } while (0)
-
/* Size of an array, as a constant expression. */
#define numberof_const(x) (sizeof (x) / sizeof ((x)[0]))
+/* Size of an array, safe version but not a constant expression:
+ Since an array can silently be converted to a pointer, we check
+ that this macro is applied on an array, not a pointer.
+ Also make sure that the type is signed ("long" is sufficient
+ in practice since the sizes come from the MPFR source), so that
+ the value can be used in arbitrary expressions without the risk
+ of silently switching to unsigned arithmetic. */
+#undef numberof
+#if 0
+/* The following should work with GCC as documented in its manual,
+ but fails: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=38377#c10
+ Thus disabled for now. */
+# define numberof(x) \
+ ( __extension__ ({ \
+ int is_array = (void *) &(x) == (void *) &(x)[0]; \
+ MPFR_STAT_STATIC_ASSERT (__builtin_constant_p (is_array) ? \
+ is_array : 1); \
+ MPFR_ASSERTN (is_array); \
+ (long) numberof_const (x); \
+ }) )
+#else
+# define numberof(x) \
+ (MPFR_ASSERTN ((void *) &(x) == (void *) &(x)[0]), \
+ (long) numberof_const (x))
+#endif
+
/* Addition with carry (detected by GCC and other good compilers). */
#define ADD_LIMB(u,v,c) ((u) += (v), (c) = (u) < (v))
@@ -1509,17 +1726,13 @@ typedef struct {
mpfr_exp_t saved_emax;
} mpfr_save_expo_t;
-/* Minimum and maximum exponents of the extended exponent range. */
-#define MPFR_EXT_EMIN MPFR_EMIN_MIN
-#define MPFR_EXT_EMAX MPFR_EMAX_MAX
-
#define MPFR_SAVE_EXPO_DECL(x) mpfr_save_expo_t x
#define MPFR_SAVE_EXPO_MARK(x) \
((x).saved_flags = __gmpfr_flags, \
(x).saved_emin = __gmpfr_emin, \
(x).saved_emax = __gmpfr_emax, \
- __gmpfr_emin = MPFR_EXT_EMIN, \
- __gmpfr_emax = MPFR_EXT_EMAX)
+ __gmpfr_emin = MPFR_EMIN_MIN, \
+ __gmpfr_emax = MPFR_EMAX_MAX)
#define MPFR_SAVE_EXPO_FREE(x) \
(__gmpfr_flags = (x).saved_flags, \
__gmpfr_emin = (x).saved_emin, \
@@ -1827,16 +2040,18 @@ typedef struct {
is not used (if the result is larger than MPFR_PREC_MAX, this
should be detected with a later assertion, e.g. in mpfr_init2).
But this change is mainly for existing code that has not been
- updated yet. So, it is advised to always use MPFR_ADD_PREC if
- the result can be larger than MPFR_PREC_MAX. */
+ updated yet. So, it is advised to always use MPFR_ADD_PREC or
+ MPFR_INC_PREC if the result can be larger than MPFR_PREC_MAX. */
#define MPFR_ADD_PREC(P,X) \
(MPFR_ASSERTN ((X) <= MPFR_PREC_MAX - (P)), (P) + (X))
+#define MPFR_INC_PREC(P,X) \
+ (MPFR_ASSERTN ((X) <= MPFR_PREC_MAX - (P)), (P) += (X))
#ifndef MPFR_USE_LOGGING
#define MPFR_ZIV_DECL(_x) mpfr_prec_t _x
#define MPFR_ZIV_INIT(_x, _p) (_x) = GMP_NUMB_BITS
-#define MPFR_ZIV_NEXT(_x, _p) ((_p) = MPFR_ADD_PREC (_p, _x), (_x) = (_p)/2)
+#define MPFR_ZIV_NEXT(_x, _p) (MPFR_INC_PREC (_p, _x), (_x) = (_p)/2)
#define MPFR_ZIV_FREE(x)
#else
@@ -1886,7 +2101,7 @@ typedef struct {
#define MPFR_ZIV_NEXT(_x, _p) \
do \
{ \
- (_p) = MPFR_ADD_PREC (_p, _x); \
+ MPFR_INC_PREC (_p, _x); \
(_x) = (_p) / 2; \
if (mpfr_log_level >= 0) \
_x ## _bad += (_x ## _cpt == 1); \
@@ -2025,7 +2240,21 @@ __MPFR_DECLSPEC extern mpfr_prec_t mpfr_log_prec;
struct mpfr_group_t {
size_t alloc;
mp_limb_t *mant;
+#if MPFR_GROUP_STATIC_SIZE != 0
mp_limb_t tab[MPFR_GROUP_STATIC_SIZE];
+#else
+ /* In order to detect memory leaks when testing, MPFR_GROUP_STATIC_SIZE
+ can be set to 0, in which case tab will not be used. ISO C does not
+ support zero-length arrays[*], thus let's use a flexible array member
+ (which will be equivalent here). Note: this is new in C99, but this
+ is just used for testing.
+ [*] Zero-length arrays are a GNU extension:
+ https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html
+ and as such an extension is forbidden in ISO C, it triggers an
+ error with -Werror=pedantic.
+ */
+ mp_limb_t tab[];
+#endif
};
#define MPFR_GROUP_DECL(g) struct mpfr_group_t g
@@ -2178,8 +2407,8 @@ __MPFR_DECLSPEC int mpfr_pow_general (mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
__MPFR_DECLSPEC void mpfr_setmax (mpfr_ptr, mpfr_exp_t);
__MPFR_DECLSPEC void mpfr_setmin (mpfr_ptr, mpfr_exp_t);
-__MPFR_DECLSPEC long mpfr_mpn_exp (mp_limb_t *, mpfr_exp_t *, int,
- mpfr_exp_t, size_t);
+__MPFR_DECLSPEC int mpfr_mpn_exp (mp_limb_t *, mpfr_exp_t *, int,
+ mpfr_exp_t, size_t);
#ifdef _MPFR_H_HAVE_FILE
__MPFR_DECLSPEC void mpfr_fdump (FILE *, mpfr_srcptr);
@@ -2261,12 +2490,18 @@ __MPFR_DECLSPEC void mpfr_mpz_clear (mpz_ptr);
__MPFR_DECLSPEC int mpfr_odd_p (mpfr_srcptr);
+__MPFR_DECLSPEC int mpfr_nbits_ulong (unsigned long);
+
#ifdef _MPFR_H_HAVE_VA_LIST
/* Declared only if <stdarg.h> has been included. */
__MPFR_DECLSPEC int mpfr_vasnprintf_aux (char**, char*, size_t, const char*,
va_list);
#endif
+#if MPFR_WANT_ASSERT >= 2
+__MPFR_DECLSPEC void flags_fout (FILE *, mpfr_flags_t);
+#endif
+
#if defined (__cplusplus)
}
#endif
@@ -2375,14 +2610,74 @@ extern "C" {
which is assumed to be present (with a value in it) when the usual
exponent field has the value MPFR_EXP_UBF. The goal of this compatible
representation is to easily be able to support UBF in "normal" code
- and hopefully avoid aliasing issues at the same time. And code that
- accepts UBF in input should also accept mpfr_t as a consequence; this
- makes mpfr_t to UBF conversion unnecessary.
- When an input of a public function is a UBF, the semantic remains
- internal to MPFR and can change in the future.
+ using the public API. This is some form of "subtyping".
+
+ Unfortunately this breaks aliasing rules, and C does not provide any way
+ to avoid that (except with additional syntax ugliness and API breakage,
+ though there is a workaround -- see the end of this comment):
+
+ https://news.ycombinator.com/item?id=11753236
+
+ The alignment requirement for __mpfr_ubf_struct (UBF) needs to be at least
+ as strong as the one for __mpfr_struct (MPFR number); this is not required
+ by the C standard, but this should always be the case in practice, since
+ __mpfr_ubf_struct starts with the same members as those of __mpfr_struct.
+ If ever this would not be the case with some particular C implementation,
+ an _Alignas alignment attribute (C11) could be added for UBF.
+
+ When an input of a public function is an UBF, the semantic remains
+ internal to MPFR and can change in the future. UBF arguments need
+ to be explicitly converted to mpfr_ptr (or mpfr_srcptr); be careful
+ with variadic functions, as the compiler will not be able to check
+ in general. See fmma.c as an example of usage.
+
+ In general, the type used for values that may be UBF must be either
+ mpfr_ubf_t or mpfr_ubf_ptr. The type mpfr_ptr or mpfr_srcptr may be
+ used for UBF only in the case where the pointer has been converted
+ from mpfr_ubf_ptr, in order to ensure valid alignment. For instance,
+ in mpfr_fmma_aux, one uses mpfr_ubf_t to generate the exact products
+ as UBF; then the corresponding pointers are converted to mpfr_srcptr
+ for mpfr_add (even though they point to UBF).
+
+ Functions that can accept either MPFR arguments (mpfr_ptr type) or
+ UBF arguments (mpfr_ubf_ptr type) must use a pointer type that can
+ always be converted from both, typically mpfr_ptr or mpfr_srcptr.
+ For instance, that's why mpfr_ubf_exp_less_p uses mpfr_srcptr.
+ Note: "void *" could also be used, but mpfr_ptr is more meaningful
+ and practical.
+
Note that functions used for logging need to support UBF (currently
- done by printing that a number is a UBF, as it may be difficult to
- do more without significant changes). */
+ done by printing that a number is an UBF, as it may be difficult to
+ do more without significant changes).
+
+ --------
+
+ A workaround to avoid breaking aliasing rules should be to use mpfr_ptr
+ to access the usual mpfr_t members and mpfr_ubf_ptr to access the
+ additional member _mpfr_zexp. And never use __mpfr_ubf_struct as a
+ declared type; otherwise this would force __mpfr_ubf_struct to be the
+ effective type of the whole object. Thus instead of
+
+ typedef __mpfr_ubf_struct mpfr_ubf_t[1];
+
+ one could use the following definition as a trick to allocate an UBF as
+ an automatic variable with the required alignment but without forcing
+ the effective type to __mpfr_ubf_struct.
+
+ typedef union {
+ __mpfr_ubf_struct u[1];
+ __mpfr_struct m[1];
+ } mpfr_ubf_t;
+
+ Then adapt the related code to select to right member, depending on the
+ context. Unfortunately, this triggers -Wstrict-aliasing false positives
+ with GCC in the MPFR_UBF_CLEAR_EXP expansion:
+
+ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94337
+
+ (see changeset r13820 in the ubf2 branch). So, for the time being,
+ as long as the code does not break, do not change anything.
+*/
typedef struct {
mpfr_prec_t _mpfr_prec;
@@ -2405,11 +2700,28 @@ __MPFR_DECLSPEC mpfr_exp_t mpfr_ubf_diff_exp (mpfr_srcptr, mpfr_srcptr);
}
#endif
-#define MPFR_ZEXP(x) \
- ((void) (x)->_mpfr_exp /* to check that x has a correct type */, \
+/* Get the _mpfr_zexp field (pointer to a mpz_t) of an UBF object.
+ For practical reasons, the type of the argument x can be either
+ mpfr_ubf_ptr or mpfr_ptr, since the latter is used in functions
+ that accept both MPFR numbers and UBF's; this is checked by the
+ code "(x)->_mpfr_exp" (the "sizeof" prevents an access, which
+ could be invalid when MPFR_ZEXP(x) is used for an assignment,
+ and also avoids breaking the aliasing rules if they are dealt
+ with in the future).
+ This macro can be used when building an UBF. So we do not check
+ that the _mpfr_exp field has the value MPFR_EXP_UBF. */
+#define MPFR_ZEXP(x) \
+ ((void) sizeof ((x)->_mpfr_exp), \
((mpfr_ubf_ptr) (x))->_mpfr_zexp)
+/* If x is an UBF, clear its mpz_t exponent. */
#define MPFR_UBF_CLEAR_EXP(x) \
((void) (MPFR_IS_UBF (x) && (mpz_clear (MPFR_ZEXP (x)), 0)))
+/* Like MPFR_GET_EXP, but accepts UBF (with exponent saturated to
+ the interval [MPFR_EXP_MIN,MPFR_EXP_MAX]). */
+#define MPFR_UBF_GET_EXP(x) \
+ (MPFR_IS_UBF (x) ? mpfr_ubf_zexp2exp (MPFR_ZEXP (x)) : \
+ MPFR_GET_EXP ((mpfr_ptr) (x)))
+
#endif /* __MPFR_IMPL_H__ */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-intmax.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-intmax.h
index 9ef3b1c6737..2fedf5f3285 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-intmax.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-intmax.h
@@ -1,6 +1,6 @@
/* MPFR internal header related to intmax_t.
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,6 +20,21 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+/* If you need something defined here, do not include this header file
+ directly, but define the MPFR_NEED_INTMAX_H macro before including
+ "mpfr-impl.h" (or "mpfr-test.h" in the tests). This will ensure that
+ this header file "mpfr-intmax.h" is included in a consistent way,
+ thus avoiding the various cases that could otherwise be obtained on
+ different platforms and compilation options. Note that in particular,
+ it needs <limits.h> (always included first in "mpfr-impl.h") if
+ <inttypes.h> or <stdint.h> does not exist or does not work. It also
+ needs "config.h" if used (HAVE_CONFIG_H defined), but "config.h" is
+ also included first in "mpfr-impl.h". */
+
+#ifndef MPFR_NEED_INTMAX_H
+# error "Never include mpfr-intmax.h directly; define MPFR_NEED_INTMAX_H instead."
+#endif
+
#ifndef __MPFR_INTMAX_H__
#define __MPFR_INTMAX_H__
@@ -53,18 +68,42 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
# define MPFR_USE_INTMAX_T
#endif
-/* Largest signed integer type available for the MPFR build. */
-#if defined(MPFR_USE_INTMAX_T)
-typedef intmax_t mpfr_intmax_t;
+/* Largest integer type available and fully working for the MPFR build
+ (may be smaller than intmax_t / uintmax_t if NPRINTF_J is defined). */
+#if defined(MPFR_USE_INTMAX_T) && !defined(NPRINTF_J)
typedef uintmax_t mpfr_uintmax_t;
-#elif defined(HAVE_LONG_LONG)
-typedef long long mpfr_intmax_t;
+typedef intmax_t mpfr_intmax_t;
+# define MPFR_UINTMAX_MAX UINTMAX_MAX
+# define MPFR_INTMAX_MAX INTMAX_MAX
+# define MPFR_INTMAX_MIN INTMAX_MIN
+# define MPFR_INTMAX_FSPEC "j"
+#elif defined(HAVE_LONG_LONG) && !defined(NPRINTF_LL)
typedef unsigned long long mpfr_uintmax_t;
+typedef long long mpfr_intmax_t;
+#if defined(ULLONG_MAX)
+/* standard */
+# define MPFR_UINTMAX_MAX ULLONG_MAX
# define MPFR_INTMAX_MAX LLONG_MAX
+# define MPFR_INTMAX_MIN LLONG_MIN
+#elif defined(ULONGLONG_MAX)
+/* Silicon Graphics IRIX 6.5 with native /usr/bin/cc */
+# define MPFR_UINTMAX_MAX ULONGLONG_MAX
+# define MPFR_INTMAX_MAX LONGLONG_MAX
+# define MPFR_INTMAX_MIN LONGLONG_MIN
+#else
+/* We do not know any platform in this case (but this case would be a bug).
+ Let's give an error. A workaround should be possible, but it should be
+ tested first. */
+# error "Neither ULLONG_MAX nor ULONGLONG_MAX is defined."
+#endif
+# define MPFR_INTMAX_FSPEC "ll"
#else
-typedef long mpfr_intmax_t;
typedef unsigned long mpfr_uintmax_t;
+typedef long mpfr_intmax_t;
+# define MPFR_UINTMAX_MAX ULONG_MAX
# define MPFR_INTMAX_MAX LONG_MAX
+# define MPFR_INTMAX_MIN LONG_MIN
+# define MPFR_INTMAX_FSPEC "l"
#endif
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-longlong.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-longlong.h
index f3961f20941..83eda2f5158 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-longlong.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-longlong.h
@@ -1,10 +1,14 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2019 Free Software Foundation, Inc.
+Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library and has been copied from
-GNU MP 6.1.0 (the FIXME's come from GNU MP), except the parts marked
-beginning of code specific to MPFR ... end of code specific to MPFR.
+GNU MP 6.2.0, with the following changes:
+ * the copyright notice (note: only LGPL 3+ is used in MPFR);
+ * the code declared as added for MPFR just below these comments;
+ * __GMP_DECLSPEC renamed to __MPFR_DECLSPEC;
+ * patch on https://gmplib.org/list-archives/gmp-bugs/2020-June/004807.html
+ for arm / aarch64 / 64-bit powerpc applied.
The GNU MPFR Library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
@@ -45,6 +49,18 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
expected.
*/
+/* Code added for MPFR */
+
+#ifndef MPFR_NEED_LONGLONG_H
+# error "Never include mpfr-longlong.h directly; define MPFR_NEED_LONGLONG_H instead."
+#endif
+
+#ifndef __GMP_GNUC_PREREQ
+# define __GMP_GNUC_PREREQ(X,Y) __MPFR_GNUC(X,Y)
+#endif
+
+/* End of code added for MPFR */
+
#define __BITS4 (W_TYPE_SIZE / 4)
#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
@@ -196,7 +212,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
(pl) = __m0 * __m1; \
} while (0)
#endif
-#define UMUL_TIME 18
#else /* ! __GNUC__ */
#include <machine/builtins.h>
#define umul_ppmm(ph, pl, m0, m1) \
@@ -214,7 +229,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
} while (0)
#define UDIV_PREINV_ALWAYS 1
#define UDIV_NEEDS_NORMALIZATION 1
-#define UDIV_TIME 220
#endif /* LONGLONG_STANDALONE */
/* clz_tab is required in all configurations, since mpn/alpha/cntlz.asm
@@ -277,7 +291,6 @@ long __MPN(count_leading_zeros) (UDItype);
#include <intrinsics.h>
#define UDIV_PREINV_ALWAYS 1
#define UDIV_NEEDS_NORMALIZATION 1
-#define UDIV_TIME 220
long __MPN(count_leading_zeros) (UDItype);
#define count_leading_zeros(count, x) \
((count) = _leadz ((UWtype) (x)))
@@ -321,7 +334,6 @@ long __MPN(count_leading_zeros) (UDItype);
__asm__ ("xma.hu %0 = %2, %3, f0\n\txma.l %1 = %2, %3, f0" \
: "=&f" (ph), "=f" (pl) \
: "f" (m0), "f" (m1))
-#define UMUL_TIME 14
#define count_leading_zeros(count, x) \
do { \
UWtype _x = (x), _y, _a, _c; \
@@ -364,7 +376,6 @@ long __MPN(count_leading_zeros) (UDItype);
#define UDIV_PREINV_ALWAYS 1
#define UDIV_NEEDS_NORMALIZATION 1
#endif
-#define UDIV_TIME 220
#endif
@@ -410,8 +421,6 @@ long __MPN(count_leading_zeros) (UDItype);
#define COUNT_LEADING_ZEROS_0 32
#endif /* __a29k__ */
-/* MPFR: changed "J" constraint to "Cal" constraint
- (https://sympa.inria.fr/sympa/arc/mpfr/2018-10/msg00010.html) */
#if defined (__arc__)
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("add.f\t%1, %4, %5\n\tadc\t%0, %2, %3" \
@@ -437,9 +446,39 @@ long __MPN(count_leading_zeros) (UDItype);
__asm__ ("adds\t%1, %4, %5\n\tadc\t%0, %2, %3" \
: "=r" (sh), "=&r" (sl) \
: "r" (ah), "rI" (bh), "%r" (al), "rI" (bl) __CLOBBER_CC)
+/* FIXME: Extend the immediate range for the low word by using both ADDS and
+ SUBS, since they set carry in the same way. We need separate definitions
+ for thumb and non-thumb since thumb lacks RSC. */
+#if defined (__thumb__)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
do { \
- if (__builtin_constant_p (al)) \
+ if (__builtin_constant_p (ah) && __builtin_constant_p (bh) \
+ && (ah) == (bh)) \
+ __asm__ ("subs\t%1, %2, %3\n\tsbc\t%0, %0, %0" \
+ : "=r" (sh), "=r" (sl) \
+ : "r" (al), "rI" (bl) __CLOBBER_CC); \
+ else if (__builtin_constant_p (al)) \
+ __asm__ ("rsbs\t%1, %5, %4\n\tsbc\t%0, %2, %3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "rI" (al), "r" (bl) __CLOBBER_CC); \
+ else if (__builtin_constant_p (bl)) \
+ __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
+ else \
+ __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
+ } while (0)
+#else
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ if (__builtin_constant_p (ah) && __builtin_constant_p (bh) \
+ && (ah) == (bh)) \
+ __asm__ ("subs\t%1, %2, %3\n\tsbc\t%0, %0, %0" \
+ : "=r" (sh), "=r" (sl) \
+ : "r" (al), "rI" (bl) __CLOBBER_CC); \
+ else if (__builtin_constant_p (al)) \
{ \
if (__builtin_constant_p (ah)) \
__asm__ ("rsbs\t%1, %5, %4\n\trsc\t%0, %3, %2" \
@@ -462,21 +501,15 @@ long __MPN(count_leading_zeros) (UDItype);
: "rI" (ah), "r" (bh), "rI" (al), "r" (bl) __CLOBBER_CC); \
} \
else if (__builtin_constant_p (bl)) \
- { \
- if (__builtin_constant_p (bh)) \
- __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
- : "=r" (sh), "=&r" (sl) \
- : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
- else \
- __asm__ ("subs\t%1, %4, %5\n\trsc\t%0, %3, %2" \
- : "=r" (sh), "=&r" (sl) \
- : "rI" (ah), "r" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
- } \
+ __asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
else /* only bh might be a constant */ \
__asm__ ("subs\t%1, %4, %5\n\tsbc\t%0, %2, %3" \
: "=r" (sh), "=&r" (sl) \
- : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC);\
+ : "r" (ah), "rI" (bh), "r" (al), "rI" (bl) __CLOBBER_CC); \
} while (0)
+#endif
#if defined (__ARM_ARCH_2__) || defined (__ARM_ARCH_2A__) \
|| defined (__ARM_ARCH_3__)
#define umul_ppmm(xh, xl, a, b) \
@@ -499,18 +532,17 @@ long __MPN(count_leading_zeros) (UDItype);
"=&r" (__t0), "=&r" (__t1), "=r" (__t2) \
: "r" ((USItype) (a)), "r" ((USItype) (b)) __CLOBBER_CC); \
} while (0)
-#define UMUL_TIME 20
+#ifndef LONGLONG_STANDALONE
#define udiv_qrnnd(q, r, n1, n0, d) \
do { UWtype __r; \
(q) = __MPN(udiv_qrnnd) (&__r, (n1), (n0), (d)); \
(r) = __r; \
} while (0)
extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
-#define UDIV_TIME 200
+#endif /* LONGLONG_STANDALONE */
#else /* ARMv4 or newer */
#define umul_ppmm(xh, xl, a, b) \
__asm__ ("umull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
-#define UMUL_TIME 5
#define smul_ppmm(xh, xl, a, b) \
__asm__ ("smull %0,%1,%2,%3" : "=&r" (xl), "=&r" (xh) : "r" (a), "r" (b))
#ifndef LONGLONG_STANDALONE
@@ -521,12 +553,10 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
} while (0)
#define UDIV_PREINV_ALWAYS 1
#define UDIV_NEEDS_NORMALIZATION 1
-#define UDIV_TIME 70
#endif /* LONGLONG_STANDALONE */
#endif /* defined(__ARM_ARCH_2__) ... */
#define count_leading_zeros(count, x) count_leading_zeros_gcc_clz(count, x)
#define count_trailing_zeros(count, x) count_trailing_zeros_gcc_ctz(count, x)
-#define COUNT_LEADING_ZEROS_0 32
#endif /* __arm__ */
#if defined (__aarch64__) && W_TYPE_SIZE == 64
@@ -542,15 +572,25 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
: "=r,r" (sh), "=&r,&r" (sl) \
: "rZ,rZ" ((UDItype)(ah)), "rZ,rZ" ((UDItype)(bh)), \
"r,Z" ((UDItype)(al)), "rI,r" ((UDItype)(bl)) __CLOBBER_CC)
+#if __GMP_GNUC_PREREQ (4,9)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
+ __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
+ w1 = __ll >> 64; \
+ w0 = __ll; \
+ } while (0)
+#endif
+#if !defined (umul_ppmm)
#define umul_ppmm(ph, pl, m0, m1) \
do { \
UDItype __m0 = (m0), __m1 = (m1); \
__asm__ ("umulh\t%0, %1, %2" : "=r" (ph) : "r" (__m0), "r" (__m1)); \
(pl) = __m0 * __m1; \
} while (0)
+#endif
#define count_leading_zeros(count, x) count_leading_zeros_gcc_clz(count, x)
#define count_trailing_zeros(count, x) count_trailing_zeros_gcc_ctz(count, x)
-#define COUNT_LEADING_ZEROS_0 64
#endif /* __aarch64__ */
#if defined (__clipper__) && W_TYPE_SIZE == 32
@@ -642,11 +682,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
(wh) = __x.__i.__h; \
(wl) = __x.__i.__l; \
} while (0)
-#define UMUL_TIME 8
-#define UDIV_TIME 60
-#else
-#define UMUL_TIME 40
-#define UDIV_TIME 80
#endif
#define count_leading_zeros(count, x) \
do { \
@@ -932,7 +967,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
double d; \
unsigned a[2]; \
} __u; \
- ASSERT ((n) != 0); \
__u.d = (UWtype) (n); \
(c) = 0x3FF + 31 - (__u.a[1] >> 20); \
} while (0)
@@ -989,12 +1023,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
#endif /* ! pentium */
-#ifndef UMUL_TIME
-#define UMUL_TIME 10
-#endif
-#ifndef UDIV_TIME
-#define UDIV_TIME 40
-#endif
#endif /* 80x86 */
#if defined (__amd64__) && W_TYPE_SIZE == 64
@@ -1008,29 +1036,61 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
: "=r" (sh), "=&r" (sl) \
: "0" ((UDItype)(ah)), "rme" ((UDItype)(bh)), \
"1" ((UDItype)(al)), "rme" ((UDItype)(bl)))
+#if X86_ASM_MULX \
+ && (HAVE_HOST_CPU_haswell || HAVE_HOST_CPU_broadwell \
+ || HAVE_HOST_CPU_skylake || HAVE_HOST_CPU_bd4 || HAVE_HOST_CPU_zen)
#define umul_ppmm(w1, w0, u, v) \
- __asm__ ("mulq %3" \
+ __asm__ ("mulx\t%3, %0, %1" \
+ : "=r" (w0), "=r" (w1) \
+ : "%d" ((UDItype)(u)), "rm" ((UDItype)(v)))
+#else
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mulq\t%3" \
: "=a" (w0), "=d" (w1) \
: "%0" ((UDItype)(u)), "rm" ((UDItype)(v)))
+#endif
#define udiv_qrnnd(q, r, n1, n0, dx) /* d renamed to dx avoiding "=d" */\
__asm__ ("divq %4" /* stringification in K&R C */ \
: "=a" (q), "=d" (r) \
: "0" ((UDItype)(n0)), "1" ((UDItype)(n1)), "rm" ((UDItype)(dx)))
-/* bsrq destination must be a 64-bit register, hence UDItype for __cbtmp. */
+
+#if HAVE_HOST_CPU_haswell || HAVE_HOST_CPU_broadwell || HAVE_HOST_CPU_skylake \
+ || HAVE_HOST_CPU_k10 || HAVE_HOST_CPU_bd1 || HAVE_HOST_CPU_bd2 \
+ || HAVE_HOST_CPU_bd3 || HAVE_HOST_CPU_bd4 || HAVE_HOST_CPU_zen \
+ || HAVE_HOST_CPU_bobcat || HAVE_HOST_CPU_jaguar
+#define count_leading_zeros(count, x) \
+ do { \
+ /* This is lzcnt, spelled for older assemblers. Destination and */ \
+ /* source must be a 64-bit registers, hence cast and %q. */ \
+ __asm__ ("rep;bsr\t%1, %q0" : "=r" (count) : "rm" ((UDItype)(x))); \
+ } while (0)
+#define COUNT_LEADING_ZEROS_0 64
+#else
#define count_leading_zeros(count, x) \
do { \
UDItype __cbtmp; \
ASSERT ((x) != 0); \
- __asm__ ("bsrq %1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x))); \
+ __asm__ ("bsr\t%1,%0" : "=r" (__cbtmp) : "rm" ((UDItype)(x))); \
(count) = __cbtmp ^ 63; \
} while (0)
-/* bsfq destination must be a 64-bit register, "%q0" forces this in case
- count is only an int. */
+#endif
+
+#if HAVE_HOST_CPU_bd2 || HAVE_HOST_CPU_bd3 || HAVE_HOST_CPU_bd4 \
+ || HAVE_HOST_CPU_zen || HAVE_HOST_CPU_jaguar
+#define count_trailing_zeros(count, x) \
+ do { \
+ /* This is tzcnt, spelled for older assemblers. Destination and */ \
+ /* source must be a 64-bit registers, hence cast and %q. */ \
+ __asm__ ("rep;bsf\t%1, %q0" : "=r" (count) : "rm" ((UDItype)(x))); \
+ } while (0)
+#define COUNT_TRAILING_ZEROS_0 64
+#else
#define count_trailing_zeros(count, x) \
do { \
ASSERT ((x) != 0); \
- __asm__ ("bsfq %1,%q0" : "=r" (count) : "rm" ((UDItype)(x))); \
+ __asm__ ("bsf\t%1, %q0" : "=r" (count) : "rm" ((UDItype)(x))); \
} while (0)
+#endif
#endif /* __amd64__ */
#if defined (__i860__) && W_TYPE_SIZE == 32
@@ -1111,12 +1171,10 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
__asm__ ("mulu%.l %3,%1:%0" \
: "=d" (w0), "=d" (w1) \
: "%0" ((USItype)(u)), "dmi" ((USItype)(v)))
-#define UMUL_TIME 45
#define udiv_qrnnd(q, r, n1, n0, d) \
__asm__ ("divu%.l %4,%1:%0" \
: "=d" (q), "=d" (r) \
: "0" ((USItype)(n0)), "1" ((USItype)(n1)), "dmi" ((USItype)(d)))
-#define UDIV_TIME 90
#define sdiv_qrnnd(q, r, n1, n0, d) \
__asm__ ("divs%.l %4,%1:%0" \
: "=d" (q), "=d" (r) \
@@ -1150,8 +1208,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
"=d" (__umul_tmp1), "=&d" (__umul_tmp2) \
: "%2" ((USItype)(a)), "d" ((USItype)(b))); \
} while (0)
-#define UMUL_TIME 100
-#define UDIV_TIME 400
#endif /* not mc68020 */
/* The '020, '030, '040 and '060 have bitfield insns.
GCC 3.4 defines __mc68020__ when in CPU32 mode, check for __mcpu32__ to
@@ -1204,11 +1260,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
__asm__ ("divu.d %0,%1,%2" \
: "=r" (__q.__ll) : "r" (__x.__ll), "r" (d)); \
(r) = (n0) - __q.__l * (d); (q) = __q.__l; })
-#define UMUL_TIME 5
-#define UDIV_TIME 25
-#else
-#define UMUL_TIME 17
-#define UDIV_TIME 150
#endif /* __m88110__ */
#endif /* __m88000__ */
@@ -1230,12 +1281,18 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
__asm__ ("multu %2,%3\n\tmflo %0\n\tmfhi %1" \
: "=d" (w0), "=d" (w1) : "d" (u), "d" (v))
#endif
-#define UMUL_TIME 10
-#define UDIV_TIME 100
#endif /* __mips */
#if (defined (__mips) && __mips >= 3) && W_TYPE_SIZE == 64
-#if __GMP_GNUC_PREREQ (4,4)
+#if defined (_MIPS_ARCH_MIPS64R6)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ UDItype __m0 = (u), __m1 = (v); \
+ (w0) = __m0 * __m1; \
+ __asm__ ("dmuhu\t%0, %1, %2" : "=d" (w1) : "d" (__m0), "d" (__m1)); \
+ } while (0)
+#endif
+#if !defined (umul_ppmm) && __GMP_GNUC_PREREQ (4,4)
#define umul_ppmm(w1, w0, u, v) \
do { \
typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
@@ -1256,8 +1313,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
: "=d" (w0), "=d" (w1) \
: "d" ((UDItype)(u)), "d" ((UDItype)(v)))
#endif
-#define UMUL_TIME 20
-#define UDIV_TIME 140
#endif /* __mips */
#if defined (__mmix__) && W_TYPE_SIZE == 64
@@ -1322,33 +1377,41 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
do { \
if (__builtin_constant_p (bh) && (bh) == 0) \
__asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
- : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl)); \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl) \
+ __CLOBBER_CC); \
else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
__asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
- : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl)); \
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "%r" (al), "rI" (bl) \
+ __CLOBBER_CC); \
else \
__asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
- : "=r" (sh), "=&r" (sl) \
- : "r" (ah), "r" (bh), "%r" (al), "rI" (bl)); \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" (ah), "r" (bh), "%r" (al), "rI" (bl) \
+ __CLOBBER_CC); \
} while (0)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
do { \
if (__builtin_constant_p (ah) && (ah) == 0) \
__asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
- : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl) \
+ __CLOBBER_CC); \
else if (__builtin_constant_p (ah) && (ah) == ~(USItype) 0) \
__asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
- : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl));\
+ : "=r" (sh), "=&r" (sl) : "r" (bh), "rI" (al), "r" (bl) \
+ __CLOBBER_CC); \
else if (__builtin_constant_p (bh) && (bh) == 0) \
__asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
- : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl) \
+ __CLOBBER_CC); \
else if (__builtin_constant_p (bh) && (bh) == ~(USItype) 0) \
__asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
- : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl));\
+ : "=r" (sh), "=&r" (sl) : "r" (ah), "rI" (al), "r" (bl) \
+ __CLOBBER_CC); \
else \
__asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
: "=r" (sh), "=&r" (sl) \
- : "r" (ah), "r" (bh), "rI" (al), "r" (bl)); \
+ : "r" (ah), "r" (bh), "rI" (al), "r" (bl) \
+ __CLOBBER_CC); \
} while (0)
#define count_leading_zeros(count, x) \
__asm__ ("cntlzw %0,%1" : "=r" (count) : "r" (x))
@@ -1370,23 +1433,17 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
(pl) = __m0 * __m1; \
} while (0)
#endif
-#define UMUL_TIME 15
#define smul_ppmm(ph, pl, m0, m1) \
do { \
SItype __m0 = (m0), __m1 = (m1); \
__asm__ ("mulhw %0,%1,%2" : "=r" (ph) : "%r" (m0), "r" (m1)); \
(pl) = __m0 * __m1; \
} while (0)
-#define SMUL_TIME 14
-#define UDIV_TIME 120
#else
-#define UMUL_TIME 8
#define smul_ppmm(xh, xl, m0, m1) \
__asm__ ("mul %0,%2,%3" : "=r" (xh), "=q" (xl) : "r" (m0), "r" (m1))
-#define SMUL_TIME 4
#define sdiv_qrnnd(q, r, nh, nl, d) \
__asm__ ("div %0,%2,%4" : "=r" (q), "=q" (r) : "r" (nh), "1" (nl), "r" (d))
-#define UDIV_TIME 100
#endif
#endif /* 32-bit POWER architecture variants. */
@@ -1402,81 +1459,59 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
__asm__ ("add%I4c %1,%3,%4\n\taddze %0,%2" \
: "=r" (sh), "=&r" (sl) \
: "r" ((UDItype)(ah)), \
- "%r" ((UDItype)(al)), "rI" ((UDItype)(bl))); \
+ "%r" ((UDItype)(al)), "rI" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
__asm__ ("add%I4c %1,%3,%4\n\taddme %0,%2" \
: "=r" (sh), "=&r" (sl) \
: "r" ((UDItype)(ah)), \
- "%r" ((UDItype)(al)), "rI" ((UDItype)(bl))); \
+ "%r" ((UDItype)(al)), "rI" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
else \
__asm__ ("add%I5c %1,%4,%5\n\tadde %0,%2,%3" \
: "=r" (sh), "=&r" (sl) \
: "r" ((UDItype)(ah)), "r" ((UDItype)(bh)), \
- "%r" ((UDItype)(al)), "rI" ((UDItype)(bl))); \
+ "%r" ((UDItype)(al)), "rI" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
} while (0)
-/* We use "*rI" for the constant operand here, since with just "I", gcc barfs.
- This might seem strange, but gcc folds away the dead code late. */
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
do { \
- if (__builtin_constant_p (bl) && bl > -0x8000 && bl <= 0x8000) { \
- if (__builtin_constant_p (ah) && (ah) == 0) \
- __asm__ ("addic %1,%3,%4\n\tsubfze %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl)))); \
- else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
- __asm__ ("addic %1,%3,%4\n\tsubfme %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl)))); \
- else if (__builtin_constant_p (bh) && (bh) == 0) \
- __asm__ ("addic %1,%3,%4\n\taddme %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(ah)), \
- "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl)))); \
- else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
- __asm__ ("addic %1,%3,%4\n\taddze %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(ah)), \
- "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl)))); \
- else \
- __asm__ ("addic %1,%4,%5\n\tsubfe %0,%3,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(ah)), "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl)))); \
- } else { \
- if (__builtin_constant_p (ah) && (ah) == 0) \
- __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "r" ((UDItype)(bl))); \
- else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
- __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "r" ((UDItype)(bl))); \
- else if (__builtin_constant_p (bh) && (bh) == 0) \
- __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(ah)), \
- "rI" ((UDItype)(al)), "r" ((UDItype)(bl))); \
- else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
- __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(ah)), \
- "rI" ((UDItype)(al)), "r" ((UDItype)(bl))); \
- else \
- __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
- : "=r" (sh), "=&r" (sl) \
- : "r" ((UDItype)(ah)), "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "r" ((UDItype)(bl))); \
- } \
+ if (__builtin_constant_p (ah) && (ah) == 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfze %0,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" ((UDItype)(bh)), \
+ "rI" ((UDItype)(al)), "r" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
+ else if (__builtin_constant_p (ah) && (ah) == ~(UDItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\tsubfme %0,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" ((UDItype)(bh)), \
+ "rI" ((UDItype)(al)), "r" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
+ else if (__builtin_constant_p (bh) && (bh) == 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddme %0,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" ((UDItype)(ah)), \
+ "rI" ((UDItype)(al)), "r" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
+ else if (__builtin_constant_p (bh) && (bh) == ~(UDItype) 0) \
+ __asm__ ("subf%I3c %1,%4,%3\n\taddze %0,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" ((UDItype)(ah)), \
+ "rI" ((UDItype)(al)), "r" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
+ else \
+ __asm__ ("subf%I4c %1,%5,%4\n\tsubfe %0,%3,%2" \
+ : "=r" (sh), "=&r" (sl) \
+ : "r" ((UDItype)(ah)), "r" ((UDItype)(bh)), \
+ "rI" ((UDItype)(al)), "r" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
} while (0)
#endif /* ! _LONG_LONG_LIMB */
#define count_leading_zeros(count, x) \
__asm__ ("cntlzd %0,%1" : "=r" (count) : "r" (x))
#define COUNT_LEADING_ZEROS_0 64
-#if 0 && __GMP_GNUC_PREREQ (4,4) /* Disable, this results in libcalls! */
+#if __GMP_GNUC_PREREQ (4,8)
#define umul_ppmm(w1, w0, u, v) \
do { \
typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
@@ -1493,15 +1528,12 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
(pl) = __m0 * __m1; \
} while (0)
#endif
-#define UMUL_TIME 15
#define smul_ppmm(ph, pl, m0, m1) \
do { \
DItype __m0 = (m0), __m1 = (m1); \
__asm__ ("mulhd %0,%1,%2" : "=r" (ph) : "%r" (__m0), "r" (__m1)); \
(pl) = __m0 * __m1; \
} while (0)
-#define SMUL_TIME 14 /* ??? */
-#define UDIV_TIME 120 /* ??? */
#endif /* 64-bit PowerPC. */
#if defined (__pyr__) && W_TYPE_SIZE == 32
@@ -1562,8 +1594,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
: "=r" (ph), "=r" (pl) \
: "%r" ((USItype)(m0)), "r" ((USItype)(m1)) \
: "r2")
-#define UMUL_TIME 20
-#define UDIV_TIME 200
#define count_leading_zeros(count, x) \
do { \
if ((x) >= 0x10000) \
@@ -1578,11 +1608,19 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
} while (0)
#endif /* RT/ROMP */
+#if defined (__riscv64) && W_TYPE_SIZE == 64
+#define umul_ppmm(ph, pl, u, v) \
+ do { \
+ UDItype __u = (u), __v = (v); \
+ (pl) = __u * __v; \
+ __asm__ ("mulhu\t%2, %1, %0" : "=r" (ph) : "%r" (__u), "r" (__v)); \
+ } while (0)
+#endif
+
#if (defined (__SH2__) || defined (__SH3__) || defined (__SH4__)) && W_TYPE_SIZE == 32
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("dmulu.l %2,%3\n\tsts macl,%1\n\tsts mach,%0" \
: "=r" (w1), "=r" (w0) : "r" (u), "r" (v) : "macl", "mach")
-#define UMUL_TIME 5
#endif
#if defined (__sparc__) && W_TYPE_SIZE == 32
@@ -1630,10 +1668,8 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
but INTERPRETED AS UNSIGNED. */
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("umul %2,%3,%1;rd %%y,%0" : "=r" (w1), "=r" (w0) : "r" (u), "r" (v))
-#define UMUL_TIME 5
#if HAVE_HOST_CPU_supersparc
-#define UDIV_TIME 60 /* SuperSPARC timing */
#else
/* Don't use this on SuperSPARC because its udiv only handles 53 bit
dividends and will trap to the kernel for the rest. */
@@ -1645,7 +1681,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
(r) = (n0) - __q * (d); \
(q) = __q; \
} while (0)
-#define UDIV_TIME 25
#endif /* HAVE_HOST_CPU_supersparc */
#else /* ! __sparc_v8__ */
@@ -1654,7 +1689,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
instructions scan (ffs from high bit) and divscc. */
#define umul_ppmm(w1, w0, u, v) \
__asm__ ("umul %2,%3,%1;rd %%y,%0" : "=r" (w1), "=r" (w0) : "r" (u), "r" (v))
-#define UMUL_TIME 5
#define udiv_qrnnd(q, r, n1, n0, d) \
__asm__ ("! Inlined udiv_qrnnd\n" \
" wr %%g0,%2,%%y ! Not a delayed write for sparclite\n" \
@@ -1697,7 +1731,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
"1: ! End of inline udiv_qrnnd" \
: "=r" (q), "=r" (r) : "r" (n1), "r" (n0), "rI" (d) \
: "%g1" __AND_CLOBBER_CC)
-#define UDIV_TIME 37
#define count_leading_zeros(count, x) \
__asm__ ("scan %1,1,%0" : "=r" (count) : "r" (x))
/* Early sparclites return 63 for an argument of 0, but they warn that future
@@ -1751,7 +1784,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
" rd %%y,%1" \
: "=r" (w1), "=r" (w0) : "%rI" (u), "r" (v) \
: "%g1", "%g2" __AND_CLOBBER_CC)
-#define UMUL_TIME 39 /* 39 instructions */
#endif
#ifndef udiv_qrnnd
#ifndef LONGLONG_STANDALONE
@@ -1761,9 +1793,6 @@ extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
(r) = __r; \
} while (0)
extern UWtype __MPN(udiv_qrnnd) (UWtype *, UWtype, UWtype, UWtype);
-#ifndef UDIV_TIME
-#define UDIV_TIME 140
-#endif
#endif /* LONGLONG_STANDALONE */
#endif /* udiv_qrnnd */
#endif /* __sparc__ */
@@ -2098,7 +2127,8 @@ extern __longlong_h_C UWtype mpn_udiv_qrnnd_r (UWtype, UWtype, UWtype, UWtype *)
/* If the processor has no udiv_qrnnd but sdiv_qrnnd, go through
__udiv_w_sdiv (defined in libgcc or elsewhere). */
-#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd) && !defined(LONGLONG_STANDALONE)
+#if !defined (udiv_qrnnd) && defined (sdiv_qrnnd) \
+ && ! defined (LONGLONG_STANDALONE)
#define udiv_qrnnd(q, r, nh, nl, d) \
do { \
UWtype __r; \
@@ -2198,12 +2228,3 @@ extern const unsigned char __MPFR_DECLSPEC __clz_tab[129];
#ifndef UDIV_PREINV_ALWAYS
#define UDIV_PREINV_ALWAYS 0
#endif
-
-/* Give defaults for UMUL_TIME and UDIV_TIME. */
-#ifndef UMUL_TIME
-#define UMUL_TIME 1
-#endif
-
-#ifndef UDIV_TIME
-#define UDIV_TIME UMUL_TIME
-#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.c b/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.c
index 1b2cd25315e..abdcb9aa280 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.c
@@ -1,6 +1,6 @@
/* mpfr-mini-gmp.c -- Interface functions for mini-gmp.
-Copyright 2014-2019 Free Software Foundation, Inc.
+Copyright 2014-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -27,8 +27,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifdef MPFR_USE_MINI_GMP
-#include "mpfr-mini-gmp.h"
-
/************************ random generation functions ************************/
#ifdef WANT_gmp_randinit_default
@@ -42,7 +40,9 @@ gmp_randinit_default (gmp_randstate_t state)
void
gmp_randseed_ui (gmp_randstate_t state, unsigned long int seed)
{
- srand48 (seed);
+ /* With a portable version of the conversion from unsigned long to long
+ (at least GCC and Clang optimize this expression to identity). */
+ srand48 (seed > LONG_MAX ? -1 - (long) ~seed : (long) seed);
}
#endif
@@ -63,12 +63,22 @@ gmp_randinit_set (gmp_randstate_t s1, gmp_randstate_t s2)
static mp_limb_t
random_limb (void)
{
- /* lrand48() only gives 31 bits */
-#if GMP_NUMB_BITS == 32
- return lrand48 () + (lrand48 () << 31);
+ /* lrand48() returns a random number in [0, 2^31-1],
+ but the low 15 bits do not depend on the random seed,
+ thus it is safer to use the upper bits */
+#if GMP_NUMB_BITS < 32
+ /* use the upper GMP_NUMB_BITS bits from lrand48 () */
+ return (mp_limb_t) (lrand48 () >> (31 - GMP_NUMB_BITS));
+#elif GMP_NUMB_BITS == 32
+ /* use the upper 16 bits from two lrand48 calls */
+ return (lrand48 () >> 15) + ((lrand48 () >> 15) << 16);
+#elif GMP_NUMB_BITS == 64
+ /* use the upper 16 bits from four lrand48 calls */
+ return (lrand48 () >> 15) + ((((mp_limb_t) lrand48 ()) >> 15) << 16)
+ + ((((mp_limb_t) lrand48 ()) >> 15) << 32)
+ + ((((mp_limb_t) lrand48 ()) >> 15) << 48);
#else
- return lrand48 () + (((mp_limb_t) lrand48 ()) << 31)
- + (((mp_limb_t) lrand48 ()) << 62);
+#error "GMP_NUMB_BITS should be 8, 16, 32 or >= 64"
#endif
}
@@ -85,7 +95,7 @@ mpz_urandomb (mpz_t rop, gmp_randstate_t state, mp_bitcnt_t nbits)
i = n * GMP_NUMB_BITS - nbits;
/* mask the upper i bits */
if (i)
- rop->_mp_d[n-1] = (rop->_mp_d[n-1] << i) >> i;
+ rop->_mp_d[n-1] = MPFR_LIMB_LSHIFT(rop->_mp_d[n-1], i) >> i;
while (n > 0 && (rop->_mp_d[n-1] == 0))
n--;
rop->_mp_size = n;
@@ -93,10 +103,46 @@ mpz_urandomb (mpz_t rop, gmp_randstate_t state, mp_bitcnt_t nbits)
#endif
#ifdef WANT_gmp_urandomm_ui
+/* generates a random unsigned long */
+static unsigned long
+random_ulong (void)
+{
+#ifdef MPFR_LONG_WITHIN_LIMB
+ /* we assume a limb and an unsigned long have both a number of different
+ values that is a power of two, thus when we cast a random limb into
+ an unsigned long, we still get an uniform distribution */
+ return random_limb ();
+#else
+ /* with the same assumption as above, we need to generate as many random
+ limbs needed to "fill" an unsigned long */
+ unsigned long u, v;
+
+ v = MPFR_LIMB_MAX;
+ u = random_limb ();
+ while (v < ULONG_MAX)
+ {
+ v = (v << GMP_NUMB_BITS) + MPFR_LIMB_MAX;
+ u = (u << GMP_NUMB_BITS) + random_limb ();
+ }
+ return u;
+#endif
+}
+
unsigned long
gmp_urandomm_ui (gmp_randstate_t state, unsigned long n)
{
- return random_limb () % n;
+ unsigned long p, q, r;
+
+ MPFR_ASSERTN (n > 0);
+ p = random_ulong (); /* p is in [0, ULONG_MAX], thus p is uniform among
+ ULONG_MAX+1 values */
+ q = n * (ULONG_MAX / n);
+ r = ULONG_MAX % n;
+ if (r != n - 1) /* ULONG_MAX+1 is not multiple of n, will happen whenever
+ n is not a power of two */
+ while (p >= q)
+ p = random_ulong ();
+ return p % n;
}
#endif
@@ -104,7 +150,22 @@ gmp_urandomm_ui (gmp_randstate_t state, unsigned long n)
unsigned long
gmp_urandomb_ui (gmp_randstate_t state, unsigned long n)
{
+#ifdef MPFR_LONG_WITHIN_LIMB
return random_limb () % (1UL << n);
+#else
+ unsigned long res = 0;
+ int m = n; /* remaining bits to generate */
+ while (m >= GMP_NUMB_BITS)
+ {
+ /* we can generate a full limb */
+ res = (res << GMP_NUMB_BITS) | (unsigned long) random_limb ();
+ m -= GMP_NUMB_BITS;
+ }
+ /* now m < GMP_NUMB_BITS */
+ if (m) /* generate m extra bits */
+ res = (res << m) | (unsigned long) (random_limb () % (1UL << m));
+ return res;
+#endif
}
#endif
@@ -208,4 +269,47 @@ mpn_tdiv_qr (mp_limb_t *qp, mp_limb_t *rp, mp_size_t qxn,
}
#endif
+#if 0 /* this function is useful for debugging, thus please keep it here */
+void
+mpz_dump (mpz_t z)
+{
+ mp_size_t n = z->_mp_size;
+
+ MPFR_STAT_STATIC_ASSERT ((GMP_NUMB_BITS % 4) == 0);
+
+ if (n == 0)
+ printf ("0");
+ else
+ {
+ int first = 1;
+ if (n < 0)
+ {
+ printf ("-");
+ n = -n;
+ }
+ while (n > 0)
+ {
+ if (first)
+ {
+ printf ("%lx", (unsigned long) z->_mp_d[n-1]);
+ first = 0;
+ }
+ else
+ {
+ char s[17];
+ int len;
+ sprintf (s, "%lx", (unsigned long) z->_mp_d[n-1]);
+ len = strlen (s);
+ /* one character should be printed for 4 bits */
+ while (len++ < GMP_NUMB_BITS / 4)
+ printf ("0");
+ printf ("%lx", (unsigned long) z->_mp_d[n-1]);
+ }
+ n--;
+ }
+ }
+ printf ("\n");
+}
+#endif
+
#endif /* MPFR_USE_MINI_GMP */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.h
index 4564628770a..950ba41bc84 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-mini-gmp.h
@@ -1,6 +1,6 @@
/* mpfr-mini-gmp.h -- Interface header for mini-gmp.
-Copyright 2014-2019 Free Software Foundation, Inc.
+Copyright 2014-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,19 +20,6 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include <stdlib.h> /* for size_t */
-#include "gmp.h"
-
-#ifndef gmp_version
-extern char gmp_version[];
-#endif
-
-#ifndef GMP_NUMB_BITS
-/* see https://gmplib.org/list-archives/gmp-bugs/2015-October/003755.html */
-#include <limits.h>
-#define GMP_NUMB_BITS (CHAR_BIT * sizeof(mp_limb_t))
-#endif
-
#ifndef mp_limb_signed_t
typedef long mp_limb_signed_t;
#endif
@@ -139,3 +126,7 @@ void mpn_tdiv_qr (mp_limb_t *, mp_limb_t *, mp_size_t,
#ifndef mpz_rrandomb
#define mpz_rrandomb mpz_urandomb
#endif
+
+#ifndef mpz_dump
+void mpz_dump (mpz_t);
+#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-sassert.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-sassert.h
index bc3a4ff1864..1c988f28fc5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-sassert.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-sassert.h
@@ -1,6 +1,6 @@
/* MPFR internal header related to Static Assertions
-Copyright 2012-2019 Free Software Foundation, Inc.
+Copyright 2012-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -27,10 +27,13 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* How to use:
===========
- MPFR_DECL_STATIC_ASSERT:
- + to check a condition at compile time within the declaration section.
MPFR_STAT_STATIC_ASSERT:
+ to check a condition at compile time within the statement section.
+
+ Note: In case one would need a static assertion in an expression,
+ a sizeof(...) instead of a typedef could be used. For instance,
+ see https://stackoverflow.com/questions/9229601/what-is-in-c-code
+ (about BUILD_BUG_ON_ZERO in the Linux kernel).
*/
#ifdef MPFR_USE_STATIC_ASSERT
@@ -38,17 +41,16 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* C11 version */
# if defined (__STDC_VERSION__)
# if (__STDC_VERSION__ >= 201112L)
-# define MPFR_DECL_STATIC_ASSERT(c) _Static_assert((c), #c )
# define MPFR_STAT_STATIC_ASSERT(c) _Static_assert((c), #c )
# endif
# endif
/* Default version which should be compatible with nearly all compilers */
-# if !defined(MPFR_DECL_STATIC_ASSERT)
+# if !defined(MPFR_STAT_STATIC_ASSERT)
# if __MPFR_GNUC(4,8)
/* Get rid of annoying warnings "typedef '...' locally defined but not used"
(new in GCC 4.8). Thanks to Jonathan Wakely for this solution:
- https://gcc.gnu.org/ml/gcc-help/2013-07/msg00142.html */
+ https://gcc.gnu.org/legacy-ml/gcc-help/2013-07/msg00142.html */
# define MPFR_TYPEDEF_UNUSED __attribute__ ((unused))
# else
# define MPFR_TYPEDEF_UNUSED
@@ -59,15 +61,11 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
typedef enum { MPFR_ASSERT_CAT(MPFR_STATIC_ASSERT_CONST_,__LINE__) = !(c) } \
MPFR_ASSERT_CAT(MPFR_ASSERT_,__LINE__)[!!(c) ? 1 : -1] \
MPFR_TYPEDEF_UNUSED; } while (0)
-# define MPFR_DECL_STATIC_ASSERT(c) \
- typedef enum { MPFR_ASSERT_CAT(MPFR_STATIC_ASSERT_CONST_,__LINE__) = !(c) } \
- MPFR_ASSERT_CAT(MPFR_ASSERT_,__LINE__)[!!(c) ? 1 : -1];
# endif
#else
/* No support: default to classic assertions */
-# define MPFR_DECL_STATIC_ASSERT(c) /* Nothing */
# define MPFR_STAT_STATIC_ASSERT(c) MPFR_ASSERTN(c)
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr-thread.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr-thread.h
index 6ae66745ae8..75d51b0a7cf 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr-thread.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr-thread.h
@@ -1,6 +1,6 @@
/* MPFR internal header related to thread-local variables.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpfr.h b/Build/source/libs/mpfr/mpfr-src/src/mpfr.h
index efcfd9d261c..109c75f73e5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpfr.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpfr.h
@@ -1,6 +1,6 @@
/* mpfr.h -- Include file for mpfr.
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -25,9 +25,9 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
/* Define MPFR version number */
#define MPFR_VERSION_MAJOR 4
-#define MPFR_VERSION_MINOR 0
-#define MPFR_VERSION_PATCHLEVEL 2
-#define MPFR_VERSION_STRING "4.0.2"
+#define MPFR_VERSION_MINOR 1
+#define MPFR_VERSION_PATCHLEVEL 0
+#define MPFR_VERSION_STRING "4.1.0"
/* User macros:
MPFR_USE_FILE: Define it to make MPFR define functions dealing
@@ -49,7 +49,11 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_VERSION \
MPFR_VERSION_NUM(MPFR_VERSION_MAJOR,MPFR_VERSION_MINOR,MPFR_VERSION_PATCHLEVEL)
+#ifndef MPFR_USE_MINI_GMP
#include <gmp.h>
+#else
+#include <mini-gmp.h>
+#endif
/* Avoid some problems with macro expansion if the user defines macros
with the same name as keywords. By convention, identifiers and macro
@@ -111,11 +115,21 @@ typedef enum {
#define GMP_RNDU MPFR_RNDU
#define GMP_RNDD MPFR_RNDD
-/* Note: With the following default choices for _MPFR_PREC_FORMAT and
+/* The _MPFR_PREC_FORMAT and _MPFR_EXP_FORMAT values are automatically
+ defined below. You MUST NOT force a value (this will break the ABI),
+ possibly except for a very particular use, in which case you also need
+ to rebuild the MPFR library with the chosen values; do not install this
+ rebuilt library in a path that is searched by default, otherwise this
+ will break applications that are dynamically linked with MPFR.
+
+ Using non-default values is not guaranteed to work.
+
+ Note: With the following default choices for _MPFR_PREC_FORMAT and
_MPFR_EXP_FORMAT, mpfr_exp_t will be the same as [mp_exp_t] (at least
- up to GMP 5). */
+ up to GMP 6). */
-/* Define precision: 1 (short), 2 (int) or 3 (long) (DON'T USE IT!) */
+/* Define precision: 1 (short), 2 (int) or 3 (long).
+ DON'T FORCE A VALUE (see above). */
#ifndef _MPFR_PREC_FORMAT
# if __GMP_MP_SIZE_T_INT
# define _MPFR_PREC_FORMAT 2
@@ -124,8 +138,8 @@ typedef enum {
# endif
#endif
-/* Define exponent: 1 (short), 2 (int), 3 (long) or 4 (intmax_t)
- (DON'T USE IT!) */
+/* Define exponent: 1 (short), 2 (int), 3 (long) or 4 (intmax_t).
+ DON'T FORCE A VALUE (see above). */
#ifndef _MPFR_EXP_FORMAT
# define _MPFR_EXP_FORMAT _MPFR_PREC_FORMAT
#endif
@@ -136,7 +150,11 @@ typedef enum {
/* Let's make mpfr_prec_t signed in order to avoid problems due to the
usual arithmetic conversions when mixing mpfr_prec_t and mpfr_exp_t
- in an expression (for error analysis) if casts are forgotten. */
+ in an expression (for error analysis) if casts are forgotten.
+ Note: mpfr_prec_t is currently limited to "long". This means that
+ under MS Windows, the precisions are limited to about 2^31; however,
+ these are already huge precisions, probably sufficient in practice
+ on this platform. */
#if _MPFR_PREC_FORMAT == 1
typedef short mpfr_prec_t;
typedef unsigned short mpfr_uprec_t;
@@ -144,6 +162,9 @@ typedef unsigned short mpfr_uprec_t;
typedef int mpfr_prec_t;
typedef unsigned int mpfr_uprec_t;
#elif _MPFR_PREC_FORMAT == 3
+/* we could use "long long" under Windows 64 here, which can be tested
+ with the macro _WIN64 according to
+ https://sourceforge.net/p/predef/wiki/OperatingSystems/ */
typedef long mpfr_prec_t;
typedef unsigned long mpfr_uprec_t;
#else
@@ -264,12 +285,12 @@ typedef enum {
#if defined (__GNUC__)
# if __GNUC__ >= 4
# undef __MPFR_SENTINEL_ATTR
-# define __MPFR_SENTINEL_ATTR __attribute__ ((sentinel))
+# define __MPFR_SENTINEL_ATTR __attribute__ ((__sentinel__))
# endif
#endif
/* If the user hasn't requested his/her preference
- and if the intension of support by the compiler is C99
+ and if the intention of support by the compiler is C99
and if the compiler is known to support the C99 feature
then we can auto-detect the C99 support as OK.
__GNUC__ is used to detect GNU-C, ICC & CLANG compilers.
@@ -323,7 +344,7 @@ typedef enum {
*/
#if defined(__GNUC__) && \
(__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1))
-# define MPFR_DEPRECATED __attribute__ ((deprecated))
+# define MPFR_DEPRECATED __attribute__ ((__deprecated__))
#elif defined(_MSC_VER) && _MSC_VER >= 1300
# define MPFR_DEPRECATED __declspec(deprecated)
#else
@@ -331,10 +352,17 @@ typedef enum {
#endif
/* TODO: Also define MPFR_EXPERIMENTAL for experimental functions?
See SVN_EXPERIMENTAL in Subversion 1.9+ as an example:
- __attribute__((warning("..."))) can be used with GCC 4.3.1+ but
+ __attribute__((__warning__("..."))) can be used with GCC 4.3.1+ but
not __llvm__, and __declspec(deprecated("...")) can be used with
MSC as above. */
+#if defined(__GNUC__) && \
+ (__GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 9))
+# define MPFR_RETURNS_NONNULL __attribute__ ((__returns_nonnull__))
+#else
+# define MPFR_RETURNS_NONNULL
+#endif
+
/* Note: In order to be declared, some functions need a specific
system header to be included *before* "mpfr.h". If the user
forgets to include the header, the MPFR function prototype in
@@ -347,14 +375,16 @@ typedef enum {
extern "C" {
#endif
-__MPFR_DECLSPEC const char * mpfr_get_version (void);
-__MPFR_DECLSPEC const char * mpfr_get_patches (void);
+__MPFR_DECLSPEC MPFR_RETURNS_NONNULL const char * mpfr_get_version (void);
+__MPFR_DECLSPEC MPFR_RETURNS_NONNULL const char * mpfr_get_patches (void);
+
__MPFR_DECLSPEC int mpfr_buildopt_tls_p (void);
__MPFR_DECLSPEC int mpfr_buildopt_float128_p (void);
__MPFR_DECLSPEC int mpfr_buildopt_decimal_p (void);
__MPFR_DECLSPEC int mpfr_buildopt_gmpinternals_p (void);
__MPFR_DECLSPEC int mpfr_buildopt_sharedcache_p (void);
-__MPFR_DECLSPEC const char * mpfr_buildopt_tune_case (void);
+__MPFR_DECLSPEC MPFR_RETURNS_NONNULL const char *
+ mpfr_buildopt_tune_case (void);
__MPFR_DECLSPEC mpfr_exp_t mpfr_get_emin (void);
__MPFR_DECLSPEC int mpfr_set_emin (mpfr_exp_t);
@@ -430,11 +460,12 @@ __MPFR_DECLSPEC int mpfr_set_flt (mpfr_ptr, float, mpfr_rnd_t);
/* _Decimal64 is not defined in C++,
cf https://gcc.gnu.org/bugzilla/show_bug.cgi?id=51364 */
__MPFR_DECLSPEC int mpfr_set_decimal64 (mpfr_ptr, _Decimal64, mpfr_rnd_t);
+__MPFR_DECLSPEC int mpfr_set_decimal128 (mpfr_ptr, _Decimal128, mpfr_rnd_t);
#endif
__MPFR_DECLSPEC int mpfr_set_ld (mpfr_ptr, long double, mpfr_rnd_t);
#ifdef MPFR_WANT_FLOAT128
-__MPFR_DECLSPEC int mpfr_set_float128 (mpfr_ptr, __float128, mpfr_rnd_t);
-__MPFR_DECLSPEC __float128 mpfr_get_float128 (mpfr_srcptr, mpfr_rnd_t);
+__MPFR_DECLSPEC int mpfr_set_float128 (mpfr_ptr, _Float128, mpfr_rnd_t);
+__MPFR_DECLSPEC _Float128 mpfr_get_float128 (mpfr_srcptr, mpfr_rnd_t);
#endif
__MPFR_DECLSPEC int mpfr_set_z (mpfr_ptr, mpz_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC int mpfr_set_z_2exp (mpfr_ptr, mpz_srcptr, mpfr_exp_t,
@@ -481,6 +512,7 @@ __MPFR_DECLSPEC float mpfr_get_flt (mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC double mpfr_get_d (mpfr_srcptr, mpfr_rnd_t);
#ifdef MPFR_WANT_DECIMAL_FLOATS
__MPFR_DECLSPEC _Decimal64 mpfr_get_decimal64 (mpfr_srcptr, mpfr_rnd_t);
+__MPFR_DECLSPEC _Decimal128 mpfr_get_decimal128 (mpfr_srcptr, mpfr_rnd_t);
#endif
__MPFR_DECLSPEC long double mpfr_get_ld (mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC double mpfr_get_d1 (mpfr_srcptr);
@@ -489,6 +521,7 @@ __MPFR_DECLSPEC long double mpfr_get_ld_2exp (long*, mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC int mpfr_frexp (mpfr_exp_t*, mpfr_ptr, mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC long mpfr_get_si (mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC unsigned long mpfr_get_ui (mpfr_srcptr, mpfr_rnd_t);
+__MPFR_DECLSPEC size_t mpfr_get_str_ndigits (int, mpfr_prec_t);
__MPFR_DECLSPEC char * mpfr_get_str (char*, mpfr_exp_t*, int, size_t,
mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC int mpfr_get_z (mpz_ptr z, mpfr_srcptr f, mpfr_rnd_t);
@@ -588,11 +621,12 @@ __MPFR_DECLSPEC int mpfr_cmp (mpfr_srcptr, mpfr_srcptr);
__MPFR_DECLSPEC int mpfr_cmp3 (mpfr_srcptr, mpfr_srcptr, int);
__MPFR_DECLSPEC int mpfr_cmp_d (mpfr_srcptr, double);
__MPFR_DECLSPEC int mpfr_cmp_ld (mpfr_srcptr, long double);
-__MPFR_DECLSPEC int mpfr_cmpabs (mpfr_srcptr, mpfr_srcptr);
__MPFR_DECLSPEC int mpfr_cmp_ui (mpfr_srcptr, unsigned long);
__MPFR_DECLSPEC int mpfr_cmp_si (mpfr_srcptr, long);
__MPFR_DECLSPEC int mpfr_cmp_ui_2exp (mpfr_srcptr, unsigned long, mpfr_exp_t);
__MPFR_DECLSPEC int mpfr_cmp_si_2exp (mpfr_srcptr, long, mpfr_exp_t);
+__MPFR_DECLSPEC int mpfr_cmpabs (mpfr_srcptr, mpfr_srcptr);
+__MPFR_DECLSPEC int mpfr_cmpabs_ui (mpfr_srcptr, unsigned long);
__MPFR_DECLSPEC void mpfr_reldiff (mpfr_ptr, mpfr_srcptr, mpfr_srcptr,
mpfr_rnd_t);
__MPFR_DECLSPEC int mpfr_eq (mpfr_srcptr, mpfr_srcptr, unsigned long);
@@ -734,6 +768,8 @@ __MPFR_DECLSPEC int mpfr_fmms (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_srcptr,
mpfr_srcptr, mpfr_rnd_t);
__MPFR_DECLSPEC int mpfr_sum (mpfr_ptr, const mpfr_ptr *, unsigned long,
mpfr_rnd_t);
+__MPFR_DECLSPEC int mpfr_dot (mpfr_ptr, const mpfr_ptr *, const mpfr_ptr *,
+ unsigned long, mpfr_rnd_t);
__MPFR_DECLSPEC void mpfr_free_cache (void);
__MPFR_DECLSPEC void mpfr_free_cache2 (mpfr_free_cache_t);
@@ -750,12 +786,15 @@ __MPFR_DECLSPEC int mpfr_round_nearest_away_end (mpfr_t, int);
__MPFR_DECLSPEC size_t mpfr_custom_get_size (mpfr_prec_t);
__MPFR_DECLSPEC void mpfr_custom_init (void *, mpfr_prec_t);
-__MPFR_DECLSPEC void * mpfr_custom_get_significand (mpfr_srcptr);
+__MPFR_DECLSPEC MPFR_RETURNS_NONNULL void *
+ mpfr_custom_get_significand (mpfr_srcptr);
__MPFR_DECLSPEC mpfr_exp_t mpfr_custom_get_exp (mpfr_srcptr);
__MPFR_DECLSPEC void mpfr_custom_move (mpfr_ptr, void *);
__MPFR_DECLSPEC void mpfr_custom_init_set (mpfr_ptr, int, mpfr_exp_t,
mpfr_prec_t, void *);
-__MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr);
+__MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr);
+
+__MPFR_DECLSPEC int mpfr_total_order_p (mpfr_srcptr, mpfr_srcptr);
#if defined (__cplusplus)
}
@@ -794,7 +833,7 @@ __MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr);
even if it produces faster and smaller code. */
#ifndef MPFR_USE_NO_MACRO
-/* Inlining theses functions is both faster and smaller */
+/* Inlining these functions is both faster and smaller */
#define mpfr_nan_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_NAN)
#define mpfr_inf_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_INF)
#define mpfr_zero_p(_x) ((_x)->_mpfr_exp == __MPFR_EXP_ZERO)
@@ -832,17 +871,8 @@ __MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr);
#define mpfr_div_2exp(y,x,n,r) mpfr_div_2ui((y),(x),(n),(r))
-/* When using GCC, optimize certain common comparisons and affectations.
- + Remove some Intel C/C++ (ICC) versions since they now define __GNUC__
- but produce a huge number of warnings if you use this code.
- VL: I couldn't reproduce a single warning when enabling these macros
- with icc 10.1 20080212 on Itanium. But with this version, the obsolete
- __ICC macro isn't defined (__INTEL_COMPILER is, though), so that these
- macros are enabled anyway. Checking with other ICC versions is needed.
- For now, !defined(__ICC) seems to be the right test. Possibly detect
- whether warnings are produced or not with a configure test.
- + Remove C++ too, since it complains too much. */
-/* Added casts to improve robustness in case of undefined behavior and
+/* When using GCC or ICC, optimize certain common comparisons and affectations.
+ Added casts to improve robustness in case of undefined behavior and
compiler extensions based on UB (in particular -fwrapv). MPFR doesn't
use such extensions, but these macros will be used by 3rd-party code,
where such extensions may be required.
@@ -862,7 +892,7 @@ __MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr);
If this is not possible (for future macros), one of the tricks described
on http://groups.google.com/group/comp.std.c/msg/e92abd24bf9eaf7b could
be used. */
-#if defined (__GNUC__) && !defined(__ICC) && !defined(__cplusplus)
+#if defined (__GNUC__) && !defined(__cplusplus)
#if (__GNUC__ >= 2)
#undef mpfr_cmp_ui
@@ -970,7 +1000,7 @@ __MPFR_DECLSPEC int mpfr_custom_get_kind (mpfr_srcptr);
#endif /* MPFR_USE_NO_MACRO */
-/* Theses are defined to be macros */
+/* These are defined to be macros */
#define mpfr_init_set_si(x, i, rnd) \
( mpfr_init(x), mpfr_set_si((x), (i), (rnd)) )
#define mpfr_init_set_ui(x, i, rnd) \
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mpn_exp.c b/Build/source/libs/mpfr/mpfr-src/src/mpn_exp.c
index ce397785234..983dc77a4a6 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mpn_exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mpn_exp.c
@@ -1,6 +1,6 @@
/* mpfr_mpn_exp -- auxiliary function for mpfr_get_str and mpfr_set_str
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -24,7 +24,43 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-/* this function computes an approximation of b^e in {a, n}, with exponent
+/* count the number of significant bits of e, i.e.,
+ nbits(mpfr_exp_t) - count_leading_zeros (e) */
+static int
+nbits_mpfr_exp_t (mpfr_exp_t e)
+{
+ int nbits = 0;
+
+ MPFR_ASSERTD (e > 0);
+ while (e >= 0x10000)
+ {
+ e >>= 16;
+ nbits += 16;
+ }
+ MPFR_ASSERTD (e <= 0xffff);
+ if (e >= 0x100)
+ {
+ e >>= 8;
+ nbits += 8;
+ }
+ MPFR_ASSERTD (e <= 0xff);
+ if (e >= 0x10)
+ {
+ e >>= 4;
+ nbits += 4;
+ }
+ MPFR_ASSERTD (e <= 0xf);
+ if (e >= 4)
+ {
+ e >>= 2;
+ nbits += 2;
+ }
+ MPFR_ASSERTD (e <= 3);
+ /* now e = 1, 2, or 3 */
+ return nbits + 1 + (e >= 2);
+}
+
+/* this function computes an approximation to b^e in {a, n}, with exponent
stored in exp_r. The computed value is rounded toward zero (truncated).
It returns an integer f such that the final error is bounded by 2^f ulps,
that is:
@@ -36,23 +72,23 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
Return -2 if an overflow occurred in the computation of exp_r.
*/
-long
+int
mpfr_mpn_exp (mp_limb_t *a, mpfr_exp_t *exp_r, int b, mpfr_exp_t e, size_t n)
{
mp_limb_t *c, B;
mpfr_exp_t f, h;
int i;
- unsigned long t; /* number of bits in e */
- unsigned long bits;
- size_t n1;
- unsigned int error; /* (number - 1) of loop a^2b inexact */
+ int t; /* number of bits in e */
+ size_t bits, n1;
+ unsigned int error; /* (number - 1) of loops a^2b inexact */
/* error == t means no error */
int err_s_a2 = 0;
int err_s_ab = 0; /* number of error when shift A^2, AB */
MPFR_TMP_DECL(marker);
- MPFR_ASSERTN(e > 0);
- MPFR_ASSERTN((2 <= b) && (b <= 62));
+ MPFR_ASSERTN (n > 0 && n <= ((size_t) -1) / GMP_NUMB_BITS);
+ MPFR_ASSERTN (e > 0);
+ MPFR_ASSERTN (2 <= b && b <= 62);
MPFR_TMP_MARK(marker);
@@ -75,17 +111,16 @@ mpfr_mpn_exp (mp_limb_t *a, mpfr_exp_t *exp_r, int b, mpfr_exp_t e, size_t n)
f = h - (n - 1) * GMP_NUMB_BITS;
/* determine number of bits in e */
- count_leading_zeros (t, (mp_limb_t) e);
+ t = nbits_mpfr_exp_t (e);
- t = GMP_NUMB_BITS - t; /* number of bits of exponent e */
-
- error = t; /* error <= GMP_NUMB_BITS */
+ error = t;
+ /* t, error <= bitsize(mpfr_exp_t) */
+ MPFR_ASSERTD (error >= 0);
MPN_ZERO (c, 2 * n);
for (i = t - 2; i >= 0; i--)
{
-
/* determine precision needed */
bits = n * GMP_NUMB_BITS - mpn_scan1 (a, 0);
n1 = (n * GMP_NUMB_BITS - bits) / GMP_NUMB_BITS;
@@ -98,19 +133,19 @@ mpfr_mpn_exp (mp_limb_t *a, mpfr_exp_t *exp_r, int b, mpfr_exp_t e, size_t n)
/* set {c+n, 2n1-n} to 0 : {c, n} = {a, n}^2*K^n */
/* check overflow on f */
- if (MPFR_UNLIKELY(f < MPFR_EXP_MIN/2 || f > MPFR_EXP_MAX/2))
+ if (MPFR_UNLIKELY (f < MPFR_EXP_MIN / 2 || f > MPFR_EXP_MAX / 2))
{
overflow:
MPFR_TMP_FREE(marker);
return -2;
}
- /* FIXME: Could f = 2*f + n * GMP_NUMB_BITS be used? */
- f = 2*f;
+ /* FIXME: Could f = 2 * f + n * GMP_NUMB_BITS be used? */
+ f = 2 * f;
MPFR_SADD_OVERFLOW (f, f, n * GMP_NUMB_BITS,
mpfr_exp_t, mpfr_uexp_t,
MPFR_EXP_MIN, MPFR_EXP_MAX,
goto overflow, goto overflow);
- if ((c[2*n - 1] & MPFR_LIMB_HIGHBIT) == 0)
+ if (MPFR_LIMB_MSB (c[2*n - 1]) == 0)
{
/* shift A by one bit to the left */
mpn_lshift (a, c + n, n, 1);
@@ -122,11 +157,11 @@ mpfr_mpn_exp (mp_limb_t *a, mpfr_exp_t *exp_r, int b, mpfr_exp_t e, size_t n)
else
MPN_COPY (a, c + n, n);
- if ((error == t) && (2 * n1 <= n) &&
- (mpn_scan1 (c + 2 * n1, 0) < (n - 2 * n1) * GMP_NUMB_BITS))
+ if (error == t && 2 * n1 <= n &&
+ mpn_scan1 (c + 2 * n1, 0) < (n - 2 * n1) * GMP_NUMB_BITS)
error = i;
- if (e & ((mpfr_exp_t) 1 << i))
+ if ((e >> i) & 1)
{
/* multiply A by B */
c[2 * n - 1] = mpn_mul_1 (c + n - 1, a, n, B);
@@ -143,18 +178,22 @@ mpfr_mpn_exp (mp_limb_t *a, mpfr_exp_t *exp_r, int b, mpfr_exp_t e, size_t n)
if (error != t)
err_s_ab ++;
}
- if ((error == t) && (c[n - 1] != 0))
+ if (error == t && c[n - 1] != 0)
error = i;
}
}
+ MPFR_ASSERTD (error >= 0);
+ MPFR_ASSERTD (err_s_a2 >= 0);
+ MPFR_ASSERTD (err_s_ab >= 0);
+
MPFR_TMP_FREE(marker);
*exp_r = f;
if (error == t)
return -1; /* result is exact */
- else /* error <= t-2 <= GMP_NUMB_BITS-2
+ else /* error <= t-2 <= bitsize(mpfr_exp_t)-2
err_s_ab, err_s_a2 <= t-1 */
{
/* if there are p loops after the first inexact result, with
@@ -162,15 +201,6 @@ mpfr_mpn_exp (mp_limb_t *a, mpfr_exp_t *exp_r, int b, mpfr_exp_t e, size_t n)
at most 2^(p+ceil((j+1)/2)+l+1)*ulp(res).
This is bounded by 2^(5/2*t-1/2) where t is the number of bits of e.
*/
- error = error + err_s_ab + err_s_a2 / 2 + 3; /* <= 5t/2-1/2 */
-#if 0
- if ((error - 1) >= ((n * GMP_NUMB_BITS - 1) / 2))
- error = n * GMP_NUMB_BITS; /* result is completely wrong:
- this is very unlikely since error is
- at most 5/2*log_2(e), and
- n * GMP_NUMB_BITS is at least
- 3*log_2(e) */
-#endif
- return error;
+ return error + err_s_ab + err_s_a2 / 2 + 3; /* <= 5t/2-1/2 */
}
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul.c b/Build/source/libs/mpfr/mpfr-src/src/mul.c
index 55f5a22dc03..d13fda1c1d2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul.c
@@ -1,6 +1,6 @@
/* mpfr_mul -- multiply two floating-point numbers
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -117,6 +117,7 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
/* now tmp[0]..tmp[k-1] contains the product of both mantissa,
with tmp[k-1]>=2^(GMP_NUMB_BITS-2) */
b1 >>= GMP_NUMB_BITS - 1; /* msb from the product */
+ MPFR_ASSERTD (b1 == 0 || b1 == 1);
/* 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
@@ -127,6 +128,7 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
cc = mpfr_round_raw (MPFR_MANT (a), tmp, bq + cq,
MPFR_IS_NEG_SIGN(sign_product),
MPFR_PREC (a), rnd_mode, &inexact);
+ MPFR_ASSERTD (cc == 0 || cc == 1);
/* cc = 1 ==> result is a power of two */
if (MPFR_UNLIKELY(cc))
@@ -135,7 +137,11 @@ mpfr_mul3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
MPFR_TMP_FREE(marker);
{
- mpfr_exp_t ax2 = ax + (mpfr_exp_t) (b1 - 1 + cc);
+ /* We need to cast b1 to a signed integer type in order to use
+ signed integer arithmetic only, as the expression can involve
+ negative integers. Let's recall that both b1 and cc are 0 or 1,
+ and since cc is an int, let's choose int for this part. */
+ mpfr_exp_t ax2 = ax + ((int) b1 - 1 + cc);
if (MPFR_UNLIKELY( ax2 > __gmpfr_emax))
return mpfr_overflow (a, rnd_mode, sign_product);
if (MPFR_UNLIKELY( ax2 < __gmpfr_emin))
@@ -161,24 +167,38 @@ int
mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
{
mpfr_t ta, tb, tc;
+ mpfr_flags_t old_flags, flags1, flags2;
int inexact1, inexact2;
if (rnd_mode == MPFR_RNDF)
return mpfr_mul2 (a, b, c, rnd_mode);
+ old_flags = __gmpfr_flags;
+
mpfr_init2 (ta, MPFR_PREC (a));
mpfr_init2 (tb, MPFR_PREC (b));
mpfr_init2 (tc, MPFR_PREC (c));
MPFR_ASSERTN (mpfr_set (tb, b, MPFR_RNDN) == 0);
MPFR_ASSERTN (mpfr_set (tc, c, MPFR_RNDN) == 0);
+ /* Note: If b or c is NaN, then the NaN flag has been set by mpfr_set above.
+ Thus restore the old flags just below to make sure that mpfr_mul3 is
+ tested under the real conditions. */
+
+ __gmpfr_flags = old_flags;
inexact2 = mpfr_mul3 (ta, tb, tc, rnd_mode);
+ flags2 = __gmpfr_flags;
+
+ __gmpfr_flags = old_flags;
inexact1 = mpfr_mul2 (a, b, c, rnd_mode);
- if (MPFR_IS_NAN (ta) && MPFR_IS_NAN (a))
- {
- /* Getting both NaN is OK. */
- }
- else if (! mpfr_equal_p (ta, a) || ! SAME_SIGN (inexact1, inexact2))
+ flags1 = __gmpfr_flags;
+
+ /* Convert the ternary values to (-1,0,1). */
+ inexact2 = VSIGN (inexact2);
+ inexact1 = VSIGN (inexact1);
+
+ if (! ((MPFR_IS_NAN (ta) && MPFR_IS_NAN (a)) || mpfr_equal_p (ta, a)) ||
+ inexact1 != inexact2 || flags1 != flags2)
{
/* We do not have MPFR_PREC_FSPEC, so let's use mpfr_eexp_t and
MPFR_EXP_FSPEC since mpfr_prec_t values are guaranteed to be
@@ -186,20 +206,25 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
fprintf (stderr, "mpfr_mul return different values for %s\n"
"Prec_a = %" MPFR_EXP_FSPEC "d, "
"Prec_b = %" MPFR_EXP_FSPEC "d, "
- "Prec_c = %" MPFR_EXP_FSPEC "d\nb = ",
+ "Prec_c = %" MPFR_EXP_FSPEC "d\n",
mpfr_print_rnd_mode (rnd_mode),
(mpfr_eexp_t) MPFR_PREC (a),
(mpfr_eexp_t) MPFR_PREC (b),
(mpfr_eexp_t) MPFR_PREC (c));
- mpfr_fdump (stderr, b);
+ /* Note: We output tb and tc instead of b and c, in case a = b or c
+ (this is why tb and tc have been created in the first place). */
+ fprintf (stderr, "b = ");
+ mpfr_fdump (stderr, tb);
fprintf (stderr, "c = ");
- mpfr_fdump (stderr, c);
+ mpfr_fdump (stderr, tc);
fprintf (stderr, "OldMul: ");
mpfr_fdump (stderr, ta);
fprintf (stderr, "NewMul: ");
mpfr_fdump (stderr, a);
- fprintf (stderr, "NewInexact = %d | OldInexact = %d\n",
- inexact1, inexact2);
+ fprintf (stderr, "OldMul: ternary = %2d, flags =", inexact2);
+ flags_fout (stderr, flags2);
+ fprintf (stderr, "NewMul: ternary = %2d, flags =", inexact1);
+ flags_fout (stderr, flags1);
MPFR_ASSERTN(0);
}
@@ -217,6 +242,20 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
#if !defined(MPFR_GENERIC_ABI)
+/* Disabled for now since the mul_1_extracted.c is not formally proven yet.
+ Once it is proven, replace MPFR_WANT_PROVEN_CODExxx by MPFR_WANT_PROVEN_CODE. */
+#if defined(MPFR_WANT_PROVEN_CODExxx) && GMP_NUMB_BITS == 64 && \
+ UINT_MAX == 0xffffffff && MPFR_PREC_BITS == 64 && \
+ _MPFR_PREC_FORMAT == 3 && _MPFR_EXP_FORMAT == _MPFR_PREC_FORMAT
+
+/* The code assumes that mp_limb_t has 64 bits exactly, unsigned int
+ has 32 bits exactly, mpfr_prec_t and mpfr_exp_t are of type long,
+ which has 64 bits exactly. */
+
+#include "mul_1_extracted.c"
+
+#else
+
/* Special code for prec(a) < GMP_NUMB_BITS and
prec(b), prec(c) <= GMP_NUMB_BITS.
Note: this code was copied in sqr.c, function mpfr_sqr_1 (this saves a few cycles
@@ -266,7 +305,7 @@ mpfr_mul_1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
a >= 0.111...111[1]*2^(emin-1), there is no underflow. */
if (MPFR_UNLIKELY(ax < __gmpfr_emin))
{
- if (ax == __gmpfr_emin - 1 && ap[0] == ~mask &&
+ if (ax == __gmpfr_emin - 1 && ap[0] == MPFR_LIMB(~mask) &&
((rnd_mode == MPFR_RNDN && rb) ||
(MPFR_IS_LIKE_RNDA(rnd_mode, MPFR_IS_NEG (a)) && (rb | sb))))
goto rounding; /* no underflow */
@@ -319,6 +358,8 @@ mpfr_mul_1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
}
}
+#endif /* MPFR_WANT_PROVEN_CODE */
+
/* Special code for prec(a) = GMP_NUMB_BITS and
prec(b), prec(c) <= GMP_NUMB_BITS. */
static int
@@ -489,7 +530,7 @@ mpfr_mul_2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
{
if (ax == __gmpfr_emin - 1 &&
ap[1] == MPFR_LIMB_MAX &&
- ap[0] == ~mask &&
+ ap[0] == MPFR_LIMB(~mask) &&
((rnd_mode == MPFR_RNDN && rb) ||
(MPFR_IS_LIKE_RNDA(rnd_mode, MPFR_IS_NEG (a)) && (rb | sb))))
goto rounding; /* no underflow */
@@ -625,7 +666,7 @@ mpfr_mul_3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
if (ax == __gmpfr_emin - 1 &&
ap[2] == MPFR_LIMB_MAX &&
ap[1] == MPFR_LIMB_MAX &&
- ap[0] == ~mask &&
+ ap[0] == MPFR_LIMB(~mask) &&
((rnd_mode == MPFR_RNDN && rb) ||
(MPFR_IS_LIKE_RNDA(rnd_mode, MPFR_IS_NEG (a)) && (rb | sb))))
goto rounding; /* no underflow */
@@ -851,7 +892,7 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (MPFR_UNLIKELY (b1 == 0))
mpn_lshift (tmp, tmp, tn, 1); /* tn <= k, so no stack corruption */
}
- else
+ else /* bn >= cn and bn >= 3 */
/* Mulders' mulhigh. This code can also be used via mpfr_sqr,
hence the tests b != c. */
if (MPFR_UNLIKELY (cn > (threshold = b != c ?
@@ -907,7 +948,9 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
else
/* Call mpfr_mul instead of mpfr_sqr as the precision
- is probably still high enough. */
+ is probably still high enough. It is thus better to call
+ mpfr_mul again, but it should not give an infinite loop
+ if we call mpfr_sqr. */
return mpfr_mul (a, b_tmp, b_tmp, rnd_mode);
}
@@ -944,9 +987,27 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
if (b != c)
{
+#if GMP_NUMB_BITS <= 32
if (cn > n)
- cp --; /* FIXME: Could this happen? */
+ cp --; /* This can only happen on a 32-bit computer,
+ and is very unlikely to happen.
+ Indeed, since n = MIN (an + 1, cn), with
+ an = MPFR_LIMB_SIZE(a), we can have cn > n
+ only when n = an + 1 < cn.
+ We are in the case aq > p - 5, with
+ aq = PREC(a) = an*W - sh, with W = GMP_NUMB_BITS
+ and 0 <= sh < W, and p = n*W - ceil(log2(n+2)),
+ thus an*W - sh > n*W - ceil(log2(n+2)) - 5.
+ Thus n < an + (ceil(log2(n+2)) + 5 - sh)/W.
+ To get n = an + 1, we need
+ ceil(log2(n+2)) + 5 - sh > W, thus since sh>=0
+ we need ceil(log2(n+2)) + 5 > W.
+ With W=32 this can only happen for n>=2^27-1,
+ thus for a precision of 2^32-64 for a,
+ and with W=64 for n>=2^59-1, which would give
+ a precision >= 2^64. */
else
+#endif
{
cp = MPFR_TMP_LIMBS_ALLOC (n + 1);
cp[0] = 0;
@@ -1020,7 +1081,8 @@ mpfr_mul (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mpn_lshift (tmp, tmp, tn, 1); /* tn <= k, so no stack corruption */
}
- ax2 = ax + (mpfr_exp_t) (b1 - 1);
+ /* b1 is 0 or 1 (most significant bit from the raw product) */
+ ax2 = ax + ((int) b1 - 1);
MPFR_RNDRAW (inexact, a, tmp, bq + cq, rnd_mode, sign, ax2++);
MPFR_TMP_FREE (marker);
MPFR_EXP (a) = ax2; /* Can't use MPFR_SET_EXP: Expo may be out of range */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_1_extracted.c b/Build/source/libs/mpfr/mpfr-src/src/mul_1_extracted.c
new file mode 100644
index 00000000000..06c51032756
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_1_extracted.c
@@ -0,0 +1,325 @@
+/* mpfr_mul_1 -- internal function to perform a one-limb multiplication
+ This code was extracted by Kremlin from a formal proof in F*
+ done by Jianyang Pan in April-August 2018: do not modify it!
+
+Source: https://github.com/project-everest/hacl-star/tree/dev_mpfr/code/mpfr
+
+Copyright 2004-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define int64_t long
+#define uint32_t unsigned int
+#define uint64_t mp_limb_t
+#define bool int
+
+typedef struct K___int64_t_uint64_t_uint64_t_s
+{
+ int64_t fst;
+ uint64_t snd;
+ uint64_t thd;
+}
+K___int64_t_uint64_t_uint64_t;
+
+#define MPFR_Lib_mpfr_struct __mpfr_struct
+#define MPFR_Lib_mpfr_RET(I) (I) != 0 ? ((__gmpfr_flags |= MPFR_FLAGS_INEXACT), (I)) : 0
+#define MPFR_Exceptions_mpfr_overflow mpfr_overflow
+#define MPFR_Exceptions_mpfr_underflow mpfr_underflow
+#define mpfr_prec _mpfr_prec
+#define mpfr_exp _mpfr_exp
+#define mpfr_d _mpfr_d
+#define mpfr_sign _mpfr_sign
+#define MPFR_Lib_gmp_NUMB_BITS GMP_NUMB_BITS
+#define MPFR_Lib_mpfr_EMAX __gmpfr_emax
+#define MPFR_Lib_mpfr_EMIN __gmpfr_emin
+#define MPFR_RoundingMode_MPFR_RNDZ MPFR_RNDZ
+
+#define MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode) (rnd_mode == MPFR_RNDN)
+#define MPFR_RoundingMode_mpfr_IS_LIKE_RNDZ MPFR_IS_LIKE_RNDZ
+#define MPFR_RoundingMode_mpfr_IS_LIKE_RNDA MPFR_IS_LIKE_RNDA
+
+/* Special code for prec(a) < GMP_NUMB_BITS and
+ prec(b), prec(c) <= GMP_NUMB_BITS.
+ Note: this code was copied in sqr.c, function mpfr_sqr_1 (this saves a few cycles
+ with respect to have this function exported). As a consequence, any change here
+ should be reported in mpfr_sqr_1. */
+static int
+mpfr_mul_1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
+ mpfr_prec_t p)
+{
+ uint64_t *ap = a->mpfr_d;
+ uint64_t *bp = b->mpfr_d;
+ uint64_t *cp = c->mpfr_d;
+ uint64_t b0 = bp[0U];
+ uint64_t c0 = cp[0U];
+ int64_t sh = MPFR_Lib_gmp_NUMB_BITS - p;
+ uint64_t mask = ((uint64_t)1U << (uint32_t)sh) - (uint64_t)1U;
+ int64_t ax = b->mpfr_exp + c->mpfr_exp;
+ //K___uint64_t_uint64_t scrut0 = MPFR_Umul_ppmm_umul_ppmm(b0, c0);
+ //uint64_t a0 = scrut0.fst;
+ //uint64_t sb = scrut0.snd;
+ uint64_t a0, sb;
+ umul_ppmm (a0, sb, b0, c0);
+ K___int64_t_uint64_t_uint64_t scrut;
+ if (a0 < (uint64_t)0x8000000000000000U)
+ scrut =
+ (
+ (K___int64_t_uint64_t_uint64_t){
+ .fst = ax - (int64_t)1,
+ .snd = a0 << (uint32_t)1U | sb >> (uint32_t)(MPFR_Lib_gmp_NUMB_BITS - (int64_t)1),
+ .thd = sb << (uint32_t)1U
+ }
+ );
+ else
+ scrut = ((K___int64_t_uint64_t_uint64_t){ .fst = ax, .snd = a0, .thd = sb });
+ int64_t ax1 = scrut.fst;
+ uint64_t a01 = scrut.snd;
+ uint64_t sb1 = scrut.thd;
+ uint64_t rb = a01 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ uint64_t sb2 = sb1 | ((a01 & mask) ^ rb);
+ ap[0U] = a01 & ~mask;
+ MPFR_Lib_mpfr_struct uu___73_2756 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___73_2756.mpfr_prec,
+ .mpfr_sign = b->mpfr_sign * c->mpfr_sign,
+ .mpfr_exp = uu___73_2756.mpfr_exp,
+ .mpfr_d = uu___73_2756.mpfr_d
+ }
+ );
+ uint64_t *ap1 = a->mpfr_d;
+ uint64_t a02 = ap1[0U];
+ if (ax1 > MPFR_Lib_mpfr_EMAX)
+ return MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ else if (ax1 < MPFR_Lib_mpfr_EMIN)
+ {
+ bool aneg = a->mpfr_sign < (int32_t)0;
+ if
+ (
+ ax1
+ == MPFR_Lib_mpfr_EMIN - (int64_t)1
+ && a02 == ~mask
+ &&
+ ((MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode) && rb > (uint64_t)0U)
+ || ((rb | sb2) > (uint64_t)0U && MPFR_RoundingMode_mpfr_IS_LIKE_RNDA(rnd_mode, aneg)))
+ )
+ {
+ uint64_t *ap2 = a->mpfr_d;
+ uint64_t a03 = ap2[0U];
+ MPFR_Lib_mpfr_struct uu___72_2907 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_2907.mpfr_prec,
+ .mpfr_sign = uu___72_2907.mpfr_sign,
+ .mpfr_exp = ax1,
+ .mpfr_d = uu___72_2907.mpfr_d
+ }
+ );
+ if (rb == (uint64_t)0U && sb2 == (uint64_t)0U)
+ return MPFR_Lib_mpfr_RET((int32_t)0);
+ else if (MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode))
+ if
+ (
+ rb
+ == (uint64_t)0U
+ || (sb2 == (uint64_t)0U && (a03 & (uint64_t)1U << (uint32_t)sh) == (uint64_t)0U)
+ )
+ {
+ int32_t ite;
+ if (a->mpfr_sign == (int32_t)1)
+ ite = (int32_t)-1;
+ else
+ ite = (int32_t)1;
+ return MPFR_Lib_mpfr_RET(ite);
+ }
+ else
+ {
+ uint64_t *ap3 = a->mpfr_d;
+ ap3[0U] = ap3[0U] + ((uint64_t)1U << (uint32_t)sh);
+ if (ap3[0U] == (uint64_t)0U)
+ {
+ ap3[0U] = (uint64_t)0x8000000000000000U;
+ if (ax1 + (int64_t)1 > MPFR_Lib_mpfr_EMAX)
+ return MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ else
+ {
+ MPFR_Lib_mpfr_struct uu___72_3047 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3047.mpfr_prec,
+ .mpfr_sign = uu___72_3047.mpfr_sign,
+ .mpfr_exp = ax1 + (int64_t)1,
+ .mpfr_d = uu___72_3047.mpfr_d
+ }
+ );
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ else
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else if (MPFR_RoundingMode_mpfr_IS_LIKE_RNDZ(rnd_mode, a->mpfr_sign < (int32_t)0))
+ {
+ int32_t ite;
+ if (a->mpfr_sign == (int32_t)1)
+ ite = (int32_t)-1;
+ else
+ ite = (int32_t)1;
+ return MPFR_Lib_mpfr_RET(ite);
+ }
+ else
+ {
+ uint64_t *ap3 = a->mpfr_d;
+ ap3[0U] = ap3[0U] + ((uint64_t)1U << (uint32_t)sh);
+ if (ap3[0U] == (uint64_t)0U)
+ {
+ ap3[0U] = (uint64_t)0x8000000000000000U;
+ if (ax1 + (int64_t)1 > MPFR_Lib_mpfr_EMAX)
+ return MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ else
+ {
+ MPFR_Lib_mpfr_struct uu___72_3237 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3237.mpfr_prec,
+ .mpfr_sign = uu___72_3237.mpfr_sign,
+ .mpfr_exp = ax1 + (int64_t)1,
+ .mpfr_d = uu___72_3237.mpfr_d
+ }
+ );
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ else
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ else if
+ (
+ MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode)
+ &&
+ (ax1
+ < MPFR_Lib_mpfr_EMIN - (int64_t)1
+ || (a02 == (uint64_t)0x8000000000000000U && (rb | sb2) == (uint64_t)0U))
+ )
+ return MPFR_Exceptions_mpfr_underflow(a, MPFR_RoundingMode_MPFR_RNDZ, a->mpfr_sign);
+ else
+ return MPFR_Exceptions_mpfr_underflow(a, rnd_mode, a->mpfr_sign);
+ }
+ else
+ {
+ uint64_t *ap2 = a->mpfr_d;
+ uint64_t a03 = ap2[0U];
+ MPFR_Lib_mpfr_struct uu___72_3422 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3422.mpfr_prec,
+ .mpfr_sign = uu___72_3422.mpfr_sign,
+ .mpfr_exp = ax1,
+ .mpfr_d = uu___72_3422.mpfr_d
+ }
+ );
+ if (rb == (uint64_t)0U && sb2 == (uint64_t)0U)
+ return MPFR_Lib_mpfr_RET((int32_t)0);
+ else if (MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode))
+ if
+ (
+ rb
+ == (uint64_t)0U
+ || (sb2 == (uint64_t)0U && (a03 & (uint64_t)1U << (uint32_t)sh) == (uint64_t)0U)
+ )
+ {
+ int32_t ite;
+ if (a->mpfr_sign == (int32_t)1)
+ ite = (int32_t)-1;
+ else
+ ite = (int32_t)1;
+ return MPFR_Lib_mpfr_RET(ite);
+ }
+ else
+ {
+ uint64_t *ap3 = a->mpfr_d;
+ ap3[0U] = ap3[0U] + ((uint64_t)1U << (uint32_t)sh);
+ if (ap3[0U] == (uint64_t)0U)
+ {
+ ap3[0U] = (uint64_t)0x8000000000000000U;
+ if (ax1 + (int64_t)1 > MPFR_Lib_mpfr_EMAX)
+ return MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ else
+ {
+ MPFR_Lib_mpfr_struct uu___72_3562 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3562.mpfr_prec,
+ .mpfr_sign = uu___72_3562.mpfr_sign,
+ .mpfr_exp = ax1 + (int64_t)1,
+ .mpfr_d = uu___72_3562.mpfr_d
+ }
+ );
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ else
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else if (MPFR_RoundingMode_mpfr_IS_LIKE_RNDZ(rnd_mode, a->mpfr_sign < (int32_t)0))
+ {
+ int32_t ite;
+ if (a->mpfr_sign == (int32_t)1)
+ ite = (int32_t)-1;
+ else
+ ite = (int32_t)1;
+ return MPFR_Lib_mpfr_RET(ite);
+ }
+ else
+ {
+ uint64_t *ap3 = a->mpfr_d;
+ ap3[0U] = ap3[0U] + ((uint64_t)1U << (uint32_t)sh);
+ if (ap3[0U] == (uint64_t)0U)
+ {
+ ap3[0U] = (uint64_t)0x8000000000000000U;
+ if (ax1 + (int64_t)1 > MPFR_Lib_mpfr_EMAX)
+ return MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ else
+ {
+ MPFR_Lib_mpfr_struct uu___72_3752 = a[0U];
+ a[0U] =
+ (
+ (MPFR_Lib_mpfr_struct){
+ .mpfr_prec = uu___72_3752.mpfr_prec,
+ .mpfr_sign = uu___72_3752.mpfr_sign,
+ .mpfr_exp = ax1 + (int64_t)1,
+ .mpfr_d = uu___72_3752.mpfr_d
+ }
+ );
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ else
+ return MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+}
+
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_2exp.c b/Build/source/libs/mpfr/mpfr-src/src/mul_2exp.c
index 720de1157d4..9ae1be8695b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul_2exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_2exp.c
@@ -1,6 +1,6 @@
/* mpfr_mul_2exp -- multiply a floating-point number by a power of two
-Copyright 1999, 2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c b/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
index 3e5d16941f9..bbf5fea48fc 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_2si.c
@@ -1,6 +1,6 @@
/* mpfr_mul_2si -- multiply a floating-point number by a power of two
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_2ui.c b/Build/source/libs/mpfr/mpfr-src/src/mul_2ui.c
index ed1191d53c2..11bf3a1d34b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul_2ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_2ui.c
@@ -1,6 +1,6 @@
/* mpfr_mul_2ui -- multiply a floating-point number by a power of two
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -35,31 +35,17 @@ mpfr_mul_2ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd_mod
inexact = (y != x) ? mpfr_set (y, x, rnd_mode) : 0;
- if (MPFR_LIKELY( MPFR_IS_PURE_FP(y)) )
+ if (MPFR_LIKELY (MPFR_IS_PURE_FP (y)))
{
- /* n will have to be casted to long to make sure that the addition
- and subtraction below (for overflow detection) are signed */
- while (MPFR_UNLIKELY(n > LONG_MAX))
- {
- int inex2;
-
- n -= LONG_MAX;
- inex2 = mpfr_mul_2ui(y, y, LONG_MAX, rnd_mode);
- if (inex2)
- return inex2; /* overflow */
- }
-
- /* MPFR_EMIN_MIN + (long) n is signed and doesn't lead to an overflow;
- the first test useful so that the real test can't lead to an
- overflow. */
- {
- mpfr_exp_t exp = MPFR_GET_EXP (y);
- if (MPFR_UNLIKELY( __gmpfr_emax < MPFR_EMIN_MIN + (long) n ||
- exp > __gmpfr_emax - (long) n))
- return mpfr_overflow (y, rnd_mode, MPFR_SIGN(y));
-
- MPFR_SET_EXP (y, exp + (long) n);
- }
+ mpfr_exp_t exp = MPFR_GET_EXP (y);
+ mpfr_exp_t diffexp;
+
+ diffexp = __gmpfr_emax - exp; /* diff of two valid exponents */
+ if (MPFR_UNLIKELY (n > diffexp)) /* exp + n > emax */
+ return mpfr_overflow (y, rnd_mode, MPFR_SIGN (y));
+ /* Now, 0 <= n <= diffexp, thus n fits in a mpfr_exp_t,
+ and exp + n <= emax (no integer overflow). */
+ MPFR_SET_EXP (y, exp + (mpfr_exp_t) n);
}
return inexact;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_d.c b/Build/source/libs/mpfr/mpfr-src/src/mul_d.c
index 6f47a554088..20fa43a10ff 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_d.c
@@ -1,7 +1,7 @@
/* mpfr_mul_d -- multiply a multiple precision floating-point number
by a machine double precision float
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mul_ui.c b/Build/source/libs/mpfr/mpfr-src/src/mul_ui.c
index c745e029983..408133a4c91 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mul_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mul_ui.c
@@ -1,6 +1,6 @@
/* mpfr_mul_ui -- multiply a floating-point number by a machine integer
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -27,10 +27,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
MPFR_HOT_FUNCTION_ATTR int
mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode)
{
- mp_limb_t *yp;
- mp_size_t xn;
- int cnt, inexact;
- MPFR_TMP_DECL (marker);
+ int inexact;
if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (x)))
{
@@ -75,45 +72,68 @@ mpfr_mul_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode
else if (MPFR_UNLIKELY (IS_POW2 (u)))
return mpfr_mul_2si (y, x, MPFR_INT_CEIL_LOG2 (u), rnd_mode);
- yp = MPFR_MANT (y);
- xn = MPFR_LIMB_SIZE (x);
-
- MPFR_ASSERTD (xn < MP_SIZE_T_MAX);
- MPFR_TMP_MARK(marker);
- yp = MPFR_TMP_LIMBS_ALLOC (xn + 1);
-
- MPFR_ASSERTN (u == (mp_limb_t) u);
- yp[xn] = mpn_mul_1 (yp, MPFR_MANT (x), xn, u);
-
- /* x * u is stored in yp[xn], ..., yp[0] */
-
- /* since the case u=1 was treated above, we have u >= 2, thus
- yp[xn] >= 1 since x was msb-normalized */
- MPFR_ASSERTD (yp[xn] != 0);
- if (MPFR_LIKELY (MPFR_LIMB_MSB (yp[xn]) == 0))
- {
- count_leading_zeros (cnt, yp[xn]);
- mpn_lshift (yp, yp, xn + 1, cnt);
- }
- else
- {
- cnt = 0;
- }
-
- /* now yp[xn], ..., yp[0] is msb-normalized too, and has at most
- PREC(x) + (GMP_NUMB_BITS - cnt) non-zero bits */
- MPFR_RNDRAW (inexact, y, yp, (mpfr_prec_t) (xn + 1) * GMP_NUMB_BITS,
- rnd_mode, MPFR_SIGN (x), cnt -- );
-
- MPFR_TMP_FREE (marker);
-
- cnt = GMP_NUMB_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));
-
- MPFR_SET_EXP (y, MPFR_GET_EXP (x) + cnt);
- MPFR_SET_SAME_SIGN (y, x);
-
- MPFR_RET (inexact);
+#ifdef MPFR_LONG_WITHIN_LIMB
+ {
+ mp_limb_t *yp;
+ mp_size_t xn;
+ int cnt;
+ MPFR_TMP_DECL (marker);
+
+ yp = MPFR_MANT (y);
+ xn = MPFR_LIMB_SIZE (x);
+
+ MPFR_ASSERTD (xn < MP_SIZE_T_MAX);
+ MPFR_TMP_MARK(marker);
+ yp = MPFR_TMP_LIMBS_ALLOC (xn + 1);
+
+ MPFR_ASSERTN (u == (mp_limb_t) u);
+ yp[xn] = mpn_mul_1 (yp, MPFR_MANT (x), xn, u);
+
+ /* x * u is stored in yp[xn], ..., yp[0] */
+
+ /* since the case u=1 was treated above, we have u >= 2, thus
+ yp[xn] >= 1 since x was msb-normalized */
+ MPFR_ASSERTD (yp[xn] != 0);
+ if (MPFR_LIKELY (MPFR_LIMB_MSB (yp[xn]) == 0))
+ {
+ count_leading_zeros (cnt, yp[xn]);
+ mpn_lshift (yp, yp, xn + 1, cnt);
+ }
+ else
+ {
+ cnt = 0;
+ }
+
+ /* now yp[xn], ..., yp[0] is msb-normalized too, and has at most
+ PREC(x) + (GMP_NUMB_BITS - cnt) non-zero bits */
+ MPFR_RNDRAW (inexact, y, yp, (mpfr_prec_t) (xn + 1) * GMP_NUMB_BITS,
+ rnd_mode, MPFR_SIGN (x), cnt -- );
+
+ MPFR_TMP_FREE (marker);
+
+ cnt = GMP_NUMB_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));
+
+ MPFR_SET_EXP (y, MPFR_GET_EXP (x) + cnt);
+ MPFR_SET_SAME_SIGN (y, x);
+ MPFR_RET (inexact);
+ }
+#else
+ {
+ mpfr_t uu;
+ MPFR_SAVE_EXPO_DECL (expo);
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ /* Warning: u might be outside the current exponent range! */
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
+ inexact = mpfr_mul (y, x, uu, rnd_mode);
+ mpfr_clear (uu);
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
+ MPFR_SAVE_EXPO_FREE (expo);
+ return mpfr_check_range (y, inexact, rnd_mode);
+ }
+#endif /* MPFR_LONG_WITHIN_LIMB */
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/mulders.c b/Build/source/libs/mpfr/mpfr-src/src/mulders.c
index 9f6d9ea6284..a08e0a61416 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/mulders.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/mulders.c
@@ -1,6 +1,6 @@
/* Mulders' short product, square and division.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -26,16 +26,9 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
July 25-27, 2011, pages 7-14.
*/
-/* Defines it to 1 to use short div (or 0 for FoldDiv(K)) */
-#define USE_SHORT_DIV 1
-
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-#ifndef MUL_FFT_THRESHOLD
-#define MUL_FFT_THRESHOLD 8448
-#endif
-
/* Don't use MPFR_MULHIGH_SIZE since it is handled by tuneup */
#ifdef MPFR_MULHIGH_TAB_SIZE
static short mulhigh_ktab[MPFR_MULHIGH_TAB_SIZE];
@@ -103,50 +96,6 @@ mpfr_mulhigh_n (mpfr_limb_ptr rp, mpfr_limb_srcptr np, mpfr_limb_srcptr mp,
}
}
-#if USE_SHORT_DIV == 0
-/* Put in rp[0..n] the n+1 low limbs of {up, n} * {vp, n}.
- Assume 2n limbs are allocated at rp. */
-static void
-mpfr_mullow_n_basecase (mpfr_limb_ptr rp, mpfr_limb_srcptr up,
- mpfr_limb_srcptr vp, mp_size_t n)
-{
- mp_size_t i;
-
- rp[n] = mpn_mul_1 (rp, up, n, vp[0]);
- for (i = 1 ; i < n ; i++)
- mpn_addmul_1 (rp + i, up, n - i + 1, vp[i]);
-}
-
-/* Put in rp[0..n] the n+1 low limbs of {np, n} * {mp, n}.
- Assume 2n limbs are allocated at rp. */
-void
-mpfr_mullow_n (mpfr_limb_ptr rp, mpfr_limb_srcptr np, mpfr_limb_srcptr mp,
- mp_size_t n)
-{
- mp_size_t k;
-
- MPFR_STAT_STATIC_ASSERT (MPFR_MULHIGH_TAB_SIZE >= 8); /* so that 3*(n/4) > n/2 */
- k = MPFR_LIKELY (n < MPFR_MULHIGH_TAB_SIZE) ? mulhigh_ktab[n] : 3*(n/4);
- MPFR_ASSERTD (k == -1 || k == 0 || (2 * k >= n && k < n));
- if (k < 0)
- mpn_mul_basecase (rp, np, n, mp, n);
- else if (k == 0)
- mpfr_mullow_n_basecase (rp, np, mp, n);
- else if (n > MUL_FFT_THRESHOLD)
- mpn_mul_n (rp, np, mp, n);
- else
- {
- mp_size_t l = n - k;
-
- mpn_mul_n (rp, np, mp, k); /* fills rp[0..2k] */
- mpfr_mullow_n (rp + n, np + k, mp, l); /* fills rp[n..n+2l] */
- mpn_add_n (rp + k, rp + k, rp + n, l + 1);
- mpfr_mullow_n (rp + n, np, mp + k, l); /* fills rp[n..n+2l] */
- mpn_add_n (rp + k, rp + k, rp + n, l + 1);
- }
-}
-#endif
-
#ifdef MPFR_SQRHIGH_TAB_SIZE
static short sqrhigh_ktab[MPFR_SQRHIGH_TAB_SIZE];
#else
@@ -186,8 +135,6 @@ mpfr_sqrhigh_n (mpfr_limb_ptr rp, mpfr_limb_srcptr np, mp_size_t n)
}
}
-#if USE_SHORT_DIV == 1
-
#ifdef MPFR_DIVHIGH_TAB_SIZE
static short divhigh_ktab[MPFR_DIVHIGH_TAB_SIZE];
#else
@@ -195,20 +142,23 @@ static short divhigh_ktab[] = {MPFR_DIVHIGH_TAB};
#define MPFR_DIVHIGH_TAB_SIZE (numberof_const (divhigh_ktab))
#endif
-#if !(defined(WANT_GMP_INTERNALS) && defined(HAVE___GMPN_SBPI1_DIVAPPR_Q))
/* Put in Q={qp, n} an approximation of N={np, 2*n} divided by D={dp, n},
with the most significant limb of the quotient as return value (0 or 1).
Assumes the most significant bit of D is set. Clobbers N.
The approximate quotient Q satisfies - 2(n-1) < N/D - Q <= 4.
+
+ Assumes n >= 2.
*/
static mp_limb_t
mpfr_divhigh_n_basecase (mpfr_limb_ptr qp, mpfr_limb_ptr np,
mpfr_limb_srcptr dp, mp_size_t n)
{
- mp_limb_t qh, d1, d0, dinv, q2, q1, q0;
+ mp_limb_t qh, d1, d0, q2, q1, q0;
mpfr_pi1_t dinv2;
+ MPFR_ASSERTD(n >= 2);
+
np += n;
if ((qh = (mpn_cmp (np, dp, n) >= 0)))
@@ -218,15 +168,7 @@ mpfr_divhigh_n_basecase (mpfr_limb_ptr qp, mpfr_limb_ptr np,
d1 = dp[n - 1];
- if (n == 1)
- {
- invert_limb (dinv, d1);
- umul_ppmm (q1, q0, np[0], dinv);
- qp[0] = np[0] + q1;
- return qh;
- }
-
- /* now n >= 2 */
+ /* we assumed n >= 2 */
d0 = dp[n - 2];
invert_pi1 (dinv2, d1, d0);
/* dinv2.inv32 = floor ((B^3 - 1) / (d0 + d1 B)) - B */
@@ -284,13 +226,14 @@ mpfr_divhigh_n_basecase (mpfr_limb_ptr qp, mpfr_limb_ptr np,
return qh;
}
-#endif
/* Put in {qp, n} an approximation of N={np, 2*n} divided by D={dp, n},
with the most significant limb of the quotient as return value (0 or 1).
Assumes the most significant bit of D is set. Clobbers N.
This implements the ShortDiv algorithm from reference [1].
+
+ Assumes n >= 2 (which should be fulfilled also in the recursive calls).
*/
mp_limb_t
mpfr_divhigh_n (mpfr_limb_ptr qp, mpfr_limb_ptr np, mpfr_limb_ptr dp,
@@ -302,24 +245,27 @@ mpfr_divhigh_n (mpfr_limb_ptr qp, mpfr_limb_ptr np, mpfr_limb_ptr dp,
MPFR_TMP_DECL(marker);
MPFR_STAT_STATIC_ASSERT (MPFR_DIVHIGH_TAB_SIZE >= 15); /* so that 2*(n/3) >= (n+4)/2 */
+ MPFR_ASSERTD(n >= 2);
k = MPFR_LIKELY (n < MPFR_DIVHIGH_TAB_SIZE) ? divhigh_ktab[n] : 2*(n/3);
if (k == 0)
+ {
#if defined(WANT_GMP_INTERNALS) && defined(HAVE___GMPN_SBPI1_DIVAPPR_Q)
- {
- mpfr_pi1_t dinv2;
- invert_pi1 (dinv2, dp[n - 1], dp[n - 2]);
- return __gmpn_sbpi1_divappr_q (qp, np, n + n, dp, n, dinv2.inv32);
- }
+ mpfr_pi1_t dinv2;
+ invert_pi1 (dinv2, dp[n - 1], dp[n - 2]);
+ if (n > 2) /* sbpi1_divappr_q wants n > 2 */
+ return __gmpn_sbpi1_divappr_q (qp, np, n + n, dp, n, dinv2.inv32);
+ else
+ return mpfr_divhigh_n_basecase (qp, np, dp, n);
#else /* use our own code for base-case short division */
- return mpfr_divhigh_n_basecase (qp, np, dp, n);
+ return mpfr_divhigh_n_basecase (qp, np, dp, n);
#endif
- else if (k == n)
- /* for k=n, we use a division with remainder (mpn_divrem),
- which computes the exact quotient */
- return mpn_divrem (qp, 0, np, 2 * n, dp, n);
+ }
+
+ /* Check the bounds from [1]. In addition, we forbid k=n-1, which would
+ give l=1 in the recursive call. It follows n >= 5. */
+ MPFR_ASSERTD ((n+4)/2 <= k && k < n-1);
- MPFR_ASSERTD ((n+4)/2 <= k && k < n); /* bounds from [1] */
MPFR_TMP_MARK (marker);
l = n - k;
/* first divide the most significant 2k limbs from N by the most significant
@@ -349,151 +295,3 @@ mpfr_divhigh_n (mpfr_limb_ptr qp, mpfr_limb_ptr np, mpfr_limb_ptr dp,
return qh;
}
-
-#else /* below is the FoldDiv(K) algorithm from [1] */
-
-mp_limb_t
-mpfr_divhigh_n (mpfr_limb_ptr qp, mpfr_limb_ptr np, mpfr_limb_ptr dp,
- mp_size_t n)
-{
- mp_size_t k, r;
- mpfr_limb_ptr ip, tp, up;
- mp_limb_t qh = 0, cy, cc;
- int count;
- MPFR_TMP_DECL(marker);
-
-#define K 3
- if (n < K)
- return mpn_divrem (qp, 0, np, 2 * n, dp, n);
-
- k = (n - 1) / K + 1; /* ceil(n/K) */
-
- MPFR_TMP_MARK (marker);
- ip = MPFR_TMP_LIMBS_ALLOC (k + 1);
- tp = MPFR_TMP_LIMBS_ALLOC (n + k);
- up = MPFR_TMP_LIMBS_ALLOC (2 * (k + 1));
- mpn_invert (ip, dp + n - (k + 1), k + 1, NULL); /* takes about 13% for n=1000 */
- /* {ip, k+1} = floor((B^(2k+2)-1)/D - B^(k+1) where D = {dp+n-(k+1),k+1} */
- for (r = n, cc = 0UL; r > 0;)
- {
- /* cc is the carry at np[n+r] */
- MPFR_ASSERTD(cc <= 1);
- /* FIXME: why can we have cc as large as say 8? */
- count = 0;
- while (cc > 0)
- {
- count ++;
- MPFR_ASSERTD(count <= 1);
- /* subtract {dp+n-r,r} from {np+n,r} */
- cc -= mpn_sub_n (np + n, np + n, dp + n - r, r);
- /* add 1 at qp[r] */
- qh += mpn_add_1 (qp + r, qp + r, n - r, 1UL);
- }
- /* it remains r limbs to reduce, i.e., the remainder is {np, n+r} */
- if (r < k)
- {
- ip += k - r;
- k = r;
- }
- /* now r >= k */
- /* qp + r - 2 * k -> up */
- mpfr_mulhigh_n (up, np + n + r - (k + 1), ip, k + 1);
- /* take into account the term B^k in the inverse: B^k * {np+n+r-k, k} */
- cy = mpn_add_n (qp + r - k, up + k + 2, np + n + r - k, k);
- /* since we need only r limbs of tp (below), it suffices to consider
- r high limbs of dp */
- if (r > k)
- {
-#if 0
- mpn_mul (tp, dp + n - r, r, qp + r - k, k);
-#else /* use a short product for the low k x k limbs */
- /* we know the upper k limbs of the r-limb product cancel with the
- remainder, thus we only need to compute the low r-k limbs */
- if (r - k >= k)
- mpn_mul (tp + k, dp + n - r + k, r - k, qp + r - k, k);
- else /* r-k < k */
- {
-/* #define LOW */
-#ifndef LOW
- mpn_mul (tp + k, qp + r - k, k, dp + n - r + k, r - k);
-#else
- mpfr_mullow_n_basecase (tp + k, qp + r - k, dp + n - r + k, r - k);
- /* take into account qp[2r-2k] * dp[n - r + k] */
- tp[r] += qp[2*r-2*k] * dp[n - r + k];
-#endif
- /* tp[k..r] is filled */
- }
-#if 0
- mpfr_mulhigh_n (up, dp + n - r, qp + r - k, k);
-#else /* compute one more limb. FIXME: we could add one limb of dp in the
- above, to save one mpn_addmul_1 call */
- mpfr_mulhigh_n (up, dp + n - r, qp + r - k, k - 1); /* {up,2k-2} */
- /* add {qp + r - k, k - 1} * dp[n-r+k-1] */
- up[2*k-2] = mpn_addmul_1 (up + k - 1, qp + r - k, k-1, dp[n-r+k-1]);
- /* add {dp+n-r, k} * qp[r-1] */
- up[2*k-1] = mpn_addmul_1 (up + k - 1, dp + n - r, k, qp[r-1]);
-#endif
-#ifndef LOW
- cc = mpn_add_n (tp + k, tp + k, up + k, k);
- mpn_add_1 (tp + 2 * k, tp + 2 * k, r - k, cc);
-#else
- /* update tp[k..r] */
- if (r - k + 1 <= k)
- mpn_add_n (tp + k, tp + k, up + k, r - k + 1);
- else /* r - k >= k */
- {
- cc = mpn_add_n (tp + k, tp + k, up + k, k);
- mpn_add_1 (tp + 2 * k, tp + 2 * k, r - 2 * k + 1, cc);
- }
-#endif
-#endif
- }
- else /* last step: since we only want the quotient, no need to update,
- just propagate the carry cy */
- {
- MPFR_ASSERTD(r < n);
- if (cy > 0)
- qh += mpn_add_1 (qp + r, qp + r, n - r, cy);
- break;
- }
- /* subtract {tp, n+k} from {np+r-k, n+k}; however we only want to
- update {np+n, n} */
- /* we should have tp[r] = np[n+r-k] up to 1 */
- MPFR_ASSERTD(tp[r] == np[n + r - k] || tp[r] + 1 == np[n + r - k]);
-#ifndef LOW
- cc = mpn_sub_n (np + n - 1, np + n - 1, tp + k - 1, r + 1); /* borrow at np[n+r] */
-#else
- cc = mpn_sub_n (np + n - 1, np + n - 1, tp + k - 1, r - k + 2);
-#endif
- /* if cy = 1, subtract {dp, n} from {np+r, n}, thus
- {dp+n-r,r} from {np+n,r} */
- if (cy)
- {
- if (r < n)
- cc += mpn_sub_n (np + n - 1, np + n - 1, dp + n - r - 1, r + 1);
- else
- cc += mpn_sub_n (np + n, np + n, dp + n - r, r);
- /* propagate cy */
- if (r == n)
- qh = cy;
- else
- qh += mpn_add_1 (qp + r, qp + r, n - r, cy);
- }
- /* cc is the borrow at np[n+r] */
- count = 0;
- while (cc > 0) /* quotient was too large */
- {
- count++;
- MPFR_ASSERTD (count <= 1);
- cy = mpn_add_n (np + n, np + n, dp + n - (r - k), r - k);
- cc -= mpn_add_1 (np + n + r - k, np + n + r - k, k, cy);
- qh -= mpn_sub_1 (qp + r - k, qp + r - k, n - (r - k), 1UL);
- }
- r -= k;
- cc = np[n + r];
- }
- MPFR_TMP_FREE(marker);
-
- return qh;
-}
-#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/nbits_ulong.c b/Build/source/libs/mpfr/mpfr-src/src/nbits_ulong.c
new file mode 100644
index 00000000000..88d978c8c6e
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/nbits_ulong.c
@@ -0,0 +1,83 @@
+/* mpfr_nbits_ulong -- number of significant bits in an unsigned long
+
+Copyright 2018-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define MPFR_NEED_LONGLONG_H /* for count_leading_zeros */
+#include "mpfr-impl.h"
+
+/* count the number of significant bits of n, i.e.,
+ nbits(unsigned long) - count_leading_zeros (n) */
+int
+mpfr_nbits_ulong (unsigned long n)
+{
+ int cnt;
+
+ MPFR_ASSERTD (n > 0);
+
+#ifdef MPFR_LONG_WITHIN_LIMB
+
+ count_leading_zeros (cnt, (mp_limb_t) n);
+ cnt = GMP_NUMB_BITS - cnt;
+
+#else
+
+ cnt = 0;
+
+ while (n >= 0x10000)
+ {
+ n >>= 16;
+ cnt += 16;
+ }
+
+ MPFR_ASSERTD (n <= 0xffff);
+
+ if (n >= 0x100)
+ {
+ n >>= 8;
+ cnt += 8;
+ }
+
+ MPFR_ASSERTD (n <= 0xff);
+
+ if (n >= 0x10)
+ {
+ n >>= 4;
+ cnt += 4;
+ }
+
+ MPFR_ASSERTD (n <= 0xf);
+
+ if (n >= 4)
+ {
+ n >>= 2;
+ cnt += 2;
+ }
+
+ MPFR_ASSERTD (n <= 3);
+
+ /* now n = 1, 2, or 3 */
+ cnt += 1 + (n >= 2);
+
+#endif
+
+ MPFR_ASSERTD (cnt >= 0);
+ return cnt;
+}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/neg.c b/Build/source/libs/mpfr/mpfr-src/src/neg.c
index 6e57e428cc7..f2d072f9b8f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/neg.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/neg.c
@@ -1,6 +1,6 @@
/* mpfr_neg -- change the sign of a floating-point number
-Copyright 1999-2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2001, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/next.c b/Build/source/libs/mpfr/mpfr-src/src/next.c
index 6b6e325498f..e119d866d2a 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/next.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/next.c
@@ -1,7 +1,7 @@
/* mpfr_nextabove, mpfr_nextbelow, mpfr_nexttoward -- next representable
floating-point number
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/nrandom.c b/Build/source/libs/mpfr/mpfr-src/src/nrandom.c
index ebcc5cb5a96..b081c87adda 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/nrandom.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/nrandom.c
@@ -2,7 +2,7 @@
and variance 1 and round it to the precision of rop according to the given
rounding mode.
-Copyright 2013-2019 Free Software Foundation, Inc.
+Copyright 2013-2020 Free Software Foundation, Inc.
Contributed by Charles Karney <charles@karney.com>, SRI International.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/odd_p.c b/Build/source/libs/mpfr/mpfr-src/src/odd_p.c
index d296bcb592d..c06f3ce697c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/odd_p.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/odd_p.c
@@ -1,6 +1,6 @@
/* mpfr_odd_p -- check for odd integers
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -63,7 +63,7 @@ mpfr_odd_p (mpfr_srcptr y)
yp = MPFR_MANT(y);
/* if expo is a multiple of GMP_NUMB_BITS, t is bit 0 */
if (expo % GMP_NUMB_BITS == 0 ? (yp[yn] & 1) == 0
- : yp[yn] << ((expo % GMP_NUMB_BITS) - 1) != MPFR_LIMB_HIGHBIT)
+ : MPFR_LIMB_LSHIFT(yp[yn], (expo % GMP_NUMB_BITS) - 1) != MPFR_LIMB_HIGHBIT)
return 0;
while (--yn >= 0)
if (yp[yn] != 0)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/out_str.c b/Build/source/libs/mpfr/mpfr-src/src/out_str.c
index 54337b2c5a1..81dd173eb42 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/out_str.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/out_str.c
@@ -1,6 +1,6 @@
/* mpfr_out_str -- output a floating-point number to a stream
-Copyright 1999, 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -39,9 +39,9 @@ mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
char *s, *s0;
size_t l;
mpfr_exp_t e;
- int err;
+ int err, r;
- MPFR_ASSERTN (base >= 2 && base <= 62);
+ MPFR_ASSERTN ((base >= -36 && base <= -2) || (base >= 2 && base <= 62));
if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (op)))
{
@@ -76,19 +76,13 @@ mpfr_out_str (FILE *stream, int base, size_t n_digits, mpfr_srcptr op,
e--; /* due to the leading digit */
/* outputs exponent */
- if (e)
- {
- int r;
-
- MPFR_ASSERTN(e >= LONG_MIN);
- MPFR_ASSERTN(e <= LONG_MAX);
-
- r = fprintf (stream, (base <= 10 ? "e%ld" : "@%ld"), (long) e);
- if (MPFR_UNLIKELY (r < 0))
- return 0;
+ r = fprintf (stream, (base <= 10 ?
+ "e%" MPFR_EXP_FSPEC "d" :
+ "@%" MPFR_EXP_FSPEC "d"), (mpfr_eexp_t) e);
- l += r;
- }
+ /* Check error from fprintf or integer overflow (wrapping) on size_t */
+ if (MPFR_UNLIKELY (r < 0 || l + r < l))
+ return 0;
- return l;
+ return l + r;
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/pool.c b/Build/source/libs/mpfr/mpfr-src/src/pool.c
index 24cd78e63cc..775d7875c96 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/pool.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/pool.c
@@ -1,6 +1,6 @@
/* mpz_t pool
-Copyright 2014-2019 Free Software Foundation, Inc.
+Copyright 2014-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/pow.c b/Build/source/libs/mpfr/mpfr-src/src/pow.c
index 1c4e82118fe..d6ebc910663 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/pow.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/pow.c
@@ -1,6 +1,6 @@
/* mpfr_pow -- power function x^y
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -23,6 +23,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
+#ifndef MPFR_POW_EXP_THRESHOLD
+# define MPFR_POW_EXP_THRESHOLD (MAX (sizeof(mpfr_exp_t) * CHAR_BIT, 256))
+#endif
+
/* return non zero iff x^y is exact.
Assumes x and y are ordinary numbers,
y is not an integer, x is not a power of 2 and x is positive
@@ -34,8 +38,7 @@ mpfr_pow_is_exact (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
mpfr_rnd_t rnd_mode, int *inexact)
{
mpz_t a, c;
- mpfr_exp_t d, b;
- unsigned long i;
+ mpfr_exp_t d, b, i;
int res;
MPFR_ASSERTD (!MPFR_IS_SINGULAR (y));
@@ -48,7 +51,9 @@ mpfr_pow_is_exact (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
if (MPFR_IS_NEG (y))
return 0; /* x is not a power of two => x^-y is not exact */
- /* compute d such that y = c*2^d with c odd integer */
+ /* Compute d such that y = c*2^d with c odd integer.
+ Since c comes from a regular MPFR number, due to the constraints on the
+ exponent and the precision, there can be no integer overflow below. */
mpz_init (c);
d = mpfr_get_z_2exp (c, y);
i = mpz_scan1 (c, 0);
@@ -58,7 +63,9 @@ mpfr_pow_is_exact (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
/* Since y is not an integer, d is necessarily < 0 */
MPFR_ASSERTD (d < 0);
- /* Compute a,b such that x=a*2^b */
+ /* Compute a,b such that x=a*2^b.
+ Since a comes from a regular MPFR number, due to the constrainst on the
+ exponent and the precision, there can be no integer overflow below. */
mpz_init (a);
b = mpfr_get_z_2exp (a, x);
i = mpz_scan1 (a, 0);
@@ -109,7 +116,8 @@ mpfr_pow_is_exact (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
/* Assumes that the exponent range has already been extended and if y is
an integer, then the result is not exact in unbounded exponent range.
- If x < 0, assumes y is an integer.
+ If y_is_integer is non-zero, y is an integer (always when x < 0).
+ expo is the saved exponent range and flags (at the call to mpfr_pow).
*/
int
mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
@@ -126,7 +134,6 @@ mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
mpfr_exp_t err; /* error */
MPFR_ZIV_DECL (ziv_loop);
-
MPFR_LOG_FUNC
(("x[%Pu]=%.*Rg y[%Pu]=%.*Rg rnd=%d",
mpfr_get_prec (x), mpfr_log_prec, x,
@@ -321,30 +328,13 @@ mpfr_pow_general (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y,
*/
if (rnd_mode == MPFR_RNDN && inexact < 0 && lk < 0 &&
MPFR_GET_EXP (z) == __gmpfr_emin - 1 - lk && mpfr_powerof2_raw (z))
- {
- /* Rounding to nearest, real result > z * 2^k = 2^(emin - 2),
- * underflow case:
- * (a) if the precision of z is > 1, we will obtain the correct
- * result and exceptions by replacing z by nextabove(z).
- * (b) if the precision of z is 1, we first copy z to zcopy of
- * precision 2 bits and perform nextabove(zcopy).
- */
- if (MPFR_PREC(z) >= 2)
- mpfr_nextabove (z);
- else
- {
- mpfr_t zcopy;
- mpfr_init2 (zcopy, MPFR_PREC(z) + 1);
- mpfr_set (zcopy, z, MPFR_RNDZ);
- mpfr_nextabove (zcopy);
- inex2 = mpfr_mul_2si (z, zcopy, lk, rnd_mode);
- mpfr_clear (zcopy);
- goto under_over;
- }
- }
+ /* Rounding to nearest, real result > z * 2^k = 2^(emin - 2),
+ * underflow case: we will obtain the correct result and exceptions
+ * by replacing z by nextabove(z).
+ */
+ mpfr_nextabove (z);
MPFR_CLEAR_FLAGS ();
inex2 = mpfr_mul_2si (z, z, lk, rnd_mode);
- under_over:
if (inex2) /* underflow or overflow */
{
inexact = inex2;
@@ -537,25 +527,19 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode)
if (cmp_x_1 * MPFR_SIGN (y) > 0)
{
- mpfr_t t;
+ mpfr_t t, x_abs;
int negative, overflow;
+ /* FIXME: since we round y*log2|x| toward zero, we could also do early
+ underflow detection */
MPFR_SAVE_EXPO_MARK (expo);
- mpfr_init2 (t, 53);
- /* we want a lower bound on y*log2|x|:
- (i) if x > 0, it suffices to round log2(x) toward zero, and
- to round y*o(log2(x)) toward zero too;
- (ii) if x < 0, we first compute t = o(-x), with rounding toward 1,
- and then follow as in case (1). */
- if (MPFR_IS_POS (x))
- mpfr_log2 (t, x, MPFR_RNDZ);
- else
- {
- mpfr_neg (t, x, (cmp_x_1 > 0) ? MPFR_RNDZ : MPFR_RNDU);
- mpfr_log2 (t, t, MPFR_RNDZ);
- }
+ mpfr_init2 (t, sizeof (mpfr_exp_t) * CHAR_BIT);
+ /* we want a lower bound on y*log2|x| */
+ MPFR_TMP_INIT_ABS (x_abs, x);
+ mpfr_log2 (t, x_abs, MPFR_RNDZ);
mpfr_mul (t, t, y, MPFR_RNDZ);
- overflow = mpfr_cmp_si (t, __gmpfr_emax) > 0;
+ overflow = mpfr_cmp_si (t, __gmpfr_emax) >= 0;
+ /* if t >= emax, then |z| >= 2^t >= 2^emax and we have overflow */
mpfr_clear (t);
MPFR_SAVE_EXPO_FREE (expo);
if (overflow)
@@ -617,8 +601,9 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode)
MBs may be necessary). Note that in such a case, either x = +/-2^b
(this case is handled below) or x^y cannot be represented exactly in
any precision supported by MPFR (the general case uses this property).
- */
- if (y_is_integer && (MPFR_GET_EXP (y) <= 256))
+ Note: the threshold of 256 should not be decreased too much, see the
+ comments about (-2^b)^y just below. */
+ if (y_is_integer && MPFR_GET_EXP (y) <= MPFR_POW_EXP_THRESHOLD)
{
mpz_t zi;
@@ -633,37 +618,49 @@ mpfr_pow (mpfr_ptr z, mpfr_srcptr x, mpfr_srcptr y, mpfr_rnd_t rnd_mode)
/* Special case (+/-2^b)^Y which could be exact. If x is negative, then
necessarily y is a large integer. */
if (mpfr_powerof2_raw (x))
- {
- mpfr_exp_t b = MPFR_GET_EXP (x) - 1;
- mpfr_t tmp;
- int sgnx = MPFR_SIGN (x);
-
- MPFR_ASSERTN (b >= LONG_MIN && b <= LONG_MAX); /* FIXME... */
-
- MPFR_LOG_MSG (("special case (+/-2^b)^Y\n", 0));
- /* now x = +/-2^b, so x^y = (+/-1)^y*2^(b*y) is exact whenever b*y is
- an integer */
- MPFR_SAVE_EXPO_MARK (expo);
- mpfr_init2 (tmp, MPFR_PREC (y) + sizeof (long) * CHAR_BIT);
- inexact = mpfr_mul_si (tmp, y, b, MPFR_RNDN); /* exact */
- MPFR_ASSERTN (inexact == 0);
- /* Note: as the exponent range has been extended, an overflow is not
- possible (due to basic overflow and underflow checking above, as
- the result is ~ 2^tmp), and an underflow is not possible either
- because b is an integer (thus either 0 or >= 1). */
- MPFR_CLEAR_FLAGS ();
- inexact = mpfr_exp2 (z, tmp, rnd_mode);
- mpfr_clear (tmp);
- if (sgnx < 0 && mpfr_odd_p (y))
- {
- mpfr_neg (z, z, rnd_mode);
- inexact = -inexact;
- }
- /* Without the following, the overflows3 test in tpow.c fails. */
- MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
- MPFR_SAVE_EXPO_FREE (expo);
- return mpfr_check_range (z, inexact, rnd_mode);
- }
+ {
+ mpfr_exp_t b = MPFR_GET_EXP (x) - 1;
+ mpfr_t tmp;
+
+ MPFR_STAT_STATIC_ASSERT (MPFR_POW_EXP_THRESHOLD >=
+ sizeof(mpfr_exp_t) * CHAR_BIT);
+
+ /* For x < 0, we have EXP(y) > MPFR_POW_EXP_THRESHOLD, thus
+ EXP(y) > bitsize of mpfr_exp_t (1). Therefore, since |x| <> 1:
+ (a) either |x| >= 2, and we have an overflow due to (1), but
+ this was detected by the early overflow detection above,
+ i.e. this case is not possible;
+ (b) either |x| <= 1/2, and we have underflow. */
+ if (MPFR_SIGN (x) < 0)
+ {
+ MPFR_ASSERTD (MPFR_EXP (x) <= 0);
+ MPFR_ASSERTD (MPFR_EXP (y) > sizeof(mpfr_exp_t) * CHAR_BIT);
+ return mpfr_underflow (z,
+ rnd_mode == MPFR_RNDN ? MPFR_RNDZ : rnd_mode,
+ MPFR_IS_NEG (x) && mpfr_odd_p (y) ? -1 : 1);
+ }
+
+ MPFR_ASSERTN (b >= LONG_MIN && b <= LONG_MAX); /* FIXME... */
+
+ MPFR_LOG_MSG (("special case (+/-2^b)^Y\n", 0));
+ /* now x = +/-2^b, so x^y = (+/-1)^y*2^(b*y) is exact whenever b*y is
+ an integer */
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_init2 (tmp, MPFR_PREC (y) + sizeof (long) * CHAR_BIT);
+ inexact = mpfr_mul_si (tmp, y, b, MPFR_RNDN); /* exact */
+ MPFR_ASSERTN (inexact == 0);
+ /* Note: as the exponent range has been extended, an overflow is not
+ possible (due to basic overflow and underflow checking above, as
+ the result is ~ 2^tmp), and an underflow is not possible either
+ because b is an integer (thus either 0 or >= 1). */
+ MPFR_CLEAR_FLAGS ();
+ inexact = mpfr_exp2 (z, tmp, rnd_mode);
+ mpfr_clear (tmp);
+ /* Without the following, the overflows3 test in tpow.c fails. */
+ MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
+ MPFR_SAVE_EXPO_FREE (expo);
+ return mpfr_check_range (z, inexact, rnd_mode);
+ }
MPFR_SAVE_EXPO_MARK (expo);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/pow_si.c b/Build/source/libs/mpfr/mpfr-src/src/pow_si.c
index 8d51615df7f..081580e1ca4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/pow_si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/pow_si.c
@@ -1,6 +1,6 @@
/* mpfr_pow_si -- power function x^y with y a signed int
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,7 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#define MPFR_NEED_LONGLONG_H
+#define MPFR_NEED_LONGLONG_H /* for MPFR_INT_CEIL_LOG2 */
#include "mpfr-impl.h"
/* The computation of y = pow_si(x,n) is done by
@@ -149,8 +149,7 @@ mpfr_pow_si (mpfr_ptr y, mpfr_srcptr x, long int n, mpfr_rnd_t rnd)
MPFR_ZIV_DECL (loop);
abs_n = - (unsigned long) n;
- count_leading_zeros (size_n, (mp_limb_t) abs_n);
- size_n = GMP_NUMB_BITS - size_n;
+ size_n = mpfr_nbits_ulong (abs_n);
/* initial working precision */
Ny = MPFR_PREC (y);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/pow_ui.c b/Build/source/libs/mpfr/mpfr-src/src/pow_ui.c
index 33aadf24723..456d6d18e74 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/pow_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/pow_ui.c
@@ -1,7 +1,7 @@
/* mpfr_pow_ui-- compute the power of a floating-point
by a machine integer
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -108,13 +108,13 @@ mpfr_pow_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int n, mpfr_rnd_t rnd)
err = prec - 1 - (mpfr_prec_t) i;
/* First step: compute square from x */
MPFR_BLOCK (flags,
- inexact = mpfr_mul (res, x, x, MPFR_RNDU);
+ inexact = mpfr_sqr (res, x, MPFR_RNDU);
MPFR_ASSERTD (i >= 2);
if (n & (1UL << (i-2)))
inexact |= mpfr_mul (res, res, x, rnd1);
for (i -= 3; i >= 0 && !MPFR_BLOCK_EXCEP; i--)
{
- inexact |= mpfr_mul (res, res, res, MPFR_RNDU);
+ inexact |= mpfr_sqr (res, res, MPFR_RNDU);
if (n & (1UL << i))
inexact |= mpfr_mul (res, res, x, rnd1);
});
diff --git a/Build/source/libs/mpfr/mpfr-src/src/pow_z.c b/Build/source/libs/mpfr/mpfr-src/src/pow_z.c
index 84c2441d80b..3b4e62fd684 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/pow_z.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/pow_z.c
@@ -1,6 +1,6 @@
/* mpfr_pow_z -- power function x^z with z a MPZ
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -82,13 +82,13 @@ mpfr_pow_pos_z (mpfr_ptr y, mpfr_srcptr x, mpz_srcptr z, mpfr_rnd_t rnd, int cr)
err = prec - 1 - (mpfr_prec_t) i;
MPFR_BLOCK (flags,
- inexmul = mpfr_mul (res, x, x, rnd2);
+ inexmul = mpfr_sqr (res, x, rnd2);
MPFR_ASSERTD (i >= 2);
if (mpz_tstbit (absz, i - 2))
inexmul |= mpfr_mul (res, res, x, rnd1);
for (i -= 3; i >= 0 && !MPFR_BLOCK_EXCEP; i--)
{
- inexmul |= mpfr_mul (res, res, res, rnd2);
+ inexmul |= mpfr_sqr (res, res, rnd2);
if (mpz_tstbit (absz, i))
inexmul |= mpfr_mul (res, res, x, rnd1);
});
diff --git a/Build/source/libs/mpfr/mpfr-src/src/powerof2.c b/Build/source/libs/mpfr/mpfr-src/src/powerof2.c
index b07ffe6828d..f403671b387 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/powerof2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/powerof2.c
@@ -1,6 +1,6 @@
/* mpfr_powerof2_raw -- test whether a floating-point number is a power of 2
-Copyright 2002-2019 Free Software Foundation, Inc.
+Copyright 2002-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/powerpc32/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/powerpc32/mparam.h
deleted file mode 100644
index 65bf53226d3..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/powerpc32/mparam.h
+++ /dev/null
@@ -1,232 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2010-10-22, gcc 4.2.4, gmp 5.0.1 */
-/* RS/6000 7025 F50 kindly provided by David Kirkby, under AIX 5.3 */
-/* used MPFR svn revision 7238 */
-
-#define MPFR_MULHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,40,40,40,40,40,40, \
- 40,40,40,40,40,44,48,48,48,48,48,48,48,48,48,48, \
- 48,48,48,48,52,52,52,52,52,52,52,52,52,52,52,64, \
- 64,64,64,64,74,74,74,75,74,75,75,75,75,75,75,75, \
- 75,75,75,75,75,75,75,75,75,75,75,75,75,75,75,75, \
- 75,93,93,93,93,93,93,93,93,93,93,93,93,93,93,93, \
- 105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105, \
- 105,105,124,124,124,124,124,124,124,124,124,124,124,124,124,124, \
- 124,124,124,124,124,124,140,140,140,140,140,140,140,140,156,156, \
- 156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156, \
- 156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156, \
- 156,156,156,156,156,156,156,156,156,156,156,156,156,156,156,156, \
- 156,156,156,156,156,156,156,156,186,186,186,186,186,186,186,186, \
- 186,186,186,186,186,186,186,186,186,186,186,186,186,186,210,210, \
- 210,210,234,234,234,234,234,234,234,234,234,234,234,234,234,234, \
- 234,234,234,234,234,234,234,233,234,234,234,234,234,234,234,234, \
- 234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,234, \
- 234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,234, \
- 234,234,234,234,234,234,234,234,234,234,234,234,234,234,234,234, \
- 234,280,280,280,280,280,280,280,312,312,312,312,312,312,312,312, \
- 312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312, \
- 312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312, \
- 312,312,312,312,312,312,312,312,312,344,344,344,344,344,344,312, \
- 344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344, \
- 344,344,344,344,344,344,376,376,376,376,376,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,407,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,408,408,408,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,584,584,584,584,584,584,584,584,584,584,584, \
- 584,584,584,584,584,584,584,584,583,584,583,584,584,584,584,584, \
- 592,584,592,584,592,592,592,592,592,584,592,592,592,584,584,584, \
- 584,584,584,584,584,584,584,584,584,584,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,591,592,591,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,591,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,735,736,735,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,832,832,736, \
- 832,831,832,832,832,832,832,832,832,832,832,832,832,832,832,832, \
- 832,832,831,832,832,832,832,832,832,832,832,832,832,832,832,832, \
- 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,7,8,8,9,9, \
- 10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17, \
- 18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25, \
- 26,26,27,28,28,28,30,32,32,32,32,32,32,32,34,34, \
- 36,36,36,36,36,40,40,40,40,40,40,40,42,42,42,44, \
- 44,44,46,46,46,46,46,46,46,46,47,47,56,56,56,56, \
- 56,56,56,56,60,64,64,64,64,64,64,64,64,64,64,64, \
- 64,64,64,68,68,72,72,72,72,72,72,72,72,76,76,76, \
- 76,76,76,76,68,72,72,72,72,72,76,76,76,76,76,76, \
- 76,76,76,76,76,76,77,77,87,90,93,93,93,93,93,93, \
- 93,96,99,99,99,99,93,96,93,93,96,99,99,102,99,99, \
- 105,102,105,105,105,105,108,108,108,111,111,111,111,111,117,117, \
- 117,117,117,117,117,117,123,123,123,123,123,123,123,126,126,129, \
- 129,123,129,129,129,129,129,129,129,129,129,129,129,129,129,129, \
- 129,123,123,123,123,123,123,123,126,129,129,129,129,129,129,129, \
- 129,129,129,129,129,129,164,164,164,164,164,164,164,164,164,164, \
- 172,172,172,172,172,172,156,156,156,156,156,156,156,156,156,163, \
- 164,164,164,164,164,171,171,171,172,172,172,172,172,172,172,180, \
- 180,179,180,180,180,180,180,180,180,180,180,180,180,180,180,180, \
- 180,180,180,180,198,198,198,198,180,198,198,198,210,210,210,210, \
- 210,210,210,210,210,210,210,222,222,222,222,222,222,222,222,222, \
- 222,222,222,222,234,234,234,234,234,234,234,234,234,234,234,234, \
- 234,234,246,246,246,246,246,246,246,246,246,246,246,246,246,246, \
- 258,246,246,258,258,258,258,258,258,258,258,258,258,270,270,270, \
- 270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270, \
- 270,270,270,270,270,270,270,270,270,270,270,270,270,270,270,270, \
- 270,270,270,270,270,270,270,270,270,270,270,270,270,270,312,270, \
- 312,312,312,270,270,270,270,270,270,270,270,328,328,312,328,328, \
- 328,328,328,328,328,328,328,344,344,312,328,344,328,328,328,328, \
- 328,328,328,328,328,328,328,328,328,328,328,327,328,328,328,328, \
- 328,344,328,328,328,328,328,328,344,344,344,344,344,344,344,344, \
- 344,344,344,360,360,360,360,360,360,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,360,360,360,360,328,328,360,328,328,328, \
- 328,328,360,328,328,328,328,328,328,328,328,344,344,344,344,344, \
- 344,344,344,344,344,344,344,344,344,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360, \
- 408,408,408,408,408,408,408,408,408,408,440,440,440,440,440,439, \
- 440,440,440,440,440,440,440,440,440,440,440,440,440,440,440,440, \
- 440,440,440,440,440,440,440,440,440,440,440,440,440,472,472,440, \
- 440,471,504,472,472,472,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,472,472,472,472,472,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,504,504,504,504,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 504,504,504,504,568,568,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,504,600,600,600,600,600,600,600,536,536,536,535, \
- 535,536,536,536,536,536,536,536,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,567,568,568,568,568,568,568, \
- 568,568,568,568,568,567,568,568,568,568,568,568,600,600,600,599, \
- 600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,568,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,599,600,600,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,600,600,600,600,600,600,600,600,600,600,600,600,600,600 \
-
-#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,7,10,9,12,13,12,9, \
- 12,12,12,12,12,12,15,15,16,15,16,16,16,19,20,20, \
- 20,19,19,19,20,20,21,21,22,23,23,24,25,25,25,25, \
- 26,26,27,27,28,28,29,29,31,31,31,31,32,35,33,33, \
- 34,36,35,35,36,36,37,37,38,38,40,39,40,40,41,41, \
- 42,42,43,48,44,48,47,45,47,47,47,48,48,48,49,49, \
- 50,51,51,51,52,52,53,53,54,55,56,55,56,63,57,64, \
- 63,64,64,64,64,64,62,64,64,63,64,64,72,64,72,65, \
- 66,72,72,71,72,71,71,70,80,71,71,71,80,72,73,80, \
- 74,79,80,80,80,80,80,80,80,79,80,80,80,80,81,81, \
- 82,88,85,95,84,96,96,88,96,96,95,95,96,96,96,96, \
- 96,95,96,104,96,96,96,94,96,95,104,96,96,96,104,104, \
- 98,104,100,104,104,104,104,104,103,104,104,103,104,104,105,105, \
- 106,106,128,110,108,128,128,128,128,128,128,128,128,128,128,128, \
- 128,128,128,128,127,128,128,128,127,124,128,128,126,126,128,125, \
- 128,128,127,128,128,128,128,128,128,127,128,128,148,128,146,129, \
- 130,148,144,147,150,148,150,148,148,150,147,150,144,148,150,148, \
- 150,150,160,148,160,148,148,150,148,149,150,150,160,148,150,148, \
- 148,150,147,150,150,150,149,149,160,150,151,151,152,156,156,156, \
- 154,156,160,160,160,156,159,157,158,160,160,160,160,160,161,161, \
- 162,168,176,192,186,192,186,186,186,192,192,184,192,186,184,192, \
- 185,186,191,192,192,191,186,192,192,192,192,192,192,192,192,192, \
- 192,190,192,192,190,192,192,192,186,192,192,192,192,192,192,192, \
- 192,192,192,192,192,192,192,191,192,192,191,192,192,208,208,208, \
- 194,208,208,208,208,207,208,208,208,208,207,208,206,208,201,208, \
- 208,208,204,208,208,208,208,208,208,208,208,208,208,208,209,209, \
- 210,210,211,211,212,248,256,216,216,248,254,256,256,248,255,256, \
- 256,256,256,255,256,256,256,255,256,256,256,248,256,256,248,256, \
- 256,255,256,256,254,256,256,256,248,255,256,256,256,256,254,256, \
- 256,248,256,247,256,256,256,256,256,256,256,255,255,255,256,256, \
- 256,254,256,256,253,255,256,256,256,255,256,256,256,253,256,288, \
- 256,256,296,256,256,296,300,296,296,288,300,299,312,312,312,312, \
- 288,312,294,311,312,312,299,300,312,296,312,300,300,296,295,299, \
- 312,300,310,312,296,312,310,312,312,311,312,312,311,312,312,312, \
- 312,312,311,312,312,312,310,311,312,310,312,312,310,311,311,312, \
- 312,312,312,312,299,300,300,312,312,312,311,312,312,312,312,312, \
- 312,312,312,312,310,300,311,310,312,312,312,312,308,300,312,312, \
- 312,310,311,310,311,311,312,301,312,312,312,311,312,312,312,312, \
- 311,312,312,312,312,312,312,312,312,312,311,312,312,312,313,313, \
- 314,314,315,320,320,372,320,320,320,372,372,371,371,372,324,372, \
- 371,371,372,370,369,371,371,372,372,372,372,372,370,370,372,370, \
- 371,372,370,372,372,372,372,372,371,371,372,372,370,372,372,372, \
- 370,372,372,372,370,372,372,370,372,370,370,371,372,371,384,372, \
- 371,384,368,372,384,370,383,372,384,383,384,384,384,384,384,372, \
- 372,384,372,372,369,370,372,370,372,368,372,372,372,372,371,370, \
- 372,372,371,416,384,384,384,416,415,383,383,416,384,384,372,372, \
- 416,370,371,372,372,415,373,417,415,416,384,384,384,416,416,417, \
- 417,416,384,416,416,384,415,415,416,384,414,416,414,416,416,417, \
- 386,408,416,416,416,408,416,416,414,416,417,417,417,416,414,416, \
- 415,416,416,416,414,416,408,415,415,417,414,407,415,416,416,415, \
- 416,416,417,416,416,415,416,416,416,416,415,416,416,416,419,415, \
- 416,416,415,414,415,416,417,413,416,417,416,416,416,416,417,417, \
- 418,418,419,419,420,420,421,421,422,444,432,430,496,443,496,496, \
- 432,432,432,468,468,468,468,444,495,466,496,496,496,494,496,496, \
- 496,468,512,494,496,496,496,496,468,496,493,496,492,496,496,512, \
- 496,496,496,495,495,495,496,496,496,496,496,512,496,496,512,496, \
- 496,493,496,496,496,509,496,512,512,496,512,496,512,512,496,495, \
- 496,512,511,511,512,512,512,511,512,511,495,496,511,511,512,511, \
- 512,512,493,495,495,495,512,493,495,560,496,496,496,496,496,560, \
- 496,560,492,496,560,495,494,496,496,495,496,495,496,560,511,496, \
- 512,509,512,495,494,496,511,496,560,496,512,512,511,496,575,512, \
- 560,496,496,495,585,511,621,495,621,511,622,624,623,511,624,620, \
- 624,623,511,620,620,624,591,623,624,622,623,620,624,613,624,624, \
- 560,623,624,624,624,621,622,623,624,623,576,624,624,624,624,620 \
-
-#define MPFR_MUL_THRESHOLD 8 /* limbs */
-#define MPFR_SQR_THRESHOLD 1 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 530 /* bits */
-#define MPFR_EXP_THRESHOLD 7030 /* bits */
-#define MPFR_SINCOS_THRESHOLD 10754 /* bits */
-#define MPFR_AI_THRESHOLD1 -30447 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 3973
-#define MPFR_AI_THRESHOLD3 46501
-/* Tuneup completed successfully, took 12578 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/powerpc64/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/powerpc64/mparam.h
index f18062bad4c..2b34da50078 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/powerpc64/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/powerpc64/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -19,215 +19,215 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.3.2 */
-/* generated on gcc40.fsffrance.org (IBM PowerPC 970 G5) with GMP 5.0.2 */
-
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 4.8.5 */
+/* generated on gcc110.fsffrance.org (POWER7) with GMP 6.1.2,
+ where GMP uses -m64 -mtune=power7 -O3 */
#define MPFR_MULHIGH_TAB \
- -1,-1,-1,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,10,11,12,13,12,13,16,14,18,18,18,18,18,20,20, \
- 22,22,23,24,24,26,24,24,26,26,26,28,26,32,36,36, \
- 32,36,36,36,36,36,36,36,36,36,36,40,40,36,44,44, \
- 44,44,44,44,48,48,48,44,44,44,48,48,48,48,48,48, \
- 52,52,52,52,52,52,63,57,57,63,63,63,63,63,63,63, \
- 63,69,69,69,69,69,69,75,75,69,75,72,75,74,75,75, \
- 75,75,75,75,75,75,81,81,81,81,81,93,93,93,93,93, \
- 93,93,105,104,105,105,105,105,105,105,105,104,105,105,105,105, \
- 105,105,105,105,105,105,105,105,105,105,105,105,105,105,105,105, \
- 105,105,105,105,117,117,105,117,117,117,117,129,117,129,117,129, \
- 129,129,129,129,129,129,129,129,129,129,129,129,129,129,141,129, \
- 141,141,141,141,141,141,141,141,141,141,156,156,156,156,156,156, \
- 156,156,156,156,156,156,156,156,156,156,156,156,156,172,172,172, \
- 172,172,172,172,172,172,172,172,172,172,172,172,172,172,172,172, \
- 188,172,172,188,172,188,188,188,188,188,188,188,188,188,188,187, \
- 188,188,188,210,210,210,210,210,210,210,210,210,210,210,210,210, \
- 210,210,210,210,210,210,210,210,210,210,210,210,210,210,210,210, \
- 210,234,210,210,234,234,234,210,234,234,234,234,234,234,234,234, \
- 234,234,234,234,234,258,234,234,258,234,258,258,258,258,258,258, \
- 258,258,258,258,258,258,258,258,258,258,258,258,258,258,258,258, \
- 258,258,258,258,258,257,258,258,282,282,282,282,282,281,282,282, \
- 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282, \
- 312,282,282,312,282,282,282,312,312,312,312,282,312,312,312,312, \
- 312,312,312,312,312,312,312,312,312,312,312,312,312,312,312,312, \
- 312,312,312,312,344,344,344,344,344,344,344,344,344,344,344,344, \
- 344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,343, \
- 344,343,344,344,344,344,344,344,344,344,344,344,376,376,376,376, \
- 344,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,376,376,376,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,376,376,376,376,376,376,408,376, \
- 408,408,408,408,376,376,408,408,376,408,408,408,408,376,408,408, \
+ -1,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,19,19,19, \
+ 21,21,22,24,24,24,24,24,24,24,24,24,30,30,32,42, \
+ 30,34,34,34,34,38,38,32,32,32,40,40,52,40,42,42, \
+ 42,52,52,52,52,48,48,48,48,52,52,52,52,52,52,52, \
+ 52,52,52,52,52,52,56,52,52,60,60,60,60,60,64,60, \
+ 64,68,68,68,68,68,68,68,68,75,68,74,68,78,75,74, \
+ 75,68,75,86,78,87,87,87,93,93,87,87,87,93,87,87, \
+ 87,99,86,87,87,87,99,90,92,93,84,99,99,74,93,99, \
+ 99,99,98,126,99,99,99,99,102,102,102,104,104,108,110,110, \
+ 108,111,111,114,114,117,117,117,117,117,122,123,123,123,123,123, \
+ 123,123,126,128,128,123,141,153,123,141,141,141,138,141,141,152, \
+ 153,153,120,153,152,153,153,153,152,162,153,117,153,153,153,153, \
+ 153,153,128,153,153,152,153,153,153,152,153,153,153,153,153,156, \
+ 156,152,153,153,153,153,153,153,153,153,153,153,153,153,153,177, \
+ 177,177,177,153,176,216,153,177,204,153,204,177,168,204,204,168, \
+ 204,204,204,204,204,177,204,204,204,204,204,204,202,204,204,204, \
+ 204,204,204,202,203,204,204,204,204,204,204,204,204,204,204,204, \
+ 204,204,203,204,204,204,204,204,204,204,204,204,204,204,204,204, \
+ 236,204,204,234,204,204,203,236,236,236,236,236,236,236,236,236, \
+ 236,236,235,236,235,236,236,236,236,236,236,236,236,236,236,236, \
+ 236,236,236,236,236,236,268,268,236,268,236,268,268,268,268,268, \
+ 268,268,268,266,267,268,267,268,268,268,268,268,267,268,268,268, \
+ 268,268,267,268,268,306,306,306,306,304,305,306,306,336,306,306, \
+ 236,305,306,306,306,306,306,306,306,306,306,306,306,306,306,306, \
+ 306,306,306,306,306,306,306,306,306,306,306,306,306,306,305,306, \
+ 306,306,306,306,306,306,306,306,330,306,306,305,306,306,306,305, \
+ 306,306,306,306,354,306,354,354,353,306,353,354,354,354,354,354, \
+ 354,354,353,354,354,354,353,354,354,354,354,354,354,354,354,354, \
+ 424,354,354,354,354,354,353,354,354,354,352,408,354,354,354,354, \
+ 354,408,408,354,408,408,408,407,408,408,408,408,408,408,407,408, \
+ 408,408,408,408,402,408,402,402,407,408,408,408,408,408,408,407, \
408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,408,408,448,448,408,408,407, \
- 408,408,408,448,408,448,448,448,448,408,448,448,448,448,448,448, \
- 448,448,448,448,448,448,448,496,496,496,496,496,496,496,448,496, \
- 496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, \
- 496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, \
- 496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, \
- 496,496,496,496,496,496,496,496,496,496,496,496,496,496,496,496, \
- 496,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544, \
- 544,544,544,544,544,544,544,544,544,544,543,544,544,544,544,544, \
- 544,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544, \
- 544,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544, \
- 544,544,592,592,592,592,567,544,568,568,568,592,592,592,592,592, \
- 592,592,568,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,591,592,592,592,592,592,592, \
- 592,592,592,592,592,592,592,592,592,592,640,592,640,592,640,640, \
- 640,640,639,640,640,640,640,639,640,639,640,640,639,640,640,639, \
- 640,639,640,640,640,640,640,640,640,640,640,640,640,640,640,639, \
- 640,639,640,639,639,640,640,639,639,640,640,640,736,736,736,736, \
- 735,736,736,736,736,735,736,736,736,735,736,736,736,735,734,735, \
- 736,735,736,736,736,736,736,736,736,736,736,736,736,736,736,735, \
- 736,736,736,735,736,736,736,736,736,736,736,735,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,735,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,735,736,736,736,735,736,832,832,831,831,832,832,832,831, \
- 832,832,832,832,832,831,832,831,832,832,831,832,832,832,832,832, \
- 832,832,832,831,832,832,832,832,832,832,832,832,832,831,832,832, \
- 832,832,832,832,832,832,832,831,832,832,832,832,832,832,832,832, \
- 832,832,831,832,832,832,832,831,832,830,832,832,832,832,832,832, \
- 832,832,832,832,832,832,832,831,832,832,832,832,832,832,832,832, \
- 832,832,832,832,832,832,832,832,832,832,832,832,832,832,832,832 \
+ 406,407,408,408,408,408,408,408,408,406,408,408,408,408,407,408, \
+ 408,408,407,408,408,407,408,408,408,408,408,407,407,408,408,408, \
+ 408,408,408,472,472,472,472,472,472,472,472,472,472,472,472,472, \
+ 472,472,472,472,472,472,472,472,471,472,472,472,472,472,472,472, \
+ 470,471,472,472,472,472,472,472,472,472,472,472,472,472,472,472, \
+ 472,472,471,472,472,470,472,472,472,472,470,471,472,472,472,472, \
+ 472,472,472,472,536,536,536,536,535,536,535,536,536,536,535,536, \
+ 536,536,536,535,536,536,536,534,535,536,536,536,536,536,536,536, \
+ 536,535,536,536,536,536,536,536,536,536,535,536,536,536,536,536, \
+ 536,536,535,535,536,535,536,536,536,536,536,535,536,536,536,536, \
+ 536,536,536,535,536,536,536,536,536,536,536,536,536,591,536,536, \
+ 536,536,592,590,536,591,592,592,592,591,591,592,592,591,592,592, \
+ 592,591,591,592,592,592,592,592,592,592,591,592,592,590,590,592, \
+ 592,592,590,591,592,592,592,592,592,592,592,592,592,592,592,592, \
+ 591,592,592,592,592,591,592,592,616,592,592,591,591,616,592,592, \
+ 592,592,616,616,616,592,616,616,592,616,592,616,640,616,616,591, \
+ 592,592,589,592,640,591,592,616,688,688,592,688,688,687,688,686, \
+ 688,688,688,688,687,688,688,688,686,687,688,688,688,687,688,688, \
+ 688,686,688,688,688,615,688,685,688,688,687,688,688,687,688,688, \
+ 688,688,686,687,688,688,688,688,688,688,688,688,688,687,687,688, \
+ 688,688,688,688,688,688,688,688,688,686,687,688,688,688,688,688, \
+ 688,688,712,736,736,688,686,736,688,736,688,736,687,735,736,736, \
+ 688,736,734,735,736,688,688,736,688,736,688,687,687,688,688,688, \
+ 688,736,736,688,688,736,736,736,736,736,784,736,688,736,736,782, \
+ 783,784,783,784,784,784,784,776,784,784,783,784,784,782,783,784, \
+ 784,784,784,783,784,784,783,784,784,784,784,784,784,784,784,784, \
+ 783,784,784,784,783,783,784,784,784,784,784,784,784,784,784,784, \
+ 784,784,784,783,784,784,783,783,784,784,784,782,783,784,784,783, \
+ 784,784,783,784,783,784,784,784,784,783,784,783,784,784,784,784, \
+ 784,784,783,784,784,783,784,784,784,783,784,784,784,784,784,783, \
+ 782,783,784,784,784,784,784,784,784,784,783,784,784,784,784,784 \
#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,0,0,0,10,9, \
- 10,10,12,12,12,12,14,13,14,14,15,15,16,16,17,17, \
- 18,18,19,20,20,20,22,22,22,22,23,23,25,25,26,25, \
- 26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,34, \
- 34,34,35,35,36,36,38,38,40,38,42,40,40,42,42,44, \
- 42,42,44,44,44,44,46,46,46,46,50,48,52,48,50,52, \
- 50,50,52,52,52,52,53,53,54,54,56,56,56,56,58,60, \
- 58,58,60,60,60,60,63,63,63,63,63,63,66,66,66,72, \
- 66,66,75,75,75,75,69,69,72,72,75,75,75,75,78,75, \
- 75,75,75,75,78,78,78,81,78,81,81,81,81,81,81,87, \
- 84,84,87,87,87,90,90,87,87,90,93,87,96,93,90,90, \
- 99,96,102,99,96,93,99,93,99,96,96,96,96,99,99,99, \
- 99,99,99,99,105,102,102,102,102,102,105,105,105,105,105,105, \
- 111,111,111,111,111,111,117,111,111,111,111,111,123,117,117,123, \
- 129,129,129,129,123,129,129,123,129,129,129,123,129,129,135,129, \
- 129,129,135,135,129,135,134,135,135,135,135,135,135,141,135,129, \
- 135,141,135,135,135,135,135,135,135,135,135,135,141,141,141,138, \
- 138,141,141,141,141,141,141,141,147,144,147,146,147,147,146,147, \
- 153,146,153,147,152,153,153,153,153,153,153,153,153,153,153,153, \
- 164,164,164,164,164,172,164,171,172,172,172,172,172,172,172,164, \
- 164,164,172,180,172,180,180,172,172,180,172,171,172,172,172,180, \
- 180,180,180,180,180,180,180,188,188,187,187,188,188,188,180,196, \
- 196,196,180,180,196,196,203,204,204,204,204,204,204,204,210,210, \
- 188,188,188,210,188,188,222,222,204,196,222,222,222,222,204,222, \
- 204,204,204,204,204,234,234,222,234,234,234,234,210,222,222,234, \
- 246,246,222,222,222,222,246,222,222,234,258,258,258,258,234,258, \
- 258,258,258,258,234,234,234,258,246,246,270,246,258,246,246,246, \
- 246,246,258,258,258,258,258,258,258,258,258,258,258,258,258,258, \
- 270,270,258,270,270,258,270,270,270,270,258,258,270,270,258,270, \
- 258,258,258,258,258,258,258,270,257,258,258,270,258,270,258,270, \
- 270,270,270,270,258,270,270,258,270,270,270,270,258,270,282,270, \
- 270,270,270,270,270,270,270,270,270,270,270,282,270,282,282,282, \
- 282,270,282,282,282,282,282,306,282,306,306,294,282,306,306,306, \
- 312,306,294,306,306,306,306,306,270,306,306,306,306,306,306,282, \
- 306,282,282,282,282,282,282,328,282,282,344,344,328,344,282,344, \
- 344,282,328,344,344,344,344,306,306,306,344,306,306,306,344,344, \
- 360,344,344,344,344,344,344,344,306,360,344,360,360,360,360,360, \
- 360,360,360,360,360,360,360,360,328,344,344,344,344,344,344,344, \
- 344,344,344,344,344,344,344,344,344,344,344,344,344,344,344,344, \
- 344,344,344,344,360,344,344,360,360,360,360,360,360,360,360,360, \
- 360,360,360,376,376,360,360,360,376,376,360,376,376,376,376,376, \
- 376,376,376,376,376,376,376,376,392,392,392,408,408,376,408,408, \
- 408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,408,424,408,408,424,408,408,424, \
- 408,408,408,408,408,408,408,408,408,408,408,408,408,407,408,408, \
- 408,407,407,408,408,408,424,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,408,408,424,408,424,424,424,424,424,424, \
- 424,424,424,424,424,424,408,408,408,408,408,407,440,440,408,408, \
- 408,440,440,424,424,440,424,424,424,424,424,424,424,424,424,424, \
- 424,424,424,440,440,408,440,440,440,472,440,440,472,440,440,440, \
- 440,472,440,440,440,424,472,440,472,440,472,424,424,440,424,424, \
- 424,440,440,424,440,440,440,472,472,440,440,472,440,472,472,472, \
- 472,472,472,424,440,424,424,423,424,424,472,440,424,424,472,440, \
- 440,440,440,440,440,472,440,472,440,440,472,440,440,440,472,440, \
- 440,440,440,440,440,440,440,456,440,472,439,440,440,456,456,472, \
- 472,472,472,471,471,472,472,472,472,472,472,472,471,472,472,472, \
- 472,472,471,471,472,472,472,471,472,472,472,472,472,472,472,472, \
- 472,472,472,471,472,472,472,472,472,471,472,472,472,472,472,472, \
- 472,472,472,472,471,472,472,519,520,472,520,472,472,472,591,592, \
- 520,520,520,520,520,592,592,592,592,568,592,592,520,520,520,592, \
- 520,544,520,544,592,544,520,543,544,544,544,520,520,520,592,519, \
- 568,568,592,592,592,592,568,592,568,568,592,568,568,592,568,592, \
- 568,568,592,592,544,568,592,592,592,592,592,568,592,592,592,592, \
- 592,592,591,592,592,592,592,592,592,592,592,568,592,592,592,568 \
+ -1,0,-1,0,0,0,-1,-1,-1,7,8,-1,10,11,11,11, \
+ 11,11,11,11,13,13,13,13,15,15,15,15,16,17,19,19, \
+ 19,19,19,19,21,22,23,23,23,23,24,25,27,27,25,29, \
+ 27,27,29,29,31,31,31,31,31,38,38,38,38,38,38,38, \
+ 38,36,36,38,38,38,38,38,42,42,44,42,46,44,46,44, \
+ 45,46,46,46,46,46,50,54,50,50,52,52,54,54,54,50, \
+ 52,52,54,54,52,52,54,54,54,54,56,58,60,60,60,62, \
+ 60,62,62,64,64,64,76,75,76,76,76,72,75,76,76,76, \
+ 76,76,76,76,84,84,76,76,84,88,88,88,88,92,92,92, \
+ 92,92,92,84,92,76,92,92,88,92,92,92,88,90,92,92, \
+ 92,88,92,92,91,91,92,92,91,92,92,92,92,92,92,92, \
+ 92,92,95,111,111,111,111,110,111,111,111,111,111,111,111,111, \
+ 111,111,111,111,111,114,111,114,117,116,111,110,121,116,129,129, \
+ 134,135,135,135,129,135,192,135,135,135,135,135,135,135,135,135, \
+ 135,135,141,135,129,129,129,135,135,135,135,135,135,134,135,141, \
+ 140,141,141,135,144,135,160,184,147,141,147,153,147,152,153,159, \
+ 153,159,159,159,159,159,159,165,159,159,159,159,159,165,164,159, \
+ 159,159,158,159,159,159,177,171,177,159,159,177,158,177,159,159, \
+ 159,158,159,159,159,171,171,159,159,171,171,159,177,177,171,171, \
+ 177,174,177,159,177,177,171,177,176,177,171,171,177,177,176,171, \
+ 177,177,177,175,176,177,177,176,177,177,204,204,196,196,204,212, \
+ 204,188,212,212,196,196,211,212,212,212,212,212,212,212,211,212, \
+ 204,204,212,212,212,212,212,211,212,212,212,212,212,220,220,236, \
+ 220,220,220,228,228,228,220,236,228,228,228,236,236,244,234,235, \
+ 236,236,236,236,244,244,236,243,244,244,244,244,244,244,244,236, \
+ 244,244,227,236,243,236,244,236,236,236,244,244,244,244,244,244, \
+ 244,244,244,244,244,244,220,219,220,244,228,220,236,236,228,233, \
+ 236,235,236,236,236,240,236,244,236,236,244,244,242,243,244,243, \
+ 244,244,244,244,244,244,243,244,244,236,244,244,244,318,318,244, \
+ 244,244,318,318,318,270,244,318,244,244,270,270,270,270,318,318, \
+ 318,318,318,318,282,318,318,318,318,318,318,318,318,318,318,318, \
+ 294,293,294,318,294,294,305,306,306,306,294,305,306,317,306,306, \
+ 306,306,318,318,318,318,318,317,318,317,318,318,318,318,318,318, \
+ 330,318,318,317,306,318,318,317,318,318,318,318,342,342,342,318, \
+ 318,318,318,408,318,318,318,330,354,342,318,318,354,353,354,354, \
+ 354,354,342,354,353,354,354,360,342,354,342,354,353,342,354,354, \
+ 342,341,342,353,354,354,354,353,354,354,354,354,354,354,354,354, \
+ 354,354,354,360,360,376,392,318,423,424,391,424,376,376,392,376, \
+ 392,391,408,392,376,392,408,423,424,424,392,424,423,424,424,424, \
+ 424,354,424,408,424,424,424,424,424,424,408,424,424,423,408,424, \
+ 424,408,424,424,424,424,424,424,424,423,424,424,424,424,424,424, \
+ 424,439,423,424,424,424,424,424,424,424,440,440,424,439,423,424, \
+ 600,439,423,424,456,424,424,472,424,424,456,456,456,423,424,424, \
+ 456,424,424,472,472,472,424,424,424,471,472,424,424,424,424,424, \
+ 424,424,472,472,488,424,423,424,424,424,488,488,488,439,488,487, \
+ 440,440,440,488,488,488,472,440,456,440,472,456,455,455,472,472, \
+ 456,456,456,472,456,472,472,472,472,488,488,471,471,486,472,472, \
+ 472,472,472,472,472,471,472,472,472,472,471,488,488,488,488,488, \
+ 488,504,488,504,600,391,488,752,488,488,488,408,568,488,488,488, \
+ 488,488,488,487,488,488,488,488,488,488,488,488,488,472,472,488, \
+ 488,488,488,599,488,600,600,488,488,488,599,600,600,599,600,488, \
+ 600,600,599,600,600,600,600,600,600,600,600,600,600,600,600,599, \
+ 598,599,600,600,600,599,600,600,600,600,616,600,424,568,568,568, \
+ 568,584,568,600,598,568,600,568,431,824,600,600,600,599,600,600, \
+ 600,600,600,600,-1,784,600,600,600,599,595,600,600,440,600,600, \
+ 600,600,600,600,600,599,600,600,600,600,597,600,600,600,600,600, \
+ 600,600,600,597,600,600,600,600,600,600,600,600,599,600,599,600, \
+ 600,600,600,599,600,600,599,600,600,600,600,598,662,600,600,600, \
+ 600,600,600,600,599,599,600,600,664,600,600,599,600,664,664,663, \
+ 664,664,664,600,664,664,664,664,664,664,600,664,664,664,664,664, \
+ 600,600,600,664,600,663,600,600,600,600,664,600,600,600,696,664, \
+ 696,598,600,600,600,664,600,600,664,664,600,600,600,600,600,600, \
+ 600,600,728,728,600,728,728,728,728,600,725,727,727,728,727,728, \
+ 727,728,728,727,728,728,728,728,728,728,728,728,727,728,728,728 \
#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,6,9,8,9,10,8,12,13, \
- 10,10,11,12,13,14,14,13,15,14,15,17,17,18,19,20, \
- 21,21,19,21,20,20,23,21,22,22,23,24,25,24,26,28, \
- 27,27,27,27,29,28,29,35,32,32,32,32,32,36,35,36, \
- 36,36,36,36,36,36,39,40,40,40,43,40,47,40,43,42, \
- 44,47,43,43,44,44,47,48,48,48,48,48,48,48,52,50, \
- 52,52,52,52,52,52,56,55,64,64,55,64,64,64,64,64, \
- 64,72,64,72,72,64,64,72,64,72,72,72,72,70,72,72, \
- 72,72,72,72,72,72,72,72,72,72,72,72,80,72,80,80, \
- 80,80,80,80,80,80,80,88,80,88,88,80,87,80,88,88, \
- 88,88,88,96,88,88,88,96,88,96,96,96,88,96,96,96, \
- 96,96,96,96,96,96,96,96,96,96,96,96,96,104,104,104, \
- 104,104,100,104,104,104,104,103,104,102,104,104,104,104,112,120, \
- 112,112,126,126,126,126,126,126,126,126,126,126,126,126,126,126, \
- 144,126,126,128,144,144,128,126,144,144,144,144,144,144,144,128, \
- 144,144,144,144,144,128,144,144,144,144,144,144,144,144,144,144, \
- 144,144,144,144,144,144,144,144,144,144,144,144,144,144,144,144, \
- 144,144,144,144,144,144,144,144,144,144,144,144,144,144,150,160, \
- 160,156,150,156,160,160,160,160,160,156,160,160,160,160,160,160, \
- 160,160,160,160,160,160,160,160,160,160,160,160,160,160,174,176, \
- 176,176,176,192,186,192,174,176,192,192,192,192,192,174,192,192, \
- 192,192,192,192,192,192,208,186,192,192,186,192,192,192,192,192, \
- 192,192,192,192,192,192,192,208,192,208,192,192,208,192,208,208, \
- 208,208,208,208,192,208,208,207,208,192,204,208,208,208,208,208, \
- 208,208,208,208,208,208,208,208,208,208,208,208,208,208,208,208, \
- 208,208,208,208,208,208,208,208,208,208,208,208,208,208,209,209, \
- 256,220,216,216,256,252,256,240,240,252,252,256,224,252,256,256, \
- 252,256,256,240,252,256,256,256,256,256,256,256,256,252,252,256, \
- 256,256,252,256,252,256,256,256,288,288,254,256,256,288,288,288, \
- 288,252,252,288,288,288,288,288,288,288,288,288,288,288,288,252, \
- 288,288,288,288,288,288,288,288,288,288,256,288,288,288,252,257, \
- 288,256,256,256,288,288,288,288,288,288,288,288,288,288,288,288, \
- 288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288, \
- 288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288, \
- 288,288,288,288,288,288,288,288,288,288,288,288,288,288,288,288, \
- 288,288,288,288,288,288,288,288,288,288,288,288,288,288,312,312, \
- 312,300,312,312,312,312,312,312,312,320,312,312,312,312,312,312, \
- 312,312,312,312,320,312,320,320,320,320,320,320,320,320,320,320, \
- 312,344,320,312,344,320,312,312,320,344,320,336,342,344,344,344, \
- 320,344,344,320,344,320,320,320,352,352,352,352,352,352,352,372, \
- 372,368,368,384,344,372,368,384,369,368,384,372,370,368,376,370, \
- 372,384,384,384,384,384,384,384,384,384,384,384,384,384,384,384, \
- 384,384,372,372,384,372,384,344,368,368,384,384,384,408,384,372, \
- 384,384,384,416,416,416,384,416,384,416,416,416,416,416,384,384, \
- 384,384,384,415,384,384,416,416,416,384,384,384,384,416,384,384, \
- 384,416,384,384,372,384,417,416,384,416,416,416,384,416,416,416, \
- 416,416,416,384,384,416,416,384,384,384,416,416,417,416,416,416, \
- 416,416,416,417,417,417,416,418,416,415,416,416,416,416,416,415, \
- 416,417,417,416,417,416,415,416,416,416,416,417,416,413,416,416, \
- 416,416,416,416,416,416,416,417,416,416,418,416,415,416,416,417, \
- 416,416,416,416,416,416,416,416,416,416,417,416,416,416,416,415, \
- 416,416,417,416,416,417,416,416,416,416,416,416,416,416,417,419, \
- 419,420,420,444,420,420,432,512,468,504,456,456,456,456,514,512, \
- 512,512,456,504,456,444,512,512,504,512,513,512,512,504,512,512, \
- 512,512,513,513,512,512,513,504,512,512,513,512,512,504,512,512, \
- 513,514,513,512,512,513,513,504,512,504,512,512,512,513,512,512, \
- 510,512,512,512,512,512,512,512,513,512,515,512,513,512,504,512, \
- 512,514,516,512,512,512,512,512,512,513,512,512,513,513,513,514, \
- 515,512,512,504,564,512,512,512,512,512,512,576,561,512,576,564, \
- 576,512,512,576,512,512,512,515,564,512,513,576,564,564,576,512, \
- 512,510,512,564,576,576,512,576,576,514,576,576,512,564,576,576, \
- 512,513,576,512,512,513,514,512,512,576,576,512,513,576,513,515, \
- 552,552,576,512,512,512,564,513,564,576,576,576,564,576,564,576, \
- 564,512,576,564,564,576,576,564,564,576,564,576,564,576,551,576 \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*32-47*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,41, /*64-79*/ \
+ 42,42,0,0,48,48,0,46,48,48,50,49,49,48,49,50, /*80-95*/ \
+ 51,0,0,0,79,52,0,0,0,54,57,68,60,58,0,59, /*96-111*/ \
+ 58,59,62,0,60,66,68,66,68,68,68,66,66,68,68,68, /*112-127*/ \
+ 76,68,76,68,68,69,75,76,70,79,73,84,76,75,78,76, /*128-143*/ \
+ 81,84,80,80,84,81,80,84,84,80,80,81,80,84,84,85, /*144-159*/ \
+ 84,83,104,96,84,96,96,92,96,96,96,132,104,100,98,104, /*160-175*/ \
+ 104,104,104,104,104,104,104,104,104,104,104,104,104,104,100,100, /*176-191*/ \
+ 104,104,112,104,100,120,120,104,104,119,112,112,118,104,120,120, /*192-207*/ \
+ 112,120,118,118,119,120,113,114,119,112,128,136,112,120,116,122, /*208-223*/ \
+ 118,132,120,119,120,136,118,120,119,120,128,136,128,136,132,136, /*224-239*/ \
+ 132,128,136,135,136,132,128,136,130,136,136,132,135,135,136,132, /*240-255*/ \
+ 132,136,136,134,135,135,136,149,135,136,135,136,136,136,138,140, /*256-271*/ \
+ 156,150,156,148,150,149,161,150,148,162,160,148,156,160,150,152, /*272-287*/ \
+ 157,150,168,160,160,150,150,152,160,160,168,168,168,156,156,160, /*288-303*/ \
+ 156,161,160,168,160,160,160,162,168,160,160,167,168,166,174,173, /*304-319*/ \
+ 167,168,198,192,168,168,174,192,168,192,168,168,168,168,184,192, /*320-335*/ \
+ 192,194,208,193,192,192,192,192,208,192,192,208,197,206,204,208, /*336-351*/ \
+ 192,207,200,204,204,191,192,208,204,208,192,208,208,208,208,209, /*352-367*/ \
+ 208,208,208,208,208,216,192,208,192,209,192,198,208,206,204,208, /*368-383*/ \
+ 208,208,208,207,208,208,216,208,208,216,208,208,208,208,206,208, /*384-399*/ \
+ 208,206,207,222,206,208,208,208,208,209,208,207,240,208,209,223, /*400-415*/ \
+ 240,233,240,220,234,216,240,240,219,233,240,222,222,224,224,232, /*416-431*/ \
+ 240,240,239,240,236,240,240,240,240,241,240,238,240,240,240,240, /*432-447*/ \
+ 300,240,245,239,240,240,233,240,236,240,240,240,240,240,241,236, /*448-463*/ \
+ 240,426,240,240,240,256,240,240,240,240,239,240,270,272,241,241, /*464-479*/ \
+ 256,246,245,256,246,245,257,272,246,256,256,272,264,272,272,268, /*480-495*/ \
+ 256,256,272,255,272,264,256,270,270,272,272,272,269,256,304,272, /*496-511*/ \
+ 268,300,306,300,272,304,300,299,264,300,294,270,270,490,272,300, /*512-527*/ \
+ 272,272,272,300,306,300,301,298,304,300,300,312,298,304,304,306, /*528-543*/ \
+ 300,299,306,312,336,312,300,298,298,300,300,318,288,299,282,305, /*544-559*/ \
+ 304,298,304,305,299,303,300,300,300,304,304,312,312,306,306,299, /*560-575*/ \
+ 304,312,312,312,300,312,324,304,529,299,300,318,306,312,336,304, /*576-591*/ \
+ 300,300,300,306,312,312,312,332,305,336,336,384,336,312,324,312, /*592-607*/ \
+ 316,312,348,312,312,328,312,353,336,320,336,336,336,318,336,332, /*608-623*/ \
+ 335,348,336,336,328,324,335,336,336,322,335,336,336,336,324,328, /*624-639*/ \
+ 384,384,384,336,384,336,336,336,336,336,336,384,336,342,335,384, /*640-655*/ \
+ 336,336,384,335,384,336,336,383,335,408,335,408,336,384,408,384, /*656-671*/ \
+ 408,408,407,384,384,408,416,384,384,408,408,384,408,408,408,408, /*672-687*/ \
+ 408,408,384,408,408,408,408,408,416,408,416,408,408,408,408,416, /*688-703*/ \
+ 408,384,408,416,416,408,408,408,408,408,408,407,408,408,416,384, /*704-719*/ \
+ 408,407,408,408,384,383,406,407,407,416,384,415,416,408,416,408, /*720-735*/ \
+ 407,416,408,408,416,406,384,384,408,408,408,406,408,407,408,408, /*736-751*/ \
+ 384,408,408,408,408,416,408,408,408,416,415,408,384,408,415,408, /*752-767*/ \
+ 408,408,408,405,408,408,408,408,408,408,408,408,416,416,416,408, /*768-783*/ \
+ 416,416,406,416,408,414,407,408,407,407,414,408,408,408,416,408, /*784-799*/ \
+ 415,416,416,408,408,416,415,416,416,416,416,416,416,416,448,415, /*800-815*/ \
+ 416,472,416,416,415,416,415,480,416,416,416,480,440,416,480,448, /*816-831*/ \
+ 440,464,440,466,477,424,472,432,470,472,456,460,464,480,448,480, /*832-847*/ \
+ 440,480,480,480,472,464,480,464,480,472,467,480,480,479,480,480, /*848-863*/ \
+ 478,480,472,472,480,480,479,480,472,480,480,470,480,480,480,472, /*864-879*/ \
+ 480,468,464,470,472,472,476,480,480,472,478,478,480,480,877,472, /*880-895*/ \
+ 480,479,480,480,512,480,479,480,756,466,472,480,466,464,478,466, /*896-911*/ \
+ 480,480,472,480,462,480,472,480,478,478,480,480,479,480,480,480, /*912-927*/ \
+ 488,480,478,472,480,480,488,480,480,480,480,472,480,480,480,536, /*928-943*/ \
+ 477,512,480,480,480,536,480,477,479,480,480,792,511,512,512,512, /*944-959*/ \
+ 493,512,501,512,527,512,528,536,488,536,512,536,512,512,535,528, /*960-975*/ \
+ 508,534,512,512,512,512,544,512,532,512,528,534,536,536,544,536, /*976-991*/ \
+ 535,540,528,528,610,536,528,528,609,612,608,536,544,612,544,536, /*992-1007*/ \
+ 540,536,612,536,607,536,612,610,610,612,612,612,612,544,612,611 /*1008-1023*/ \
-#define MPFR_MUL_THRESHOLD 1 /* limbs */
-#define MPFR_SQR_THRESHOLD 5 /* limbs */
-#define MPFR_DIV_THRESHOLD 17 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 966 /* bits */
-#define MPFR_EXP_THRESHOLD 10924 /* bits */
-#define MPFR_SINCOS_THRESHOLD 36978 /* bits */
-#define MPFR_AI_THRESHOLD1 -12626 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 1377
-#define MPFR_AI_THRESHOLD3 24323
-/* Tuneup completed successfully, took 2598 seconds */
+#define MPFR_MUL_THRESHOLD 9 /* limbs */
+#define MPFR_SQR_THRESHOLD 14 /* limbs */
+#define MPFR_DIV_THRESHOLD 3 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 580 /* bits */
+#define MPFR_EXP_THRESHOLD 10480 /* bits */
+#define MPFR_SINCOS_THRESHOLD 22904 /* bits */
+#define MPFR_AI_THRESHOLD1 -12474 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 1158
+#define MPFR_AI_THRESHOLD3 20165
+/* Tuneup completed successfully, took 571 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/print_raw.c b/Build/source/libs/mpfr/mpfr-src/src/print_raw.c
index 9ff9ef64f33..f49247e8105 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/print_raw.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/print_raw.c
@@ -2,7 +2,7 @@
of a significand of floating-point number (for the tests and
debugging purpose)
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/print_rnd_mode.c b/Build/source/libs/mpfr/mpfr-src/src/print_rnd_mode.c
index 21de96d67f8..fd36ab83745 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/print_rnd_mode.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/print_rnd_mode.c
@@ -1,6 +1,6 @@
/* mpfr_print_rnd_mode -- convert a given rounding mode to a string
-Copyright 1999, 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,6 +22,9 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include "mpfr-impl.h"
+/* WARNING! When adding a new rounding mode, do not forget to update the
+ description of this mpfr_print_rnd_mode function in the manual. */
+
const char *
mpfr_print_rnd_mode (mpfr_rnd_t rnd_mode)
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/printf.c b/Build/source/libs/mpfr/mpfr-src/src/printf.c
index 4561604d18f..7b5f0620c61 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/printf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/printf.c
@@ -1,6 +1,6 @@
/* Formatted output functions (printf functions family).
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -30,17 +30,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include <stdarg.h>
-#ifndef HAVE_VA_COPY
-# ifdef HAVE___VA_COPY
-# define va_copy(dst,src) __va_copy(dst, src)
-# else
-/* autoconf manual advocates this fallback.
- This is also the solution chosen by gmp */
-# define va_copy(dst,src) \
- do { memcpy(&(dst), &(src), sizeof(va_list)); } while (0)
-# endif /* HAVE___VA_COPY */
-#endif /* HAVE_VA_COPY */
-
#include "mpfr-impl.h"
#ifdef _MPFR_H_HAVE_FILE
diff --git a/Build/source/libs/mpfr/mpfr-src/src/random_deviate.c b/Build/source/libs/mpfr/mpfr-src/src/random_deviate.c
index 29bd83d2080..72531e774fa 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/random_deviate.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/random_deviate.c
@@ -1,6 +1,6 @@
/* random_deviate routines for mpfr_erandom and mpfr_nrandom.
-Copyright 2013-2019 Free Software Foundation, Inc.
+Copyright 2013-2020 Free Software Foundation, Inc.
Contributed by Charles Karney <charles@karney.com>, SRI International.
This file is part of the GNU MPFR Library.
@@ -110,7 +110,7 @@ static void
random_deviate_generate (mpfr_random_deviate_t x, mpfr_random_size_t k,
gmp_randstate_t r, mpz_t t)
{
- /* Various compile time checks on mprf_random_deviate_t */
+ /* Various compile time checks on mpfr_random_deviate_t */
/* Check that the h field of a mpfr_random_deviate_t can hold W bits */
MPFR_STAT_STATIC_ASSERT (W > 0 && W <= sizeof (unsigned long) * CHAR_BIT);
@@ -124,7 +124,7 @@ random_deviate_generate (mpfr_random_deviate_t x, mpfr_random_size_t k,
sizeof (mpfr_random_size_t) >=
sizeof (mpfr_uprec_t));
- /* Finally, at runtime, check that k is not too big. e is set to ceil(k/W)*W
+ /* Finally, at run time, check that k is not too big. e is set to ceil(k/W)*W
* and we require that this allows x->e + 1 in random_deviate_leading_bit to
* be computed without overflow. */
MPFR_ASSERTN (k <= (mpfr_random_size_t)(-((int) W + 1)));
@@ -172,24 +172,29 @@ random_deviate_generate (mpfr_random_deviate_t x, mpfr_random_size_t k,
}
}
+#ifndef MPFR_LONG_WITHIN_LIMB /* a long does not fit in a mp_limb_t */
/*
- * return index [-1..127] of highest bit set. Return -1 if x = 0, 2 if x = 4,
- * etc. (From Algorithms for programmers by Joerg Arndt.)
+ * return index [0..127] of highest bit set. Return 0 if x = 1, 2 if x = 4,
+ * etc. Assume x > 0. (From Algorithms for programmers by Joerg Arndt.)
*/
static int
-highest_bit_idx_alt (unsigned long x)
+highest_bit_idx (unsigned long x)
{
+ unsigned long y;
int r = 0;
- if (x == 0)
- return -1;
- MPFR_ASSERTN (sizeof (unsigned long) * CHAR_BIT <= 128);
- if (sizeof (unsigned long) * CHAR_BIT > 64)
+ MPFR_ASSERTD(x > 0);
+ MPFR_STAT_STATIC_ASSERT (sizeof (unsigned long) * CHAR_BIT <= 128);
+
+ /* A compiler with VRP (like GCC) will optimize and not generate any code
+ for the following lines if unsigned long has at most 64 values bits. */
+ y = ((x >> 16) >> 24) >> 24; /* portable x >> 64 */
+ if (y != 0)
{
- /* handle 128-bit unsigned longs avoiding compiler warnings */
- unsigned long y = x >> 16; y >>= 24; y >>= 24;
- if (y) { x = y; r += 64;}
+ x = y;
+ r += 64;
}
+
if (x & ~0xffffffffUL) { x >>= 16; x >>= 16; r +=32; }
if (x & 0xffff0000UL) { x >>= 16; r += 16; }
if (x & 0x0000ff00UL) { x >>= 8; r += 8; }
@@ -198,29 +203,23 @@ highest_bit_idx_alt (unsigned long x)
if (x & 0x00000002UL) { r += 1; }
return r;
}
-
+#else /* a long fits in a mp_limb_t */
/*
- * return index [-1..63] of highest bit set.
- * Return -1 if x = 0, 63 is if x = ~0 (for 64-bit unsigned long).
- * See highest_bit_idx_alt too.
+ * return index [0..63] of highest bit set. Assume x > 0.
+ * Return 0 if x = 1, 63 is if x = ~0 (for 64-bit unsigned long).
+ * See alternate code above too.
*/
static int
highest_bit_idx (unsigned long x)
{
- /* this test should be evaluated at compile time */
- if (sizeof (mp_limb_t) >= sizeof (unsigned long))
- {
- int cnt;
+ int cnt;
- if (x == 0)
- return -1;
- count_leading_zeros (cnt, (mp_limb_t) x);
- MPFR_ASSERTD (cnt <= GMP_NUMB_BITS - 1);
- return GMP_NUMB_BITS - 1 - cnt;
- }
- else
- return highest_bit_idx_alt (x);
+ MPFR_ASSERTD(x > 0);
+ count_leading_zeros (cnt, (mp_limb_t) x);
+ MPFR_ASSERTD (cnt <= GMP_NUMB_BITS - 1);
+ return GMP_NUMB_BITS - 1 - cnt;
}
+#endif /* MPFR_LONG_WITHIN_LIMB */
/* return position of leading bit, counting from 1 */
static mpfr_random_size_t
diff --git a/Build/source/libs/mpfr/mpfr-src/src/random_deviate.h b/Build/source/libs/mpfr/mpfr-src/src/random_deviate.h
index b98de28fd67..fe924623619 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/random_deviate.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/random_deviate.h
@@ -1,6 +1,6 @@
/* Declarations of random_deviate routines for mpfr_erandom and mpfr_nrandom.
-Copyright 2013-2019 Free Software Foundation, Inc.
+Copyright 2013-2020 Free Software Foundation, Inc.
Contributed by Charles Karney <charles@karney.com>, SRI International.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/rec_sqrt.c b/Build/source/libs/mpfr/mpfr-src/src/rec_sqrt.c
index 3e5bb571d88..a95d3caa548 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/rec_sqrt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/rec_sqrt.c
@@ -1,6 +1,6 @@
/* mpfr_rec_sqrt -- inverse square root
-Copyright 2008-2019 Free Software Foundation, Inc.
+Copyright 2008-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -165,7 +165,7 @@ mpfr_mpn_rec_sqrt (mpfr_limb_ptr x, mpfr_prec_t p,
MPFR_ASSERTD((a[an - 1] & MPFR_LIMB_HIGHBIT) != 0);
/* We should have enough bits in one limb and GMP_NUMB_BITS should be even.
Since that does not depend on MPFR, we always check this. */
- MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS >= 12 && (GMP_NUMB_BITS & 1) == 0);
+ MPFR_STAT_STATIC_ASSERT ((GMP_NUMB_BITS & 1) == 0);
/* {a, an} and {x, n} should not overlap */
MPFR_ASSERTD((a + an <= x) || (x + n <= a));
MPFR_ASSERTD(p >= 11);
@@ -179,15 +179,34 @@ mpfr_mpn_rec_sqrt (mpfr_limb_ptr x, mpfr_prec_t p,
if (p == 11) /* should happen only from recursive calls */
{
unsigned long i, ab, ac;
- mp_limb_t t;
+ unsigned int t;
/* take the 12+as most significant bits of A */
+#if GMP_NUMB_BITS >= 16
i = a[an - 1] >> (GMP_NUMB_BITS - (12 + as));
+#else
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 8);
+ {
+ unsigned int a12 = a[an - 1] << 8;
+ if (an >= 2)
+ a12 |= a[an - 2];
+ MPFR_ASSERTN(GMP_NUMB_BITS >= 4 + as);
+ i = a12 >> (GMP_NUMB_BITS - (4 + as));
+ }
+#endif
/* if one wants faithful rounding for p=11, replace #if 0 by #if 1 */
ab = i >> 4;
ac = (ab & 0x3F0) | (i & 0x0F);
- t = (mp_limb_t) T1[ab - 0x80] + (mp_limb_t) T2[ac - 0x80];
- x[0] = t << (GMP_NUMB_BITS - p);
+ t = T1[ab - 0x80] + T2[ac - 0x80]; /* fits on 16 bits */
+#if GMP_NUMB_BITS >= 16
+ /* x has only one limb */
+ x[0] = (mp_limb_t) t << (GMP_NUMB_BITS - p);
+#else
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 8);
+ MPFR_ASSERTD (1024 <= t && t <= 2047);
+ x[1] = t >> 3; /* 128 <= x[1] <= 255 */
+ x[0] = MPFR_LIMB_LSHIFT(t, 5);
+#endif
}
else /* p >= 12 */
{
@@ -225,7 +244,7 @@ mpfr_mpn_rec_sqrt (mpfr_limb_ptr x, mpfr_prec_t p,
/* we need h+1+as bits of a */
ahn = LIMB_SIZE(h + 1 + as); /* number of high limbs of A
- needed for the recursive call*/
+ needed for the recursive call */
if (MPFR_UNLIKELY(ahn > an))
ahn = an;
mpfr_mpn_rec_sqrt (x + ln, h, a + an - ahn, ahn * GMP_NUMB_BITS, as);
@@ -373,9 +392,10 @@ mpfr_mpn_rec_sqrt (mpfr_limb_ptr x, mpfr_prec_t p,
thus we round u to nearest at bit pl-1 of u[0] */
if (pl > 0)
{
- cu = mpn_add_1 (u, u, un, u[0] & (MPFR_LIMB_ONE << (pl - 1)));
+ cu = mpn_add_1 (u, u, un,
+ u[0] & MPFR_LIMB_LSHIFT(MPFR_LIMB_ONE, pl - 1));
/* mask bits 0..pl-1 of u[0] */
- u[0] &= ~MPFR_LIMB_MASK(pl);
+ u[0] &= MPFR_LIMB(~MPFR_LIMB_MASK(pl));
}
else /* round bit is in u[-1] */
cu = mpn_add_1 (u, u, un, u[-1] >> (GMP_NUMB_BITS - 1));
diff --git a/Build/source/libs/mpfr/mpfr-src/src/reldiff.c b/Build/source/libs/mpfr/mpfr-src/src/reldiff.c
index 573d3da74d5..9afd01608de 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/reldiff.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/reldiff.c
@@ -1,6 +1,6 @@
/* mpfr_reldiff -- compute relative difference of two floating-point numbers.
-Copyright 2000-2001, 2004-2019 Free Software Foundation, Inc.
+Copyright 2000-2001, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/rem1.c b/Build/source/libs/mpfr/mpfr-src/src/rem1.c
index 7c3c5591f18..9e75e428798 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/rem1.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/rem1.c
@@ -2,7 +2,7 @@
mpfr_fmod -- compute the floating-point remainder of x/y
mpfr_remquo and mpfr_remainder -- argument reduction functions
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,7 +22,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-# include "mpfr-impl.h"
+#include "mpfr-impl.h"
/* we return as many bits as we can, keeping just one bit for the sign */
# define WANTED_BITS (sizeof(long) * CHAR_BIT - 1)
@@ -100,9 +100,11 @@ mpfr_rem1 (mpfr_ptr rem, long *quo, mpfr_rnd_t rnd_q,
mpz_abs (my, my);
q_is_odd = 0;
- /* divide my by 2^k if possible to make operations mod my easier */
+ /* Divide my by 2^k if possible to make operations mod my easier.
+ Since my comes from a regular MPFR number, due to the constraints on the
+ exponent and the precision, there can be no integer overflow below. */
{
- unsigned long k = mpz_scan1 (my, 0);
+ mpfr_exp_t k = mpz_scan1 (my, 0);
ey += k;
mpz_fdiv_q_2exp (my, my, k);
}
@@ -157,8 +159,18 @@ mpfr_rem1 (mpfr_ptr rem, long *quo, mpfr_rnd_t rnd_q,
which is obtained by dividing by 2Y. */
mpz_mul_2exp (my, my, 1); /* 2Y */
- mpz_set_ui (r, 2);
- mpz_powm_ui (r, r, ex - ey, my); /* 2^(ex-ey) mod my */
+ /* Warning: up to GMP 6.2.0, mpz_powm_ui is not optimized when BASE^EXP
+ has about the same size as MOD, in which case it should first compute
+ BASE^EXP exactly, then reduce it modulo MOD:
+ https://gmplib.org/list-archives/gmp-bugs/2020-February/004736.html
+ Thus when 2^(ex-ey) is less than my^3, we use this algorithm. */
+ if (ex - ey > 3 * mpz_sizeinbase (my, 2))
+ {
+ mpz_set_ui (r, 2);
+ mpz_powm_ui (r, r, ex - ey, my); /* 2^(ex-ey) mod my */
+ }
+ else
+ mpz_ui_pow_ui (r, 2, ex - ey);
mpz_mul (r, r, mx);
mpz_mod (r, r, my);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/rint.c b/Build/source/libs/mpfr/mpfr-src/src/rint.c
index 8e4ae2827d5..199533568a0 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/rint.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/rint.c
@@ -1,6 +1,6 @@
/* mpfr_rint -- Round to an integer.
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -136,7 +136,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
uj = un - ui; /* lowest limb of the integer part */
idiff = exp % GMP_NUMB_BITS; /* #int-part bits in up[uj] or 0 */
- uflags = idiff == 0 || (up[uj] << idiff) == 0 ? 0 : 2;
+ uflags = idiff == 0 || MPFR_LIMB_LSHIFT(up[uj],idiff) == 0 ? 0 : 2;
if (uflags == 0)
while (uj > 0)
if (up[--uj] != 0)
@@ -191,7 +191,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] << (GMP_NUMB_BITS - sh) != 0)
+ if (sh != 0 && MPFR_LIMB_LSHIFT(rp[0], GMP_NUMB_BITS - sh) != 0)
uflags = 1; /* u is not representable in r */
else
{
@@ -288,7 +288,7 @@ mpfr_rint (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
MPFR_RET(0);
MPFR_ASSERTD (rnd_away >= 0); /* rounding direction is defined */
- if (rnd_away && mpn_add_1(rp, rp, rn, MPFR_LIMB_ONE << sh))
+ if (rnd_away && mpn_add_1 (rp, rp, rn, MPFR_LIMB_ONE << sh))
{
if (exp == __gmpfr_emax)
return mpfr_overflow (r, rnd_mode, sign) >= 0 ?
diff --git a/Build/source/libs/mpfr/mpfr-src/src/rndna.c b/Build/source/libs/mpfr/mpfr-src/src/rndna.c
index 54c95914bb1..23997bf0ee7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/rndna.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/rndna.c
@@ -1,6 +1,6 @@
/* mpfr_round_nearest_away -- round to nearest away
-Copyright 2012-2019 Free Software Foundation, Inc.
+Copyright 2012-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -137,8 +137,14 @@ mpfr_round_nearest_away_end (mpfr_t rop, int inex)
mpfr_prec_t n;
MPFR_SAVE_EXPO_DECL (expo);
- /* Get back the hidden context. */
- ext = ((mpfr_size_limb_extended_t *) MPFR_MANT(rop)) - MANTISSA;
+ /* Get back the hidden context.
+ Note: The cast to void * prevents the compiler from emitting a warning
+ (or error), such as:
+ cast increases required alignment of target type
+ with the -Wcast-align GCC option. Correct alignment is a consequence
+ of the code that built rop.
+ */
+ ext = ((mpfr_size_limb_extended_t *) (void *) MPFR_MANT(rop)) - MANTISSA;
/* Create tmp with the result of the function. */
tmp[0] = rop[0];
diff --git a/Build/source/libs/mpfr/mpfr-src/src/root.c b/Build/source/libs/mpfr/mpfr-src/src/root.c
index f68eabc0fc1..a8bd7d04eed 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/root.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/root.c
@@ -1,6 +1,6 @@
/* mpfr_root -- kth root.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -161,7 +161,7 @@ mpfr_rootn_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long k, mpfr_rnd_t rnd_mode)
sh = tmp - n;
if (sh > 0) /* we have to flush to 0 the last sh bits from m */
{
- inexact = inexact || ((mpfr_exp_t) mpz_scan1 (m, 0) < sh);
+ inexact = inexact || (mpz_scan1 (m, 0) < sh);
mpz_fdiv_q_2exp (m, m, sh);
e += k * sh;
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/round_near_x.c b/Build/source/libs/mpfr/mpfr-src/src/round_near_x.c
index 9c87e6488e9..2a0a5330781 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/round_near_x.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/round_near_x.c
@@ -1,6 +1,6 @@
/* mpfr_round_near_x -- Round a floating point number nears another one.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/round_p.c b/Build/source/libs/mpfr/mpfr-src/src/round_p.c
index df3fc0d4ebf..3b2426cd598 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/round_p.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/round_p.c
@@ -1,6 +1,6 @@
/* mpfr_round_p -- check if an approximation is roundable.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -48,7 +48,9 @@ mpfr_round_p (mp_limb_t *bp, mp_size_t bn, mpfr_exp_t err0, mpfr_prec_t prec)
fprintf (stderr, "mpfr_round_p(%d) != mpfr_can_round(%d)!\n"
"bn = %lu, err0 = %ld, prec = %lu\nbp = ", i1, i2,
(unsigned long) bn, (long) err0, (unsigned long) prec);
+#ifndef MPFR_USE_MINI_GMP
gmp_fprintf (stderr, "%NX\n", bp, bn);
+#endif
MPFR_ASSERTN (0);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/round_prec.c b/Build/source/libs/mpfr/mpfr-src/src/round_prec.c
index 436adaff718..f03fbac7be7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/round_prec.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/round_prec.c
@@ -1,7 +1,7 @@
/* mpfr_round_raw_generic, mpfr_round_raw2, mpfr_round_raw, mpfr_prec_round,
mpfr_can_round, mpfr_can_round_raw -- various rounding functions
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -28,6 +28,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define use_inexp 1
#include "round_raw_generic.c"
+/* mpfr_round_raw_2 is called from mpfr_round_raw2 */
#define mpfr_round_raw_generic mpfr_round_raw_2
#define flag 1
#define use_inexp 0
@@ -194,20 +195,42 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err,
MPFR_ASSERT_SIGN(neg);
neg = MPFR_IS_NEG_SIGN(neg);
-
- /* Transform RNDD and RNDU to Zero / Away */
MPFR_ASSERTD (neg == 0 || neg == 1);
- /* transform RNDF to RNDN */
+
+ /* For rnd1 and rnd2, transform RNDF / RNDD / RNDU to RNDN / RNDZ / RNDA
+ (with a special case for rnd1 directed rounding, rnd2 = RNDF). */
+
if (rnd1 == MPFR_RNDF)
- rnd1 = MPFR_RNDN;
- if (rnd1 != MPFR_RNDN)
+ rnd1 = MPFR_RNDN; /* transform RNDF to RNDN */
+ else if (rnd1 != MPFR_RNDN)
rnd1 = MPFR_IS_LIKE_RNDZ(rnd1, neg) ? MPFR_RNDZ : MPFR_RNDA;
+
+ MPFR_ASSERTD (rnd1 == MPFR_RNDN ||
+ rnd1 == MPFR_RNDZ ||
+ rnd1 == MPFR_RNDA);
+
if (rnd2 == MPFR_RNDF)
- rnd2 = (rnd1 == MPFR_RNDN) ? MPFR_RNDN :
- MPFR_IS_LIKE_RNDZ(rnd2, neg) ? MPFR_RNDA : MPFR_RNDZ;
- if (rnd2 != MPFR_RNDN)
+ {
+ if (rnd1 == MPFR_RNDN)
+ rnd2 = MPFR_RNDN;
+ else
+ {
+ rnd2 = MPFR_IS_LIKE_RNDZ(rnd1, neg) ? MPFR_RNDA : MPFR_RNDZ;
+ /* Warning: in this case (rnd1 directed rounding, rnd2 = RNDF),
+ the specification of mpfr_can_round says that we should
+ return non-zero (i.e., we can round) when {bp, bn} is
+ exactly representable in precision prec. */
+ if (mpfr_round_raw2 (bp, bn, neg, MPFR_RNDA, prec) == 0)
+ return 1;
+ }
+ }
+ else if (rnd2 != MPFR_RNDN)
rnd2 = MPFR_IS_LIKE_RNDZ(rnd2, neg) ? MPFR_RNDZ : MPFR_RNDA;
+ MPFR_ASSERTD (rnd2 == MPFR_RNDN ||
+ rnd2 == MPFR_RNDZ ||
+ rnd2 == MPFR_RNDA);
+
/* For err < prec (+1 for rnd1=RNDN), we can never round correctly, since
the error is at least 2*ulp(b) >= ulp(round(b)).
However for err = prec (+1 for rnd1=RNDN), we can round correctly in some
@@ -324,24 +347,8 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err,
}
return 1;
}
- else if (rnd1 == rnd2)
- {
- if (rnd1 == MPFR_RNDN && prec < (mpfr_prec_t) bn * GMP_NUMB_BITS)
- {
- /* then rnd2 = RNDN, and for prec = bn * GMP_NUMB_BITS we cannot
- have b the middle of two representable numbers */
- k1 = MPFR_PREC2LIMBS (prec + 1);
- MPFR_UNSIGNED_MINUS_MODULO(s1, prec + 1);
- if (((bp[bn - k1] >> s1) & 1) &&
- mpfr_round_raw2 (bp, bn, neg, MPFR_RNDA, prec + 1) == 0)
- /* b is representable in precision prec+1 and ends with a 1 */
- return 0;
- else
- return 1;
- }
- else
- return 1;
- }
+ else if (rnd1 == rnd2) /* cases RNDZ RNDZ or RNDA RNDA: ok */
+ return 1;
else
return mpfr_round_raw2 (bp, bn, neg, MPFR_RNDA, prec) != 0;
}
@@ -376,7 +383,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err,
k++; /* since we work with k+1 everywhere */
tmp = MPFR_TMP_LIMBS_ALLOC (tn);
if (bn > k)
- MPN_COPY (tmp, bp, bn - k);
+ MPN_COPY (tmp, bp, bn - k); /* copy low bn-k limbs of b into tmp */
MPFR_ASSERTD (k > 0);
@@ -384,7 +391,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err,
{
case MPFR_RNDZ:
/* rnd1 = Round to Zero */
- cc = (bp[bn - 1] >> s1) & 1;
+ cc = (bp[bn - 1] >> s1) & 1; /* cc is the least significant bit of b */
/* mpfr_round_raw2 returns 1 if one should add 1 at ulp(b,prec),
and 0 otherwise */
cc ^= mpfr_round_raw2 (bp, bn, neg, rnd2, prec2);
@@ -394,7 +401,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err,
cy = mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
/* propagate carry up to most significant limb */
for (tn = 0; tn + 1 < k1 && cy != 0; tn ++)
- cy = ~bp[bn + tn] == 0;
+ cy = bp[bn + tn] == MPFR_LIMB_MAX;
if (cy == 0 && err == prec)
{
res = 0;
@@ -424,7 +431,7 @@ mpfr_can_round_raw (const mp_limb_t *bp, mp_size_t bn, int neg, mpfr_exp_t err,
cy = mpn_add_1 (tmp + bn - k, bp + bn - k, k, MPFR_LIMB_ONE << s);
/* propagate carry up to most significant limb */
for (tn = 0; tn + 1 < k1 && cy != 0; tn ++)
- cy = ~bp[bn + tn] == 0;
+ cy = bp[bn + tn] == MPFR_LIMB_MAX;
cc = (tmp[bn - 1] >> s1) & 1; /* gives 0 when cc=1 */
cc ^= mpfr_round_raw2 (tmp, bn, neg, rnd2, prec2);
/* cc is the new value of bit s1 in bp[bn-1]+eps after rounding 'rnd2' */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/round_raw_generic.c b/Build/source/libs/mpfr/mpfr-src/src/round_raw_generic.c
index 1c87ad24409..ee83d65b7fb 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/round_raw_generic.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/round_raw_generic.c
@@ -1,6 +1,6 @@
/* mpfr_round_raw_generic -- Generic rounding function
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -54,6 +54,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
* may change in the future without notice.
*/
+#if !(flag == 0 || flag == 1)
+#error "flag must be 0 or 1"
+#endif
+
int
mpfr_round_raw_generic(
#if flag == 0
@@ -72,20 +76,21 @@ mpfr_round_raw_generic(
#if flag == 0
int carry;
#endif
-#if use_inexp == 0
- int *inexp;
-#endif
- if (use_inexp)
- MPFR_ASSERTD(inexp != ((int*) 0));
- MPFR_ASSERTD(neg == 0 || neg == 1);
+#if use_inexp != 0
+ MPFR_ASSERTD (inexp != ((int*) 0));
+#endif
+ MPFR_ASSERTD (neg == 0 || neg == 1);
+#if flag == 1
+ /* rnd_mode = RNDF is only possible for flag = 0. */
+ MPFR_ASSERTD (rnd_mode != MPFR_RNDF);
+#endif
if (rnd_mode == MPFR_RNDF)
{
- if (use_inexp)
- *inexp = 0; /* make sure it has a valid value */
- if (flag)
- return 0;
+#if use_inexp != 0
+ *inexp = 0; /* make sure it has a valid value */
+#endif
rnd_mode = MPFR_RNDZ; /* faster */
new_use_inexp = 0;
}
@@ -108,8 +113,9 @@ mpfr_round_raw_generic(
nw++;
MPFR_ASSERTD(nw >= 1);
MPFR_ASSERTD(nw >= xsize);
- if (use_inexp)
- *inexp = 0;
+#if use_inexp != 0
+ *inexp = 0;
+#endif
#if flag == 0
mpn_copyd (yp + (nw - xsize), xp, xsize);
MPN_ZERO(yp, nw - xsize);
@@ -154,8 +160,9 @@ mpfr_round_raw_generic(
sb = xp[xsize - nw] & (himask ^ (himask << 1));
if (sb == 0)
{
- if (use_inexp)
- *inexp = 2*MPFR_EVEN_INEX*neg-MPFR_EVEN_INEX;
+#if use_inexp != 0
+ *inexp = 2 * MPFR_EVEN_INEX * neg - MPFR_EVEN_INEX;
+#endif
/* ((neg!=0)^(sb!=0)) ? MPFR_EVEN_INEX : -MPFR_EVEN_INEX */
/* since neg = 0 or 1 and sb = 0 */
#if flag == 0
@@ -168,8 +175,9 @@ mpfr_round_raw_generic(
{
away_addone_ulp:
/* sb != 0 && rnd_mode == MPFR_RNDN */
- if (use_inexp)
- *inexp = MPFR_EVEN_INEX-2*MPFR_EVEN_INEX*neg;
+#if use_inexp != 0
+ *inexp = MPFR_EVEN_INEX - 2 * MPFR_EVEN_INEX * neg;
+#endif
/* ((neg!=0)^(sb!=0)) ? MPFR_EVEN_INEX : -MPFR_EVEN_INEX */
/* since neg = 0 or 1 and sb != 0 */
goto rnd_RNDN_add_one_ulp;
@@ -177,8 +185,9 @@ mpfr_round_raw_generic(
}
else /* sb != 0 && rnd_mode == MPFR_RNDN */
{
- if (use_inexp)
- *inexp = 1-2*neg; /* neg == 0 ? 1 : -1 */
+#if use_inexp != 0
+ *inexp = 1 - 2 * neg; /* neg == 0 ? 1 : -1 */
+#endif
rnd_RNDN_add_one_ulp:
#if flag == 1
return 1; /* sb != 0 && rnd_mode != MPFR_RNDZ */
@@ -197,12 +206,13 @@ mpfr_round_raw_generic(
{
/* rnd_mode == MPFR_RNDZ */
rnd_RNDZ:
- while (MPFR_UNLIKELY(sb == 0) && k > 0)
+ while (MPFR_UNLIKELY (sb == 0) && k > 0)
sb = xp[--k];
- if (use_inexp)
- /* rnd_mode == MPFR_RNDZ and neg = 0 or 1 */
- /* ((neg != 0) ^ (rnd_mode != MPFR_RNDZ)) ? 1 : -1 */
- *inexp = MPFR_UNLIKELY(sb == 0) ? 0 : (2*neg-1);
+#if use_inexp != 0
+ /* rnd_mode == MPFR_RNDZ and neg = 0 or 1 */
+ /* ((neg != 0) ^ (rnd_mode != MPFR_RNDZ)) ? 1 : -1 */
+ *inexp = MPFR_UNLIKELY (sb == 0) ? 0 : 2 * neg - 1;
+#endif
#if flag == 0
mpn_copyi (yp, xp + xsize - nw, nw);
yp[0] &= himask;
@@ -212,14 +222,15 @@ mpfr_round_raw_generic(
else
{
/* Rounding away from zero */
- while (MPFR_UNLIKELY(sb == 0) && k > 0)
+ while (MPFR_UNLIKELY (sb == 0) && k > 0)
sb = xp[--k];
- if (MPFR_UNLIKELY(sb == 0))
+ if (MPFR_UNLIKELY (sb == 0))
{
/* sb = 0 && rnd_mode != MPFR_RNDZ */
- if (use_inexp)
- /* ((neg != 0) ^ (rnd_mode != MPFR_RNDZ)) ? 1 : -1 */
- *inexp = 0;
+#if use_inexp != 0
+ /* ((neg != 0) ^ (rnd_mode != MPFR_RNDZ)) ? 1 : -1 */
+ *inexp = 0;
+#endif
#if flag == 0
mpn_copyi (yp, xp + xsize - nw, nw);
yp[0] &= himask;
@@ -229,14 +240,15 @@ mpfr_round_raw_generic(
else
{
/* sb != 0 && rnd_mode != MPFR_RNDZ */
- if (use_inexp)
- *inexp = 1-2*neg; /* neg == 0 ? 1 : -1 */
+#if use_inexp != 0
+ *inexp = 1 - 2 * neg; /* neg == 0 ? 1 : -1 */
+#endif
#if flag == 1
return 1;
#else
carry = mpn_add_1(yp, xp + xsize - nw, nw,
rw ? MPFR_LIMB_ONE << (GMP_NUMB_BITS - rw)
- : 1);
+ : MPFR_LIMB_ONE);
yp[0] &= himask;
return carry;
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/scale2.c b/Build/source/libs/mpfr/mpfr-src/src/scale2.c
index 7b0cd9488ad..5f5528a3616 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/scale2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/scale2.c
@@ -1,6 +1,6 @@
/* mpfr_scale2 -- multiply a double float by 2^exp
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sec.c b/Build/source/libs/mpfr/mpfr-src/src/sec.c
index 6f62800b23c..851894bc204 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sec.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sec.c
@@ -1,6 +1,6 @@
/* mpfr_sec - secant function = 1/cos.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sech.c b/Build/source/libs/mpfr/mpfr-src/src/sech.c
index 9d575bfe500..a2800fae020 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sech.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sech.c
@@ -1,6 +1,6 @@
/* mpfr_sech - Hyperbolic secant function = 1/cosh.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set.c b/Build/source/libs/mpfr/mpfr-src/src/set.c
index aeca021a57f..68b172bf3bd 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set.c
@@ -1,6 +1,6 @@
/* mpfr_set -- copy of a floating-point number
-Copyright 1999, 2001-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_d.c b/Build/source/libs/mpfr/mpfr-src/src/set_d.c
index d4284311c9b..bad66a85bea 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_d.c
@@ -1,7 +1,7 @@
/* mpfr_set_d -- convert a machine double precision float to
a multiple precision floating-point number
-Copyright 1999-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -36,12 +36,9 @@ static int
extract_double (mpfr_limb_ptr rp, double d)
{
int exp;
- mp_limb_t manl;
-#if GMP_NUMB_BITS == 32
- mp_limb_t manh;
-#endif
+ mp_limb_t man[MPFR_LIMBS_PER_DOUBLE];
- /* FIXME: Generalize to handle all GMP_NUMB_BITS. */
+ /* FIXME: Generalize to handle GMP_NUMB_BITS < 16. */
MPFR_ASSERTD(!DOUBLE_ISNAN(d));
MPFR_ASSERTD(!DOUBLE_ISINF(d));
@@ -56,14 +53,29 @@ extract_double (mpfr_limb_ptr rp, double d)
exp = x.s.exp;
if (exp)
{
+ /* x.s.manh has 20 bits (in its low bits), x.s.manl has 32 bits */
#if GMP_NUMB_BITS >= 64
- manl = ((MPFR_LIMB_ONE << (GMP_NUMB_BITS - 1)) |
- ((mp_limb_t) x.s.manh << (GMP_NUMB_BITS - 21)) |
- ((mp_limb_t) x.s.manl << (GMP_NUMB_BITS - 53)));
+ man[0] = ((MPFR_LIMB_ONE << (GMP_NUMB_BITS - 1)) |
+ ((mp_limb_t) x.s.manh << (GMP_NUMB_BITS - 21)) |
+ ((mp_limb_t) x.s.manl << (GMP_NUMB_BITS - 53)));
+#elif GMP_NUMB_BITS == 32
+ man[1] = (MPFR_LIMB_ONE << 31) | (x.s.manh << 11) | (x.s.manl >> 21);
+ man[0] = x.s.manl << 11;
+#elif GMP_NUMB_BITS == 16
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 16);
+ man[3] = (MPFR_LIMB_ONE << 15) | (x.s.manh >> 5);
+ man[2] = (x.s.manh << 11) | (x.s.manl >> 21);
+ man[1] = x.s.manl >> 5;
+ man[0] = MPFR_LIMB_LSHIFT(x.s.manl,11);
#else
- MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 32);
- manh = (MPFR_LIMB_ONE << 31) | (x.s.manh << 11) | (x.s.manl >> 21);
- manl = x.s.manl << 11;
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 8);
+ man[6] = (MPFR_LIMB_ONE << 7) | (x.s.manh >> 13);
+ man[5] = (mp_limb_t) (x.s.manh >> 5);
+ man[4] = MPFR_LIMB_LSHIFT(x.s.manh, 3) | (mp_limb_t) (x.s.manl >> 29);
+ man[3] = (mp_limb_t) (x.s.manl >> 21);
+ man[2] = (mp_limb_t) (x.s.manl >> 13);
+ man[1] = (mp_limb_t) (x.s.manl >> 5);
+ man[0] = MPFR_LIMB_LSHIFT(x.s.manl,3);
#endif
exp -= 1022;
}
@@ -72,25 +84,71 @@ extract_double (mpfr_limb_ptr rp, double d)
int cnt;
exp = -1021;
#if GMP_NUMB_BITS >= 64
- manl = (((mp_limb_t) x.s.manh << (GMP_NUMB_BITS - 21)) |
- ((mp_limb_t) x.s.manl << (GMP_NUMB_BITS - 53)));
- count_leading_zeros (cnt, manl);
-#else
- MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 32);
- manh = (x.s.manh << 11) /* high 21 bits */
+ man[0] = (((mp_limb_t) x.s.manh << (GMP_NUMB_BITS - 21)) |
+ ((mp_limb_t) x.s.manl << (GMP_NUMB_BITS - 53)));
+ count_leading_zeros (cnt, man[0]);
+#elif GMP_NUMB_BITS == 32
+ man[1] = (x.s.manh << 11) /* high 21 bits */
| (x.s.manl >> 21); /* middle 11 bits */
- manl = x.s.manl << 11; /* low 21 bits */
- if (manh == 0)
+ man[0] = x.s.manl << 11; /* low 21 bits */
+ if (man[1] == 0)
+ {
+ man[1] = man[0];
+ man[0] = 0;
+ exp -= GMP_NUMB_BITS;
+ }
+ count_leading_zeros (cnt, man[1]);
+ man[1] = (man[1] << cnt) |
+ (cnt != 0 ? man[0] >> (GMP_NUMB_BITS - cnt) : 0);
+#elif GMP_NUMB_BITS == 16
+ man[3] = x.s.manh >> 5;
+ man[2] = (x.s.manh << 11) | (x.s.manl >> 21);
+ man[1] = x.s.manl >> 5;
+ man[0] = x.s.manl << 11;
+ while (man[3] == 0) /* d is assumed <> 0 */
{
- manh = manl;
- manl = 0;
+ man[3] = man[2];
+ man[2] = man[1];
+ man[1] = man[0];
+ man[0] = 0;
exp -= GMP_NUMB_BITS;
}
- count_leading_zeros (cnt, manh);
- manh = (manh << cnt) |
- (cnt != 0 ? manl >> (GMP_NUMB_BITS - cnt) : 0);
+ count_leading_zeros (cnt, man[3]);
+ if (cnt)
+ {
+ man[3] = (man[3] << cnt) | (man[2] >> (GMP_NUMB_BITS - cnt));
+ man[2] = (man[2] << cnt) | (man[1] >> (GMP_NUMB_BITS - cnt));
+ man[1] = (man[1] << cnt) | (man[0] >> (GMP_NUMB_BITS - cnt));
+ }
+#else
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 8);
+ man[6] = x.s.manh >> 13;
+ man[5] = x.s.manh >> 5;
+ man[4] = (x.s.manh << 3) | (x.s.manl >> 29);
+ man[3] = x.s.manl >> 21;
+ man[2] = x.s.manl >> 13;
+ man[1] = x.s.manl >> 5;
+ man[0] = x.s.manl << 3;
+ while (man[6] == 0) /* d is assumed <> 0 */
+ {
+ man[6] = man[5];
+ man[5] = man[4];
+ man[4] = man[3];
+ man[3] = man[2];
+ man[2] = man[1];
+ man[1] = man[0];
+ man[0] = 0;
+ exp -= GMP_NUMB_BITS;
+ }
+ count_leading_zeros (cnt, man[6]);
+ if (cnt)
+ {
+ int i;
+ for (i = 6; i > 0; i--)
+ man[i] = (man[i] << cnt) | (man[i-1] >> (GMP_NUMB_BITS - cnt));
+ }
#endif
- manl <<= cnt;
+ man[0] <<= cnt;
exp -= cnt;
}
}
@@ -131,26 +189,46 @@ extract_double (mpfr_limb_ptr rp, double d)
d *= MP_BASE_AS_DOUBLE;
#if GMP_NUMB_BITS >= 64
#ifndef __clang__
- manl = d;
+ man[0] = d;
#else
/* clang produces an invalid exception when d >= 2^63,
- see https://bugs.llvm.org//show_bug.cgi?id=17686.
+ see <https://bugs.llvm.org/show_bug.cgi?id=17686>.
Since this is always the case, here, we use the following patch. */
MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 64);
- manl = 0x8000000000000000 + (mp_limb_t) (d - 0x8000000000000000);
+ man[0] = 0x8000000000000000 + (mp_limb_t) (d - 0x8000000000000000);
#endif /* __clang__ */
+#elif GMP_NUMB_BITS == 32
+ man[1] = (mp_limb_t) d;
+ man[0] = (mp_limb_t) ((d - man[1]) * MP_BASE_AS_DOUBLE);
#else
- MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 32);
- manh = (mp_limb_t) d;
- manl = (mp_limb_t) ((d - manh) * MP_BASE_AS_DOUBLE);
+ MPFR_STAT_STATIC_ASSERT (GMP_NUMB_BITS == 16);
+ {
+ double r = d;
+ man[3] = (mp_limb_t) r;
+ r = (r - man[3]) * MP_BASE_AS_DOUBLE;
+ man[2] = (mp_limb_t) r;
+ r = (r - man[2]) * MP_BASE_AS_DOUBLE;
+ man[1] = (mp_limb_t) r;
+ r = (r - man[1]) * MP_BASE_AS_DOUBLE;
+ man[0] = (mp_limb_t) r;
+ }
#endif
}
#endif /* _MPFR_IEEE_FLOATS */
- rp[0] = manl;
-#if GMP_NUMB_BITS == 32
- rp[1] = manh;
+ rp[0] = man[0];
+#if GMP_NUMB_BITS <= 32
+ rp[1] = man[1];
+#endif
+#if GMP_NUMB_BITS <= 16
+ rp[2] = man[2];
+ rp[3] = man[3];
+#endif
+#if GMP_NUMB_BITS <= 8
+ rp[4] = man[4];
+ rp[5] = man[5];
+ rp[6] = man[6];
#endif
MPFR_ASSERTD((rp[MPFR_LIMBS_PER_DOUBLE - 1] & MPFR_LIMB_HIGHBIT) != 0);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_d128.c b/Build/source/libs/mpfr/mpfr-src/src/set_d128.c
new file mode 100644
index 00000000000..abee670955e
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_d128.c
@@ -0,0 +1,495 @@
+/* mpfr_set_decimal128 -- convert a IEEE 754r decimal128 float to
+ a multiple precision floating-point number
+
+See https://gcc.gnu.org/legacy-ml/gcc/2006-06/msg00691.html,
+https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html,
+and TR 24732 <http://www.open-std.org/jtc1/sc22/wg14/www/projects#24732>.
+
+Copyright 2006-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramel projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#define MPFR_NEED_LONGLONG_H
+#include "mpfr-impl.h"
+
+#ifdef MPFR_WANT_DECIMAL_FLOATS
+
+#if HAVE_DECIMAL128_IEEE && \
+ (GMP_NUMB_BITS == 32 || GMP_NUMB_BITS == 64) && \
+ !defined(DECIMAL_GENERIC_CODE)
+
+#ifdef DECIMAL_DPD_FORMAT
+ /* conversion 10-bits to 3 digits */
+static unsigned int T[1024] = {
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 81, 800, 801, 880, 881, 10, 11, 12, 13,
+ 14, 15, 16, 17, 18, 19, 90, 91, 810, 811, 890, 891, 20, 21, 22, 23, 24, 25,
+ 26, 27, 28, 29, 82, 83, 820, 821, 808, 809, 30, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 92, 93, 830, 831, 818, 819, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
+ 84, 85, 840, 841, 88, 89, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 94, 95,
+ 850, 851, 98, 99, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 86, 87, 860, 861,
+ 888, 889, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 96, 97, 870, 871, 898,
+ 899, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 180, 181, 900, 901,
+ 980, 981, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 190, 191, 910,
+ 911, 990, 991, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 182, 183,
+ 920, 921, 908, 909, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 192,
+ 193, 930, 931, 918, 919, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149,
+ 184, 185, 940, 941, 188, 189, 150, 151, 152, 153, 154, 155, 156, 157, 158,
+ 159, 194, 195, 950, 951, 198, 199, 160, 161, 162, 163, 164, 165, 166, 167,
+ 168, 169, 186, 187, 960, 961, 988, 989, 170, 171, 172, 173, 174, 175, 176,
+ 177, 178, 179, 196, 197, 970, 971, 998, 999, 200, 201, 202, 203, 204, 205,
+ 206, 207, 208, 209, 280, 281, 802, 803, 882, 883, 210, 211, 212, 213, 214,
+ 215, 216, 217, 218, 219, 290, 291, 812, 813, 892, 893, 220, 221, 222, 223,
+ 224, 225, 226, 227, 228, 229, 282, 283, 822, 823, 828, 829, 230, 231, 232,
+ 233, 234, 235, 236, 237, 238, 239, 292, 293, 832, 833, 838, 839, 240, 241,
+ 242, 243, 244, 245, 246, 247, 248, 249, 284, 285, 842, 843, 288, 289, 250,
+ 251, 252, 253, 254, 255, 256, 257, 258, 259, 294, 295, 852, 853, 298, 299,
+ 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 286, 287, 862, 863, 888,
+ 889, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 296, 297, 872, 873,
+ 898, 899, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 380, 381, 902,
+ 903, 982, 983, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 390, 391,
+ 912, 913, 992, 993, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 382,
+ 383, 922, 923, 928, 929, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339,
+ 392, 393, 932, 933, 938, 939, 340, 341, 342, 343, 344, 345, 346, 347, 348,
+ 349, 384, 385, 942, 943, 388, 389, 350, 351, 352, 353, 354, 355, 356, 357,
+ 358, 359, 394, 395, 952, 953, 398, 399, 360, 361, 362, 363, 364, 365, 366,
+ 367, 368, 369, 386, 387, 962, 963, 988, 989, 370, 371, 372, 373, 374, 375,
+ 376, 377, 378, 379, 396, 397, 972, 973, 998, 999, 400, 401, 402, 403, 404,
+ 405, 406, 407, 408, 409, 480, 481, 804, 805, 884, 885, 410, 411, 412, 413,
+ 414, 415, 416, 417, 418, 419, 490, 491, 814, 815, 894, 895, 420, 421, 422,
+ 423, 424, 425, 426, 427, 428, 429, 482, 483, 824, 825, 848, 849, 430, 431,
+ 432, 433, 434, 435, 436, 437, 438, 439, 492, 493, 834, 835, 858, 859, 440,
+ 441, 442, 443, 444, 445, 446, 447, 448, 449, 484, 485, 844, 845, 488, 489,
+ 450, 451, 452, 453, 454, 455, 456, 457, 458, 459, 494, 495, 854, 855, 498,
+ 499, 460, 461, 462, 463, 464, 465, 466, 467, 468, 469, 486, 487, 864, 865,
+ 888, 889, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 496, 497, 874,
+ 875, 898, 899, 500, 501, 502, 503, 504, 505, 506, 507, 508, 509, 580, 581,
+ 904, 905, 984, 985, 510, 511, 512, 513, 514, 515, 516, 517, 518, 519, 590,
+ 591, 914, 915, 994, 995, 520, 521, 522, 523, 524, 525, 526, 527, 528, 529,
+ 582, 583, 924, 925, 948, 949, 530, 531, 532, 533, 534, 535, 536, 537, 538,
+ 539, 592, 593, 934, 935, 958, 959, 540, 541, 542, 543, 544, 545, 546, 547,
+ 548, 549, 584, 585, 944, 945, 588, 589, 550, 551, 552, 553, 554, 555, 556,
+ 557, 558, 559, 594, 595, 954, 955, 598, 599, 560, 561, 562, 563, 564, 565,
+ 566, 567, 568, 569, 586, 587, 964, 965, 988, 989, 570, 571, 572, 573, 574,
+ 575, 576, 577, 578, 579, 596, 597, 974, 975, 998, 999, 600, 601, 602, 603,
+ 604, 605, 606, 607, 608, 609, 680, 681, 806, 807, 886, 887, 610, 611, 612,
+ 613, 614, 615, 616, 617, 618, 619, 690, 691, 816, 817, 896, 897, 620, 621,
+ 622, 623, 624, 625, 626, 627, 628, 629, 682, 683, 826, 827, 868, 869, 630,
+ 631, 632, 633, 634, 635, 636, 637, 638, 639, 692, 693, 836, 837, 878, 879,
+ 640, 641, 642, 643, 644, 645, 646, 647, 648, 649, 684, 685, 846, 847, 688,
+ 689, 650, 651, 652, 653, 654, 655, 656, 657, 658, 659, 694, 695, 856, 857,
+ 698, 699, 660, 661, 662, 663, 664, 665, 666, 667, 668, 669, 686, 687, 866,
+ 867, 888, 889, 670, 671, 672, 673, 674, 675, 676, 677, 678, 679, 696, 697,
+ 876, 877, 898, 899, 700, 701, 702, 703, 704, 705, 706, 707, 708, 709, 780,
+ 781, 906, 907, 986, 987, 710, 711, 712, 713, 714, 715, 716, 717, 718, 719,
+ 790, 791, 916, 917, 996, 997, 720, 721, 722, 723, 724, 725, 726, 727, 728,
+ 729, 782, 783, 926, 927, 968, 969, 730, 731, 732, 733, 734, 735, 736, 737,
+ 738, 739, 792, 793, 936, 937, 978, 979, 740, 741, 742, 743, 744, 745, 746,
+ 747, 748, 749, 784, 785, 946, 947, 788, 789, 750, 751, 752, 753, 754, 755,
+ 756, 757, 758, 759, 794, 795, 956, 957, 798, 799, 760, 761, 762, 763, 764,
+ 765, 766, 767, 768, 769, 786, 787, 966, 967, 988, 989, 770, 771, 772, 773,
+ 774, 775, 776, 777, 778, 779, 796, 797, 976, 977, 998, 999 };
+#endif
+
+/* Convert d to a decimal string (one-to-one correspondence, no rounding).
+ The string s needs to have at least 44 characters (including the final \0):
+ * 1 for the sign '-'
+ * 2 for the leading '0.'
+ * 34 for the significand
+ * 6 for the exponent (for example 'E-1000')
+ * 1 for the final '\0'
+
+ According to IEEE 754-2008 (page 11), we have k=128, thus w = k/16+4 = 12,
+ t = 15*k/16-10 = 110, p = 9*k/32-2 = 34, emax = 3*2^(w-1) = 6144,
+ emin = 1-emax = -6143, bias = emax+p-2 = 6176.
+
+ The _Decimal128 encoding is:
+ * 1 bit for the sign
+ * a 17-bit (w+5) combination field G
+ * a 110-bit trailing significand field T
+*/
+static void
+decimal128_to_string (char *s, _Decimal128 d)
+{
+ union ieee_decimal128 x;
+ char *t;
+ int Gh; /* most 5 significant bits from combination field */
+ int exp; /* exponent */
+ unsigned int i;
+#ifdef DECIMAL_DPD_FORMAT
+ unsigned int D[12]; /* declets */
+#else /* BID */
+ mp_limb_t rp[4];
+ mp_size_t rn;
+#endif
+
+ /* now convert BID or DPD to string:
+ the combination field has 17 bits: 5 + 12 */
+ x.d128 = d;
+ Gh = x.s.comb >> 12;
+ if (Gh == 31)
+ {
+ sprintf (s, "NaN");
+ return;
+ }
+ else if (Gh == 30)
+ {
+ if (x.s.sig == 0)
+ sprintf (s, "Inf");
+ else
+ sprintf (s, "-Inf");
+ return;
+ }
+ t = s;
+ if (x.s.sig)
+ *t++ = '-';
+
+ /* both the decimal128 DPD and BID encodings consist of:
+ * a sign bit of 1 bit
+ * a combination field of 17 bits (5 for the combination field and
+ 12 remaining bits)
+ * a trailing significand field of 110 bits
+ */
+#ifdef DECIMAL_DPD_FORMAT
+ /* page 11 of IEEE 754-2008, case c1) */
+ if (Gh < 24)
+ {
+ exp = Gh >> 3;
+ D[0] = Gh & 7; /* 4G2+2G3+G4 */
+ }
+ else /* case c1i): the most significant five bits of G are 110xx or 1110x */
+ {
+ exp = (Gh >> 1) & 3; /* 2G2+G3 */
+ D[0] = 8 | (Gh & 1); /* leading significant digit, 8 or 9 */
+ }
+ exp = (exp << 12) | (x.s.comb & 0xfff); /* add last 12 bits of biased exp. */
+ D[1] = x.s.t0 >> 4; /* first declet */
+ D[2] = ((x.s.t0 << 6) | (x.s.t1 >> 26)) & 1023;
+ D[3] = (x.s.t1 >> 16) & 1023;
+ D[4] = (x.s.t1 >> 6) & 1023;
+ D[5] = ((x.s.t1 << 4) | (x.s.t2 >> 28)) & 1023;
+ D[6] = (x.s.t2 >> 18) & 1023;
+ D[7] = (x.s.t2 >> 8) & 1023;
+ D[8] = ((x.s.t2 << 2) | (x.s.t3 >> 30)) & 1023;
+ D[9] = (x.s.t3 >> 20) & 1023;
+ D[10] = (x.s.t3 >> 10) & 1023;
+ D[11] = x.s.t3 & 1023;
+ sprintf (t, "%1u%3u%3u%3u%3u%3u%3u%3u%3u%3u%3u%3u", D[0], T[D[1]], T[D[2]],
+ T[D[3]], T[D[4]], T[D[5]], T[D[6]], T[D[7]], T[D[8]], T[D[9]],
+ T[D[10]], T[D[11]]);
+ /* Warning: some characters may be blank */
+ for (i = 0; i < 34; i++)
+ if (t[i] == ' ')
+ t[i] = '0';
+ t += 34;
+#else /* BID */
+ /* w + 5 = 17, thus w = 12 */
+ /* IEEE 754-2008 specifies that if the decoded significand exceeds the
+ maximum, i.e. here if it is >= 10^34, then the value is zero. */
+ if (Gh < 24)
+ {
+ /* the biased exponent E is formed from G[0] to G[13] and the
+ significant from bits G[14] through the end of the decoding
+ (including the bits of the trailing significand field) */
+ exp = x.s.comb >> 3; /* upper 14 bits, exp <= 12287 */
+ rp[3] = ((x.s.comb & 7) << 14) | x.s.t0;
+ MPFR_ASSERTD (rp[3] < MPFR_LIMB_ONE << 17); /* rp[3] < 2^17 */
+ }
+ else
+ goto zero; /* in that case, the significand would be formed by prefixing
+ (8 + G[16]) to the trailing significand field of 110 bits,
+ which would give a value of at least 2^113 > 10^34-1,
+ and the standard says that any value exceeding the maximum
+ is non-canonical and should be interpreted as 0. */
+ rp[2] = x.s.t1;
+ rp[1] = x.s.t2;
+ rp[0] = x.s.t3;
+#if GMP_NUMB_BITS == 64
+ rp[0] |= rp[1] << 32;
+ rp[1] = rp[2] | (rp[3] << 32);
+ rn = 2;
+#else
+ rn = 4;
+#endif
+ while (rn > 0 && rp[rn - 1] == 0)
+ rn --;
+ if (rn == 0)
+ {
+ zero:
+ t[0] = '0';
+ t[1] = '\0';
+ return;
+ }
+ i = mpn_get_str ((unsigned char *) t, 10, rp, rn);
+ if (i > 34)
+ goto zero;
+ /* convert the values from mpn_get_str (0, 1, ..., 9) to digits: */
+ while (i-- > 0)
+ *t++ += '0';
+#endif /* DPD or BID */
+
+ exp -= 6176; /* unbiased exponent: emin - (p-1) where
+ emin = 1-emax = 1-6144 = -6143 and p=34 */
+ sprintf (t, "E%d", exp);
+}
+
+#else /* portable version */
+
+#ifndef DEC128_MAX
+# define DEC128_MAX 9.999999999999999999999999999999999E6144dl
+#endif
+
+static void
+decimal128_to_string (char *s, _Decimal128 d)
+{
+ int sign = 0, n;
+ int exp = 0;
+ _Decimal128 ten, ten2, ten4, ten8, ten16, ten32, ten64,
+ ten128, ten256, ten512, ten1024, ten2048, ten4096;
+
+ ten = 10;
+ ten2 = 100;
+ ten4 = 10000;
+ ten8 = 100000000;
+ ten16 = ten8 * ten8;
+ ten32 = ten16 * ten16;
+ ten64 = ten32 * ten32;
+ ten128 = ten64 * ten64;
+ ten256 = ten128 * ten128;
+ ten512 = ten256 * ten256;
+ ten1024 = ten512 * ten512;
+ ten2048 = ten1024 * ten1024;
+ ten4096 = ten2048 * ten2048;
+
+ if (MPFR_UNLIKELY (DOUBLE_ISNAN (d))) /* NaN */
+ {
+ sprintf (s, "NaN"); /* sprintf puts a final '\0' */
+ return;
+ }
+ else if (MPFR_UNLIKELY (d > DEC128_MAX)) /* +Inf */
+ {
+ sprintf (s, "Inf");
+ return;
+ }
+ else if (MPFR_UNLIKELY (d < -DEC128_MAX)) /* -Inf */
+ {
+ sprintf (s, "-Inf");
+ return;
+ }
+
+ /* now d is neither NaN nor +Inf nor -Inf */
+
+ if (d < (_Decimal128) 0.0)
+ {
+ sign = 1;
+ d = -d;
+ }
+ else if (d == (_Decimal128) -0.0)
+ { /* Warning: the comparison d == -0.0 returns true for d = 0.0 too,
+ copy code from set_d.c here. We first compare to the +0.0 bitstring,
+ in case +0.0 and -0.0 are represented identically. */
+ double dd = (double) d, poszero = +0.0, negzero = DBL_NEG_ZERO;
+ if (memcmp (&dd, &poszero, sizeof(double)) != 0 &&
+ memcmp (&dd, &negzero, sizeof(double)) == 0)
+ {
+ sign = 1;
+ d = -d;
+ }
+ }
+
+ /* now normalize d in [0.1, 1[ */
+ if (d >= (_Decimal128) 1.0)
+ {
+ if (d >= ten4096)
+ {
+ d /= ten4096;
+ exp += 4096;
+ }
+ if (d >= ten2048)
+ {
+ d /= ten2048;
+ exp += 2048;
+ }
+ if (d >= ten1024)
+ {
+ d /= ten1024;
+ exp += 1024;
+ }
+ if (d >= ten512)
+ {
+ d /= ten512;
+ exp += 512;
+ }
+ if (d >= ten256)
+ {
+ d /= ten256;
+ exp += 256;
+ }
+ if (d >= ten128)
+ {
+ d /= ten128;
+ exp += 128;
+ }
+ if (d >= ten64)
+ {
+ d /= ten64;
+ exp += 64;
+ }
+ if (d >= ten32)
+ {
+ d /= ten32;
+ exp += 32;
+ }
+ if (d >= ten16)
+ {
+ d /= ten16;
+ exp += 16;
+ }
+ if (d >= ten8)
+ {
+ d /= ten8;
+ exp += 8;
+ }
+ if (d >= ten4)
+ {
+ d /= ten4;
+ exp += 4;
+ }
+ if (d >= ten2)
+ {
+ d /= ten2;
+ exp += 2;
+ }
+ while (d >= 1)
+ {
+ d /= ten;
+ exp += 1;
+ }
+ }
+ else /* d < 1.0 */
+ {
+ if (d < 1 / ten4096)
+ {
+ d *= ten4096;
+ exp -= 4096;
+ }
+ if (d < 1 / ten2048)
+ {
+ d *= ten2048;
+ exp -= 2048;
+ }
+ if (d < 1 / ten1024)
+ {
+ d *= ten1024;
+ exp -= 1024;
+ }
+ if (d < 1 / ten512)
+ {
+ d *= ten512;
+ exp -= 512;
+ }
+ if (d < 1 / ten256)
+ {
+ d *= ten256;
+ exp -= 256;
+ }
+ if (d < 1 / ten128)
+ {
+ d *= ten128;
+ exp -= 128;
+ }
+ if (d < 1 / ten64)
+ {
+ d *= ten64;
+ exp -= 64;
+ }
+ if (d < 1 / ten32)
+ {
+ d *= ten32;
+ exp -= 32;
+ }
+ if (d < 1 / ten16)
+ {
+ d *= ten16;
+ exp -= 16;
+ }
+ if (d < 1 / ten8)
+ {
+ d *= ten8;
+ exp -= 8;
+ }
+ if (d < 1 / ten4)
+ {
+ d *= ten4;
+ exp -= 4;
+ }
+ if (d < 1 / ten2)
+ {
+ d *= ten2;
+ exp -= 2;
+ }
+ if (d < 1 / ten)
+ {
+ d *= ten;
+ exp -= 1;
+ }
+ }
+
+ /* now 0.1 <= d < 1 */
+ if (sign == 1)
+ *s++ = '-';
+ *s++ = '0';
+ *s++ = '.';
+ for (n = 0; n < 34; n++)
+ {
+ int r;
+
+ MPFR_ASSERTD (d < 1);
+ d *= 10;
+ MPFR_ASSERTD (d < 10);
+ r = (int) d;
+ *s++ = '0' + r;
+ d -= (_Decimal128) r;
+ }
+ MPFR_ASSERTN (d == 0);
+ if (exp != 0)
+ sprintf (s, "E%d", exp); /* adds a final '\0' */
+ else
+ *s = '\0';
+}
+
+#endif /* definition of decimal128_to_string (DPD, BID, or portable) */
+
+/* the IEEE754-2008 decimal128 format has 34 digits, with emax=6144,
+ emin=1-emax=-6143 */
+int
+mpfr_set_decimal128 (mpfr_ptr r, _Decimal128 d, mpfr_rnd_t rnd_mode)
+{
+ char s[44]; /* need 1 character for sign,
+ 2 characters for '0.'
+ 34 characters for significand,
+ 1 character for exponent 'E',
+ 5 characters for exponent (including sign),
+ 1 character for terminating \0. */
+
+ decimal128_to_string (s, d);
+ MPFR_LOG_MSG (("string: %s\n", s));
+ return mpfr_strtofr (r, s, NULL, 10, rnd_mode);
+}
+
+#endif /* MPFR_WANT_DECIMAL_FLOATS */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_d64.c b/Build/source/libs/mpfr/mpfr-src/src/set_d64.c
index e7470499630..41c2e7da585 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_d64.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_d64.c
@@ -1,11 +1,11 @@
/* mpfr_set_decimal64 -- convert an IEEE 754-2008 decimal64 float to
a multiple precision floating-point number
-See https://gcc.gnu.org/ml/gcc/2006-06/msg00691.html,
+See https://gcc.gnu.org/legacy-ml/gcc/2006-06/msg00691.html,
https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html,
and TR 24732 <http://www.open-std.org/jtc1/sc22/wg14/www/projects#24732>.
-Copyright 2006-2019 Free Software Foundation, Inc.
+Copyright 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -30,7 +30,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#ifdef MPFR_WANT_DECIMAL_FLOATS
-#ifdef DPD_FORMAT
+#ifdef DECIMAL_DPD_FORMAT
/* conversion 10-bits to 3 digits */
static unsigned int T[1024] = {
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 80, 81, 800, 801, 880, 881, 10, 11, 12, 13,
@@ -102,7 +102,8 @@ static unsigned int T[1024] = {
774, 775, 776, 777, 778, 779, 796, 797, 976, 977, 998, 999 };
#endif
-#if _MPFR_IEEE_FLOATS
+#if _MPFR_IEEE_FLOATS && !defined(DECIMAL_GENERIC_CODE)
+
/* Convert d to a decimal string (one-to-one correspondence, no rounding).
The string s needs to have at least 25 characters (with the final '\0'):
* 1 for the sign '-'
@@ -119,16 +120,42 @@ decimal64_to_string (char *s, _Decimal64 d)
char *t;
unsigned int Gh; /* most 5 significant bits from combination field */
int exp; /* exponent */
- mp_limb_t rp[2];
- mp_size_t rn = 2;
unsigned int i;
-#ifdef DPD_FORMAT
+
+#ifdef DECIMAL_DPD_FORMAT
unsigned int d0, d1, d2, d3, d4, d5;
+#else /* BID */
+#if GMP_NUMB_BITS >= 64
+ mp_limb_t rp[2];
+#else
+ unsigned long rp[2]; /* rp[0] and rp[1] should contain at least 32 bits */
+#endif
+#define NLIMBS (64 / GMP_NUMB_BITS)
+ mp_limb_t sp[NLIMBS];
+ mp_size_t sn;
#endif
+ /* end of declarations */
+
+ /* Memory representation of the _Decimal64 argument. */
+ MPFR_LOG_MSG (("d = { %02X, %02X, %02X, %02X, %02X, %02X, %02X, %02X }\n",
+ ((unsigned char *) &d)[0],
+ ((unsigned char *) &d)[1],
+ ((unsigned char *) &d)[2],
+ ((unsigned char *) &d)[3],
+ ((unsigned char *) &d)[4],
+ ((unsigned char *) &d)[5],
+ ((unsigned char *) &d)[6],
+ ((unsigned char *) &d)[7]));
+
/* now convert BID or DPD to string */
y.d64 = d;
x.d = y.d;
+ MPFR_LOG_MSG (("x = { .sig = %u, .exp = %u, "
+ ".manh = 0x%05lX = %lu, .manl = 0x%08lX = %lu }\n",
+ (unsigned int) x.s.sig, (unsigned int) x.s.exp,
+ (unsigned long) x.s.manh, (unsigned long) x.s.manh,
+ (unsigned long) x.s.manl, (unsigned long) x.s.manl));
Gh = x.s.exp >> 6;
if (Gh == 31)
{
@@ -147,16 +174,23 @@ decimal64_to_string (char *s, _Decimal64 d)
if (x.s.sig)
*t++ = '-';
-#ifdef DPD_FORMAT
+ /* both the decimal64 DPD and BID encodings consist of:
+ * a sign bit of 1 bit
+ * a combination field of 13=5+8 bits
+ * a trailing significand field of 50 bits
+ */
+#ifdef DECIMAL_DPD_FORMAT
+ /* the most significant 5 bits of the combination field give the first digit
+ of the significand, and leading bits of the biased exponent (0, 1, 2). */
if (Gh < 24)
{
exp = (x.s.exp >> 1) & 768;
- d0 = Gh & 7;
+ d0 = Gh & 7; /* first digit is in 0..7 */
}
else
{
exp = (x.s.exp & 384) << 1;
- d0 = 8 | (Gh & 1);
+ d0 = 8 | (Gh & 1); /* first digit is 8 or 9 */
}
exp |= (x.s.exp & 63) << 2;
exp |= x.s.manh >> 18;
@@ -172,6 +206,8 @@ decimal64_to_string (char *s, _Decimal64 d)
t[i] = '0';
t += 16;
#else /* BID */
+ /* IEEE 754-2008 specifies that if the decoded significand exceeds the
+ maximum, i.e. here if it is >= 10^16, then the value is zero. */
if (Gh < 24)
{
/* the biased exponent E is formed from G[0] to G[9] and the
@@ -191,30 +227,56 @@ decimal64_to_string (char *s, _Decimal64 d)
rp[1] &= 524287; /* 2^19-1: cancel G[11] */
rp[1] |= 2097152; /* add 2^21 */
}
-#if GMP_NUMB_BITS >= 54
- rp[0] |= rp[1] << 32;
- rn = 1;
+ /* now convert {rp, 2} to {sp, NLIMBS} */
+#if GMP_NUMB_BITS >= 64
+ sp[0] = MPFR_LIMB(rp[0]) | MPFR_LIMB_LSHIFT(rp[1],32);
+#elif GMP_NUMB_BITS == 32
+ sp[0] = rp[0];
+ sp[1] = rp[1];
+#elif GMP_NUMB_BITS == 16
+ sp[0] = MPFR_LIMB(rp[0]);
+ sp[1] = MPFR_LIMB(rp[0] >> 16);
+ sp[2] = MPFR_LIMB(rp[1]);
+ sp[3] = MPFR_LIMB(rp[1] >> 16);
+#elif GMP_NUMB_BITS == 8
+ sp[0] = MPFR_LIMB(rp[0]);
+ sp[1] = MPFR_LIMB(rp[0] >> 8);
+ sp[2] = MPFR_LIMB(rp[0] >> 16);
+ sp[3] = MPFR_LIMB(rp[0] >> 24);
+ sp[4] = MPFR_LIMB(rp[1]);
+ sp[5] = MPFR_LIMB(rp[1] >> 8);
+ sp[6] = MPFR_LIMB(rp[1] >> 16);
+ sp[7] = MPFR_LIMB(rp[1] >> 24);
+#else
+#error "GMP_NUMB_BITS should be 8, 16, 32, or >= 64"
#endif
- while (rn > 0 && rp[rn - 1] == 0)
- rn --;
- if (rn == 0)
+ sn = NLIMBS;
+ while (sn > 0 && sp[sn - 1] == 0)
+ sn --;
+ if (sn == 0)
{
+ zero:
*t = 0;
i = 1;
}
else
{
- i = mpn_get_str ((unsigned char*)t, 10, rp, rn);
+ i = mpn_get_str ((unsigned char*) t, 10, sp, sn);
+ if (i > 16) /* non-canonical encoding: return zero */
+ goto zero;
}
+ /* convert the values from mpn_get_str (0, 1, ..., 9) to digits: */
while (i-- > 0)
*t++ += '0';
#endif /* DPD or BID */
- exp -= 398; /* unbiased exponent */
+ exp -= 398; /* unbiased exponent: -398 = emin - (p-1) where
+ emin = 1-emax = 1-384 = -383 and p=16 */
sprintf (t, "E%d", exp);
}
-#else
-/* portable version */
+
+#else /* portable version */
+
#ifndef DEC64_MAX
# define DEC64_MAX 9.999999999999999E384dd
#endif
@@ -412,8 +474,11 @@ decimal64_to_string (char *s, _Decimal64 d)
else
*s = '\0';
}
-#endif /* _MPFR_IEEE_FLOATS */
+#endif /* definition of decimal64_to_string (DPD, BID, or portable) */
+
+/* the IEEE754-2008 decimal64 format has 16 digits, with emax=384,
+ emin=1-emax=-383 */
int
mpfr_set_decimal64 (mpfr_ptr r, _Decimal64 d, mpfr_rnd_t rnd_mode)
{
@@ -425,6 +490,7 @@ mpfr_set_decimal64 (mpfr_ptr r, _Decimal64 d, mpfr_rnd_t rnd_mode)
1 character for terminating \0. */
decimal64_to_string (s, d);
+ MPFR_LOG_MSG (("string: %s\n", s));
return mpfr_strtofr (r, s, NULL, 10, rnd_mode);
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_dfl_prec.c b/Build/source/libs/mpfr/mpfr-src/src/set_dfl_prec.c
index ff43fe12bb1..3e3143a7617 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_dfl_prec.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_dfl_prec.c
@@ -1,6 +1,6 @@
/* mpfr_set_default_prec, mpfr_get_default_prec -- set/get default precision
-Copyright 1999-2001, 2004-2019 Free Software Foundation, Inc.
+Copyright 1999-2001, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_exp.c b/Build/source/libs/mpfr/mpfr-src/src/set_exp.c
index f73f0741c32..a10875a67d9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_exp.c
@@ -1,6 +1,6 @@
/* mpfr_set_exp - set the exponent of a floating-point number
-Copyright 2002-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_f.c b/Build/source/libs/mpfr/mpfr-src/src/set_f.c
index 67a3559218f..76cdbbf85df 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_f.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_f.c
@@ -1,6 +1,6 @@
/* mpfr_set_f -- set a MPFR number from a GNU MPF number
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_float128.c b/Build/source/libs/mpfr/mpfr-src/src/set_float128.c
index e8aae6dbc6e..aff75d2bd99 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_float128.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_float128.c
@@ -1,7 +1,7 @@
-/* mpfr_set_float128 -- convert a machine __float128 number to
+/* mpfr_set_float128 -- convert a machine _Float128 number to
a multiple precision floating-point number
-Copyright 2012-2019 Free Software Foundation, Inc.
+Copyright 2012-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -21,23 +21,28 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#include <float.h> /* for DBL_MAX */
-
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
#ifdef MPFR_WANT_FLOAT128
-/* The q suffix is a GNU C extension, but so is __float128. */
-#define MPFR_FLOAT128_MAX 0x1.ffffffffffffffffffffffffffffp+16383q
+#if MPFR_WANT_FLOAT128 == 1
+/* _Float128 type from ISO/IEC TS 18661 */
+# define MPFR_FLOAT128_MAX 0x1.ffffffffffffffffffffffffffffp+16383f128
+#elif MPFR_WANT_FLOAT128 == 2
+/* __float128 type (GNU C extension) */
+# define MPFR_FLOAT128_MAX 0x1.ffffffffffffffffffffffffffffp+16383q
+#else
+# error "Unsupported value for MPFR_WANT_FLOAT128"
+#endif
int
-mpfr_set_float128 (mpfr_ptr r, __float128 d, mpfr_rnd_t rnd_mode)
+mpfr_set_float128 (mpfr_ptr r, _Float128 d, mpfr_rnd_t rnd_mode)
{
mpfr_t t;
mp_limb_t *tp;
int inexact, shift_exp, neg, e, i;
- __float128 p[14], q[14];
+ _Float128 p[14], q[14];
MPFR_SAVE_EXPO_DECL (expo);
/* Check for NaN */
@@ -61,7 +66,7 @@ mpfr_set_float128 (mpfr_ptr r, __float128 d, mpfr_rnd_t rnd_mode)
return 0;
}
/* Check for ZERO */
- else if (MPFR_UNLIKELY (d == (__float128) 0.0))
+ else if (MPFR_UNLIKELY (d == (_Float128) 0.0))
return mpfr_set_d (r, (double) d, rnd_mode);
shift_exp = 0; /* invariant: remainder to deal with is d*2^shift_exp */
@@ -124,7 +129,7 @@ mpfr_set_float128 (mpfr_ptr r, __float128 d, mpfr_rnd_t rnd_mode)
for (i = MPFR_LAST_LIMB (t); i >= 0; i--)
{
- d *= 2 * (__float128) MPFR_LIMB_HIGHBIT;
+ d *= 2 * (_Float128) MPFR_LIMB_HIGHBIT;
tp[i] = (mp_limb_t) d;
d -= tp[i];
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_flt.c b/Build/source/libs/mpfr/mpfr-src/src/set_flt.c
index e8a6d0dcf43..5a6edbc90bc 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_flt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_flt.c
@@ -1,6 +1,6 @@
/* mpfr_set_flt -- convert a machine single precision float to mpfr_t
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_inf.c b/Build/source/libs/mpfr/mpfr-src/src/set_inf.c
index 06608d64625..78c7b766780 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_inf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_inf.c
@@ -1,6 +1,6 @@
/* mpfr_set_inf -- set a number to plus or minus infinity.
-Copyright 2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_ld.c b/Build/source/libs/mpfr/mpfr-src/src/set_ld.c
index 3d92d70affa..3ff57b99472 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_ld.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_ld.c
@@ -1,7 +1,7 @@
/* mpfr_set_ld -- convert a machine long double to
a multiple precision floating-point number
-Copyright 2002-2019 Free Software Foundation, Inc.
+Copyright 2002-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -26,27 +26,8 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-/* Various i386 systems have been seen with <float.h> LDBL constants equal
- to the DBL ones, whereas they ought to be bigger, reflecting the 10-byte
- IEEE extended format on that processor. gcc 3.2.1 on FreeBSD and Solaris
- has been seen with the problem, and gcc 2.95.4 on FreeBSD 4.7. */
-
-#if HAVE_LDOUBLE_IEEE_EXT_LITTLE
-static const union {
- char bytes[10];
- long double d;
-} ldbl_max_struct = {
- { '\377','\377','\377','\377',
- '\377','\377','\377','\377',
- '\376','\177' }
-};
-#define MPFR_LDBL_MAX (ldbl_max_struct.d)
-#else
-#define MPFR_LDBL_MAX LDBL_MAX
-#endif
-
-/* To check for +inf, one can use the test x > MPFR_LDBL_MAX, as LDBL_MAX
- is the maximum finite number representable in a long double, according
+/* To check for +inf, one can use the test x > LDBL_MAX, as LDBL_MAX is
+ the maximum finite number representable in a long double, according
to DR 467; see
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2092.htm
If this fails on some platform, a test x - x != 0 might be used. */
@@ -62,11 +43,25 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
#elif defined(HAVE_LDOUBLE_IEEE_EXT_LITTLE)
+#if GMP_NUMB_BITS >= 64
+# define MPFR_LIMBS_PER_LONG_DOUBLE 1
+#elif GMP_NUMB_BITS == 32
+# define MPFR_LIMBS_PER_LONG_DOUBLE 2
+#elif GMP_NUMB_BITS == 16
+# define MPFR_LIMBS_PER_LONG_DOUBLE 4
+#elif GMP_NUMB_BITS == 8
+# define MPFR_LIMBS_PER_LONG_DOUBLE 8
+#else
+#error "GMP_NUMB_BITS is assumed to be 8, 16, 32 or >= 64"
+#endif
+/* The hypothetical GMP_NUMB_BITS == 16 is not supported. It will trigger
+ an error below. */
+
/* IEEE Extended Little Endian Code */
int
mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
{
- int inexact, i, k, cnt;
+ int inexact, k, cnt;
mpfr_t tmp;
mp_limb_t tmpmant[MPFR_LIMBS_PER_LONG_DOUBLE];
mpfr_long_double_t x;
@@ -81,13 +76,13 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
MPFR_RET_NAN;
}
/* Check for INF */
- else if (MPFR_UNLIKELY (d > MPFR_LDBL_MAX))
+ else if (MPFR_UNLIKELY (d > LDBL_MAX))
{
MPFR_SET_INF (r);
MPFR_SET_POS (r);
return 0;
}
- else if (MPFR_UNLIKELY (d < -MPFR_LDBL_MAX))
+ else if (MPFR_UNLIKELY (d < -LDBL_MAX))
{
MPFR_SET_INF (r);
MPFR_SET_NEG (r);
@@ -120,25 +115,48 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
x.ld = -x.ld;
}
- /* Extract mantissa */
-#if GMP_NUMB_BITS >= 64
+ /* Extract and normalize the significand */
+#if MPFR_LIMBS_PER_LONG_DOUBLE == 1
tmpmant[0] = ((mp_limb_t) x.s.manh << 32) | ((mp_limb_t) x.s.manl);
-#else
+ count_leading_zeros (cnt, tmpmant[0]);
+ tmpmant[0] <<= cnt;
+ k = 0; /* number of limbs shifted */
+#else /* MPFR_LIMBS_PER_LONG_DOUBLE >= 2 */
+#if MPFR_LIMBS_PER_LONG_DOUBLE == 2
tmpmant[0] = (mp_limb_t) x.s.manl;
tmpmant[1] = (mp_limb_t) x.s.manh;
-#endif
-
- /* Normalize mantissa */
- i = MPFR_LIMBS_PER_LONG_DOUBLE;
- MPN_NORMALIZE_NOT_ZERO (tmpmant, i);
- k = MPFR_LIMBS_PER_LONG_DOUBLE - i;
- count_leading_zeros (cnt, tmpmant[i - 1]);
- if (MPFR_UNLIKELY (cnt != 0))
- mpn_lshift (tmpmant + k, tmpmant, i, cnt);
- else if (MPFR_UNLIKELY (k != 0))
- MPN_COPY (tmpmant + k, tmpmant, i);
- if (MPFR_UNLIKELY (k != 0))
- MPN_ZERO (tmpmant, k);
+#elif MPFR_LIMBS_PER_LONG_DOUBLE == 4
+ tmpmant[0] = (mp_limb_t) x.s.manl;
+ tmpmant[1] = (mp_limb_t) (x.s.manl >> 16);
+ tmpmant[2] = (mp_limb_t) x.s.manh;
+ tmpmant[3] = (mp_limb_t) (x.s.manh >> 16);
+#elif MPFR_LIMBS_PER_LONG_DOUBLE == 8
+ tmpmant[0] = (mp_limb_t) x.s.manl;
+ tmpmant[1] = (mp_limb_t) (x.s.manl >> 8);
+ tmpmant[2] = (mp_limb_t) (x.s.manl >> 16);
+ tmpmant[3] = (mp_limb_t) (x.s.manl >> 24);
+ tmpmant[4] = (mp_limb_t) x.s.manh;
+ tmpmant[5] = (mp_limb_t) (x.s.manh >> 8);
+ tmpmant[6] = (mp_limb_t) (x.s.manh >> 16);
+ tmpmant[7] = (mp_limb_t) (x.s.manh >> 24);
+#else
+#error "MPFR_LIMBS_PER_LONG_DOUBLE should be 1, 2, 4 or 8"
+#endif /* MPFR_LIMBS_PER_LONG_DOUBLE >= 2 */
+ {
+ int i = MPFR_LIMBS_PER_LONG_DOUBLE;
+ MPN_NORMALIZE_NOT_ZERO (tmpmant, i);
+ k = MPFR_LIMBS_PER_LONG_DOUBLE - i;
+ count_leading_zeros (cnt, tmpmant[i - 1]);
+ if (cnt != 0)
+ mpn_lshift (tmpmant + k, tmpmant, i, cnt);
+ else if (k != 0)
+ /* since we copy {tmpmant, i} into {tmpmant + k, i}, we should work
+ decreasingly, thus call mpn_copyd */
+ mpn_copyd (tmpmant + k, tmpmant, i);
+ if (k != 0)
+ MPN_ZERO (tmpmant, k);
+ }
+#endif /* MPFR_LIMBS_PER_LONG_DOUBLE == 1 */
/* Set exponent */
exp = (mpfr_exp_t) ((x.s.exph << 8) + x.s.expl); /* 15-bit unsigned int */
@@ -163,7 +181,7 @@ int
mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
{
mpfr_t t, u;
- int inexact, shift_exp;
+ int inexact;
double h, l;
MPFR_SAVE_EXPO_DECL (expo);
@@ -171,12 +189,12 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
LONGDOUBLE_NAN_ACTION (d, goto nan);
/* Check for INF */
- if (d > MPFR_LDBL_MAX)
+ if (d > LDBL_MAX)
{
mpfr_set_inf (r, 1);
return 0;
}
- else if (d < -MPFR_LDBL_MAX)
+ else if (d < -LDBL_MAX)
{
mpfr_set_inf (r, -1);
return 0;
@@ -185,8 +203,8 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
else if (d == 0.0)
return mpfr_set_d (r, (double) d, rnd_mode);
- if (d >= (long double) MPFR_LDBL_MAX || d <= (long double) -MPFR_LDBL_MAX)
- h = (d >= (long double) MPFR_LDBL_MAX) ? MPFR_LDBL_MAX : -MPFR_LDBL_MAX;
+ if (d >= LDBL_MAX || d <= -LDBL_MAX)
+ h = (d >= LDBL_MAX) ? LDBL_MAX : -LDBL_MAX;
else
h = (double) d; /* should not overflow */
l = (double) (d - (long double) h);
@@ -229,12 +247,12 @@ mpfr_set_ld (mpfr_ptr r, long double d, mpfr_rnd_t rnd_mode)
LONGDOUBLE_NAN_ACTION (d, goto nan);
/* Check for INF */
- if (d > MPFR_LDBL_MAX)
+ if (d > LDBL_MAX)
{
mpfr_set_inf (r, 1);
return 0;
}
- else if (d < -MPFR_LDBL_MAX)
+ else if (d < -LDBL_MAX)
{
mpfr_set_inf (r, -1);
return 0;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_nan.c b/Build/source/libs/mpfr/mpfr-src/src/set_nan.c
index 87f1f1abe70..21843f47e29 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_nan.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_nan.c
@@ -1,6 +1,6 @@
/* mpfr_set_nan -- set a number to NaN.
-Copyright 2002, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_prc_raw.c b/Build/source/libs/mpfr/mpfr-src/src/set_prc_raw.c
index 92586c77488..f156d9eefc4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_prc_raw.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_prc_raw.c
@@ -1,6 +1,6 @@
/* mpfr_set_prec_raw -- reset the precision of a floating-point number
-Copyright 2000-2001, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2001, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_prec.c b/Build/source/libs/mpfr/mpfr-src/src/set_prec.c
index e58be29e857..ea2f385660e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_prec.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_prec.c
@@ -1,6 +1,6 @@
/* mpfr_set_prec -- reset the precision of a floating-point number
-Copyright 1999, 2001-2002, 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001-2002, 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_q.c b/Build/source/libs/mpfr/mpfr-src/src/set_q.c
index b7a069c94e3..af2a6c24dbb 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_q.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_q.c
@@ -1,6 +1,6 @@
/* mpfr_set_q -- set a floating-point number from a multiple-precision rational
-Copyright 2000-2002, 2004-2019 Free Software Foundation, Inc.
+Copyright 2000-2002, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -45,9 +45,8 @@ set_z (mpfr_ptr f, mpz_srcptr z, mp_size_t *zs)
/* Get working precision */
count_leading_zeros (c, p[s-1]);
pf = s * GMP_NUMB_BITS - c;
- if (pf < MPFR_PREC_MIN)
- pf = MPFR_PREC_MIN;
- mpfr_init2 (f, pf);
+ MPFR_ASSERTD (pf >= 1);
+ mpfr_init2 (f, pf >= MPFR_PREC_MIN ? pf : MPFR_PREC_MIN);
/* Copy Mantissa */
if (MPFR_LIKELY (c))
@@ -102,14 +101,28 @@ mpfr_set_q (mpfr_ptr f, mpq_srcptr q, mpfr_rnd_t rnd)
cn = set_z (n, num, &sn);
cd = set_z (d, den, &sd);
+ /* sn is the number of limbs of the numerator, sd that of the denominator */
+
sn -= sd;
+#if GMP_NUMB_BITS <= 32 /* overflow/underflow cannot happen on 64-bit
+ processors, where MPFR_EMAX_MAX is 2^62 - 1, due to
+ memory limits */
+ /* If sn >= 0, the quotient has at most sn limbs, thus is larger or equal to
+ 2^((sn-1)*GMP_NUMB_BITS), thus its exponent >= (sn-1)*GMP_NUMB_BITS)+1.
+ (sn-1)*GMP_NUMB_BITS)+1 > emax yields (sn-1)*GMP_NUMB_BITS) >= emax,
+ i.e., sn-1 >= floor(emax/GMP_NUMB_BITS). */
if (MPFR_UNLIKELY (sn > MPFR_EMAX_MAX / GMP_NUMB_BITS))
{
MPFR_SAVE_EXPO_FREE (expo);
inexact = mpfr_overflow (f, rnd, MPFR_SIGN (f));
goto end;
}
- if (MPFR_UNLIKELY (sn < MPFR_EMIN_MIN / GMP_NUMB_BITS -1))
+ /* If sn < 0, the inverse quotient is >= 2^((-sn-1)*GMP_NUMB_BITS),
+ thus the quotient is <= 2^((sn+1)*GMP_NUMB_BITS), and thus its
+ exponent is <= (sn+1)*GMP_NUMB_BITS+1.
+ (sn+1)*GMP_NUMB_BITS+1 < emin yields (sn+1)*GMP_NUMB_BITS+2 <= emin,
+ i.e., sn+1 <= floor((emin-2)/GMP_NUMB_BITS). */
+ if (MPFR_UNLIKELY (sn <= (MPFR_EMIN_MIN - 2) / GMP_NUMB_BITS - 1))
{
MPFR_SAVE_EXPO_FREE (expo);
if (rnd == MPFR_RNDN)
@@ -117,17 +130,26 @@ mpfr_set_q (mpfr_ptr f, mpq_srcptr q, mpfr_rnd_t rnd)
inexact = mpfr_underflow (f, rnd, MPFR_SIGN (f));
goto end;
}
+#endif
inexact = mpfr_div (f, n, d, rnd);
shift = GMP_NUMB_BITS*sn+cn-cd;
MPFR_ASSERTD (shift == GMP_NUMB_BITS*sn+cn-cd);
cd = mpfr_mul_2si (f, f, shift, rnd);
MPFR_SAVE_EXPO_FREE (expo);
+ /* we can have cd <> 0 only in case of underflow or overflow, but since we
+ are still in extended exponent range, this cannot happen on 64-bit (see
+ above) */
+#if GMP_NUMB_BITS <= 32
if (MPFR_UNLIKELY (cd != 0))
inexact = cd;
else
inexact = mpfr_check_range (f, inexact, rnd);
end:
+#else
+ MPFR_ASSERTD(cd == 0);
+ inexact = mpfr_check_range (f, inexact, rnd);
+#endif
mpfr_clear (d);
mpfr_clear (n);
MPFR_RET (inexact);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_rnd.c b/Build/source/libs/mpfr/mpfr-src/src/set_rnd.c
index 394305957c5..6956f07e2eb 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_rnd.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_rnd.c
@@ -1,7 +1,7 @@
/* mpfr_set_default_rounding_mode -- set the default rounding mode
mpfr_get_default_rounding_mode -- get the default rounding mode
-Copyright 1999, 2001, 2004-2019 Free Software Foundation, Inc.
+Copyright 1999, 2001, 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_si.c b/Build/source/libs/mpfr/mpfr-src/src/set_si.c
index ed92fce9f15..97d03520933 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_si.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_si.c
@@ -1,6 +1,6 @@
/* mpfr_set_si -- set a MPFR number from a machine signed integer
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_si_2exp.c b/Build/source/libs/mpfr/mpfr-src/src/set_si_2exp.c
index 97743d7acbb..5e703a47aaa 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_si_2exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_si_2exp.c
@@ -1,7 +1,7 @@
/* mpfr_set_si_2exp -- set a MPFR number from a machine signed integer with
a shift
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -33,6 +33,7 @@ mpfr_set_si_2exp (mpfr_ptr x, long i, mpfr_exp_t e, mpfr_rnd_t rnd_mode)
MPFR_SET_POS (x);
MPFR_RET (0);
}
+#ifdef MPFR_LONG_WITHIN_LIMB
else
{
mp_size_t xn;
@@ -40,7 +41,15 @@ mpfr_set_si_2exp (mpfr_ptr x, long i, mpfr_exp_t e, mpfr_rnd_t rnd_mode)
mp_limb_t ai, *xp;
int inex = 0;
- /* FIXME: support int limbs (e.g. 16-bit limbs on 16-bit proc) */
+ /* Early underflow/overflow checking is necessary to avoid
+ integer overflow or errors due to special exponent values. */
+ if (MPFR_UNLIKELY (e < __gmpfr_emin - (mpfr_exp_t)
+ (sizeof (unsigned long) * CHAR_BIT + 1)))
+ return mpfr_underflow (x, rnd_mode == MPFR_RNDN ?
+ MPFR_RNDZ : rnd_mode, i < 0 ? -1 : 1);
+ if (MPFR_UNLIKELY (e >= __gmpfr_emax))
+ return mpfr_overflow (x, rnd_mode, i < 0 ? -1 : 1);
+
ai = SAFE_ABS (unsigned long, i);
MPFR_ASSERTN (SAFE_ABS (unsigned long, i) == ai);
@@ -70,4 +79,15 @@ mpfr_set_si_2exp (mpfr_ptr x, long i, mpfr_exp_t e, mpfr_rnd_t rnd_mode)
MPFR_EXP (x) = e;
return mpfr_check_range (x, inex, rnd_mode);
}
+#else
+ /* if a long does not fit into a limb, we use mpfr_set_z_2exp */
+ {
+ mpz_t z;
+ int inex;
+ mpz_init_set_si (z, i);
+ inex = mpfr_set_z_2exp (x, z, e, rnd_mode);
+ mpz_clear (z);
+ return inex;
+ }
+#endif
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_sj.c b/Build/source/libs/mpfr/mpfr-src/src/set_sj.c
index 9e20627c6cc..48812507618 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_sj.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_sj.c
@@ -1,6 +1,6 @@
/* mpfr_set_sj -- set a MPFR number from a huge machine signed integer
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,11 +20,7 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
#ifdef _MPFR_H_HAVE_INTMAX_T
@@ -38,7 +34,7 @@ mpfr_set_sj (mpfr_t x, intmax_t j, mpfr_rnd_t rnd)
int
mpfr_set_sj_2exp (mpfr_t x, intmax_t j, intmax_t e, mpfr_rnd_t rnd)
{
- if (j>=0)
+ if (j >= 0)
return mpfr_set_uj_2exp (x, j, e, rnd);
else
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_str.c b/Build/source/libs/mpfr/mpfr-src/src/set_str.c
index 8b35307aa7c..408051dbbe8 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_str.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_str.c
@@ -1,6 +1,6 @@
/* mpfr_set_str -- set a floating-point number from a string
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_str_raw.c b/Build/source/libs/mpfr/mpfr-src/src/set_str_raw.c
index d713371b83d..fd27cb3f3b0 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_str_raw.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_str_raw.c
@@ -1,6 +1,6 @@
/* mpfr_set_str_binary -- set a floating-point number from a binary string
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_ui.c b/Build/source/libs/mpfr/mpfr-src/src/set_ui.c
index a6a228a00f0..b6b9501930b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_ui.c
@@ -1,6 +1,6 @@
/* mpfr_set_ui -- set a MPFR number from a machine unsigned integer
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_ui_2exp.c b/Build/source/libs/mpfr/mpfr-src/src/set_ui_2exp.c
index 29ab03525e4..fa72613abb5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_ui_2exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_ui_2exp.c
@@ -1,7 +1,7 @@
/* mpfr_set_ui_2exp -- set a MPFR number from a machine unsigned integer with
a shift
-Copyright 2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -36,12 +36,21 @@ mpfr_set_ui_2exp (mpfr_ptr x, unsigned long i, mpfr_exp_t e, mpfr_rnd_t rnd_mode
}
else
{
+#ifdef MPFR_LONG_WITHIN_LIMB
mp_size_t xn;
int cnt, nbits;
mp_limb_t *xp;
int inex = 0;
- /* FIXME: support int limbs (e.g. 16-bit limbs on 16-bit proc) */
+ /* Early underflow/overflow checking is necessary to avoid
+ integer overflow or errors due to special exponent values. */
+ if (MPFR_UNLIKELY (e < __gmpfr_emin - (mpfr_exp_t)
+ (sizeof (unsigned long) * CHAR_BIT + 1)))
+ return mpfr_underflow (x, rnd_mode == MPFR_RNDN ?
+ MPFR_RNDZ : rnd_mode, i < 0 ? -1 : 1);
+ if (MPFR_UNLIKELY (e >= __gmpfr_emax))
+ return mpfr_overflow (x, rnd_mode, i < 0 ? -1 : 1);
+
MPFR_ASSERTD (i == (mp_limb_t) i);
/* Position of the highest limb */
@@ -68,5 +77,15 @@ mpfr_set_ui_2exp (mpfr_ptr x, unsigned long i, mpfr_exp_t e, mpfr_rnd_t rnd_mode
MPFR_EXP (x) = e;
return mpfr_check_range (x, inex, rnd_mode);
+#else
+ /* if a long does not fit into a limb, we use mpfr_set_z_2exp */
+ mpz_t z;
+ int inex;
+
+ mpz_init_set_ui (z, i);
+ inex = mpfr_set_z_2exp (x, z, e, rnd_mode);
+ mpz_clear (z);
+ return inex;
+#endif
}
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_uj.c b/Build/source/libs/mpfr/mpfr-src/src/set_uj.c
index 1f115b541d8..4dab72e1928 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_uj.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_uj.c
@@ -1,6 +1,6 @@
/* mpfr_set_uj -- set a MPFR number from a huge machine unsigned integer
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -20,12 +20,8 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-#ifdef HAVE_CONFIG_H
-# include "config.h"
-#endif
-
#define MPFR_NEED_LONGLONG_H
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
#ifdef _MPFR_H_HAVE_INTMAX_T
@@ -41,7 +37,7 @@ mpfr_set_uj (mpfr_t x, uintmax_t j, mpfr_rnd_t rnd)
int
mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd)
{
- int cnt;
+ int cnt, inex;
mp_size_t i, k;
mp_limb_t limb;
mp_limb_t yp[uintmaxpml];
@@ -57,6 +53,10 @@ mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd)
MPFR_RET(0);
}
+ /* early overflow detection to avoid a possible integer overflow below */
+ if (MPFR_UNLIKELY(e >= __gmpfr_emax))
+ return mpfr_overflow (x, rnd, MPFR_SIGN_POS);
+
MPFR_ASSERTN (sizeof(uintmax_t) % sizeof(mp_limb_t) == 0);
/* Create an auxiliary var */
@@ -107,7 +107,9 @@ mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd)
e += k * GMP_NUMB_BITS - cnt; /* Update Expo */
MPFR_ASSERTD (MPFR_LIMB_MSB(yp[numberof (yp) - 1]) != 0);
- /* Check expo underflow / overflow (can't use mpfr_check_range) */
+ MPFR_RNDRAW (inex, x, yp, uintmax_bit_size, rnd, MPFR_SIGN_POS, e++);
+
+ /* Check expo underflow / overflow */
if (MPFR_UNLIKELY(e < __gmpfr_emin))
{
/* The following test is necessary because in the rounding to the
@@ -116,16 +118,18 @@ mpfr_set_uj_2exp (mpfr_t x, uintmax_t j, intmax_t e, mpfr_rnd_t rnd)
* _ |x| < 2^(emin-2), or
* _ |x| = 2^(emin-2) and the absolute value of the exact
* result is <= 2^(emin-2). */
- if (rnd == MPFR_RNDN && (e+1 < __gmpfr_emin || mpfr_powerof2_raw(y)))
+ if (rnd == MPFR_RNDN &&
+ (e + 1 < __gmpfr_emin ||
+ (mpfr_powerof2_raw (x) && inex >= 0)))
rnd = MPFR_RNDZ;
return mpfr_underflow (x, rnd, MPFR_SIGN_POS);
}
if (MPFR_UNLIKELY(e > __gmpfr_emax))
return mpfr_overflow (x, rnd, MPFR_SIGN_POS);
- MPFR_SET_EXP (y, e);
- /* Final: set x to y (rounding if necessary) */
- return mpfr_set (x, y, rnd);
+ MPFR_SET_SIGN (x, MPFR_SIGN_POS);
+ MPFR_SET_EXP (x, e);
+ MPFR_RET (inex);
}
#endif
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_z.c b/Build/source/libs/mpfr/mpfr-src/src/set_z.c
index 2e3a428e3d7..1d780f032d1 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_z.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_z.c
@@ -1,6 +1,6 @@
/* mpfr_set_z -- set a floating-point number from a multiple-precision integer
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_z_exp.c b/Build/source/libs/mpfr/mpfr-src/src/set_z_exp.c
index 9b4462e0d4e..718fbe6c6a4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_z_exp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_z_exp.c
@@ -1,7 +1,7 @@
/* mpfr_set_z_2exp -- set a floating-point number from a multiple-precision
integer and an exponent
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/set_zero.c b/Build/source/libs/mpfr/mpfr-src/src/set_zero.c
index 5eb7aae61a0..a8847c35ba5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/set_zero.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/set_zero.c
@@ -1,6 +1,6 @@
/* mpfr_set_zero -- set a number to plus or minus zero.
-Copyright 2009-2019 Free Software Foundation, Inc.
+Copyright 2009-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/setmax.c b/Build/source/libs/mpfr/mpfr-src/src/setmax.c
index 49b3d232563..69abe9110a3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/setmax.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/setmax.c
@@ -1,6 +1,6 @@
/* mpfr_setmax -- maximum representable floating-point number (raw version)
-Copyright 2002-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/setmin.c b/Build/source/libs/mpfr/mpfr-src/src/setmin.c
index f2fe4fd005a..8caaf5c2aba 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/setmin.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/setmin.c
@@ -1,6 +1,6 @@
/* mpfr_setmin -- minimum representable floating-point number (raw version)
-Copyright 2002-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2002-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/setsign.c b/Build/source/libs/mpfr/mpfr-src/src/setsign.c
index 029e505d21e..346e7f817b2 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/setsign.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/setsign.c
@@ -1,6 +1,6 @@
/* mpfr_setsign -- Produce a value with the magnitude of x and sign bit s
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sgn.c b/Build/source/libs/mpfr/mpfr-src/src/sgn.c
index ebf8eed8cba..207c02b4584 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sgn.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sgn.c
@@ -1,6 +1,6 @@
/* mpfr_sgn -- Sign of a floating point number.
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/si_op.c b/Build/source/libs/mpfr/mpfr-src/src/si_op.c
index fa392e0ca7e..210cc7088dd 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/si_op.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/si_op.c
@@ -5,7 +5,7 @@
mpfr_div_si -- divide a floating-point number by a machine integer
mpfr_si_div -- divide a machine number by a floating-point number
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/signbit.c b/Build/source/libs/mpfr/mpfr-src/src/signbit.c
index 0e16448670b..2c5cd0f36d4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/signbit.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/signbit.c
@@ -1,6 +1,6 @@
/* mpfr_signbit -- Signbit of a MPFR number
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sin.c b/Build/source/libs/mpfr/mpfr-src/src/sin.c
index 0a4dde912f8..0e5d058dc83 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sin.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sin.c
@@ -1,6 +1,6 @@
/* mpfr_sin -- sine of a floating-point number
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -82,7 +82,9 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
goto end;
}
- m = precy + MPFR_INT_CEIL_LOG2 (precy) + 7;
+ /* for x large, since argument reduction is expensive, we want to avoid
+ any failure in Ziv's strategy, thus we take into account expx too */
+ m = precy + MPFR_INT_CEIL_LOG2 (MAX(precy,expx)) + 8;
/* since we compute sin(x) as sqrt(1-cos(x)^2), and for x small we have
cos(x)^2 ~ 1 - x^2, when subtracting cos(x)^2 from 1 we will lose
@@ -149,7 +151,7 @@ mpfr_sin (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
/* now that the argument is reduced, precision m is enough */
mpfr_set_prec (c, m);
mpfr_cos (c, xx, MPFR_RNDA); /* c = cos(x) rounded away */
- mpfr_mul (c, c, c, MPFR_RNDU); /* away */
+ mpfr_sqr (c, c, MPFR_RNDU); /* away */
mpfr_ui_sub (c, 1, c, MPFR_RNDZ);
mpfr_sqrt (c, c, MPFR_RNDZ);
if (MPFR_IS_NEG_SIGN(sign))
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sin_cos.c b/Build/source/libs/mpfr/mpfr-src/src/sin_cos.c
index 84c214c49e7..daf3040ee9b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sin_cos.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sin_cos.c
@@ -1,6 +1,6 @@
/* mpfr_sin_cos -- sine and cosine of a floating-point number
-Copyright 2002-2019 Free Software Foundation, Inc.
+Copyright 2002-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -282,13 +282,15 @@ reduce2 (mpz_t S, mpz_t C, mpfr_prec_t prec)
Assumes prec >= 10.
*/
+
+#define KMAX 64
static unsigned long
sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r,
mpfr_prec_t prec)
{
- mpz_t T[GMP_NUMB_BITS], Q[GMP_NUMB_BITS], ptoj[GMP_NUMB_BITS], pp;
- mpfr_prec_t log2_nb_terms[GMP_NUMB_BITS], mult[GMP_NUMB_BITS];
- mpfr_prec_t accu[GMP_NUMB_BITS], size_ptoj[GMP_NUMB_BITS];
+ mpz_t T[KMAX], Q[KMAX], ptoj[KMAX], pp;
+ mpfr_prec_t log2_nb_terms[KMAX], mult[KMAX];
+ mpfr_prec_t accu[KMAX], size_ptoj[KMAX];
mpfr_prec_t prec_i_have, h, r0 = r, pp_s, p_s;
unsigned long i, j, m;
int alloc, k, l;
@@ -342,7 +344,9 @@ sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r,
k ++;
if (k + 1 >= alloc) /* necessarily k + 1 = alloc */
{
+ MPFR_ASSERTD (k + 1 == alloc);
alloc ++;
+ MPFR_ASSERTN (k + 1 < KMAX);
mpz_init (T[k+1]);
mpz_init (Q[k+1]);
mpz_init (ptoj[k+1]);
@@ -353,6 +357,7 @@ sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r,
then Q[k+1] = (2*i+2)*(2*i+3), T[k+1] = 1,
which reduces to T[k] = (2*i+2)*(2*i+3)*2^r-pp,
Q[k] = (2*i)*(2*i+1)*(2*i+2)*(2*i+3). */
+ MPFR_ASSERTN (k < KMAX);
log2_nb_terms[k] = 1;
mpz_set_ui (Q[k], 2 * i + 2);
mpz_mul_ui (Q[k], Q[k], 2 * i + 3);
@@ -371,6 +376,7 @@ sin_bs_aux (mpz_t Q0, mpz_t S0, mpz_t C0, mpz_srcptr p, mpfr_prec_t r,
l = 1;
while ((j & 1) == 0) /* combine and reduce */
{
+ MPFR_ASSERTN (k >= 1);
mpz_mul (T[k], T[k], ptoj[l]);
mpz_mul (T[k-1], T[k-1], Q[k]);
mpz_mul_2exp (T[k-1], T[k-1], r << l);
@@ -502,7 +508,7 @@ sincos_aux (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
else
{
/* y <- trunc(x2 * 2^sh) = trunc(x * 2^(2*sh-1)) */
- mpfr_mul_2exp (x2, x2, sh, MPFR_RNDN); /* exact */
+ mpfr_mul_2ui (x2, x2, sh, MPFR_RNDN); /* exact */
mpfr_get_z (y, x2, MPFR_RNDZ); /* round toward zero: now
0 <= x2 < 2^sh, thus
0 <= x2/2^(sh-1) < 2^(1-sh) */
@@ -548,11 +554,11 @@ sincos_aux (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd_mode)
mpfr_set_z (s, S, MPFR_RNDN);
mpfr_div_z (s, s, Q, MPFR_RNDN);
- mpfr_div_2exp (s, s, l, MPFR_RNDN);
+ mpfr_div_2ui (s, s, l, MPFR_RNDN);
mpfr_set_z (c, C, MPFR_RNDN);
mpfr_div_z (c, c, Q, MPFR_RNDN);
- mpfr_div_2exp (c, c, l, MPFR_RNDN);
+ mpfr_div_2ui (c, c, l, MPFR_RNDN);
mpz_clear (Q);
mpz_clear (S);
@@ -615,7 +621,7 @@ mpfr_sincos_fast (mpfr_t s, mpfr_t c, mpfr_srcptr x, mpfr_rnd_t rnd)
mpfr_init2 (x_red, w);
mpfr_init2 (pi, (MPFR_EXP(x) > 0) ? w + MPFR_EXP(x) : w);
mpfr_const_pi (pi, MPFR_RNDN);
- mpfr_div_2exp (pi, pi, 1, MPFR_RNDN); /* Pi/2 */
+ mpfr_div_2ui (pi, pi, 1, MPFR_RNDN); /* Pi/2 */
mpfr_remquo (x_red, &q, x, pi, MPFR_RNDN);
/* x = q * (Pi/2 + eps1) + x_red + eps2,
where |eps1| <= 1/2*ulp(Pi/2) = 2^(-w-MAX(0,EXP(x))),
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sinh.c b/Build/source/libs/mpfr/mpfr-src/src/sinh.c
index 1cbb7a0c23f..83c8d9bf320 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sinh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sinh.c
@@ -1,6 +1,6 @@
/* mpfr_sinh -- hyperbolic sine
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sinh_cosh.c b/Build/source/libs/mpfr/mpfr-src/src/sinh_cosh.c
index 742e87de1b0..5e5764cd858 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sinh_cosh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sinh_cosh.c
@@ -1,6 +1,6 @@
/* mpfr_sinh_cosh -- hyperbolic sine and cosine
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -23,9 +23,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-#define INEXPOS(y) ((y) == 0 ? 0 : (((y) > 0) ? 1 : 2))
-#define INEX(y,z) (INEXPOS(y) | (INEXPOS(z) << 2))
-
/* The computations are done by
cosh(x) = 1/2 [e^(x)+e^(-x)]
sinh(x) = 1/2 [e^(x)-e^(-x)]
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sparc64/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/sparc64/mparam.h
index 765912448fb..5608c18f9cb 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sparc64/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/sparc64/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -19,215 +19,216 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 3.3.5 */
-/* gcc64.fsffrance.org (sparc64) with gmp 5.0.2 */
-
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 7.3.0 */
+/* gcc202.fsffrance.org (UltraSparc T5 (Niagara5)) with gmp snapshot
+ gmp-6.1.99-20180221 (gmp-6.1.2 is broken on this machine),
+ which defines -m64 -mptr64 -mcpu=niagara4 -Wa,-Av9d */
#define MPFR_MULHIGH_TAB \
- -1,0,0,-1,0,-1,-1,-1,7,-1,9,9,11,11,11,13, \
- 11,13,13,15,15,17,15,19,17,17,19,19,19,19,21,21, \
- 23,23,23,23,25,27,23,30,30,30,30,30,30,30,34,34, \
- 34,34,34,34,38,38,38,38,38,38,42,42,41,42,42,42, \
- 42,42,42,46,46,46,46,46,46,50,50,50,50,50,50,60, \
- 60,60,60,60,60,60,60,60,60,68,60,68,68,60,68,68, \
- 68,68,68,68,68,68,68,68,76,76,76,76,76,76,76,76, \
- 76,76,76,76,84,76,84,84,84,76,84,84,84,84,84,84, \
- 84,84,84,84,84,84,92,92,92,92,92,92,92,84,92,92, \
- 92,92,100,100,100,100,100,100,100,100,100,100,120,100,120,120, \
- 120,120,120,120,120,120,120,120,120,120,120,120,120,120,120,120, \
- 120,120,119,120,119,120,120,136,136,136,136,136,136,136,136,136, \
- 136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,152, \
- 152,152,152,136,152,152,152,136,152,136,152,152,136,152,152,152, \
- 152,152,152,136,152,152,168,168,168,201,168,168,201,201,201,201, \
- 201,201,201,201,201,200,201,200,201,200,201,201,201,201,201,201, \
- 201,201,201,201,201,200,201,201,201,201,201,201,201,201,201,201, \
- 201,201,201,201,201,201,201,201,201,201,201,201,201,201,201,201, \
- 201,201,201,201,200,201,200,201,201,201,201,201,201,201,201,201, \
- 225,224,225,225,225,225,225,224,225,224,225,224,225,225,225,282, \
- 225,282,282,282,282,282,282,294,294,294,294,294,294,294,294,294, \
- 282,294,294,294,294,294,294,294,294,294,294,294,294,294,294,294, \
- 294,294,293,294,294,294,294,294,294,294,294,294,294,294,294,294, \
- 294,294,294,294,293,294,294,294,294,294,294,294,294,294,293,294, \
- 294,294,294,294,294,294,294,294,294,294,294,294,294,318,294,318, \
- 294,294,294,360,359,360,360,358,360,360,360,360,359,360,360,360, \
- 360,360,360,360,360,360,360,360,360,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,359,360,360,360,360,360,360,360,360,360, \
- 360,360,360,360,360,360,360,358,360,360,360,360,360,360,354,360, \
- 360,360,360,360,360,360,360,392,360,360,392,392,360,392,391,392, \
- 391,392,392,392,391,392,391,392,354,392,391,392,391,392,391,392, \
- 391,392,391,392,391,392,391,392,392,392,391,392,392,392,392,392, \
- 424,392,391,392,424,392,424,424,424,392,424,424,424,424,424,472, \
- 424,424,424,472,424,472,472,472,472,472,472,472,472,472,472,471, \
- 472,472,472,472,472,472,472,472,472,472,472,471,472,472,472,471, \
- 472,472,472,472,472,472,472,472,472,472,472,472,472,472,471,472, \
- 472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,472,472,471,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,472,472,472,472,472,472,472,472,472,472,472,472,472, \
- 472,472,472,536,536,536,536,536,536,528,536,536,536,536,536,536, \
- 536,536,536,536,536,536,544,536,536,536,536,600,536,599,600,600, \
- 599,599,600,600,600,600,600,600,599,600,600,600,600,599,600,600, \
- 600,600,600,600,600,599,600,599,600,600,600,599,600,600,600,600, \
- 600,599,600,599,600,600,600,599,600,600,600,600,600,600,600,600, \
- 600,600,600,599,599,600,600,600,600,600,600,600,600,600,600,600, \
- 600,600,600,600,600,599,600,600,599,600,599,600,599,600,600,600, \
- 599,600,600,600,599,600,600,664,600,664,600,600,600,600,600,663, \
- 599,664,600,664,600,664,664,664,664,664,664,664,663,664,664,664, \
- 663,664,664,664,663,664,663,664,664,664,663,664,663,664,664,664, \
- 664,664,664,664,664,664,663,664,664,663,664,664,664,664,664,664, \
- 663,663,664,664,664,664,663,664,663,664,663,664,663,664,663,664, \
- 663,664,663,664,664,664,664,664,664,664,663,664,663,664,664,664, \
- 664,664,664,664,664,664,664,664,663,728,663,728,728,727,728,728, \
- 728,728,728,728,728,728,728,728,727,728,728,728,727,728,728,728, \
- 728,728,728,728,727,728,727,728,728,728,727,728,727,728,728,728, \
- 727,728,728,728,727,728,728,728,728,728,727,728,728,728,728,728, \
- 727,728,728,728,727,728,792,792,727,728,727,728,791,792,728,728, \
- 728,728,728,728,728,728,792,792,727,792,792,792,792,792,791,792, \
- 792,792,792,792,792,792,792,792,792,792,792,792,792,792,791,790, \
- 791,792,791,792,792,792,791,792,791,792,791,792,791,792,791,792, \
- 791,792,792,792,791,792,792,792,791,792,792,792,791,792,791,791, \
- 791,791,791,792,792,791,792,792,791,792,792,792,791,792,792,792, \
- 792,791,792,792,791,792,792,856,792,792,792,856,792,791,792,856 \
+ -1,0,0,0,0,0,-1,0,0,0,-1,0,0,0,-1,0, \
+ 0,0,0,14,14,15,16,15,18,18,16,18,18,19,20,22, \
+ 22,23,22,23,26,27,26,27,26,27,27,27,27,26,26,27, \
+ 27,29,30,27,32,33,34,35,36,37,38,38,40,40,40,44, \
+ 44,44,46,46,44,44,46,46,44,44,46,46,44,53,52,54, \
+ 52,53,54,54,52,54,54,54,52,53,54,54,54,54,58,54, \
+ 58,58,58,64,72,72,70,72,72,72,72,72,76,76,72,76, \
+ 76,76,76,76,76,76,76,72,88,88,76,88,88,88,88,88, \
+ 88,92,92,92,88,92,88,88,88,92,92,92,88,92,92,96, \
+ 104,108,104,108,92,108,104,104,104,108,108,108,108,108,108,108, \
+ 108,108,104,108,108,108,108,108,108,106,106,108,108,108,108,108, \
+ 108,108,108,116,108,108,108,108,116,108,116,108,108,116,108,108, \
+ 116,108,108,108,116,112,116,116,116,136,144,144,136,148,136,144, \
+ 136,143,144,152,148,148,144,144,152,152,144,144,148,148,152,144, \
+ 151,152,144,144,152,144,152,144,150,152,152,152,172,152,148,176, \
+ 176,176,176,176,176,176,176,176,176,176,176,184,184,184,184,184, \
+ 184,184,184,176,184,176,176,176,184,184,184,184,184,184,184,184, \
+ 184,183,184,184,184,184,184,184,184,184,184,213,184,184,216,213, \
+ 213,184,213,219,213,207,213,213,213,212,213,213,213,216,216,216, \
+ 225,219,219,225,213,225,216,225,225,225,228,225,225,213,213,237, \
+ 237,225,225,237,237,261,261,237,237,261,261,259,261,261,225,261, \
+ 261,261,261,225,261,255,260,261,261,261,261,261,261,264,264,264, \
+ 261,273,264,273,273,273,273,273,273,273,272,273,273,273,273,273, \
+ 273,273,273,273,272,273,273,273,273,273,273,273,273,261,273,273, \
+ 273,273,273,273,273,264,264,264,271,273,273,267,273,273,273,273, \
+ 273,272,273,273,273,272,273,273,273,273,273,273,273,272,273,273, \
+ 273,276,273,273,272,273,273,273,273,273,273,273,273,273,273,273, \
+ 273,273,273,273,273,273,318,273,318,273,318,318,318,273,273,273, \
+ 318,318,318,318,318,318,318,318,318,318,318,318,318,317,318,318, \
+ 318,318,317,318,318,318,317,318,318,318,318,318,318,318,318,318, \
+ 342,342,318,342,318,342,342,342,342,318,318,342,342,342,342,342, \
+ 342,342,342,342,342,342,342,342,342,342,342,342,342,342,424,424, \
+ 424,424,424,424,424,424,424,424,424,400,408,408,424,408,400,424, \
+ 424,424,400,423,424,424,424,424,424,424,424,424,424,424,424,423, \
+ 424,424,423,424,424,424,424,424,424,424,424,424,424,424,424,424, \
+ 424,424,424,424,424,424,424,423,423,424,424,424,423,424,424,424, \
+ 423,424,424,424,424,424,424,424,424,424,424,424,424,424,424,424, \
+ 424,424,424,424,424,424,424,424,424,424,424,456,424,424,456,456, \
+ 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, \
+ 456,456,456,456,456,456,456,456,456,456,456,456,456,456,456,456, \
+ 456,455,456,456,455,456,456,456,456,456,456,455,456,455,456,456, \
+ 456,488,487,488,488,488,488,488,488,488,488,487,488,488,488,488, \
+ 456,456,488,488,488,488,488,552,552,456,552,552,552,560,552,568, \
+ 552,560,560,552,551,560,560,568,559,560,560,568,559,568,560,583, \
+ 567,567,551,584,600,568,568,599,600,600,600,567,568,584,600,584, \
+ 600,568,583,584,560,568,600,568,583,600,600,584,568,584,583,584, \
+ 584,584,584,584,584,584,584,584,600,600,600,600,583,584,599,584, \
+ 600,600,600,600,600,600,584,600,597,598,599,600,600,598,600,599, \
+ 600,598,599,600,600,600,600,584,600,599,600,599,600,599,615,600, \
+ 616,600,600,616,600,599,600,599,600,600,600,599,600,616,648,648, \
+ 632,648,648,648,648,648,680,656,680,680,680,680,680,680,680,680, \
+ 696,696,680,680,696,696,696,696,696,679,696,695,696,680,696,696, \
+ 696,678,696,696,696,696,696,680,680,680,688,688,680,680,680,712, \
+ 696,696,695,696,696,696,696,696,696,728,720,728,696,728,696,696, \
+ 727,728,727,728,712,728,728,696,696,696,728,720,728,728,727,728, \
+ 728,728,727,728,728,728,727,728,728,728,728,727,728,728,728,728, \
+ 728,728,727,727,728,728,728,728,728,728,728,727,728,728,728,728, \
+ 728,728,728,728,728,728,728,728,728,728,728,728,728,727,728,727, \
+ 728,728,728,728,726,727,728,728,728,727,728,728,726,727,728,728, \
+ 728,728,728,728,728,727,728,726,727,728,728,728,728,727,728,728, \
+ 727,712,728,728,720,726,727,728,728,728,728,728,728,727,727,824, \
+ 824,728,727,728,728,727,728,728,728,727,728,824,728,824,824,824, \
+ 824,856,808,856,824,824,824,824,824,856,855,856,855,856,856,856, \
+ 856,856,856,856,855,856,856,856,855,856,855,856,856,856,856,856 \
#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,-1,5,5,7,7,9,7,9,8,9,10, \
- 11,10,11,11,13,12,13,13,17,14,16,16,16,16,17,18, \
- 18,18,19,20,20,22,21,24,22,24,23,24,24,26,26,26, \
- 28,28,28,30,28,29,30,31,30,31,32,33,32,33,34,35, \
- 34,35,36,36,36,37,38,40,40,40,40,40,42,43,42,44, \
- 45,47,50,44,44,44,50,48,50,51,47,48,49,48,49,50, \
- 51,52,53,52,53,52,53,54,55,56,57,58,59,56,57,58, \
- 59,58,59,62,61,60,61,62,63,62,63,64,65,64,65,70, \
- 67,72,72,72,76,74,72,72,74,76,76,76,76,74,80,80, \
- 74,76,84,80,80,82,80,84,82,84,84,88,84,90,88,82, \
- 86,88,88,84,84,86,88,88,88,88,88,88,88,88,90,92, \
- 90,92,92,92,96,94,96,96,96,96,100,96,96,116,98,100, \
- 98,98,100,100,117,117,118,119,119,120,116,119,120,119,118,119, \
- 119,119,122,128,120,119,120,119,116,121,120,118,120,125,125,119, \
- 125,124,131,131,130,131,134,131,132,134,124,125,133,143,137,138, \
- 131,144,138,137,135,138,130,135,137,143,143,137,137,143,130,138, \
- 131,140,138,137,136,149,149,142,143,156,149,149,144,154,149,147, \
- 149,156,149,152,147,147,155,156,149,150,149,146,160,160,163,168, \
- 167,167,156,166,156,164,156,158,161,172,161,166,167,161,173,164, \
- 167,174,173,162,171,172,173,176,173,171,165,182,174,174,173,184, \
- 171,170,174,173,178,176,176,168,179,176,177,182,178,180,191,174, \
- 186,184,176,192,180,180,173,174,179,185,175,182,184,180,179,178, \
- 179,180,179,186,185,185,188,184,186,188,186,190,191,191,195,192, \
- 198,192,194,200,213,197,225,198,201,200,191,210,195,212,224,212, \
- 213,213,212,212,213,213,221,218,218,224,199,224,219,224,225,225, \
- 225,222,225,228,229,213,237,228,218,224,234,240,237,240,242,242, \
- 243,240,242,242,235,228,231,228,237,230,231,236,236,237,336,336, \
- 336,336,336,336,336,336,336,336,336,336,341,336,336,336,336,336, \
- 336,336,341,336,336,336,336,342,336,336,342,336,336,336,336,342, \
- 336,336,336,336,336,336,336,342,336,336,336,336,342,336,336,336, \
- 336,336,336,336,336,336,336,342,336,336,336,336,342,336,336,342, \
- 336,336,342,336,336,336,336,336,336,336,342,336,336,336,336,342, \
- 336,342,342,336,342,342,336,342,336,342,336,336,342,336,336,342, \
- 336,336,342,336,336,342,336,342,342,342,341,348,342,348,348,348, \
- 342,342,354,348,354,354,348,336,354,354,354,336,342,360,360,354, \
- 354,342,360,360,366,366,360,372,354,360,354,360,354,360,360,353, \
- 336,336,342,360,366,342,360,336,336,342,342,336,336,336,341,341, \
- 336,336,336,336,342,342,336,342,342,342,342,336,342,342,341,342, \
- 348,342,342,360,354,348,348,342,354,348,360,348,354,354,353,354, \
- 354,354,354,456,360,360,456,366,372,366,366,456,354,366,456,456, \
- 456,378,456,456,455,456,456,456,378,366,390,384,378,378,360,378, \
- 372,366,378,456,378,464,472,378,472,472,336,456,472,456,456,456, \
- 472,472,456,456,472,464,456,456,456,342,426,456,426,455,472,456, \
- 472,472,426,472,348,456,472,456,456,455,456,480,455,456,455,456, \
- 456,455,456,456,454,456,456,456,456,455,456,456,454,455,456,456, \
- 456,464,456,456,455,456,455,456,456,464,456,456,472,456,456,464, \
- 472,472,456,456,455,456,456,456,455,472,479,456,472,472,488,464, \
- 472,472,471,488,472,472,488,488,472,472,488,456,480,472,456,488, \
- 472,472,479,463,488,426,456,426,426,426,426,425,455,455,425,456, \
- 455,455,456,480,455,456,456,456,456,455,456,456,454,456,455,456, \
- 456,455,456,456,455,455,455,456,456,454,456,456,455,456,456,456, \
- 456,455,456,456,472,456,456,456,456,455,464,464,472,472,472,464, \
- 472,472,456,455,472,472,471,456,472,480,456,480,480,480,456,488, \
- 480,488,488,488,472,472,488,488,472,472,488,480,496,472,456,480, \
- 496,472,488,456,480,456,456,456,456,488,456,456,488,456,456,456, \
- 456,455,456,456,455,455,456,464,456,512,456,456,512,472,464,456, \
- 472,512,456,480,464,480,472,471,472,472,471,479,470,480,471,471, \
- 472,472,480,488,478,480,488,487,480,480,488,488,568,485,488,488, \
- 512,488,488,471,568,512,512,512,512,496,511,511,512,512,520,511, \
- 512,512,520,520,568,512,520,520,512,512,520,520,519,520,519,519, \
- 520,568,520,536,536,536,536,528,536,528,535,535,534,512,535,512, \
- 536,536,552,552,536,552,552,520,567,544,552,552,552,568,567,567, \
- 568,568,567,567,568,568,535,584,568,512,568,567,512,568,567,568, \
- 576,568,567,584,568,600,584,584,600,568,597,592,591,600,599,599 \
+ -1,0,0,0,0,0,-1,0,0,0,-1,7,8,8,10,10, \
+ 10,10,11,11,12,12,14,14,14,14,16,16,16,16,18,18, \
+ 18,18,20,20,20,20,22,22,22,24,24,26,26,24,26,26, \
+ 26,26,28,28,28,30,30,29,30,31,32,31,32,32,34,34, \
+ 34,34,36,36,36,36,38,38,38,38,40,39,40,40,42,42, \
+ 44,42,44,44,46,44,46,46,46,46,48,48,48,50,54,49, \
+ 52,50,52,52,54,54,58,56,58,56,58,58,56,58,58,60, \
+ 58,58,59,60,60,60,62,72,62,62,66,64,64,66,70,72, \
+ 72,72,72,72,72,72,70,72,72,72,72,76,72,76,76,76, \
+ 76,76,76,76,80,76,78,80,80,80,80,80,80,84,84,84, \
+ 84,84,88,84,84,84,88,88,88,88,88,88,88,88,92,92, \
+ 92,92,92,92,92,92,96,100,96,96,96,96,96,96,100,100, \
+ 100,100,104,104,104,104,104,104,104,104,104,112,120,104,112,119, \
+ 108,119,124,108,108,108,120,112,112,112,132,112,124,112,124,119, \
+ 120,119,118,119,117,117,119,117,124,120,130,120,120,120,126,125, \
+ 124,128,125,124,129,131,126,126,128,136,130,128,131,136,130,130, \
+ 131,131,137,131,136,134,137,136,137,136,138,142,136,138,137,137, \
+ 141,138,140,142,144,142,143,142,148,142,144,144,147,154,154,146, \
+ 147,149,149,154,160,148,156,160,154,153,152,153,152,154,155,155, \
+ 160,154,155,155,156,168,159,161,166,166,160,160,160,162,162,161, \
+ 162,166,166,172,173,166,167,166,172,166,167,167,178,174,178,172, \
+ 174,171,172,172,173,174,178,174,179,180,178,179,184,177,179,178, \
+ 178,180,182,180,180,185,190,184,184,184,190,213,184,213,190,213, \
+ 186,213,213,213,213,213,190,213,213,213,213,213,213,213,213,213, \
+ 213,213,213,213,216,213,213,213,225,213,213,213,225,225,225,213, \
+ 213,225,213,213,213,225,225,225,237,237,237,237,225,237,225,225, \
+ 225,237,237,237,237,237,228,225,237,237,237,237,237,237,237,237, \
+ 237,237,237,237,237,249,240,225,225,225,225,225,228,225,237,237, \
+ 234,237,237,237,237,237,237,237,237,237,240,233,237,245,237,237, \
+ 237,237,237,249,242,249,249,243,244,249,249,249,249,261,249,261, \
+ 249,248,256,249,249,259,249,261,249,249,249,249,249,252,252,255, \
+ 261,257,261,257,257,261,261,261,261,261,261,261,261,261,261,261, \
+ 261,261,261,261,261,261,273,273,269,273,268,273,273,273,273,273, \
+ 273,273,273,273,273,273,273,273,273,273,273,273,273,273,273,273, \
+ 278,285,285,285,285,285,285,285,285,285,285,285,285,285,288,288, \
+ 285,285,285,285,285,285,297,297,297,297,296,297,297,297,297,297, \
+ 297,297,297,292,297,293,295,296,297,297,297,297,297,297,303,297, \
+ 321,306,300,300,304,302,303,305,308,309,307,309,309,309,307,309, \
+ 309,309,309,321,309,321,319,319,321,321,319,321,321,321,321,321, \
+ 321,321,321,316,321,321,321,320,321,321,321,320,321,321,321,321, \
+ 329,333,333,328,333,333,333,332,333,333,333,333,333,333,333,333, \
+ 333,333,342,333,333,333,333,333,342,342,342,354,342,342,342,342, \
+ 342,341,342,342,342,342,342,342,342,342,348,354,354,348,348,426, \
+ 354,354,426,354,426,353,354,354,353,354,354,354,354,354,354,354, \
+ 354,354,450,365,365,450,449,366,365,366,366,366,450,425,426,450, \
+ 426,426,426,425,366,426,426,426,426,424,450,426,426,426,426,426, \
+ 425,426,450,424,425,426,426,450,449,450,450,449,450,450,450,449, \
+ 450,449,449,450,449,450,449,450,449,450,450,450,448,450,426,449, \
+ 425,450,426,450,425,426,426,426,426,426,426,426,425,426,426,426, \
+ 426,426,426,426,425,426,450,448,449,450,450,449,450,450,450,450, \
+ 450,450,450,450,450,450,450,450,450,450,450,450,450,450,450,450, \
+ 450,449,450,450,450,450,449,450,448,449,450,450,449,448,450,450, \
+ 448,450,450,450,450,450,449,450,450,448,448,450,450,448,449,450, \
+ 450,449,450,449,450,450,450,449,450,450,450,449,450,450,450,450, \
+ 450,450,450,450,450,450,450,450,450,450,450,450,449,450,450,450, \
+ 450,450,450,450,450,450,450,450,449,450,450,450,450,450,450,450, \
+ 488,450,488,488,488,487,488,488,568,568,560,560,599,600,567,568, \
+ 568,600,568,568,568,568,568,568,568,568,568,568,567,568,567,568, \
+ 568,568,567,568,568,567,568,568,568,568,568,568,567,568,599,567, \
+ 600,568,599,600,568,600,600,600,568,600,600,600,599,599,600,600, \
+ 600,599,568,600,600,600,600,600,599,600,600,600,568,568,600,598, \
+ 600,600,568,600,600,600,600,599,600,599,600,598,600,599,600,600, \
+ 600,599,600,599,600,600,600,600,600,600,600,600,600,599,600,600, \
+ 600,598,600,600,632,599,632,631,632,632,631,632,631,632,632,632 \
#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,6,7,8,9,10,11,12,13, \
- 10,10,11,11,13,12,13,13,14,14,15,15,18,17,19,19, \
- 18,21,19,20,22,21,27,27,22,22,27,28,27,27,27,30, \
- 27,27,27,27,31,31,30,30,31,31,31,35,34,33,35,35, \
- 38,37,36,38,39,39,39,37,39,39,43,43,47,42,43,43, \
- 45,47,54,43,54,54,45,54,54,54,54,55,54,54,55,54, \
- 54,54,54,54,54,54,54,54,54,54,58,58,60,60,60,60, \
- 60,60,68,62,60,60,65,68,68,68,68,68,67,68,76,68, \
- 67,68,67,68,76,76,71,73,76,76,77,76,79,73,79,84, \
- 76,76,78,76,76,84,84,84,84,83,84,84,92,92,83,84, \
- 92,92,84,84,92,84,88,108,86,108,108,108,108,108,108,108, \
- 108,92,108,108,92,108,108,108,120,120,108,108,120,120,120,120, \
- 120,120,108,108,108,120,108,108,120,108,118,108,108,108,108,120, \
- 120,120,108,108,120,120,118,120,120,120,120,120,120,120,120,120, \
- 120,120,120,120,120,120,136,120,120,120,125,136,136,120,136,136, \
- 136,136,136,136,136,136,136,136,136,136,136,136,136,136,136,136, \
- 136,136,136,136,152,136,135,136,152,152,136,136,152,152,152,152, \
- 152,152,152,152,151,152,152,152,152,152,149,150,152,152,152,152, \
- 152,152,151,152,152,168,167,168,152,152,167,152,152,152,165,157, \
- 168,168,167,168,168,184,168,168,168,168,168,168,168,168,168,168, \
- 168,167,168,168,184,168,168,168,184,184,184,184,184,184,184,184, \
- 172,184,179,180,184,184,184,184,184,184,176,180,184,184,216,216, \
- 184,184,184,216,184,184,216,184,184,216,184,216,216,184,216,216, \
- 240,240,216,216,240,240,216,216,240,240,239,214,240,240,216,240, \
- 240,240,238,240,240,240,216,240,240,239,240,216,240,240,216,238, \
- 240,240,240,216,240,240,240,238,240,240,239,240,240,240,240,240, \
- 240,239,240,240,240,240,240,240,240,240,239,238,240,240,240,240, \
- 240,240,240,238,240,240,240,240,240,240,239,238,240,240,240,240, \
- 240,240,238,238,240,240,240,240,240,239,239,240,240,240,240,240, \
- 240,240,240,240,240,240,271,240,240,240,240,271,240,240,272,272, \
- 272,272,272,272,272,272,272,272,270,271,272,272,272,272,272,272, \
- 272,271,272,272,272,269,272,272,272,270,269,272,272,272,272,272, \
- 272,272,272,269,272,272,272,272,304,267,271,272,272,272,272,272, \
- 271,272,272,272,272,272,271,272,272,270,272,272,272,272,273,301, \
- 304,304,300,301,304,303,304,304,304,303,303,304,304,304,303,301, \
- 304,304,303,298,304,304,303,304,304,303,301,304,304,303,301,302, \
- 304,303,304,304,304,304,301,304,304,304,301,302,304,304,301,304, \
- 304,303,303,304,304,304,304,304,304,304,303,304,304,304,336,336, \
- 336,335,336,334,336,336,336,336,336,336,336,336,336,336,336,336, \
- 336,336,334,336,336,336,336,336,336,336,335,336,336,336,336,336, \
- 336,336,336,336,336,328,336,336,336,336,335,336,336,336,336,336, \
- 336,368,336,334,336,336,336,336,336,336,336,336,336,336,396,400, \
- 398,384,368,400,384,399,399,400,368,368,368,400,368,368,368,400, \
- 400,400,399,400,400,376,400,400,400,367,399,400,368,367,400,366, \
- 367,368,400,366,368,368,365,368,368,368,400,399,400,400,368,399, \
- 368,368,366,368,368,368,400,368,368,368,368,368,368,368,400,400, \
- 396,400,397,374,400,399,400,400,400,400,397,398,400,401,400,400, \
- 400,400,400,396,399,397,400,400,400,400,400,396,400,401,400,432, \
- 400,398,399,400,396,396,432,432,400,432,400,396,400,397,399,400, \
- 400,400,400,396,400,401,432,432,432,399,432,400,400,432,432,432, \
- 432,432,432,432,432,433,432,432,432,432,432,480,480,432,432,432, \
- 432,432,432,432,432,432,432,432,432,431,431,432,432,480,432,432, \
- 480,480,432,478,480,432,432,480,432,432,432,432,480,432,432,432, \
- 432,432,432,432,480,480,432,432,480,432,432,432,432,432,480,478, \
- 480,447,477,480,480,480,480,480,480,479,440,444,480,445,448,480, \
- 480,479,464,464,480,480,480,478,480,480,478,480,480,480,480,480, \
- 480,479,480,479,480,480,478,480,480,480,478,478,480,480,480,480, \
- 480,480,480,478,480,480,480,478,480,479,478,480,480,476,480,478, \
- 480,480,478,478,480,480,480,480,480,479,479,478,480,480,480,480, \
- 480,479,480,478,480,480,480,480,480,479,543,544,544,480,544,544, \
- 542,543,544,544,544,540,544,544,544,544,544,542,544,544,544,544, \
- 542,542,542,542,544,544,544,560,542,542,575,543,544,544,544,542, \
- 544,575,575,544,544,544,544,544,561,561,543,559,544,560,560,560, \
- 608,587,573,575,575,608,583,585,560,575,585,575,588,573,608,577 \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*32-47*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,37,0,37,37,44,41,43,44,44,45,45,44, /*64-79*/ \
+ 44,45,45,45,45,51,51,52,51,53,52,49,49,52,50,50, /*80-95*/ \
+ 51,50,51,52,53,52,53,56,58,54,57,59,59,66,64,66, /*96-111*/ \
+ 64,75,74,68,72,72,72,72,72,72,74,72,72,68,72,67, /*112-127*/ \
+ 75,72,80,88,72,88,88,88,86,88,88,72,88,88,88,88, /*128-143*/ \
+ 88,84,88,88,88,88,88,88,84,90,88,88,88,84,88,87, /*144-159*/ \
+ 88,91,92,91,88,89,91,88,90,88,92,101,90,100,98,104, /*160-175*/ \
+ 104,104,102,104,104,104,104,106,104,104,104,104,104,104,100,100, /*176-191*/ \
+ 106,108,107,105,102,106,108,104,104,108,104,104,116,104,120,107, /*192-207*/ \
+ 112,116,112,114,114,116,116,116,116,116,128,136,116,144,116,128, /*208-223*/ \
+ 124,132,128,136,132,136,144,148,136,144,144,144,152,144,144,144, /*224-239*/ \
+ 148,148,144,148,144,144,144,144,144,148,160,132,135,136,136,136, /*240-255*/ \
+ 144,136,144,176,144,144,148,148,152,152,152,144,148,152,176,148, /*256-271*/ \
+ 176,144,144,140,150,176,152,176,176,176,148,144,148,144,176,152, /*272-287*/ \
+ 176,169,176,176,176,176,176,180,180,176,175,176,176,176,176,176, /*288-303*/ \
+ 180,176,175,176,182,176,176,176,175,176,176,175,176,176,180,176, /*304-319*/ \
+ 180,183,184,176,176,176,176,176,176,175,176,176,176,176,176,176, /*320-335*/ \
+ 176,182,200,180,176,176,186,180,180,176,180,200,184,180,184,188, /*336-351*/ \
+ 180,180,200,208,204,180,192,212,196,208,216,184,208,208,208,213, /*352-367*/ \
+ 208,208,208,207,208,215,208,208,212,208,212,215,208,212,210,208, /*368-383*/ \
+ 208,208,210,207,208,208,216,207,208,208,207,208,208,208,208,216, /*384-399*/ \
+ 215,215,215,215,214,216,216,208,208,216,216,232,232,214,224,216, /*400-415*/ \
+ 230,216,232,224,231,216,232,224,232,232,232,232,232,230,232,232, /*416-431*/ \
+ 232,240,232,231,232,232,240,228,231,232,232,232,232,232,231,256, /*432-447*/ \
+ 232,264,232,232,232,272,256,232,256,264,232,272,272,288,272,288, /*448-463*/ \
+ 288,280,272,272,288,271,256,296,288,288,288,288,296,288,296,288, /*464-479*/ \
+ 296,296,288,304,296,296,288,303,288,304,296,288,288,288,296,296, /*480-495*/ \
+ 296,304,296,264,300,288,288,303,288,296,304,304,296,288,288,304, /*496-511*/ \
+ 288,300,288,296,296,296,336,352,352,296,288,288,304,288,288,296, /*512-527*/ \
+ 303,272,296,287,352,288,296,352,352,352,304,288,352,296,352,352, /*528-543*/ \
+ 352,304,288,360,288,288,352,296,352,352,296,352,288,288,296,296, /*544-559*/ \
+ 288,288,288,304,296,304,304,352,368,304,304,352,352,296,312,320, /*560-575*/ \
+ 304,304,336,351,360,352,304,352,304,352,351,352,352,352,351,352, /*576-591*/ \
+ 352,352,352,352,352,350,352,352,352,352,368,352,360,360,352,352, /*592-607*/ \
+ 352,352,351,352,352,352,352,352,360,352,352,352,352,367,352,352, /*608-623*/ \
+ 352,352,368,352,356,368,360,352,352,360,352,368,368,352,368,368, /*624-639*/ \
+ 360,352,368,360,352,352,352,350,368,352,352,368,352,352,352,364, /*640-655*/ \
+ 359,352,351,352,360,352,352,352,352,352,352,352,352,352,359,351, /*656-671*/ \
+ 352,352,368,352,352,352,352,352,352,350,352,352,352,349,351,352, /*672-687*/ \
+ 352,352,360,360,352,360,360,368,352,364,368,352,360,368,362,368, /*688-703*/ \
+ 360,360,366,367,360,360,360,359,367,368,368,367,368,368,361,367, /*704-719*/ \
+ 368,368,367,368,368,368,365,368,367,368,367,367,368,368,416,432, /*720-735*/ \
+ 373,432,432,399,424,424,432,432,414,432,414,424,432,414,424,416, /*736-751*/ \
+ 400,424,424,424,424,424,423,426,424,432,422,423,424,416,426,432, /*752-767*/ \
+ 424,426,430,432,424,424,426,414,424,432,414,432,416,416,416,417, /*768-783*/ \
+ 414,414,416,416,416,414,416,432,426,432,432,415,432,414,432,424, /*784-799*/ \
+ 432,424,418,414,424,424,425,414,425,416,412,414,416,424,422,430, /*800-815*/ \
+ 432,424,424,430,432,432,424,430,416,423,416,424,432,425,432,426, /*816-831*/ \
+ 432,426,432,432,432,424,428,432,431,431,432,432,432,448,432,426, /*832-847*/ \
+ 448,432,432,432,456,456,462,462,448,464,448,462,432,464,461,456, /*848-863*/ \
+ 456,464,462,462,456,461,462,462,462,462,463,464,462,462,460,464, /*864-879*/ \
+ 528,456,464,462,460,461,462,460,464,464,464,528,544,544,464,528, /*880-895*/ \
+ 528,462,528,528,512,544,544,528,528,544,544,544,544,528,542,544, /*896-911*/ \
+ 544,544,544,544,544,528,512,544,512,542,545,528,544,542,528,544, /*912-927*/ \
+ 544,544,543,528,544,541,542,542,528,544,544,543,545,544,544,544, /*928-943*/ \
+ 544,545,542,544,544,546,542,544,544,544,544,546,542,544,544,544, /*944-959*/ \
+ 542,544,544,543,544,543,542,544,576,544,544,544,576,576,544,543, /*960-975*/ \
+ 544,543,544,544,544,544,576,544,545,576,576,541,592,544,544,576, /*976-991*/ \
+ 576,575,576,544,543,544,576,527,576,528,608,576,544,608,544,544, /*992-1007*/ \
+ 542,544,544,544,544,539,608,608,543,542,544,608,543,544,528,544 /*1008-1023*/ \
#define MPFR_MUL_THRESHOLD 13 /* limbs */
-#define MPFR_SQR_THRESHOLD 11 /* limbs */
-#define MPFR_DIV_THRESHOLD 19 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 1092 /* bits */
-#define MPFR_EXP_THRESHOLD 11053 /* bits */
-#define MPFR_SINCOS_THRESHOLD 25857 /* bits */
-#define MPFR_AI_THRESHOLD1 -19352 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 1476
-#define MPFR_AI_THRESHOLD3 30069
-/* Tuneup completed successfully, took 8167 seconds */
+#define MPFR_SQR_THRESHOLD 13 /* limbs */
+#define MPFR_DIV_THRESHOLD 4 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 1712 /* bits */
+#define MPFR_EXP_THRESHOLD 3213 /* bits */
+#define MPFR_SINCOS_THRESHOLD 21539 /* bits */
+#define MPFR_AI_THRESHOLD1 -6778 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 549
+#define MPFR_AI_THRESHOLD3 8223
+/* Tuneup completed successfully, took 686 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sqr.c b/Build/source/libs/mpfr/mpfr-src/src/sqr.c
index 56c21453021..0ab414ba113 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sqr.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sqr.c
@@ -1,6 +1,6 @@
/* mpfr_sqr -- Floating-point square
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -26,8 +26,10 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#if !defined(MPFR_GENERIC_ABI) && (GMP_NUMB_BITS == 32 || GMP_NUMB_BITS == 64)
/* Special code for prec(a) < GMP_NUMB_BITS and prec(b) <= GMP_NUMB_BITS.
- Note: this function was copied from mpfr_mul_1 in file mul.c, thus any change
- here should be done also in mpfr_mul_1. */
+ Note: this function was copied from mpfr_mul_1 in file mul.c, thus any
+ change here should be done also in mpfr_mul_1.
+ Although this function works as soon as prec(a) < GMP_NUMB_BITS and
+ prec(b) <= GMP_NUMB_BITS, we use it for prec(a)=prec(b) < GMP_NUMB_BITS. */
static int
mpfr_sqr_1 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
{
@@ -75,16 +77,17 @@ mpfr_sqr_1 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
possible for p=53, because the largest significand is 6369051672525772
but its square has only 52 leading ones. For p=24 it is possible,
with b = 11863283, whose square has 24 leading ones. */
- if ((ax == __gmpfr_emin - 1) && (ap[0] == ~mask) &&
+ if (ax == __gmpfr_emin - 1 && ap[0] == ~mask &&
((rnd_mode == MPFR_RNDN && rb) ||
- (MPFR_IS_LIKE_RNDA(rnd_mode, MPFR_IS_NEG (a)) && (rb | sb))))
+ (MPFR_IS_LIKE_RNDA (rnd_mode, 0) && (rb | sb))))
goto rounding; /* no underflow */
/* For RNDN, mpfr_underflow always rounds away, thus for |a| <= 2^(emin-2)
we have to change to RNDZ. This corresponds to:
(a) either ax < emin - 1
(b) or ax = emin - 1 and ap[0] = 1000....000 and rb = sb = 0 */
if (rnd_mode == MPFR_RNDN &&
- (ax < __gmpfr_emin - 1 || (ap[0] == MPFR_LIMB_HIGHBIT && (rb | sb) == 0)))
+ (ax < __gmpfr_emin - 1 ||
+ (ap[0] == MPFR_LIMB_HIGHBIT && (rb | sb) == 0)))
rnd_mode = MPFR_RNDZ;
return mpfr_underflow (a, rnd_mode, MPFR_SIGN_POS);
}
@@ -104,7 +107,7 @@ mpfr_sqr_1 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
else
goto add_one_ulp;
}
- else if (MPFR_IS_LIKE_RNDZ(rnd_mode, MPFR_IS_NEG(a)))
+ else if (MPFR_IS_LIKE_RNDZ (rnd_mode, 0))
{
truncate:
MPFR_ASSERTD(ax >= __gmpfr_emin);
@@ -179,7 +182,8 @@ mpfr_sqr_1n (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode)
(a) either ax < emin - 1
(b) or ax = emin - 1 and ap[0] = 1000....000 and rb = sb = 0 */
if (rnd_mode == MPFR_RNDN &&
- (ax < __gmpfr_emin - 1 || (ap[0] == MPFR_LIMB_HIGHBIT && (rb | sb) == 0)))
+ (ax < __gmpfr_emin - 1 ||
+ (ap[0] == MPFR_LIMB_HIGHBIT && (rb | sb) == 0)))
rnd_mode = MPFR_RNDZ;
return mpfr_underflow (a, rnd_mode, MPFR_SIGN_POS);
}
@@ -199,7 +203,7 @@ mpfr_sqr_1n (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode)
else
goto add_one_ulp;
}
- else if (MPFR_IS_LIKE_RNDZ(rnd_mode, MPFR_IS_NEG(a)))
+ else if (MPFR_IS_LIKE_RNDZ (rnd_mode, 0))
{
truncate:
MPFR_ASSERTD(ax >= __gmpfr_emin);
@@ -292,24 +296,24 @@ mpfr_sqr_2 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
a >= 0.111...111[1]*2^(emin-1), there is no underflow. */
if (MPFR_UNLIKELY(ax < __gmpfr_emin))
{
- /* Note: like for mpfr_sqr_2, the case
+ /* Note: like for mpfr_sqr_1, the case
0.111...111*2^(emin-1) < a < 2^(emin-1) is not possible when emin is
odd, since (modulo a shift) this would imply 1-2^(-p) < a = b^2 < 1,
and this is not possible with 1-2^(-p) <= b < 1.
For emin even, it is possible for some values of p, for example for
p=69 with b=417402170410649030795*2^k. */
- if ((ax == __gmpfr_emin - 1) &&
- (ap[1] == MPFR_LIMB_MAX) &&
- (ap[0] == ~mask) &&
+ if (ax == __gmpfr_emin - 1 &&
+ ap[1] == MPFR_LIMB_MAX &&
+ ap[0] == ~mask &&
((rnd_mode == MPFR_RNDN && rb) ||
- (MPFR_IS_LIKE_RNDA(rnd_mode, MPFR_IS_NEG (a)) && (rb | sb))))
+ (MPFR_IS_LIKE_RNDA (rnd_mode, 0) && (rb | sb))))
goto rounding; /* no underflow */
- /* for RNDN, mpfr_underflow always rounds away, thus for |a| <= 2^(emin-2)
- we have to change to RNDZ */
+ /* for RNDN, mpfr_underflow always rounds away, thus for
+ |a| <= 2^(emin-2) we have to change to RNDZ */
if (rnd_mode == MPFR_RNDN &&
(ax < __gmpfr_emin - 1 ||
(ap[1] == MPFR_LIMB_HIGHBIT && ap[0] == 0 && (rb | sb) == 0)))
- rnd_mode = MPFR_RNDZ;
+ rnd_mode = MPFR_RNDZ;
return mpfr_underflow (a, rnd_mode, MPFR_SIGN_POS);
}
@@ -328,7 +332,7 @@ mpfr_sqr_2 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
else
goto add_one_ulp;
}
- else if (MPFR_IS_LIKE_RNDZ(rnd_mode, MPFR_IS_NEG(a)))
+ else if (MPFR_IS_LIKE_RNDZ (rnd_mode, 0))
{
truncate:
MPFR_ASSERTD(ax >= __gmpfr_emin);
@@ -401,13 +405,13 @@ mpfr_sqr_3 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
sb = sb2 = 1; /* result cannot be exact in that case */
else
{
- mp_limb_t p[6];
- mpn_sqr (p, bp, 3);
- a2 = p[5];
- a1 = p[4];
- a0 = p[3];
- sb = p[2];
- sb2 = p[1] | p[0];
+ mp_limb_t t[6];
+ mpn_sqr (t, bp, 3);
+ a2 = t[5];
+ a1 = t[4];
+ a0 = t[3];
+ sb = t[2];
+ sb2 = t[1] | t[0];
}
if (a2 < MPFR_LIMB_HIGHBIT)
{
@@ -435,12 +439,12 @@ mpfr_sqr_3 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
a >= 0.111...111[1]*2^(emin-1), there is no underflow. */
if (MPFR_UNLIKELY(ax < __gmpfr_emin))
{
- if ((ax == __gmpfr_emin - 1) &&
- (ap[2] == MPFR_LIMB_MAX) &&
- (ap[1] == MPFR_LIMB_MAX) &&
- (ap[0] == ~mask) &&
+ if (ax == __gmpfr_emin - 1 &&
+ ap[2] == MPFR_LIMB_MAX &&
+ ap[1] == MPFR_LIMB_MAX &&
+ ap[0] == ~mask &&
((rnd_mode == MPFR_RNDN && rb) ||
- (MPFR_IS_LIKE_RNDA(rnd_mode, MPFR_IS_NEG (a)) && (rb | sb))))
+ (MPFR_IS_LIKE_RNDA (rnd_mode, 0) && (rb | sb))))
goto rounding; /* no underflow */
/* for RNDN, mpfr_underflow always rounds away, thus for |a| <= 2^(emin-2)
we have to change to RNDZ */
@@ -467,7 +471,7 @@ mpfr_sqr_3 (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode, mpfr_prec_t p)
else
goto add_one_ulp;
}
- else if (MPFR_IS_LIKE_RNDZ(rnd_mode, MPFR_IS_NEG(a)))
+ else if (MPFR_IS_LIKE_RNDZ (rnd_mode, 0))
{
truncate:
MPFR_ASSERTD(ax >= __gmpfr_emin);
@@ -535,19 +539,20 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode)
bq = MPFR_GET_PREC(b);
#if !defined(MPFR_GENERIC_ABI) && (GMP_NUMB_BITS == 32 || GMP_NUMB_BITS == 64)
- if (aq < GMP_NUMB_BITS && bq <= GMP_NUMB_BITS)
- return mpfr_sqr_1 (a, b, rnd_mode, aq);
+ if (aq == bq)
+ {
+ if (aq < GMP_NUMB_BITS)
+ return mpfr_sqr_1 (a, b, rnd_mode, aq);
- if (GMP_NUMB_BITS < aq && aq < 2 * GMP_NUMB_BITS
- && GMP_NUMB_BITS < bq && bq <= 2 * GMP_NUMB_BITS)
- return mpfr_sqr_2 (a, b, rnd_mode, aq);
+ if (GMP_NUMB_BITS < aq && aq < 2 * GMP_NUMB_BITS)
+ return mpfr_sqr_2 (a, b, rnd_mode, aq);
- if (aq == GMP_NUMB_BITS && bq <= GMP_NUMB_BITS)
- return mpfr_sqr_1n (a, b, rnd_mode);
+ if (aq == GMP_NUMB_BITS)
+ return mpfr_sqr_1n (a, b, rnd_mode);
- if (2 * GMP_NUMB_BITS < aq && aq < 3 * GMP_NUMB_BITS
- && 2 * GMP_NUMB_BITS < bq && bq <= 3 * GMP_NUMB_BITS)
- return mpfr_sqr_3 (a, b, rnd_mode, aq);
+ if (2 * GMP_NUMB_BITS < aq && aq < 3 * GMP_NUMB_BITS)
+ return mpfr_sqr_3 (a, b, rnd_mode, aq);
+ }
#endif
ax = 2 * MPFR_GET_EXP (b);
@@ -558,6 +563,8 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode)
2*bn or 2*bn-1 */
if (MPFR_UNLIKELY(bn > MPFR_SQR_THRESHOLD))
+ /* the following line should not be replaced by mpfr_sqr,
+ otherwise we'll get an infinite loop! */
return mpfr_mul (a, b, b, rnd_mode);
MPFR_TMP_MARK(marker);
@@ -585,7 +592,7 @@ mpfr_sqr (mpfr_ptr a, mpfr_srcptr b, mpfr_rnd_t rnd_mode)
MPFR_TMP_FREE(marker);
{
- mpfr_exp_t ax2 = ax + (mpfr_exp_t) (b1 - 1 + cc);
+ mpfr_exp_t ax2 = ax + ((int) b1 - 1 + cc);
if (MPFR_UNLIKELY( ax2 > __gmpfr_emax))
return mpfr_overflow (a, rnd_mode, MPFR_SIGN_POS);
if (MPFR_UNLIKELY( ax2 < __gmpfr_emin))
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sqrt.c b/Build/source/libs/mpfr/mpfr-src/src/sqrt.c
index 613d6a156dd..33f8a68c0d5 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sqrt.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sqrt.c
@@ -1,6 +1,6 @@
/* mpfr_sqrt -- square root of a floating-point number
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -33,17 +33,17 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
static void
mpfr_sqrt2_approx (mpfr_limb_ptr rp, mpfr_limb_srcptr np)
{
- mp_limb_t x, r1, r0, h, l, t;
+ mp_limb_t x, r1, r0, h, l;
__gmpfr_sqrt_limb (r1, h, l, x, np[1]);
- /* now r1 = floor(sqrt(n1)) and h:l = n1^2 - r1^2 with h:l <= 2*r1,
- thus h <= 1 */
+ /* now r1 = floor(sqrt(2^64*n1)) and h:l = 2^64*n1 - r1^2 with h:l <= 2*r1,
+ thus h <= 1, and x is an approximation of 2^96/sqrt(np[1])-2^64 */
l += np[0];
h += (l < np[0]);
- /* now h <= 2 */
+ /* now 2^64*n1 + n0 - r1^2 = 2^64*h + l with h <= 2 */
/* divide by 2 */
l = (h << 63) | (l >> 1);
@@ -53,7 +53,7 @@ mpfr_sqrt2_approx (mpfr_limb_ptr rp, mpfr_limb_srcptr np)
/* now add (2^64+x) * (h*2^64+l) / 2^64 to [r1*2^64, 0] */
- umul_ppmm (r0, t, x, l); /* x * l */
+ umul_hi (r0, x, l); /* x * l */
r0 += l;
r1 += h + (r0 < l); /* now we have added 2^64 * (h*2^64+l) */
if (h)
@@ -68,7 +68,7 @@ mpfr_sqrt2_approx (mpfr_limb_ptr rp, mpfr_limb_srcptr np)
rp[1] = r1;
}
-/* Special code for prec(r), prec(u) < GMP_NUMB_BITS. We cannot have
+/* Special code for prec(r) = prec(u) < GMP_NUMB_BITS. We cannot have
prec(u) = GMP_NUMB_BITS here, since when the exponent of u is odd,
we need to shift u by one bit to the right without losing any bit.
Assumes GMP_NUMB_BITS = 64. */
@@ -102,9 +102,21 @@ mpfr_sqrt1 (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
/* the exact square root is in [r0, r0 + 7] */
if (MPFR_UNLIKELY(((r0 + 7) & (mask >> 1)) <= 7))
{
- /* first ensure r0 has its most significant bit set */
- if (MPFR_UNLIKELY(r0 < MPFR_LIMB_HIGHBIT))
- r0 = MPFR_LIMB_HIGHBIT;
+ /* We should ensure r0 has its most significant bit set.
+ Since r0 <= sqrt(2^64*u0) <= r0 + 7, as soon as sqrt(2^64*u0)>=2^63+7,
+ which happens for u0>=2^62+8, then r0 >= 2^63.
+ It thus remains to check that for 2^62 <= u0 <= 2^62+7,
+ __gmpfr_sqrt_limb_approx (r0, u0) gives r0 >= 2^63, which is indeed
+ the case:
+ u0=4611686018427387904 r0=9223372036854775808
+ u0=4611686018427387905 r0=9223372036854775808
+ u0=4611686018427387906 r0=9223372036854775809
+ u0=4611686018427387907 r0=9223372036854775810
+ u0=4611686018427387908 r0=9223372036854775811
+ u0=4611686018427387909 r0=9223372036854775812
+ u0=4611686018427387910 r0=9223372036854775813
+ u0=4611686018427387911 r0=9223372036854775814 */
+ MPFR_ASSERTD(r0 >= MPFR_LIMB_HIGHBIT);
umul_ppmm (rb, sb, r0, r0);
sub_ddmmss (rb, sb, u0, 0, rb, sb);
/* for the exact square root, we should have 0 <= rb:sb <= 2*r0 */
@@ -140,14 +152,24 @@ mpfr_sqrt1 (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
{
if (rnd_mode == MPFR_RNDN)
{
- if ((exp_r == __gmpfr_emin - 1) && (rp[0] == ~mask) && rb)
- goto rounding; /* no underflow */
- if (exp_r < __gmpfr_emin - 1 || (rp[0] == MPFR_LIMB_HIGHBIT && sb == 0))
+ /* If (1-2^(-p-1))*2^(emin-1) <= sqrt(u) < 2^(emin-1),
+ then sqrt(u) would be rounded to 2^(emin-1) with unbounded
+ exponent range, and there would be no underflow.
+ But this case cannot happen if u has precision p.
+ Indeed, we would have:
+ (1-2^(-p-1))^2*2^(2*emin-2) <= u < 2^(2*emin-2), i.e.,
+ (1-2^(-p)+2^(-2p-2))*2^(2*emin-2) <= u < 2^(2*emin-2),
+ and there is no p-bit number in that interval. */
+ /* If the result is <= 0.5^2^(emin-1), we should round to 0. */
+ if (exp_r < __gmpfr_emin - 1 ||
+ (rp[0] == MPFR_LIMB_HIGHBIT && sb == 0))
rnd_mode = MPFR_RNDZ;
}
else if (MPFR_IS_LIKE_RNDA(rnd_mode, 0))
{
- if ((exp_r == __gmpfr_emin - 1) && (rp[0] == ~mask) && (rb | sb))
+ if (exp_r == __gmpfr_emin - 1 &&
+ rp[0] == ~mask &&
+ (rb | sb) != 0)
goto rounding; /* no underflow */
}
return mpfr_underflow (r, rnd_mode, 1);
@@ -195,7 +217,7 @@ mpfr_sqrt1 (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
}
}
-/* Special code for prec(r) = GMP_NUMB_BITS and prec(u) <= GMP_NUMB_BITS. */
+/* Special code for prec(r) = prec(u) = GMP_NUMB_BITS. */
static int
mpfr_sqrt1n (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
{
@@ -226,9 +248,8 @@ mpfr_sqrt1n (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
/* the exact square root is in [r0, r0 + 7] */
- /* first ensure r0 has its most significant bit set */
- if (MPFR_UNLIKELY(r0 < MPFR_LIMB_HIGHBIT))
- r0 = MPFR_LIMB_HIGHBIT;
+ /* As shown in mpfr_sqrt1 above, r0 has its most significant bit set */
+ MPFR_ASSERTD(r0 >= MPFR_LIMB_HIGHBIT);
umul_ppmm (rb, sb, r0, r0);
sub_ddmmss (rb, sb, u0, low, rb, sb);
@@ -269,12 +290,15 @@ mpfr_sqrt1n (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
{
/* the case rp[0] = 111...111 and rb = 1 cannot happen, since it
would imply u0 >= (2^64-1/2)^2/2^64 thus u0 >= 2^64 */
- if (exp_r < __gmpfr_emin - 1 || (rp[0] == MPFR_LIMB_HIGHBIT && sb == 0))
+ if (exp_r < __gmpfr_emin - 1 ||
+ (rp[0] == MPFR_LIMB_HIGHBIT && sb == 0))
rnd_mode = MPFR_RNDZ;
}
else if (MPFR_IS_LIKE_RNDA(rnd_mode, 0))
{
- if ((exp_r == __gmpfr_emin - 1) && (rp[0] == ~MPFR_LIMB_ZERO) && (rb | sb))
+ if (exp_r == __gmpfr_emin - 1 &&
+ rp[0] == MPFR_LIMB_MAX &&
+ (rb | sb) != 0)
goto rounding; /* no underflow */
}
return mpfr_underflow (r, rnd_mode, 1);
@@ -322,8 +346,7 @@ mpfr_sqrt1n (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
}
}
-/* Special code for GMP_NUMB_BITS < prec(r) < 2*GMP_NUMB_BITS,
- and GMP_NUMB_BITS < prec(u) <= 2*GMP_NUMB_BITS.
+/* Special code for GMP_NUMB_BITS < prec(r) = prec(u) < 2*GMP_NUMB_BITS.
Assumes GMP_NUMB_BITS=64. */
static int
mpfr_sqrt2 (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
@@ -415,9 +438,6 @@ mpfr_sqrt2 (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
{
if (rnd_mode == MPFR_RNDN)
{
- if (exp_r == __gmpfr_emin - 1 && (rp[1] == MPFR_LIMB_MAX &&
- rp[0] == ~mask) && rb)
- goto rounding; /* no underflow */
if (exp_r < __gmpfr_emin - 1 || (rp[1] == MPFR_LIMB_HIGHBIT &&
rp[0] == MPFR_LIMB_ZERO && sb == 0))
rnd_mode = MPFR_RNDZ;
@@ -618,7 +638,8 @@ mpfr_sqrt (mpfr_ptr r, mpfr_srcptr u, mpfr_rnd_t rnd_mode)
expr = (MPFR_GET_EXP(u) + odd_exp) / 2; /* exact */
- if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDD || sticky == MPFR_LIMB_ZERO)
+ if (rnd_mode == MPFR_RNDZ || rnd_mode == MPFR_RNDD ||
+ sticky == MPFR_LIMB_ZERO)
{
inexact = (sticky == MPFR_LIMB_ZERO) ? 0 : -1;
goto truncate;
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sqrt_ui.c b/Build/source/libs/mpfr/mpfr-src/src/sqrt_ui.c
index 878097603c1..b8689d794dd 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sqrt_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sqrt_ui.c
@@ -1,6 +1,6 @@
/* mpfr_sqrt_ui -- square root of a machine integer
-Copyright 2000-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -29,9 +29,10 @@ mpfr_sqrt_ui (mpfr_ptr r, unsigned long u, mpfr_rnd_t rnd_mode)
if (u)
{
mpfr_t uu;
+ int inex;
+#ifdef MPFR_LONG_WITHIN_LIMB
mp_limb_t up[1];
int cnt;
- int inex;
MPFR_SAVE_EXPO_DECL (expo);
MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
@@ -41,9 +42,19 @@ mpfr_sqrt_ui (mpfr_ptr r, unsigned long u, mpfr_rnd_t rnd_mode)
MPFR_SAVE_EXPO_MARK (expo);
MPFR_SET_EXP (uu, GMP_NUMB_BITS - cnt);
- inex = mpfr_sqrt(r, uu, rnd_mode);
+ inex = mpfr_sqrt (r, uu, rnd_mode);
+#else
+ MPFR_SAVE_EXPO_DECL (expo);
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ /* Warning: u might be outside the current exponent range! */
+ MPFR_SAVE_EXPO_MARK (expo);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
+ inex = mpfr_sqrt (r, uu, rnd_mode);
+ mpfr_clear (uu);
+#endif /* MPFR_LONG_WITHIN_LIMB */
MPFR_SAVE_EXPO_FREE (expo);
- return mpfr_check_range(r, inex, rnd_mode);
+ return mpfr_check_range (r, inex, rnd_mode);
}
else /* sqrt(0) = 0 */
{
diff --git a/Build/source/libs/mpfr/mpfr-src/src/stack_interface.c b/Build/source/libs/mpfr/mpfr-src/src/stack_interface.c
index 68691f6daf8..ceb7b977275 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/stack_interface.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/stack_interface.c
@@ -1,6 +1,6 @@
/* mpfr_stack -- initialize a floating-point number with given allocation area
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/strtofr.c b/Build/source/libs/mpfr/mpfr-src/src/strtofr.c
index 056326f931a..c6aeb739133 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/strtofr.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/strtofr.c
@@ -1,6 +1,6 @@
/* mpfr_strtofr -- set a floating-point number from a string
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub.c b/Build/source/libs/mpfr/mpfr-src/src/sub.c
index e6e4fbe4bf0..6b21b8beb29 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sub.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub.c
@@ -1,6 +1,6 @@
/* mpfr_sub -- subtract two floating-point numbers
-Copyright 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub1.c b/Build/source/libs/mpfr/mpfr-src/src/sub1.c
index 4584e67d682..6ffdcd358a3 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sub1.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub1.c
@@ -1,6 +1,6 @@
/* mpfr_sub1 -- internal function to perform a "real" subtraction
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -28,8 +28,6 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
a positive value otherwise.
*/
-/* TODO: check the code in case exp_b == MPFR_EXP_MAX. */
-
int
mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
{
@@ -55,8 +53,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
(void) MPFR_GET_PREC (c);
sign = mpfr_cmp2 (b, c, &cancel);
+
if (MPFR_UNLIKELY(sign == 0))
{
+ MPFR_LOG_MSG (("sign=0\n", 0));
if (rnd_mode == MPFR_RNDD)
MPFR_SET_NEG (a);
else
@@ -65,6 +65,10 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
MPFR_RET (0);
}
+ /* sign != 0, so that cancel has a valid value. */
+ MPFR_LOG_MSG (("sign=%d cancel=%Pd\n", sign, cancel));
+ MPFR_ASSERTD (cancel >= 0 && cancel <= MPFR_PREC_MAX);
+
/*
* If subtraction: sign(a) = sign * sign(b)
* If addition: sign(a) = sign of the larger argument in absolute value.
@@ -91,9 +95,29 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (MPFR_UNLIKELY (MPFR_IS_UBF (b) || MPFR_IS_UBF (c)))
{
- exp_b = MPFR_IS_UBF (b) ?
- mpfr_ubf_zexp2exp (MPFR_ZEXP (b)) : MPFR_GET_EXP (b);
+ exp_b = MPFR_UBF_GET_EXP (b);
+ /* Early underflow detection. Rare, but a test is needed anyway
+ since in the "MAX (aq, bq) + 2 <= diff_exp" branch, the exponent
+ may decrease and MPFR_EXP_MIN would yield an integer overflow. */
+ if (MPFR_UNLIKELY (exp_b < __gmpfr_emin - 1))
+ {
+ if (rnd_mode == MPFR_RNDN)
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
+ }
diff_exp = mpfr_ubf_diff_exp (b, c);
+ MPFR_LOG_MSG (("UBF: exp_b=%" MPFR_EXP_FSPEC "d%s "
+ "diff_exp=%" MPFR_EXP_FSPEC "d%s\n",
+ (mpfr_eexp_t) exp_b,
+ exp_b == MPFR_EXP_MAX ? "=MPFR_EXP_MAX" : "",
+ (mpfr_eexp_t) diff_exp,
+ diff_exp == MPFR_EXP_MAX ? "=MPFR_EXP_MAX" : ""));
+ /* If diff_exp == MPFR_EXP_MAX, the actual value can be larger,
+ but anyway, since mpfr_exp_t >= mp_size_t, this will be the
+ case c small below, and the exact value does not matter. */
+ /* mpfr_set4 below used with MPFR_RNDF does not support UBF. */
+ if (rnd_mode == MPFR_RNDF)
+ rnd_mode = MPFR_RNDN;
}
else
{
@@ -123,27 +147,24 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (rnd_mode == MPFR_RNDF)
return mpfr_set4 (a, b, MPFR_RNDZ, MPFR_SIGN (a));
- MPFR_EXP (a) = exp_b; /* may be up to MPFR_EXP_MAX */
+ exp_a = exp_b; /* may be any out-of-range value due to UBF */
MPFR_RNDRAW_EVEN (inexact, a, MPFR_MANT (b), bq,
rnd_mode, MPFR_SIGN (a),
- if (MPFR_EXP (a) != MPFR_EXP_MAX)
- ++ MPFR_EXP (a));
+ if (exp_a != MPFR_EXP_MAX)
+ exp_a ++);
MPFR_LOG_MSG (("inexact=%d\n", inexact));
- if (inexact == 0)
- {
+ if (inexact == 0 &&
/* a = b, but the exact value of b - c is a bit below. Then,
except for directed rounding similar to toward zero and
before overflow checking: a is the correctly rounded value
and since |b| - |c| < |a|, the ternary value value is given
by the sign of a. */
- if (! MPFR_IS_LIKE_RNDZ (rnd_mode, MPFR_IS_NEG (a)))
- {
- inexact = MPFR_INT_SIGN (a);
- goto check_overflow;
- }
- }
- else /* inexact != 0 */
+ ! MPFR_IS_LIKE_RNDZ (rnd_mode, MPFR_IS_NEG (a)))
{
+ MPFR_LOG_MSG (("c small, case 1\n", 0));
+ inexact = MPFR_INT_SIGN (a);
+ }
+ else if (inexact != 0 &&
/* A.AAAAAAAAAAAAAA
= B.BBBBBBBBBBBBBBB
- C.CCCCCCCCCCCCC */
@@ -163,27 +184,41 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
1.BBBBBBBBBBBBB1+1 if inexact == -EVEN_INEX (x == 1)
which means we get a wrong rounded result if x == 1,
i.e. inexact == MPFR_EVEN_INEX (for positive numbers). */
- if (MPFR_LIKELY (inexact != MPFR_EVEN_INEX * MPFR_INT_SIGN (a)))
- goto check_overflow;
+ MPFR_LIKELY (inexact != MPFR_EVEN_INEX * MPFR_INT_SIGN (a)))
+ {
+ MPFR_LOG_MSG (("c small, case 2\n", 0));
+ /* nothing to do */
}
- /* We need to take the value preceding |a|. We can't use
- mpfr_nexttozero due to a possible out-of-range exponent.
- But this will allow us to have more specific code. */
- MPFR_LOG_MSG (("correcting the value of a\n", 0));
- sh = (mpfr_prec_t) an * GMP_NUMB_BITS - aq;
- mpn_sub_1 (ap, ap, an, MPFR_LIMB_ONE << sh);
- if (MPFR_UNLIKELY (MPFR_LIMB_MSB (ap[an-1]) == 0))
+ else
{
- MPFR_EXP (a) --;
- /* The following is valid whether an = 1 or an > 1. */
- ap[an-1] |= MPFR_LIMB_HIGHBIT;
+ /* We need to take the value preceding |a|. We can't use
+ mpfr_nexttozero due to a possible out-of-range exponent.
+ But this will allow us to have more specific code. */
+ MPFR_LOG_MSG (("c small, case 3: correcting the value of a\n", 0));
+ sh = (mpfr_prec_t) an * GMP_NUMB_BITS - aq;
+ mpn_sub_1 (ap, ap, an, MPFR_LIMB_ONE << sh);
+ if (MPFR_UNLIKELY (MPFR_LIMB_MSB (ap[an-1]) == 0))
+ {
+ exp_a --;
+ /* The following is valid whether an = 1 or an > 1. */
+ ap[an-1] |= MPFR_LIMB_HIGHBIT;
+ }
+ inexact = - MPFR_INT_SIGN (a);
}
- inexact = - MPFR_INT_SIGN (a);
- check_overflow:
- if (MPFR_UNLIKELY (MPFR_EXP (a) > __gmpfr_emax))
+ /* The underflow case is possible only with UBF. The overflow case
+ is also possible with normal FP due to rounding. */
+ if (MPFR_UNLIKELY (exp_a > __gmpfr_emax))
return mpfr_overflow (a, rnd_mode, MPFR_SIGN (a));
- else
- MPFR_RET (inexact);
+ if (MPFR_UNLIKELY (exp_a < __gmpfr_emin))
+ {
+ if (rnd_mode == MPFR_RNDN &&
+ (exp_a < __gmpfr_emin - 1 ||
+ (inexact * MPFR_INT_SIGN (a) >= 0 && mpfr_powerof2_raw (a))))
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
+ }
+ MPFR_SET_EXP (a, exp_a);
+ MPFR_RET (inexact);
}
/* reserve a space to store b aligned with the result, i.e. shifted by
@@ -656,6 +691,15 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
if (MPFR_LIKELY(cancel))
{
cancel -= add_exp; /* OK: add_exp is an int equal to 0 or 1 */
+ MPFR_ASSERTD (cancel >= 0);
+ /* Detect an underflow case to avoid a possible integer overflow
+ with UBF in the computation of exp_a. */
+ if (MPFR_UNLIKELY (exp_b < __gmpfr_emin - 1))
+ {
+ if (rnd_mode == MPFR_RNDN)
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
+ }
exp_a = exp_b - cancel;
/* The following assertion corresponds to a limitation of the MPFR
implementation. It may fail with a 32-bit ABI and huge precisions,
@@ -671,14 +715,17 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
rnd_mode = MPFR_RNDZ;
return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
}
- if (MPFR_UNLIKELY (exp_a > __gmpfr_emax))
+ /* We cannot have an overflow here, except for UBFs. Indeed:
+ exp_a = exp_b - cancel + add_exp <= emax - 1 + 1 <= emax.
+ For UBFs, we can have exp_b > emax. */
+ if (exp_a > __gmpfr_emax)
{
+ MPFR_ASSERTD (exp_b > __gmpfr_emax); /* since exp_b >= exp_a */
return mpfr_overflow (a, rnd_mode, MPFR_SIGN (a));
}
}
else /* cancel = 0: MPFR_EXP(a) <- MPFR_EXP(b) + add_exp */
{
-
/* in case cancel = 0, add_exp can still be 1, in case b is just
below a power of two, c is very small, prec(a) < prec(b),
and rnd=away or nearest */
@@ -687,12 +734,13 @@ mpfr_sub1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
a subtraction below to avoid a potential integer overflow in
the case exp_b == MPFR_EXP_MAX. */
if (MPFR_UNLIKELY (exp_b > __gmpfr_emax - add_exp))
- {
- return mpfr_overflow (a, rnd_mode, MPFR_SIGN (a));
- }
+ return mpfr_overflow (a, rnd_mode, MPFR_SIGN (a));
exp_a = exp_b + add_exp;
+ /* Warning: an underflow can happen for UBFs, for example when
+ mpfr_add is called from mpfr_fmma or mpfr_fmms. */
if (MPFR_UNLIKELY (exp_a < __gmpfr_emin))
goto underflow;
+ MPFR_ASSERTD (exp_a >= __gmpfr_emin);
}
MPFR_SET_EXP (a, exp_a);
/* check that result is msb-normalized */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c b/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
index 2fc19db1d33..3b71e33a6de 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub1sp.c
@@ -1,7 +1,7 @@
/* mpfr_sub1sp -- internal function to perform a "real" subtraction
All the op must have the same precision
-Copyright 2003-2019 Free Software Foundation, Inc.
+Copyright 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -24,8 +24,25 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_NEED_LONGLONG_H
#include "mpfr-impl.h"
-/* Check if we have to check the result of mpfr_sub1sp with mpfr_sub1 */
+/* define MPFR_FULLSUB to use alternate code in mpfr_sub1sp2 and mpfr_sub1sp2n
+ (see comments in mpfr_sub1sp2) */
+/* #define MPFR_FULLSUB */
+
#if MPFR_WANT_ASSERT >= 2
+/* Check the result of mpfr_sub1sp with mpfr_sub1.
+
+ Note: mpfr_sub1sp itself has two algorithms: one always valid and one
+ faster for small precisions (up to 3 limbs). The latter one is disabled
+ if MPFR_GENERIC_ABI is defined. When MPFR_WANT_ASSERT >= 2, it could be
+ interesting to compare the results of these different algorithms. For
+ the time being, this is currently done by running the same code on the
+ same data with and without MPFR_GENERIC_ABI defined, where we have the
+ following comparisons in small precisions:
+ mpfr_sub1sp slow <-> mpfr_sub1 when MPFR_GENERIC_ABI is defined;
+ mpfr_sub1sp fast <-> mpfr_sub1 when MPFR_GENERIC_ABI is not defined.
+ By transitivity, the absence of failures implies that the 3 results are
+ the same.
+*/
int mpfr_sub1sp_ref (mpfr_ptr, mpfr_srcptr, mpfr_srcptr, mpfr_rnd_t);
int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
@@ -58,6 +75,10 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
inexact = mpfr_sub1sp_ref (a, b, c, rnd_mode);
flags = __gmpfr_flags;
+ /* Convert the ternary values to (-1,0,1). */
+ inexact2 = VSIGN (inexact2);
+ inexact = VSIGN (inexact);
+
if (! mpfr_equal_p (tmpa, a) || inexact != inexact2 || flags != flags2)
{
fprintf (stderr, "sub1 & sub1sp return different values for %s\n"
@@ -73,9 +94,10 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mpfr_fdump (stderr, tmpa);
fprintf (stderr, "sub1sp: ");
mpfr_fdump (stderr, a);
- fprintf (stderr, "Inexact sp = %d | Inexact = %d\n"
- "Flags sp = %u | Flags = %u\n",
- inexact, inexact2, flags, flags2);
+ fprintf (stderr, "sub1 : ternary = %2d, flags =", inexact2);
+ flags_fout (stderr, flags2);
+ fprintf (stderr, "sub1sp: ternary = %2d, flags =", inexact);
+ flags_fout (stderr, flags);
MPFR_ASSERTN (0);
}
mpfr_clears (tmpa, tmpb, tmpc, (mpfr_ptr) 0);
@@ -86,6 +108,20 @@ int mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
#if !defined(MPFR_GENERIC_ABI)
+/* the sub1sp1_extracted.c is not ready yet */
+
+#if 0 && defined(MPFR_WANT_PROVEN_CODE) && GMP_NUMB_BITS == 64 && \
+ UINT_MAX == 0xffffffff && MPFR_PREC_BITS == 64 && \
+ _MPFR_PREC_FORMAT == 3 && _MPFR_EXP_FORMAT == _MPFR_PREC_FORMAT
+
+/* The code assumes that mp_limb_t has 64 bits exactly, unsigned int
+ has 32 bits exactly, mpfr_prec_t and mpfr_exp_t are of type long,
+ which has 64 bits exactly. */
+
+#include "sub1sp1_extracted.c"
+
+#else
+
/* special code for p < GMP_NUMB_BITS */
static int
mpfr_sub1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
@@ -107,8 +143,7 @@ mpfr_sub1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
if (bx == cx)
{
- a0 = bp[0] - cp[0];
- if (a0 == 0) /* result is zero */
+ if (MPFR_UNLIKELY(bp[0] == cp[0])) /* result is zero */
{
if (rnd_mode == MPFR_RNDD)
MPFR_SET_NEG(a);
@@ -117,13 +152,16 @@ mpfr_sub1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
MPFR_SET_ZERO(a);
MPFR_RET (0);
}
- else if (a0 > bp[0]) /* borrow: |c| > |b| */
+ else if (cp[0] > bp[0]) /* borrow: |c| > |b| */
{
+ a0 = cp[0] - bp[0];
MPFR_SET_OPPOSITE_SIGN (a, b);
- a0 = -a0;
}
else /* bp[0] > cp[0] */
- MPFR_SET_SAME_SIGN (a, b);
+ {
+ a0 = bp[0] - cp[0];
+ MPFR_SET_SAME_SIGN (a, b);
+ }
/* now a0 != 0 */
MPFR_ASSERTD(a0 != 0);
@@ -133,10 +171,21 @@ mpfr_sub1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
rb = sb = 0;
/* Note: sh is not initialized, but will not be used in this case. */
}
- else if (bx > cx)
+ else
{
- MPFR_SET_SAME_SIGN (a, b);
- BGreater1:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ MPFR_SET_OPPOSITE_SIGN (a, b);
+ }
+ else
+ {
+ MPFR_SET_SAME_SIGN (a, b);
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
sh = GMP_NUMB_BITS - p;
mask = MPFR_LIMB_MASK(sh);
@@ -202,15 +251,6 @@ mpfr_sub1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
sb = 1;
}
}
- else /* cx > bx */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- MPFR_SET_OPPOSITE_SIGN (a, b);
- goto BGreater1;
- }
/* now perform rounding */
@@ -266,6 +306,8 @@ mpfr_sub1sp1 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
}
}
+#endif /* MPFR_WANT_PROVEN_CODE */
+
/* special code for p = GMP_NUMB_BITS */
static int
mpfr_sub1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
@@ -312,10 +354,21 @@ mpfr_sub1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
bx -= cnt;
rb = sb = 0;
}
- else if (bx > cx)
+ else
{
- MPFR_SET_SAME_SIGN (a, b);
- BGreater1:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ MPFR_SET_OPPOSITE_SIGN (a, b);
+ }
+ else
+ {
+ MPFR_SET_SAME_SIGN (a, b);
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
if (d < GMP_NUMB_BITS)
{
@@ -369,8 +422,8 @@ mpfr_sub1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
bx --;
if (d == GMP_NUMB_BITS && cp[0] > MPFR_LIMB_HIGHBIT)
{ /* case (b) */
- rb = (-cp[0]) >= (MPFR_LIMB_HIGHBIT >> 1);
- sb = (-cp[0]) << 2;
+ rb = MPFR_LIMB(-cp[0]) >= (MPFR_LIMB_HIGHBIT >> 1);
+ sb = MPFR_LIMB(-cp[0]) << 2;
ap[0] = -(MPFR_LIMB_ONE << 1);
}
else /* cases (a), (c), (d) and (e) */
@@ -388,15 +441,6 @@ mpfr_sub1sp1n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
}
}
- else /* cx > bx */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- MPFR_SET_OPPOSITE_SIGN (a, b);
- goto BGreater1;
- }
/* now perform rounding */
@@ -519,12 +563,23 @@ mpfr_sub1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
rb = sb = 0;
/* Note: sh is not initialized, but will not be used in this case. */
}
- else if (bx > cx)
+ else
{
mp_limb_t t;
- MPFR_SET_SAME_SIGN (a, b);
- BGreater2:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ MPFR_SET_OPPOSITE_SIGN (a, b);
+ }
+ else
+ {
+ MPFR_SET_SAME_SIGN (a, b);
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
sh = 2 * GMP_NUMB_BITS - p;
mask = MPFR_LIMB_MASK(sh);
@@ -652,15 +707,6 @@ mpfr_sub1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
sb = 1;
}
}
- else /* cx > bx */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- MPFR_SET_OPPOSITE_SIGN (a, b);
- goto BGreater2;
- }
/* now perform rounding */
@@ -712,6 +758,287 @@ mpfr_sub1sp2 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
}
}
+/* special code for p = 2*GMP_NUMB_BITS */
+static int
+mpfr_sub1sp2n (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
+{
+ mpfr_exp_t bx = MPFR_GET_EXP (b);
+ mpfr_exp_t cx = MPFR_GET_EXP (c);
+ mp_limb_t *ap = MPFR_MANT(a);
+ mp_limb_t *bp = MPFR_MANT(b);
+ mp_limb_t *cp = MPFR_MANT(c);
+ mpfr_prec_t cnt;
+ mp_limb_t rb; /* round bit */
+ mp_limb_t sb; /* sticky bit */
+ mp_limb_t a0, a1;
+ mpfr_uexp_t d;
+
+/* this function is inspired by mpfr_sub1sp2 (for the operations of the
+ 2-limb arrays) and by mpfr_sub1sp1n (for the different cases to handle) */
+
+ if (bx == cx) /* subtraction is exact in this case */
+ {
+ a0 = bp[0] - cp[0];
+ a1 = bp[1] - cp[1] - (bp[0] < cp[0]);
+ if (a1 == 0 && a0 == 0) /* result is zero */
+ {
+ if (rnd_mode == MPFR_RNDD)
+ MPFR_SET_NEG(a);
+ else
+ MPFR_SET_POS(a);
+ MPFR_SET_ZERO(a);
+ MPFR_RET (0);
+ }
+ /* since B/2 <= bp[1], cp[1] < B with B=2^GMP_NUMB_BITS,
+ if no borrow we have 0 <= bp[1] - cp[1] - x < B/2
+ where x = (bp[0] < cp[0]) is 0 or 1, thus a1 < B/2 <= bp[1] */
+ else if (a1 >= bp[1]) /* borrow: |c| > |b| */
+ {
+ MPFR_SET_OPPOSITE_SIGN (a, b);
+ /* negate [a1,a0] */
+ a0 = -a0;
+ a1 = -a1 - (a0 != 0);
+ }
+ else /* no borrow */
+ MPFR_SET_SAME_SIGN (a, b);
+
+ /* now [a1,a0] is the absolute value of b - c,
+ maybe not normalized */
+ if (a1 == 0)
+ {
+ a1 = a0;
+ a0 = 0;
+ bx -= GMP_NUMB_BITS;
+ }
+
+ /* now a1 != 0 */
+ MPFR_ASSERTD(a1 != 0);
+ count_leading_zeros (cnt, a1);
+ if (cnt)
+ {
+ /* shift [a1,a0] left by cnt bit and store in result */
+ ap[1] = (a1 << cnt) | (a0 >> (GMP_NUMB_BITS - cnt));
+ ap[0] = a0 << cnt;
+ bx -= cnt;
+ }
+ else
+ {
+ ap[1] = a1;
+ ap[0] = a0;
+ }
+ rb = sb = 0; /* the subtraction is exact */
+ }
+ else
+ {
+ mp_limb_t t;
+
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ MPFR_SET_OPPOSITE_SIGN (a, b);
+ }
+ else
+ {
+ MPFR_SET_SAME_SIGN (a, b);
+ }
+ MPFR_ASSERTD (bx > cx);
+ d = (mpfr_uexp_t) bx - cx;
+ if (d < GMP_NUMB_BITS)
+ {
+ t = (cp[1] << (GMP_NUMB_BITS - d)) | (cp[0] >> d);
+ /* t is the part that should be subtracted to bp[0]:
+ | a1 | a0 |
+ | bp[1] | bp[0] |
+ | cp[1]>>d | t | sb | */
+#ifndef MPFR_FULLSUB
+ a0 = bp[0] - t;
+ a1 = bp[1] - (cp[1] >> d) - (bp[0] < t);
+ sb = cp[0] << (GMP_NUMB_BITS - d); /* neglected part of c */
+ /* now negate sb and subtract borrow to a0 if sb <> 0 */
+ if (sb)
+ {
+ a1 -= (a0 == 0);
+ a0 --;
+ /* a = a1,a0 can only be zero when d=1, b = 0.1000...000*2^bx,
+ and c = 0.111...111*2^(bx-1). In that case (where we have
+ sb = MPFR_LIMB_HIGHBIT below), the subtraction is exact, the
+ result is b/2^(2*GMP_NUMB_BITS). This case is dealt below. */
+ sb = -sb;
+ }
+#else
+ sb = - (cp[0] << (GMP_NUMB_BITS - d));
+ a0 = bp[0] - t - (sb != 0);
+ a1 = bp[1] - (cp[1] >> d) - (bp[0] < t || (bp[0] == t && sb != 0));
+#endif
+ /* now the result is formed of [a1,a0,sb], which might not be
+ normalized */
+ if (a1 == MPFR_LIMB_ZERO)
+ {
+ /* this implies d=1 */
+ MPFR_ASSERTD(d == 1);
+ a1 = a0;
+ a0 = sb;
+ sb = MPFR_LIMB_ZERO;
+ bx -= GMP_NUMB_BITS;
+ }
+ if (a1 == MPFR_LIMB_ZERO) /* case a = a1,a0 = 0 mentioned above */
+ {
+ MPFR_ASSERTD(a0 == MPFR_LIMB_HIGHBIT); /* was sb above */
+ a1 = a0;
+ a0 = sb;
+ bx -= GMP_NUMB_BITS;
+ sb = MPFR_LIMB_ZERO;
+ }
+ else
+ {
+ count_leading_zeros (cnt, a1);
+ if (cnt)
+ {
+ /* shift [a1,a0,sb] left by cnt bits and adjust exponent */
+ a1 = (a1 << cnt) | (a0 >> (GMP_NUMB_BITS - cnt));
+ a0 = (a0 << cnt) | (sb >> (GMP_NUMB_BITS - cnt));
+ sb <<= cnt;
+ bx -= cnt;
+ }
+ }
+ rb = sb & MPFR_LIMB_HIGHBIT;
+ sb = sb & ~MPFR_LIMB_HIGHBIT;
+ ap[1] = a1;
+ ap[0] = a0;
+ }
+ else if (d < 2 * GMP_NUMB_BITS)
+ { /* GMP_NUMB_BITS <= d < 2*GMP_NUMB_BITS:
+ compute t, the part to be subtracted to bp[0],
+ and sb, the neglected part of c:
+ | a1 | a0 |
+ | bp[1] | bp[0] |
+ | t | sb | */
+ /* warning: we should not ignore the low bits from cp[0]
+ in case d > GMP_NUMB_BITS */
+ sb = (d == GMP_NUMB_BITS) ? cp[0]
+ : (cp[1] << (2*GMP_NUMB_BITS - d))
+ | (cp[0] >> (d - GMP_NUMB_BITS))
+ | ((cp[0] << (2*GMP_NUMB_BITS - d)) != 0);
+ t = (cp[1] >> (d - GMP_NUMB_BITS)) + (sb != 0);
+ /* Warning: t might overflow to 0 if d=GMP_NUMB_BITS, sb <> 0,
+ and cp[1] = 111...111 */
+ a0 = bp[0] - t;
+ a1 = bp[1] - (bp[0] < t) - (t == 0 && sb != 0);
+ sb = -sb;
+ /* now the result is [a1,a0,sb]. Since bp[1] has its most significant
+ bit set, we can have an exponent decrease of at most one */
+ if (a1 < MPFR_LIMB_HIGHBIT)
+ {
+ /* shift [a1,a0] left by 1 bit */
+ a1 = (a1 << 1) | (a0 >> (GMP_NUMB_BITS - 1));
+ MPFR_ASSERTD(a1 >= MPFR_LIMB_HIGHBIT);
+ a0 = (a0 << 1) | (sb >> (GMP_NUMB_BITS - 1));
+ sb <<= 1;
+ bx --;
+ }
+ ap[1] = a1;
+ ap[0] = a0;
+ rb = sb & MPFR_LIMB_HIGHBIT;
+ sb = sb & ~MPFR_LIMB_HIGHBIT;
+ }
+ else
+ { /* d >= 2*GMP_NUMB_BITS:
+ | a1 | a0 |
+ | bp[1] | bp[0] |
+ | cp[1] | cp[0] | */
+ /* we mimic the case d >= GMP_NUMB_BITS of mpfr_sub1sp1n */
+ int tst = cp[1] == MPFR_LIMB_HIGHBIT && cp[0] == MPFR_LIMB_ZERO;
+ /* if d = 2 * GMP_NUMB_BITS and tst=1, c = 1/2*ulp(b) */
+ if (bp[1] > MPFR_LIMB_HIGHBIT || bp[0] > MPFR_LIMB_ZERO)
+ {
+ /* no borrow in b - ulp(b) */
+ rb = d > 2 * GMP_NUMB_BITS || tst;
+ sb = d > 2 * GMP_NUMB_BITS || !tst;
+ ap[1] = bp[1] - (bp[0] == MPFR_LIMB_ZERO);
+ ap[0] = bp[0] - MPFR_LIMB_ONE;
+ }
+ else
+ {
+ /* b = 1000...000, thus subtracting c yields an exponent shift */
+ bx --;
+ if (d == 2 * GMP_NUMB_BITS && !tst) /* c > 1/2*ulp(b) */
+ {
+ t = -cp[1] - (cp[0] > MPFR_LIMB_ZERO);
+ /* the rounding bit is the 2nd most significant bit of t
+ (where the most significant bit of t is necessarily 0),
+ and the sticky bit is formed by the remaining bits of t,
+ and those from -cp[0] */
+ rb = t >= (MPFR_LIMB_HIGHBIT >> 1);
+ sb = (t << 2) | cp[0];
+ ap[1] = MPFR_LIMB_MAX;
+ ap[0] = -(MPFR_LIMB_ONE << 1);
+ }
+ else /* c <= 1/2*ulp(b) */
+ {
+ rb = d > 2 * GMP_NUMB_BITS + 1
+ || (d == 2 * GMP_NUMB_BITS + 1 && tst);
+ sb = d > 2 * GMP_NUMB_BITS + 1
+ || (d == 2 * GMP_NUMB_BITS + 1 && !tst);
+ ap[1] = -MPFR_LIMB_ONE;
+ ap[0] = -MPFR_LIMB_ONE;
+ }
+ }
+ }
+ }
+
+ /* now perform rounding */
+
+ /* Warning: MPFR considers underflow *after* rounding with an unbounded
+ exponent range. However since b and c have same precision p, they are
+ multiples of 2^(emin-p), likewise for b-c. Thus if bx < emin, the
+ subtraction (with an unbounded exponent range) is exact, so that bx is
+ also the exponent after rounding with an unbounded exponent range. */
+ if (MPFR_UNLIKELY(bx < __gmpfr_emin))
+ {
+ /* for RNDN, mpfr_underflow always rounds away, thus for |a|<=2^(emin-2)
+ we have to change to RNDZ */
+ if (rnd_mode == MPFR_RNDN &&
+ (bx < __gmpfr_emin - 1 ||
+ (ap[1] == MPFR_LIMB_HIGHBIT && ap[0] == 0)))
+ rnd_mode = MPFR_RNDZ;
+ return mpfr_underflow (a, rnd_mode, MPFR_SIGN(a));
+ }
+
+ MPFR_SET_EXP (a, bx);
+ if ((rb == 0 && sb == 0) || rnd_mode == MPFR_RNDF)
+ MPFR_RET (0);
+ else if (rnd_mode == MPFR_RNDN)
+ {
+ if (rb == 0 || (sb == 0 && (ap[0] & MPFR_LIMB_ONE) == 0))
+ goto truncate;
+ else
+ goto add_one_ulp;
+ }
+ else if (MPFR_IS_LIKE_RNDZ(rnd_mode, MPFR_IS_NEG(a)))
+ {
+ truncate:
+ MPFR_RET(-MPFR_SIGN(a));
+ }
+ else /* round away from zero */
+ {
+ add_one_ulp:
+ ap[0] += MPFR_LIMB_ONE;
+ ap[1] += (ap[0] == 0);
+ if (MPFR_UNLIKELY(ap[1] == 0))
+ {
+ ap[1] = MPFR_LIMB_HIGHBIT;
+ /* Note: bx+1 cannot exceed __gmpfr_emax, since |a| <= |b|, thus
+ bx+1 is at most equal to the original exponent of b. */
+ MPFR_ASSERTD(bx + 1 <= __gmpfr_emax);
+ MPFR_SET_EXP (a, bx + 1);
+ }
+ MPFR_RET(MPFR_SIGN(a));
+ }
+}
+
/* special code for 2*GMP_NUMB_BITS < p < 3*GMP_NUMB_BITS */
static int
mpfr_sub1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
@@ -791,10 +1118,21 @@ mpfr_sub1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
rb = sb = 0;
/* Note: sh is not initialized, but will not be used in this case. */
}
- else if (bx > cx)
+ else
{
- MPFR_SET_SAME_SIGN (a, b);
- BGreater2:
+ if (bx < cx) /* swap b and c */
+ {
+ mpfr_exp_t tx;
+ mp_limb_t *tp;
+ tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
+ MPFR_SET_OPPOSITE_SIGN (a, b);
+ }
+ else
+ {
+ MPFR_SET_SAME_SIGN (a, b);
+ }
+ MPFR_ASSERTD (bx > cx);
d = (mpfr_uexp_t) bx - cx;
sh = 3 * GMP_NUMB_BITS - p;
mask = MPFR_LIMB_MASK(sh);
@@ -976,15 +1314,6 @@ mpfr_sub1sp3 (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode,
sb = 1;
}
}
- else /* cx > bx */
- {
- mpfr_exp_t tx;
- mp_limb_t *tp;
- tx = bx; bx = cx; cx = tx;
- tp = bp; bp = cp; cp = tp;
- MPFR_SET_OPPOSITE_SIGN (a, b);
- goto BGreater2;
- }
/* now perform rounding */
@@ -1097,14 +1426,21 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
mpfr_exp_t bx, cx;
mpfr_uexp_t d;
mpfr_prec_t p, sh, cnt;
- mp_size_t n;
- mp_limb_t *ap, *bp, *cp;
+ mp_size_t n, k;
+ mp_limb_t *ap = MPFR_MANT(a);
+ mp_limb_t *bp = MPFR_MANT(b);
+ mp_limb_t *cp = MPFR_MANT(c);
mp_limb_t limb;
int inexact;
- mp_limb_t bcp,bcp1; /* Cp and C'p+1 */
- mp_limb_t bbcp = MPFR_LIMB_MAX, bbcp1 = MPFR_LIMB_MAX; /* Cp+1 and C'p+2,
+ mp_limb_t rb, sb; /* round and sticky bits. They are interpreted as
+ negative, i.e., if rb <> 0, then we should subtract 1
+ at the round bit position, and of sb <> 0, we should
+ subtract something below the round bit position. */
+ mp_limb_t rbb = MPFR_LIMB_MAX, sbb = MPFR_LIMB_MAX; /* rbb is the next bit
+ after the round bit, and sbb the corresponding sticky bit.
gcc claims that they might be used uninitialized. We fill them with invalid
values, which should produce a failure if so. See README.dev file. */
+ int pow2;
MPFR_TMP_DECL(marker);
@@ -1132,6 +1468,9 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
/* special case for 2*GMP_NUMB_BITS < p < 3*GMP_NUMB_BITS */
if (2 * GMP_NUMB_BITS < p && p < 3 * GMP_NUMB_BITS)
return mpfr_sub1sp3 (a, b, c, rnd_mode, p);
+
+ if (p == 2 * GMP_NUMB_BITS)
+ return mpfr_sub1sp2n (a, b, c, rnd_mode);
#endif
n = MPFR_PREC2LIMBS (p);
@@ -1141,14 +1480,15 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
MPFR_TMP_MARK(marker);
+ k = n - 1;
+
if (bx == cx)
{
- mp_size_t k = n - 1;
/* Check mantissa since exponents are equal */
- bp = MPFR_MANT(b);
- cp = MPFR_MANT(c);
while (k >= 0 && MPFR_UNLIKELY(bp[k] == cp[k]))
k--;
+ /* now k = - 1 if b == c, otherwise k is the largest integer < n such
+ that bp[k] <> cp[k] */
if (k < 0)
/* b == c ! */
{
@@ -1173,10 +1513,13 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
/* Swap b and c and set sign */
mpfr_srcptr t;
mpfr_exp_t tx;
+ mp_limb_t *tp;
+
+ tx = bx; bx = cx; cx = tx;
CGreater:
MPFR_SET_OPPOSITE_SIGN(a,b);
t = b; b = c; c = t;
- tx = bx; bx = cx; cx = tx;
+ tp = bp; bp = cp; cp = tp;
}
else
{
@@ -1190,25 +1533,26 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
d = (mpfr_uexp_t) bx - cx;
/* printf ("New with diff=%lu\n", (unsigned long) d); */
- if (d <= 1)
+ /* FIXME: The goto's below are too complex (long backward) and make
+ the code unreadable. */
+
+ if (d == 0)
{
- if (d == 0)
- {
- /* <-- b -->
- <-- c --> : exact sub */
- ap = MPFR_MANT(a);
- mpn_sub_n (ap, MPFR_MANT(b), MPFR_MANT(c), n);
+ /* <-- b -->
+ <-- c --> : exact sub */
+ mpn_sub_n (ap, bp, cp, n);
/* Normalize */
ExactNormalize:
limb = ap[n-1];
if (MPFR_LIKELY (limb != 0))
{
/* First limb is not zero. */
- count_leading_zeros(cnt, limb);
- /* cnt could be == 0 <= SubD1Lose */
+ count_leading_zeros (cnt, limb);
+ /* Warning: cnt can be 0 when we come from the case SubD1Lose
+ with goto ExactNormalize */
if (MPFR_LIKELY(cnt))
{
- mpn_lshift(ap, ap, n, cnt); /* Normalize number */
+ mpn_lshift (ap, ap, n, cnt); /* Normalize number */
bx -= cnt; /* Update final expo */
}
/* Last limb should be OK */
@@ -1217,35 +1561,33 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
else
{
- /* First limb is zero */
- mp_size_t k = n-1, len;
+ /* First limb is zero: this can only occur for n >= 2 */
+ mp_size_t len;
/* Find the first limb not equal to zero. It necessarily exists
- since |b| > |c|. */
- do
- {
- MPFR_ASSERTD( k > 0 );
- limb = ap[--k];
- }
- while (limb == 0);
+ since |b| > |c|. We know that bp[k] > cp[k] and all upper
+ limbs are equal. */
+ while (ap[k] == 0)
+ k--;
+ limb = ap[k];
+ /* ap[k] is the non-zero limb of largest index, thus we have
+ to consider the k+1 least significant limbs */
MPFR_ASSERTD(limb != 0);
count_leading_zeros(cnt, limb);
k++;
- len = n - k; /* Number of last limb */
- MPFR_ASSERTD(k >= 0);
+ len = n - k; /* Number of most significant zero limbs */
+ MPFR_ASSERTD(k > 0);
if (cnt)
mpn_lshift (ap + len, ap, k, cnt); /* Normalize the High Limb*/
else
- {
- /* Must use copyd since src and dst may overlap & dst>=src */
- mpn_copyd (ap+len, ap, k);
- }
+ /* Must use copyd since src and dst may overlap & dst>=src */
+ mpn_copyd (ap + len, ap, k);
MPN_ZERO(ap, len); /* Zeroing the last limbs */
- bx -= cnt + len*GMP_NUMB_BITS; /* Update Expo */
- /* Last limb should be OK */
+ bx -= cnt + len * GMP_NUMB_BITS; /* update exponent */
+ /* ap[len] should have its low bits zero: it is bp[0]-cp[0] */
MPFR_ASSERTD(!(ap[len] & MPFR_LIMB_MASK((unsigned int) (-p)
% GMP_NUMB_BITS)));
}
- /* Check expo underflow */
+ /* Check exponent underflow (no overflow can happen) */
if (MPFR_UNLIKELY(bx < __gmpfr_emin))
{
MPFR_TMP_FREE(marker);
@@ -1261,122 +1603,110 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
MPFR_SET_EXP (a, bx);
/* No rounding is necessary since the result is exact */
- MPFR_ASSERTD(ap[n-1] > ~ap[n-1]);
+ MPFR_ASSERTD(ap[n-1] & MPFR_LIMB_HIGHBIT);
MPFR_TMP_FREE(marker);
return 0;
- }
- else /* if (d == 1) */
+ }
+ else if (d == 1)
{
/* | <-- b -->
| <-- c --> */
mp_limb_t c0, mask;
- mp_size_t k;
MPFR_UNSIGNED_MINUS_MODULO(sh, p);
/* If we lose at least one bit, compute 2*b-c (Exact)
* else compute b-c/2 */
- bp = MPFR_MANT(b);
- cp = MPFR_MANT(c);
- k = n-1;
limb = bp[k] - cp[k]/2;
- /* we have |b|-|c| >= limb*W^k - (2*W^k-1)/2 >= limb*W^k - W^k + 1/2
- thus if limb > W^k/2, |b|-|c| >= 1/2*W^n.
+ /* Let W = 2^GMP_NUMB_BITS:
+ we have |b|-|c| >= limb*W^k - (2*W^k-1)/2 >= limb*W^k - W^k + 1/2
+ thus if limb > W/2, |b|-|c| >= 1/2*W^n.
Moreover if trunc(|c|) represents the first p-1 bits of |c|,
- minus the last significant bit called c0 below, then we have
+ minus the last significant bit called c0 below (in fact c0 is that
+ bit shifted by sh bits), then we have
|b|-trunc(|c|) >= 1/2*W^n+1, thus the two mpn_sub_n calls
below necessarily yield a > 1/2*W^n. */
- if (limb > MPFR_LIMB_HIGHBIT)
+ if (limb > MPFR_LIMB_HIGHBIT) /* case limb > W/2 */
{
+ mp_limb_t *tp;
/* The exponent cannot decrease: compute b-c/2 */
/* Shift c in the allocated temporary block */
SubD1NoLose:
c0 = cp[0] & (MPFR_LIMB_ONE << sh);
mask = ~MPFR_LIMB_MASK(sh);
- ap = MPFR_MANT(a);
- cp = MPFR_TMP_LIMBS_ALLOC (n);
+ tp = MPFR_TMP_LIMBS_ALLOC (n);
/* FIXME: it might be faster to have one function shifting c by 1
to the right and adding with b to a, which would read c once
only, and avoid a temporary allocation. */
- mpn_rshift (cp, MPFR_MANT(c), n, 1);
- cp[0] &= mask; /* Zero last bit of c if set */
- mpn_sub_n (ap, bp, cp, n);
- MPFR_SET_EXP(a, bx); /* No expo overflow! */
- MPFR_ASSERTD(ap[n-1] > ~ap[n-1]);
+ mpn_rshift (tp, cp, n, 1);
+ tp[0] &= mask; /* Zero last bit of c if set */
+ mpn_sub_n (ap, bp, tp, n);
+ MPFR_SET_EXP(a, bx); /* No exponent overflow! */
+ MPFR_ASSERTD(ap[n-1] & MPFR_LIMB_HIGHBIT);
if (MPFR_LIKELY(c0 == 0))
{
/* Result is exact: no need of rounding! */
MPFR_TMP_FREE(marker);
return 0;
}
+ /* c0 is non-zero, thus we have to subtract 1/2*ulp(a),
+ however we know (see analysis above) that this cannot
+ make the exponent decrease */
MPFR_ASSERTD( !(ap[0] & ~mask) ); /* Check last bits */
/* No normalize is needed */
- /* Rounding is necessary since c0 = 1 */
- /* Cp =-1 and C'p+1=0 */
- bcp = 1; bcp1 = 0;
-
- if (rnd_mode == MPFR_RNDF)
- goto truncate; /* low(b) = 0 and low(c) is 0 or 1/2 ulp(b), thus
- low(b) - low(c) = 0 or -1/2 ulp(b) */
- else if (rnd_mode == MPFR_RNDN)
- {
- /* Even Rule apply: Check last bit of a. */
- if (MPFR_LIKELY( (ap[0] & (MPFR_LIMB_ONE << sh)) == 0) )
- goto truncate;
- else
- goto sub_one_ulp;
- }
- MPFR_UPDATE_RND_MODE(rnd_mode, MPFR_IS_NEG(a));
- if (rnd_mode == MPFR_RNDZ)
- goto sub_one_ulp;
- else
- goto truncate;
+
+ /* Rounding is necessary since c0 is non-zero */
+ /* we have to subtract 1 at the round bit position,
+ and 0 for the lower bits */
+ rb = 1; rbb = sbb = 0;
}
else if (MPFR_LIKELY(limb < MPFR_LIMB_HIGHBIT))
{
+ mp_limb_t *tp;
/* |b| - |c| <= (W/2-1)*W^k + W^k-1 = 1/2*W^n - 1 */
/* The exponent decreases by one. */
SubD1Lose:
- ap = MPFR_MANT(a);
/* Compute 2*b-c (Exact) */
- /* Experiments with __gmpn_rsblsh_n show that it is not always
- faster than mpn_lshift + mpn_sub_n, thus we don't enable it
- for now (HAVE___GMPN_RSBLSH_N -> HAVE___GMPN_RSBLSH_Nxxx). */
-#if defined(WANT_GMP_INTERNALS) && defined(HAVE___GMPN_RSBLSH_Nxxx)
+#if defined(WANT_GMP_INTERNALS) && defined(HAVE___GMPN_RSBLSH1_N)
/* {ap, n} = 2*{bp, n} - {cp, n} */
- __gmpn_rsblsh_n (ap, MPFR_MANT(c), MPFR_MANT(b), n, 1);
+ /* mpn_rsblsh1_n -- rp[] = (vp[] << 1) - up[] */
+ __gmpn_rsblsh1_n (ap, cp, bp, n);
#else
- bp = MPFR_TMP_LIMBS_ALLOC (n);
+ tp = MPFR_TMP_LIMBS_ALLOC (n);
/* Shift b in the allocated temporary block */
- mpn_lshift (bp, MPFR_MANT(b), n, 1);
- mpn_sub_n (ap, bp, cp, n);
+ mpn_lshift (tp, bp, n, 1);
+ mpn_sub_n (ap, tp, cp, n);
#endif
bx--;
+ MPFR_ASSERTD(k == n-1);
goto ExactNormalize;
}
- else
+ else /* limb = MPFR_LIMB_HIGHBIT */
{
/* Case: limb = 100000000000 */
- /* Check while b[k] == c'[k] (C' is C shifted by 1) */
- /* If b[k]<c'[k] => We lose at least one bit*/
- /* If b[k]>c'[k] => We don't lose any bit */
- /* If k==-1 => We don't lose any bit
+ /* Check while b[l] == c'[l] (C' is C shifted by 1) */
+ /* If b[l]<c'[l] => We lose at least one bit */
+ /* If b[l]>c'[l] => We don't lose any bit */
+ /* If l==-1 => We don't lose any bit
AND the result is 100000000000 0000000000 00000000000 */
- mp_limb_t carry;
+ mp_size_t l = n - 1;
+ mp_limb_t cl_shifted;
do
{
- carry = cp[k] << (GMP_NUMB_BITS - 1);
- if (--k < 0)
+ /* the first loop will compare b[n-2] and c'[n-2] */
+ cl_shifted = cp[l] << (GMP_NUMB_BITS - 1);
+ if (--l < 0)
break;
- carry += cp[k] >> 1;
+ cl_shifted += cp[l] >> 1;
}
- while (bp[k] == carry);
- if (MPFR_UNLIKELY(k < 0))
+ while (bp[l] == cl_shifted);
+ if (MPFR_UNLIKELY(l < 0))
{
- ap = MPFR_MANT (a);
- if (MPFR_UNLIKELY(carry))
+ if (MPFR_UNLIKELY(cl_shifted))
{
- /* If carry then necessarily the precision is an exact
- multiple of GMP_NUMB_BITS, and we lose one bit,
- thus the (exact) result is a power of 2 minus 1. */
+ /* Since cl_shifted is what should be subtracted
+ from ap[-1], if non-zero then necessarily the
+ precision is a multiple of GMP_NUMB_BITS, and we lose
+ one bit, thus the (exact) result is a power of 2
+ minus 1. */
memset (ap, -1, n * MPFR_BYTES_PER_MP_LIMB);
MPFR_SET_EXP (a, bx - 1);
/* No underflow is possible since cx = bx-1 is a valid
@@ -1384,138 +1714,79 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
}
else
{
- /* No carry: result is a power of 2. */
+ /* cl_shifted=0: result is a power of 2. */
MPN_ZERO (ap, n - 1);
ap[n-1] = MPFR_LIMB_HIGHBIT;
- MPFR_SET_EXP (a, bx); /* No expo overflow! */
+ MPFR_SET_EXP (a, bx); /* No exponent overflow! */
}
/* No Normalize is needed */
/* No Rounding is needed */
MPFR_TMP_FREE (marker);
return 0;
}
- /* carry = cp[k]/2+(cp[k-1]&1)<<(GMP_NUMB_BITS-1) = c'[k]*/
- else if (bp[k] > carry)
+ /* cl_shifted is the shifted value c'[l] */
+ else if (bp[l] > cl_shifted)
goto SubD1NoLose; /* |b|-|c| >= 1/2*W^n */
else
{
- MPFR_ASSERTD(bp[k] < carry);
+ /* we cannot have bp[l] = cl_shifted since the only way we
+ can exit the while loop above is when bp[l] <> cl_shifted
+ or l < 0, and the case l < 0 was already treated above. */
+ MPFR_ASSERTD(bp[l] < cl_shifted);
goto SubD1Lose; /* |b|-|c| <= 1/2*W^n-1 and is exact */
}
}
}
- }
else if (MPFR_UNLIKELY(d >= p)) /* the difference of exponents is larger
than the precision of all operands, thus
the result is either b or b - 1 ulp,
with a possible exact result when
d = p, b = 2^e and c = 1/2 ulp(b) */
{
- ap = MPFR_MANT(a);
MPFR_UNSIGNED_MINUS_MODULO(sh, p);
/* We can't set A before since we use cp for rounding... */
/* Perform rounding: check if a=b or a=b-ulp(b) */
if (MPFR_UNLIKELY(d == p))
{
- /* 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<<(GMP_NUMB_BITS-2)));
- /* We need also C'p+1 for an even more unprobable case... */
- if (MPFR_LIKELY( bbcp ))
- bcp1 = 1;
- else
- {
- cp = MPFR_MANT(c);
- if (MPFR_UNLIKELY(cp[n-1] == MPFR_LIMB_HIGHBIT))
- {
- mp_size_t k = n-1;
- do
- k--;
- while (k >= 0 && cp[k] == 0);
- bcp1 = (k >= 0);
- }
- else
- bcp1 = 1;
- }
- /* printf("(D=P) Cp=-1 Cp+1=%d C'p+1=%d \n", bbcp!=0, bcp1!=0); */
- bp = MPFR_MANT (b);
-
- /* Even if src and dest overlap, it is OK using MPN_COPY */
- if (MPFR_LIKELY(rnd_mode == MPFR_RNDF))
- /* then d = p, and subtracting one ulp of b is ok even in the
- exact case b = 2^e and c = 1/2 ulp(b) */
- {
- MPN_COPY(ap, bp, n);
- goto sub_one_ulp;
- }
- else if (rnd_mode == MPFR_RNDN)
- {
- if (MPFR_UNLIKELY (bcp != 0 && bcp1 == 0))
- /* Cp=-1 and C'p+1=0: Even rule Apply! */
- /* Check Ap-1 = Bp-1 */
- if ((bp[0] & (MPFR_LIMB_ONE << sh)) == 0)
- {
- MPN_COPY(ap, bp, n);
- goto truncate;
- }
- MPN_COPY(ap, bp, n);
- goto sub_one_ulp;
- }
- MPFR_UPDATE_RND_MODE(rnd_mode, MPFR_IS_NEG(a));
- if (rnd_mode == MPFR_RNDZ)
- {
- MPN_COPY(ap, bp, n);
- goto sub_one_ulp;
- }
- else
- {
- MPN_COPY(ap, bp, n);
- goto truncate;
- }
+ /* since c is normalized, we need to subtract 1/2 ulp(b) */
+ rb = 1;
+ /* rbb is the bit of weight 1/4 ulp(b) in c. We assume a limb has
+ at least 2 bits. If the precision is 1, we read in the unused
+ bits, which should be zero, and this is what we want. */
+ rbb = cp[n-1] & (MPFR_LIMB_HIGHBIT >> 1);
+
+ /* We need also sbb */
+ sbb = cp[n-1] & MPFR_LIMB_MASK(GMP_NUMB_BITS - 2);
+ for (k = n-1; sbb == 0 && k > 0;)
+ sbb = cp[--k];
}
else
{
- /* Cp=0, Cp+1=-1 if d==p+1, C'p+1=-1 */
- bcp = 0; bbcp = (d==p+1); bcp1 = 1;
- /* printf("(D>P) Cp=%d Cp+1=%d C'p+1=%d\n", bcp!=0,bbcp!=0,bcp1!=0); */
- /* Need to compute C'p+2 if d==p+1 and if rnd_mode=NEAREST
- (Because of a very improbable case) */
- if (MPFR_UNLIKELY(d==p+1 && rnd_mode==MPFR_RNDN))
+ rb = 0;
+ if (d == p + 1)
{
- cp = MPFR_MANT(c);
- if (MPFR_UNLIKELY(cp[n-1] == MPFR_LIMB_HIGHBIT))
- {
- mp_size_t k = n-1;
- do
- k--;
- while (k >= 0 && cp[k] == 0);
- bbcp1 = (k >= 0);
- }
- else
- bbcp1 = 1;
- /* printf("(D>P) C'p+2=%d\n", bbcp1!=0); */
+ rbb = 1;
+ sbb = cp[n-1] & MPFR_LIMB_MASK(GMP_NUMB_BITS - 1);
+ for (k = n-1; sbb == 0 && k > 0;)
+ sbb = cp[--k];
+ }
+ else
+ {
+ rbb = 0;
+ sbb = 1; /* since C is non-zero */
}
- /* Copy mantissa B in A */
- MPN_COPY(ap, MPFR_MANT(b), n);
- /* Round */
- if (rnd_mode == MPFR_RNDF || rnd_mode == MPFR_RNDN)
- goto truncate;
- MPFR_UPDATE_RND_MODE(rnd_mode, MPFR_IS_NEG(a));
- if (rnd_mode == MPFR_RNDZ)
- goto sub_one_ulp;
- else /* rnd_mode = AWAY */
- goto truncate;
}
+ /* Copy mantissa B in A */
+ MPN_COPY(ap, bp, n);
}
else /* case 2 <= d < p */
{
mpfr_uexp_t dm;
mp_size_t m;
- mp_limb_t mask;
+ mp_limb_t mask, *tp;
MPFR_UNSIGNED_MINUS_MODULO(sh, p);
- cp = MPFR_TMP_LIMBS_ALLOC (n);
+ tp = MPFR_TMP_LIMBS_ALLOC (n);
/* Shift c in temporary allocated place */
dm = d % GMP_NUMB_BITS;
@@ -1524,276 +1795,164 @@ mpfr_sub1sp (mpfr_ptr a, mpfr_srcptr b, mpfr_srcptr c, mpfr_rnd_t rnd_mode)
{
/* dm = 0 and m > 0: Just copy */
MPFR_ASSERTD(m != 0);
- MPN_COPY(cp, MPFR_MANT(c)+m, n-m);
- MPN_ZERO(cp+n-m, m);
+ MPN_COPY(tp, cp + m, n - m);
+ MPN_ZERO(tp + n - m, m);
}
else if (MPFR_LIKELY(m == 0))
{
/* dm >=2 and m == 0: just shift */
MPFR_ASSERTD(dm >= 2);
- mpn_rshift(cp, MPFR_MANT(c), n, dm);
+ mpn_rshift (tp, cp, n, dm);
}
else
{
/* dm > 0 and m > 0: shift and zero */
- mpn_rshift(cp, MPFR_MANT(c)+m, n-m, dm);
- MPN_ZERO(cp+n-m, m);
+ mpn_rshift (tp, cp + m, n - m, dm);
+ MPN_ZERO (tp + n - m, m);
}
+ /* FIXME: Instead of doing "cp = tp;", keep using tp to avoid
+ confusion? Thus in the block below, we don't need
+ "mp_limb_t *cp = MPFR_MANT(c);". In short, cp should always
+ be MPFR_MANT(c) defined earlier, possibly after the swap. */
+ cp = tp;
/* mpfr_print_mant_binary("Before", MPFR_MANT(c), p); */
/* mpfr_print_mant_binary("B= ", MPFR_MANT(b), p); */
/* mpfr_print_mant_binary("After ", cp, p); */
- /* Compute bcp=Cp and bcp1=C'p+1 */
- if (MPFR_LIKELY(sh))
- {
- /* Try to compute them from C' rather than C (FIXME: Faster?) */
- bcp = (cp[0] & (MPFR_LIMB_ONE<<(sh-1))) ;
- if (cp[0] & MPFR_LIMB_MASK(sh-1))
- bcp1 = 1;
- else
- {
- /* We can't compute C'p+1 from C'. Compute it from C */
- /* Start from bit x=p-d+sh in mantissa C
- (+sh since we have already looked sh bits in C'!) */
- mpfr_prec_t x = p-d+sh-1;
- if (x > p)
- /* We are already looked at all the bits of c, so C'p+1 = 0*/
- bcp1 = 0;
- else
- {
- mp_limb_t *tp = MPFR_MANT(c);
- mp_size_t kx = n-1 - (x / GMP_NUMB_BITS);
- mpfr_prec_t sx = GMP_NUMB_BITS-1-(x%GMP_NUMB_BITS);
- /* printf ("(First) x=%lu Kx=%ld Sx=%lu\n",
- (unsigned long) x, (long) kx, (unsigned long) sx); */
- /* Looks at the last bits of limb kx (if sx=0 does nothing)*/
- if (tp[kx] & MPFR_LIMB_MASK(sx))
- bcp1 = 1;
- else
- {
- /*kx += (sx==0);*/
- /*If sx==0, tp[kx] hasn't been checked*/
- do
- kx--;
- while (kx >= 0 && tp[kx] == 0);
- bcp1 = (kx >= 0);
- }
- }
- }
- }
- else
- {
- /* Compute Cp and C'p+1 from C with sh=0 */
- 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 / GMP_NUMB_BITS);
- mpfr_prec_t sx = GMP_NUMB_BITS-1-(x%GMP_NUMB_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)*/
- if (tp[kx] & MPFR_LIMB_MASK(sx))
- bcp1 = 1;
- else
- {
- /*kx += (sx==0);*/ /*If sx==0, tp[kx] hasn't been checked*/
- do
- kx--;
- while (kx >= 0 && tp[kx] == 0);
- bcp1 = (kx >= 0);
- }
- }
- /* printf("sh=%lu Cp=%d C'p+1=%d\n", sh, bcp!=0, bcp1!=0); */
-
- /* Check if we can lose a bit, and if so compute Cp+1 and C'p+2 */
- bp = MPFR_MANT(b);
- if (MPFR_UNLIKELY (bp[n-1] - cp[n-1] <= MPFR_LIMB_HIGHBIT))
- {
- /* We can lose a bit so we precompute Cp+1 and C'p+2 */
- /* Test for trivial case: since C'p+1=0, Cp+1=0 and C'p+2 =0 */
- if (MPFR_LIKELY(bcp1 == 0))
- {
- bbcp = 0;
- bbcp1 = 0;
- }
- else /* bcp1 != 0 */
- {
- /* We can lose a bit:
- compute Cp+1 and C'p+2 from mantissa C */
- mp_limb_t *tp = MPFR_MANT(c);
- /* Start from bit x=(p+1)-d in mantissa C */
- mpfr_prec_t x = p+1-d;
- mp_size_t kx = n-1 - (x / GMP_NUMB_BITS);
- mpfr_prec_t sx = GMP_NUMB_BITS-1 - (x % GMP_NUMB_BITS);
-
- MPFR_ASSERTD(p > d);
- /* printf ("(pre) x=%lu Kx=%ld Sx=%lu\n",
- (unsigned long) x, (long) kx, (unsigned long) sx); */
- bbcp = (tp[kx] & (MPFR_LIMB_ONE<<sx)) ;
- /* Looks at the last bits of limb kx (If sx=0, does nothing)*/
- /* If Cp+1=0, since C'p+1!=0, C'p+2=1 ! */
- if (MPFR_LIKELY (bbcp == 0 || (tp[kx] & MPFR_LIMB_MASK(sx))))
- bbcp1 = 1;
- else
- {
- /*kx += (sx==0);*/ /*If sx==0, tp[kx] hasn't been checked*/
- do
- kx--;
- while (kx >= 0 && tp[kx] == 0);
- bbcp1 = (kx >= 0);
- /* printf ("(Pre) Scan done for %ld\n", (long) kx); */
- }
- } /*End of Bcp1 != 0*/
- /* printf("(Pre) Cp+1=%d C'p+2=%d\n", bbcp!=0, bbcp1!=0); */
- } /* End of "can lose a bit" */
+ /* Compute rb=Cp and sb=C'p+1 */
+ {
+ /* Compute rb and rbb from C */
+ mp_limb_t *cp = MPFR_MANT(c);
+ /* The round bit is bit p-d in C, assuming the most significant bit
+ of C is bit 0 */
+ mpfr_prec_t x = p - d;
+ mp_size_t kx = n - 1 - (x / GMP_NUMB_BITS);
+ mpfr_prec_t sx = GMP_NUMB_BITS - 1 - (x % GMP_NUMB_BITS);
+ /* the round bit is in cp[kx], at position sx */
+ MPFR_ASSERTD(p >= d);
+ rb = cp[kx] & (MPFR_LIMB_ONE << sx);
+
+ /* Now compute rbb: since d >= 2 it always exists in C */
+ if (sx == 0) /* rbb is in the next limb */
+ {
+ kx --;
+ sx = GMP_NUMB_BITS - 1;
+ }
+ else
+ sx --; /* rb and rbb are in the same limb */
+ rbb = cp[kx] & (MPFR_LIMB_ONE << sx);
+
+ /* Now look at the remaining low bits of C to determine sbb */
+ sbb = cp[kx] & MPFR_LIMB_MASK(sx);
+ while (sbb == 0 && kx > 0)
+ sbb = cp[--kx];
+ }
+ /* printf("sh=%lu Cp=%d C'p+1=%d\n", sh, rb!=0, sb!=0); */
/* Clean shifted C' */
mask = ~MPFR_LIMB_MASK (sh);
cp[0] &= mask;
/* Subtract the mantissa c from b in a */
- ap = MPFR_MANT(a);
mpn_sub_n (ap, bp, cp, n);
/* mpfr_print_mant_binary("Sub= ", ap, p); */
- /* Normalize: we lose at max one bit*/
+ /* Normalize: we lose at most one bit */
if (MPFR_UNLIKELY(MPFR_LIMB_MSB(ap[n-1]) == 0))
{
/* High bit is not set and we have to fix it! */
/* Ap >= 010000xxx001 */
- mpn_lshift(ap, ap, n, 1);
+ mpn_lshift (ap, ap, n, 1);
/* Ap >= 100000xxx010 */
- if (MPFR_UNLIKELY(bcp != 0)) /* Check if Cp = -1 */
+ if (MPFR_UNLIKELY(rb != 0)) /* Check if Cp = -1 */
/* Since Cp == -1, we have to subtract one more */
{
- mpn_sub_1(ap, ap, n, MPFR_LIMB_ONE<<sh);
+ mpn_sub_1 (ap, ap, n, MPFR_LIMB_ONE << sh);
MPFR_ASSERTD(MPFR_LIMB_MSB(ap[n-1]) != 0);
}
/* Ap >= 10000xxx001 */
/* Final exponent -1 since we have shifted the mantissa */
bx--;
- /* Update bcp and bcp1 */
- MPFR_ASSERTD(bbcp != MPFR_LIMB_MAX);
- MPFR_ASSERTD(bbcp1 != MPFR_LIMB_MAX);
- bcp = bbcp;
- bcp1 = bbcp1;
+ /* Update rb and sb */
+ rb = rbb;
+ rbb = sbb;
/* We don't have anymore a valid Cp+1!
But since Ap >= 100000xxx001, the final sub can't unnormalize!*/
}
MPFR_ASSERTD( !(ap[0] & ~mask) );
+ }
- /* Rounding */
- if (MPFR_LIKELY(rnd_mode == MPFR_RNDF))
- goto truncate;
- else if (MPFR_LIKELY(rnd_mode == MPFR_RNDN))
- {
- if (MPFR_LIKELY(bcp == 0))
- goto truncate;
- else if (bcp1 != 0 || (ap[0] & (MPFR_LIMB_ONE << sh)) != 0)
- goto sub_one_ulp;
- else
- goto truncate;
- }
+ rounding:
+ /* at this point 'a' contains b - high(c), normalized,
+ and we have to subtract rb * 1/2 ulp(a), rbb * 1/4 ulp(a),
+ and sbb * 1/8 ulp(a), interpreting rb/rbb/sbb as 1 if non-zero. */
- /* Update rounding mode */
- MPFR_UPDATE_RND_MODE(rnd_mode, MPFR_IS_NEG(a));
- if (rnd_mode == MPFR_RNDZ && MPFR_LIKELY (bcp != 0 || bcp1 != 0))
- goto sub_one_ulp;
- goto truncate;
+ sb = rbb | sbb;
+
+ if (rb == 0 && sb == 0)
+ {
+ inexact = 0;
+ goto end_of_sub;
}
- MPFR_RET_NEVER_GO_HERE ();
-
- /* Sub one ulp to the result */
- sub_one_ulp:
- mpn_sub_1 (ap, ap, n, MPFR_LIMB_ONE << sh);
- /* Result should be smaller than exact value: inexact=-1 */
- inexact = -1;
- /* Check normalization */
- if (MPFR_UNLIKELY(ap[n-1] < MPFR_LIMB_HIGHBIT))
+
+ pow2 = mpfr_powerof2_raw (a);
+ if (pow2 && rb != 0) /* subtract 1 ulp */
{
- /* ap was a power of 2, and we lose a bit */
- /* Now it is 0111111111111111111[00000 */
- /* The following 2 lines are equivalent to: mpn_lshift(ap, ap, n, 1); */
- ap[0] <<= 1;
+ mpn_sub_1 (ap, ap, n, MPFR_LIMB_ONE << sh);
ap[n-1] |= MPFR_LIMB_HIGHBIT;
bx--;
- /* And the lost bit x depends on Cp+1, and Cp */
- /* Compute Cp+1 if it isn't already computed (ie d==1) */
- /* Note: we can't have d = 1 here, since the only "goto sub_one_ulp"
- for d = 1 are in the "SubD1NoLose" case, and in that case
- |b|-|c| >= 1/2*W^n, thus round(|b|-|c|) >= 1/2*W^n, and ap[n-1]
- cannot go below MPFR_LIMB_HIGHBIT. */
- /* printf("(SubOneUlp)Cp=%d, Cp+1=%d C'p+1=%d\n", bcp!=0,bbcp!=0,bcp1!=0); */
- /* Compute the last bit (Since we have shifted the mantissa)
- we need one more bit! */
- MPFR_ASSERTD(bbcp != MPFR_LIMB_MAX);
- if ((rnd_mode == MPFR_RNDZ && bcp == 0) ||
- (rnd_mode == MPFR_RNDN && bbcp == 0) ||
- (bcp != 0 && bcp1 == 0)) /* Exact result */
- {
- ap[0] |= MPFR_LIMB_ONE << sh;
- if (rnd_mode == MPFR_RNDN)
- inexact = 1;
- /* printf("(SubOneUlp) Last bit set\n"); */
- }
- /* Result could be exact if C'p+1 = 0 and rnd == Zero
- since we have had one more bit to the result */
- /* Fixme: rnd_mode == MPFR_RNDZ needed ? */
- if (rnd_mode == MPFR_RNDZ && bcp1 == 0)
- {
- /* printf("(SubOneUlp) Exact result\n"); */
- inexact = 0;
- }
+ rb = rbb;
+ rbb = sbb;
+ sbb = 0;
+ /* Note: for p=1 this case can only happen with d=1, but then we will
+ have rb=sb=0 at the next round. */
+ goto rounding;
}
- goto end_of_sub;
-
- truncate:
- /* Check if the result is an exact power of 2: 100000000000
- in which cases, we could have to do sub_one_ulp due to some nasty reasons:
- If Result is a Power of 2:
- + If rnd = AWAY,
- | If Cp=-1 and C'p+1 = 0, SubOneUlp and the result is EXACT.
- If Cp=-1 and C'p+1 =-1, SubOneUlp and the result is above.
- Otherwise truncate
- + If rnd = NEAREST,
- If Cp= 0 and Cp+1 =-1 and C'p+2=-1, SubOneUlp and the result is above
- If cp=-1 and C'p+1 = 0, SubOneUlp and the result is exact.
- Otherwise truncate.
- X bit should always be set if SubOneUlp*/
- if (MPFR_UNLIKELY(ap[n-1] == MPFR_LIMB_HIGHBIT))
+ /* now if a is a power of two, necessary rb = 0,
+ which means the exact result is always in (pred(a), a),
+ and the bounds cannot be attained */
+
+ if (rnd_mode == MPFR_RNDF)
+ inexact = 0;
+ else if (rnd_mode == MPFR_RNDN)
{
- mp_size_t k = n-1;
- do
- k--;
- while (k >= 0 && ap[k] == 0);
- if (MPFR_UNLIKELY (k < 0))
+ if (pow2)
{
- /* It is a power of 2! */
- /* Compute Cp+1 if it isn't already compute (ie d==1) */
- /* Note: if d=1, we have {a, n} > 1/2*W^n, thus we cannot have k < 0. */
- /* printf("(Truncate) Cp=%d, Cp+1=%d C'p+1=%d C'p+2=%d\n",
- bcp!=0, bbcp!=0, bcp1!=0, bbcp1!=0); */
- MPFR_ASSERTD(bbcp != MPFR_LIMB_MAX);
- MPFR_ASSERTD(rnd_mode != MPFR_RNDN || bcp != 0 ||
- bbcp == 0 || bbcp1 != MPFR_LIMB_MAX);
- if ((rnd_mode != MPFR_RNDZ && bcp != 0) ||
- (rnd_mode == MPFR_RNDN && bcp == 0 && bbcp != 0 && bbcp1 != 0))
+ MPFR_ASSERTD(rb == 0);
+ /* since we have at the end of the binade, we have in fact rb = rbb
+ and sb = sbb */
+ rb = rbb;
+ sb = sbb;
+ }
+ /* Warning: for p=1, the significand is always odd: the "even" rule
+ rounds to the value with largest magnitude, thus we have to check
+ that case separately */
+ if (rb == 0 ||
+ (rb != 0 && sb == 0 &&
+ ((ap[0] & (MPFR_LIMB_ONE << sh)) == 0 || p == 1)))
+ inexact = 1; /* round to a and return 1 */
+ else /* round to pred(a) and return -1 */
+ {
+ subtract:
+ mpn_sub_1 (ap, ap, n, MPFR_LIMB_ONE << sh);
+ if (pow2) /* deal with cancellation */
{
- /* printf("(Truncate) Do sub\n"); */
- mpn_sub_1 (ap, ap, n, MPFR_LIMB_ONE << sh);
ap[n-1] |= MPFR_LIMB_HIGHBIT;
bx--;
- /* FIXME: Explain why it works (or why not)... */
- inexact = (bcp1 == 0) ? 0 : (rnd_mode == MPFR_RNDN) ? -1 : 1;
- goto end_of_sub;
}
+ inexact = -1;
}
}
-
- /* Calcul of Inexact flag.*/
- inexact = (bcp != 0 || bcp1 != 0);
+ else /* directed rounding */
+ {
+ MPFR_UPDATE_RND_MODE(rnd_mode, MPFR_IS_NEG(a));
+ if (rnd_mode == MPFR_RNDZ)
+ goto subtract;
+ else
+ inexact = 1;
+ }
end_of_sub:
/* Update Exponent */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub1sp1_extracted.c b/Build/source/libs/mpfr/mpfr-src/src/sub1sp1_extracted.c
new file mode 100644
index 00000000000..8e62b3f4dcf
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub1sp1_extracted.c
@@ -0,0 +1,530 @@
+/* mpfr_sub1sp1 -- internal function to perform a "real" subtraction on one limb
+ This code was extracted by Kremlin from a formal proof in F*
+ done by Félix Breton in June-July 2019: do not modify it!
+
+Source: https://github.com/project-everest/hacl-star/tree/dev_mpfr/code/mpfr
+
+Copyright 2004-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "stdint.h"
+#include "inttypes.h" /* for __builtin_clzll */
+
+/* beginning of manually added declarations */
+
+#define MPFR_mpfr_sub1sp1 mpfr_sub1sp1
+#define MPFR_RoundingMode_mpfr_rnd_t mpfr_rnd_t
+#define MPFR_Lib_mpfr_struct __mpfr_struct
+#define MPFR_Lib_gmp_NUMB_BITS GMP_NUMB_BITS
+#define __eq__MPFR_RoundingMode_mpfr_rnd_t(x,y) ((x)==(y))
+#define MPFR_RoundingMode_MPFR_RNDD MPFR_RNDD
+#define MPFR_RoundingMode_MPFR_RNDN MPFR_RNDN
+#define MPFR_RoundingMode_MPFR_RNDZ MPFR_RNDZ
+#define MPFR_RoundingMode_MPFR_RNDU MPFR_RNDU
+#define MPFR_Lib_mpfr_SET_EXP MPFR_SET_EXP
+#define MPFR_Lib_mpfr_RET MPFR_RET
+#define MPFR_Lib_mpfr_NEG_SIGN(x) (-(x))
+#define MPFR_Exceptions_mpfr_underflow mpfr_underflow
+#define MPFR_Exceptions_mpfr_overflow mpfr_overflow
+#define true 1
+#define false 0
+
+/* the original code had mpfr_exp instead of _mpfr_exp */
+#define mpfr_exp _mpfr_exp
+/* the original code had mpfr_d instead of _mpfr_d */
+#define mpfr_d _mpfr_d
+/* the original code had mpfr_prec instead of _mpfr_prec */
+#define mpfr_prec _mpfr_prec
+/* the original code had mpfr_sign instead of _mpfr_sign */
+#define mpfr_sign _mpfr_sign
+#define bool int /* to avoid conflict with C++ keyword */
+
+/* end of manually added declarations */
+
+static uint32_t MPFR_Lib_Clz_count_leading_zeros (uint64_t a) {
+ return __builtin_clzll(a);
+}
+
+typedef struct MPFR_Add1sp1_state_s
+{
+ int64_t sh;
+ int64_t bx;
+ uint64_t rb;
+ uint64_t sb;
+}
+MPFR_Add1sp1_state;
+
+typedef struct
+K___MPFR_Lib_mpfr_struct__MPFR_Lib_mpfr_struct__int64_t_int64_t_uint64_t__uint64_t__s
+{
+ const MPFR_Lib_mpfr_struct *fst; /* added const */
+ const MPFR_Lib_mpfr_struct *snd; /* added const */
+ int64_t thd;
+ int64_t f3;
+ uint64_t *f4;
+ uint64_t *f5;
+}
+K___MPFR_Lib_mpfr_struct__MPFR_Lib_mpfr_struct__int64_t_int64_t_uint64_t__uint64_t_;
+
+static MPFR_Add1sp1_state
+MPFR_Add1sp1_mk_state(int64_t sh, int64_t bx, uint64_t rb, uint64_t sb)
+{
+ MPFR_Add1sp1_state lit;
+ lit.sh = sh;
+ lit.bx = bx;
+ lit.rb = rb;
+ lit.sb = sb;
+ return lit;
+}
+
+static MPFR_Add1sp1_state
+MPFR_Sub1sp1_mpfr_sub1sp1_gt_branch_1(
+ MPFR_Lib_mpfr_struct *a,
+ const MPFR_Lib_mpfr_struct *b, /* added const */
+ const MPFR_Lib_mpfr_struct *c, /* added const */
+ uint64_t *ap,
+ uint64_t *bp,
+ uint64_t *cp,
+ int64_t bx,
+ int64_t cx,
+ int64_t p,
+ int64_t sh,
+ uint64_t mask,
+ uint64_t sb_1,
+ uint64_t a0_base
+)
+{
+ uint32_t cnt = MPFR_Lib_Clz_count_leading_zeros(a0_base);
+ uint64_t a0;
+ if (cnt == (uint32_t)0U)
+ {
+ a0 = a0_base;
+ }
+ else
+ {
+ a0 = a0_base << cnt | sb_1 >> ((uint32_t)64U - cnt);
+ }
+ {
+ uint64_t sb_2 = sb_1 << cnt;
+ uint64_t rb = a0 & (uint64_t)1U << (uint32_t)(sh - (int64_t)1);
+ uint64_t sb = sb_2 | ((a0 & mask) ^ rb);
+ ap[0U] = a0 & ~mask;
+ return MPFR_Add1sp1_mk_state(sh, bx - (int64_t)cnt, rb, sb);
+ }
+}
+
+static bool MPFR_RoundingMode_uu___is_MPFR_RNDN(MPFR_RoundingMode_mpfr_rnd_t projectee)
+{
+ switch (projectee)
+ {
+ case MPFR_RoundingMode_MPFR_RNDN:
+ {
+ return true;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+}
+
+static bool MPFR_RoundingMode_uu___is_MPFR_RNDZ(MPFR_RoundingMode_mpfr_rnd_t projectee)
+{
+ switch (projectee)
+ {
+ case MPFR_RoundingMode_MPFR_RNDZ:
+ {
+ return true;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+}
+
+static bool MPFR_RoundingMode_uu___is_MPFR_RNDU(MPFR_RoundingMode_mpfr_rnd_t projectee)
+{
+ switch (projectee)
+ {
+ case MPFR_RoundingMode_MPFR_RNDU:
+ {
+ return true;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+}
+
+static bool MPFR_RoundingMode_uu___is_MPFR_RNDD(MPFR_RoundingMode_mpfr_rnd_t projectee)
+{
+ switch (projectee)
+ {
+ case MPFR_RoundingMode_MPFR_RNDD:
+ {
+ return true;
+ }
+ default:
+ {
+ return false;
+ }
+ }
+}
+
+static int32_t
+MPFR_Sub1sp1_mpfr_sub1sp1(
+ MPFR_Lib_mpfr_struct *a,
+ const MPFR_Lib_mpfr_struct *b, /* added const */
+ const MPFR_Lib_mpfr_struct *c, /* added const */
+ MPFR_RoundingMode_mpfr_rnd_t rnd_mode,
+ int64_t p
+)
+{
+ int64_t bx = b->mpfr_exp;
+ int64_t cx = c->mpfr_exp;
+ uint64_t *ap = a->mpfr_d;
+ uint64_t *bp = b->mpfr_d;
+ uint64_t *cp = c->mpfr_d;
+ int64_t sh = MPFR_Lib_gmp_NUMB_BITS - p;
+ uint64_t bp0ul = bp[0U];
+ uint64_t cp0ul = cp[0U];
+ if (bx == cx && bp0ul == cp0ul)
+ {
+ if (__eq__MPFR_RoundingMode_mpfr_rnd_t(rnd_mode, MPFR_RoundingMode_MPFR_RNDD))
+ {
+ MPFR_Lib_mpfr_struct uu____0 = a[0U];
+ MPFR_Lib_mpfr_struct lit;
+ lit.mpfr_prec = uu____0.mpfr_prec;
+ lit.mpfr_sign = (int32_t)-1;
+ lit.mpfr_exp = uu____0.mpfr_exp;
+ lit.mpfr_d = uu____0.mpfr_d;
+ a[0U] = lit;
+ }
+ else
+ {
+ MPFR_Lib_mpfr_struct uu____1 = a[0U];
+ MPFR_Lib_mpfr_struct lit;
+ lit.mpfr_prec = uu____1.mpfr_prec;
+ lit.mpfr_sign = (int32_t)1;
+ lit.mpfr_exp = uu____1.mpfr_exp;
+ lit.mpfr_d = uu____1.mpfr_d;
+ a[0U] = lit;
+ }
+ MPFR_Lib_mpfr_SET_EXP(a, (int64_t)-0x7fffffffffffffff);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET((int32_t)0);
+ }
+ else
+ {
+ MPFR_Add1sp1_state st;
+ if (bx == cx)
+ {
+ /* Prims_int vb = FStar_UInt64_v(bp[0U]); */ /* unused */
+ /* Prims_int vc = FStar_UInt64_v(cp[0U]); */ /* unused */
+ /* Prims_int vsh = FStar_Int64_v(sh); */ /* unused */
+ if (cp[0U] > bp[0U])
+ {
+ uint64_t a0 = cp[0U] - bp[0U];
+ uint32_t cnt = MPFR_Lib_Clz_count_leading_zeros(a0);
+ int32_t uu____2 = MPFR_Lib_mpfr_NEG_SIGN(b->mpfr_sign);
+ MPFR_Lib_mpfr_struct uu____3 = a[0U];
+ MPFR_Lib_mpfr_struct lit;
+ lit.mpfr_prec = uu____3.mpfr_prec;
+ lit.mpfr_sign = uu____2;
+ lit.mpfr_exp = uu____3.mpfr_exp;
+ lit.mpfr_d = uu____3.mpfr_d;
+ a[0U] = lit;
+ ap[0U] = a0 << cnt;
+ {
+ int64_t bx1 = bx - (int64_t)cnt;
+ st = MPFR_Add1sp1_mk_state(sh, bx1, (uint64_t)0U, (uint64_t)0U);
+ }
+ }
+ else
+ {
+ uint64_t a0 = bp[0U] - cp[0U];
+ uint32_t cnt = MPFR_Lib_Clz_count_leading_zeros(a0);
+ MPFR_Lib_mpfr_struct uu____4 = a[0U];
+ MPFR_Lib_mpfr_struct lit;
+ lit.mpfr_prec = uu____4.mpfr_prec;
+ lit.mpfr_sign = b->mpfr_sign;
+ lit.mpfr_exp = uu____4.mpfr_exp;
+ lit.mpfr_d = uu____4.mpfr_d;
+ a[0U] = lit;
+ ap[0U] = a0 << cnt;
+ {
+ int64_t bx1 = bx - (int64_t)cnt;
+ st = MPFR_Add1sp1_mk_state(sh, bx1, (uint64_t)0U, (uint64_t)0U);
+ }
+ }
+ }
+ else
+ {
+ K___MPFR_Lib_mpfr_struct__MPFR_Lib_mpfr_struct__int64_t_int64_t_uint64_t__uint64_t_ scrut;
+ if (bx >= cx)
+ {
+ MPFR_Lib_mpfr_struct uu____5 = a[0U];
+ MPFR_Lib_mpfr_struct lit;
+ lit.mpfr_prec = uu____5.mpfr_prec;
+ lit.mpfr_sign = b->mpfr_sign;
+ lit.mpfr_exp = uu____5.mpfr_exp;
+ lit.mpfr_d = uu____5.mpfr_d;
+ a[0U] = lit;
+ {
+ K___MPFR_Lib_mpfr_struct__MPFR_Lib_mpfr_struct__int64_t_int64_t_uint64_t__uint64_t_ lit0;
+ lit0.fst = b;
+ lit0.snd = c;
+ lit0.thd = bx;
+ lit0.f3 = cx;
+ lit0.f4 = bp;
+ lit0.f5 = cp;
+ scrut = lit0;
+ }
+ }
+ else
+ {
+ int32_t uu____6 = MPFR_Lib_mpfr_NEG_SIGN(b->mpfr_sign);
+ MPFR_Lib_mpfr_struct uu____7 = a[0U];
+ MPFR_Lib_mpfr_struct lit;
+ lit.mpfr_prec = uu____7.mpfr_prec;
+ lit.mpfr_sign = uu____6;
+ lit.mpfr_exp = uu____7.mpfr_exp;
+ lit.mpfr_d = uu____7.mpfr_d;
+ a[0U] = lit;
+ {
+ K___MPFR_Lib_mpfr_struct__MPFR_Lib_mpfr_struct__int64_t_int64_t_uint64_t__uint64_t_ lit0;
+ lit0.fst = c;
+ lit0.snd = b;
+ lit0.thd = cx;
+ lit0.f3 = bx;
+ lit0.f4 = cp;
+ lit0.f5 = bp;
+ scrut = lit0;
+ }
+ }
+ {
+ const MPFR_Lib_mpfr_struct *b1 = scrut.fst; /* added const */
+ const MPFR_Lib_mpfr_struct *c1 = scrut.snd; /* added const */
+ int64_t bx1 = scrut.thd;
+ int64_t cx1 = scrut.f3;
+ uint64_t *bp1 = scrut.f4;
+ uint64_t *cp1 = scrut.f5;
+ int64_t d = bx1 - cx1;
+ uint64_t bp0ul1 = bp1[0U];
+ uint64_t cp0ul1 = cp1[0U];
+ uint64_t mask = ((uint64_t)1U << (uint32_t)sh) - (uint64_t)1U;
+ if (d < (int64_t)64)
+ {
+ uint64_t sb_1 = ~(cp0ul1 << (uint32_t)(MPFR_Lib_gmp_NUMB_BITS - d)) + (uint64_t)1U;
+ uint64_t ite;
+ if (sb_1 == (uint64_t)0U)
+ {
+ ite = (uint64_t)0U;
+ }
+ else
+ {
+ ite = (uint64_t)1U;
+ }
+ st =
+ MPFR_Sub1sp1_mpfr_sub1sp1_gt_branch_1(a,
+ b1,
+ c1,
+ ap,
+ bp1,
+ cp1,
+ bx1,
+ cx1,
+ p,
+ sh,
+ mask,
+ sb_1,
+ bp0ul1 - ite - (cp0ul1 >> (uint32_t)d));
+ }
+ else if (bp0ul1 > (uint64_t)0x8000000000000000U)
+ {
+ ap[0U] = bp0ul1 - ((uint64_t)1U << (uint32_t)sh);
+ st = MPFR_Add1sp1_mk_state(sh, bx1, (uint64_t)1U, (uint64_t)1U);
+ }
+ else
+ {
+ bool
+ rb =
+ sh
+ > (int64_t)1
+ || d > MPFR_Lib_gmp_NUMB_BITS
+ || cp0ul1 == (uint64_t)0x8000000000000000U;
+ bool
+ sb =
+ sh
+ > (int64_t)1
+ || d > MPFR_Lib_gmp_NUMB_BITS
+ || cp0ul1 != (uint64_t)0x8000000000000000U;
+ ap[0U] = ~mask;
+ {
+ uint64_t ite0;
+ if (rb)
+ {
+ ite0 = (uint64_t)1U;
+ }
+ else
+ {
+ ite0 = (uint64_t)0U;
+ }
+ {
+ uint64_t ite;
+ if (sb)
+ {
+ ite = (uint64_t)1U;
+ }
+ else
+ {
+ ite = (uint64_t)0U;
+ }
+ st = MPFR_Add1sp1_mk_state(sh, bx1 - (int64_t)1, ite0, ite);
+ }
+ }
+ }
+ }
+ }
+ /* the constant (int64_t)-0x000000003fffffff from the original extracted
+ code was manually replaced by __gmpfr_emin */
+ if (st.bx < __gmpfr_emin)
+ {
+ int32_t s = a->mpfr_sign;
+ uint64_t ap0ul = ap[0U];
+ if
+ (
+ __eq__MPFR_RoundingMode_mpfr_rnd_t(rnd_mode,
+ MPFR_RoundingMode_MPFR_RNDN)
+ /* the constant (int64_t)-1073741824 from the original extracted
+ code was manually replaced by __gmpfr_emin-1 */
+ && (st.bx < __gmpfr_emin - 1 || ap0ul == (uint64_t)0x8000000000000000U)
+ )
+ {
+ MPFR_Lib_mpfr_SET_EXP(a, (int64_t)-0x7fffffffffffffff);
+ return MPFR_Lib_mpfr_NEG_SIGN(s);
+ }
+ else
+ {
+ int32_t t = MPFR_Exceptions_mpfr_underflow(a, rnd_mode, s);
+ return t;
+ }
+ }
+ else
+ {
+ uint64_t a0 = ap[0U];
+ MPFR_Lib_mpfr_SET_EXP(a, st.bx);
+ if (st.rb == (uint64_t)0U && st.sb == (uint64_t)0U)
+ {
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET((int32_t)0);
+ }
+ else if (MPFR_RoundingMode_uu___is_MPFR_RNDN(rnd_mode))
+ {
+ if
+ (
+ st.rb
+ == (uint64_t)0U
+ || (st.sb == (uint64_t)0U && (a0 & (uint64_t)1U << (uint32_t)st.sh) == (uint64_t)0U)
+ )
+ {
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(MPFR_Lib_mpfr_NEG_SIGN(a->mpfr_sign));
+ }
+ else if (ap[0U] + ((uint64_t)1U << (uint32_t)st.sh) == (uint64_t)0U)
+ {
+ ap[0U] = ap[0U] + ((uint64_t)1U << (uint32_t)st.sh);
+ ap[0U] = (uint64_t)0x8000000000000000U;
+ /* the constant (int64_t)0x000000003fffffff from the original
+ extracted code was replaced by __gmpfr_emax */
+ if (st.bx + (int64_t)1 <= __gmpfr_emax)
+ {
+ MPFR_Lib_mpfr_SET_EXP(a, st.bx + (int64_t)1);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else
+ {
+ int32_t t = MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(t);
+ }
+ }
+ else
+ {
+ ap[0U] = ap[0U] + ((uint64_t)1U << (uint32_t)st.sh);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ else
+ {
+ bool uu____8 = a->mpfr_sign < (int32_t)0;
+ if
+ (
+ MPFR_RoundingMode_uu___is_MPFR_RNDZ(rnd_mode)
+ || (MPFR_RoundingMode_uu___is_MPFR_RNDU(rnd_mode) && uu____8)
+ || (MPFR_RoundingMode_uu___is_MPFR_RNDD(rnd_mode) && !uu____8)
+ )
+ {
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(MPFR_Lib_mpfr_NEG_SIGN(a->mpfr_sign));
+ }
+ else if (ap[0U] + ((uint64_t)1U << (uint32_t)st.sh) == (uint64_t)0U)
+ {
+ ap[0U] = ap[0U] + ((uint64_t)1U << (uint32_t)st.sh);
+ ap[0U] = (uint64_t)0x8000000000000000U;
+ /* the constant (int64_t)0x000000003fffffff from the original
+ extracted code was replaced by __gmpfr_emax */
+ if (st.bx + (int64_t)1 <= __gmpfr_emax)
+ {
+ MPFR_Lib_mpfr_SET_EXP(a, st.bx + (int64_t)1);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ else
+ {
+ int32_t t = MPFR_Exceptions_mpfr_overflow(a, rnd_mode, a->mpfr_sign);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(t);
+ }
+ }
+ else
+ {
+ ap[0U] = ap[0U] + ((uint64_t)1U << (uint32_t)st.sh);
+ /* the following return was commented out from the extracted code */
+ /*return*/ MPFR_Lib_mpfr_RET(a->mpfr_sign);
+ }
+ }
+ }
+ }
+}
+
+int32_t
+(*MPFR_mpfr_sub1sp1)(
+ MPFR_Lib_mpfr_struct *x0,
+ const MPFR_Lib_mpfr_struct *x1, /* added const */
+ const MPFR_Lib_mpfr_struct *x2, /* added const */
+ MPFR_RoundingMode_mpfr_rnd_t x3,
+ int64_t x4
+) = MPFR_Sub1sp1_mpfr_sub1sp1;
+
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub_d.c b/Build/source/libs/mpfr/mpfr-src/src/sub_d.c
index bf870d7e565..d7b2585dcc7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sub_d.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub_d.c
@@ -1,7 +1,7 @@
/* mpfr_sub_d -- subtract a machine double precision float from
a multiple precision floating-point number
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sub_ui.c b/Build/source/libs/mpfr/mpfr-src/src/sub_ui.c
index bfea60c6895..936e1756d65 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sub_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sub_ui.c
@@ -1,6 +1,6 @@
/* mpfr_sub_ui -- subtract a floating-point number and a machine integer
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -56,24 +56,38 @@ mpfr_sub_ui (mpfr_ptr y, mpfr_srcptr x, unsigned long int u, mpfr_rnd_t rnd_mode
/* Main code */
{
- mpfr_t uu;
- mp_limb_t up[1];
- int cnt;
int inex;
MPFR_SAVE_EXPO_DECL (expo);
- MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
- MPFR_STAT_STATIC_ASSERT (MPFR_LIMB_MAX >= ULONG_MAX);
- /* So, u fits in a mp_limb_t, which justifies the casts below. */
- MPFR_ASSERTD (u != 0);
- count_leading_zeros (cnt, (mp_limb_t) u);
- *up = (mp_limb_t) u << cnt;
-
/* 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, GMP_NUMB_BITS - cnt);
- inex = mpfr_sub (y, x, uu, rnd_mode);
+
+#ifdef MPFR_LONG_WITHIN_LIMB
+ {
+ mpfr_t uu;
+ mp_limb_t up[1];
+ int cnt;
+
+ MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
+ /* So, u fits in a mp_limb_t, which justifies the casts below. */
+ MPFR_ASSERTD (u != 0);
+ count_leading_zeros (cnt, (mp_limb_t) u);
+ up[0] = (mp_limb_t) u << cnt;
+ MPFR_SET_EXP (uu, GMP_NUMB_BITS - cnt);
+ inex = mpfr_sub (y, x, uu, rnd_mode);
+ }
+#else
+ {
+ mpfr_t uu;
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
+ inex = mpfr_sub (y, x, uu, rnd_mode);
+ mpfr_clear (uu);
+ }
+#endif
+
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inex, rnd_mode);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/subnormal.c b/Build/source/libs/mpfr/mpfr-src/src/subnormal.c
index c9762505775..76fccf0576f 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/subnormal.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/subnormal.c
@@ -1,7 +1,7 @@
/* mpfr_subnormalize -- Subnormalize a floating point number
emulating sub-normal numbers.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -70,7 +70,7 @@ mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd)
and since y is not a power of 2: 0.5*2^emin < Y < 1*2^emin
We also know the direction of the error thanks to ternary value. */
- if (rnd == MPFR_RNDN)
+ if (rnd == MPFR_RNDN || rnd == MPFR_RNDNA)
{
mp_limb_t *mant, rb ,sb;
mp_size_t s;
@@ -95,7 +95,7 @@ mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd)
Otherwise, rounding bit = 1, sticky bit = 0 and inexact = 0
So we have 0.1100000000000000000000000*2^emin exactly.
We return 0.1*2^(emin+1) according to the even-rounding
- rule on subnormals. */
+ rule on subnormals. Note the same holds for RNDNA. */
goto set_min_p1;
}
else if (MPFR_IS_LIKE_RNDZ (rnd, MPFR_IS_NEG (y)))
@@ -116,6 +116,7 @@ mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd)
{
mpfr_t dest;
mpfr_prec_t q;
+ mpfr_rnd_t rnd2;
int inexact, inex2;
MPFR_ASSERTD (MPFR_GET_EXP (y) > __gmpfr_emin);
@@ -129,17 +130,20 @@ mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd)
/* Round y in dest */
MPFR_SET_EXP (dest, MPFR_GET_EXP (y));
MPFR_SET_SIGN (dest, sign);
+ rnd2 = rnd == MPFR_RNDNA ? MPFR_RNDN : rnd;
MPFR_RNDRAW_EVEN (inexact, dest,
- MPFR_MANT (y), MPFR_PREC (y), rnd, sign,
+ MPFR_MANT (y), MPFR_PREC (y), rnd2, sign,
MPFR_SET_EXP (dest, MPFR_GET_EXP (dest) + 1));
if (MPFR_LIKELY (old_inexact != 0))
{
- if (MPFR_UNLIKELY (rnd == MPFR_RNDN &&
+ if (MPFR_UNLIKELY (rnd2 == MPFR_RNDN &&
(inexact == MPFR_EVEN_INEX ||
inexact == -MPFR_EVEN_INEX)))
{
- /* if both roundings are in the same direction, we have to go
- back in the other direction */
+ /* If both roundings are in the same direction,
+ we have to go back in the other direction.
+ For MPFR_RNDNA it is the same, since we are not
+ exactly in the middle case (old_inexact != 0). */
if (SAME_SIGN (inexact, old_inexact))
{
if (SAME_SIGN (inexact, MPFR_INT_SIGN (y)))
@@ -155,6 +159,19 @@ mpfr_subnormalize (mpfr_ptr y, int old_inexact, mpfr_rnd_t rnd)
else if (MPFR_UNLIKELY (inexact == 0))
inexact = old_inexact;
}
+ else if (rnd == MPFR_RNDNA &&
+ (inexact == MPFR_EVEN_INEX || inexact == -MPFR_EVEN_INEX))
+ {
+ /* We are in the middle case: since we used RNDN to round, we should
+ round in the opposite direction when inexact has the opposite
+ sign of y. */
+ if (!SAME_SIGN (inexact, MPFR_INT_SIGN (y)))
+ {
+ mpfr_nexttoinf (dest);
+ MPFR_ASSERTD(!MPFR_IS_INF (dest));
+ inexact = -inexact;
+ }
+ }
inex2 = mpfr_set (y, dest, rnd);
MPFR_ASSERTN (inex2 == 0);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/sum.c b/Build/source/libs/mpfr/mpfr-src/src/sum.c
index 37f0dc02a24..ca3cba48c74 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/sum.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/sum.c
@@ -1,6 +1,6 @@
/* Sum -- efficiently sum a list of floating-point numbers
-Copyright 2014-2019 Free Software Foundation, Inc.
+Copyright 2014-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -968,6 +968,16 @@ sum_aux (mpfr_ptr sum, const mpfr_ptr *x, unsigned long n, mpfr_rnd_t rnd,
wi = tq / GMP_NUMB_BITS;
td = tq % GMP_NUMB_BITS;
+ /* Note: The "else" (td == 0) branch below can be executed
+ only if tq >= GMP_NUMB_BITS, which is possible only when
+ logn is large enough. Indeed, if tq > logn + some constant,
+ this means that the TMD did not occur.
+ TODO: Find an upper bound on tq, and add a corresponding
+ MPFR_ASSERTD assertion / hint. On some platforms, this
+ branch might be dead code, and such information would
+ allow the compiler to remove it.
+ It seems that this branch is never tested (r12754). */
+
if (td != 0)
{
wi++; /* number of words with represented bits */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/swap.c b/Build/source/libs/mpfr/mpfr-src/src/swap.c
index 3e6ee2e301a..bd461d44059 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/swap.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/swap.c
@@ -1,6 +1,6 @@
/* mpfr_swap (U, V) -- Swap U and V.
-Copyright 2000-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/tan.c b/Build/source/libs/mpfr/mpfr-src/src/tan.c
index b02c708c72e..ccdaa907a8b 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/tan.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/tan.c
@@ -1,6 +1,6 @@
/* mpfr_tan -- tangent of a floating-point number
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/tanh.c b/Build/source/libs/mpfr/mpfr-src/src/tanh.c
index aa283b37b2f..29117d7e6ef 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/tanh.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/tanh.c
@@ -1,6 +1,6 @@
/* mpfr_tanh -- hyperbolic tangent
-Copyright 2001-2019 Free Software Foundation, Inc.
+Copyright 2001-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/total_order.c b/Build/source/libs/mpfr/mpfr-src/src/total_order.c
new file mode 100644
index 00000000000..c0999f2d13c
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/total_order.c
@@ -0,0 +1,42 @@
+/* mpfr_total_order_p -- total order of two floating-point numbers
+
+Copyright 2018-2020 Free Software Foundation, Inc.
+Contributed by the AriC and Caramba projects, INRIA.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+#include "mpfr-impl.h"
+
+/* follows IEEE 754-2008, Section 5.10 */
+int
+mpfr_total_order_p (mpfr_srcptr x, mpfr_srcptr y)
+{
+ if (MPFR_SIGN (x) != MPFR_SIGN (y))
+ return MPFR_IS_POS (y);
+
+ if (MPFR_IS_NAN (x))
+ return MPFR_IS_NAN (y) || MPFR_IS_NEG (x);
+
+ /* Now x is not NaN. */
+ if (MPFR_IS_NAN (y))
+ return MPFR_IS_POS (y); /* x < +NaN, x > -NaN */
+
+ /* Now neither x nor y is NaN, and zeros of different sign have
+ already been taken into account. */
+ return mpfr_lessequal_p (x, y);
+}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ubf.c b/Build/source/libs/mpfr/mpfr-src/src/ubf.c
index 95af2e6a36d..8b3ba066b7c 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ubf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ubf.c
@@ -1,6 +1,6 @@
/* Functions to work with unbounded floats (limited low-level interface).
-Copyright 2016-2019 Free Software Foundation, Inc.
+Copyright 2016-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -31,7 +31,8 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
detected and handled separately, but for polynomial, this should not
be needed). */
-/* This function does not change the flags. */
+/* Get the exponent of a regular MPFR number or UBF as a mpz_t, which is
+ initialized by this function. The flags are not changed. */
static void
mpfr_init_get_zexp (mpz_ptr ez, mpfr_srcptr x)
{
@@ -41,20 +42,25 @@ mpfr_init_get_zexp (mpz_ptr ez, mpfr_srcptr x)
mpz_set (ez, MPFR_ZEXP (x));
else
{
+ mpfr_exp_t ex = MPFR_GET_EXP (x);
+
+#if _MPFR_EXP_FORMAT <= 3
+ /* mpfr_exp_t fits in a long */
+ mpz_set_si (ez, ex);
+#else
mp_limb_t e_limb[MPFR_EXP_LIMB_SIZE];
mpfr_t e;
int inex;
MPFR_SAVE_EXPO_DECL (expo);
- /* TODO: Once this has been tested, optimize based on whether
- _MPFR_EXP_FORMAT <= 3. */
MPFR_TMP_INIT1 (e_limb, e, sizeof (mpfr_exp_t) * CHAR_BIT);
MPFR_SAVE_EXPO_MARK (expo);
- MPFR_DBGRES (inex = mpfr_set_exp_t (e, MPFR_GET_EXP (x), MPFR_RNDN));
+ MPFR_DBGRES (inex = mpfr_set_exp_t (e, ex, MPFR_RNDN));
MPFR_ASSERTD (inex == 0);
MPFR_DBGRES (inex = mpfr_get_z (ez, e, MPFR_RNDN));
MPFR_ASSERTD (inex == 0);
MPFR_SAVE_EXPO_FREE (expo);
+#endif
}
}
@@ -181,6 +187,10 @@ mpfr_ubf_mul_exact (mpfr_ubf_ptr a, mpfr_srcptr b, mpfr_srcptr c)
}
}
+/* Compare the exponents of two numbers, which can be either MPFR numbers
+ or UBF numbers. If both numbers can be MPFR numbers, it is better to
+ use the MPFR_UBF_EXP_LESS_P wrapper macro, which is optimized for this
+ common case. */
int
mpfr_ubf_exp_less_p (mpfr_srcptr x, mpfr_srcptr y)
{
@@ -195,7 +205,7 @@ mpfr_ubf_exp_less_p (mpfr_srcptr x, mpfr_srcptr y)
return c;
}
-/* Convert an mpz_t to an mpfr_exp_t, restricted to
+/* Convert an mpz_t to an mpfr_exp_t, saturated to
the interval [MPFR_EXP_MIN,MPFR_EXP_MAX]. */
mpfr_exp_t
mpfr_ubf_zexp2exp (mpz_ptr ez)
@@ -224,7 +234,7 @@ mpfr_ubf_zexp2exp (mpz_ptr ez)
return e;
}
-/* Return the difference of the exponents of x and y, restricted to
+/* Return the difference of the exponents of x and y, saturated to
the interval [MPFR_EXP_MIN,MPFR_EXP_MAX]. */
mpfr_exp_t
mpfr_ubf_diff_exp (mpfr_srcptr x, mpfr_srcptr y)
diff --git a/Build/source/libs/mpfr/mpfr-src/src/uceil_exp2.c b/Build/source/libs/mpfr/mpfr-src/src/uceil_exp2.c
index 14eda00e719..ee61d14d767 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/uceil_exp2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/uceil_exp2.c
@@ -1,6 +1,6 @@
/* __gmpfr_ceil_exp2 - returns y >= 2^d
-Copyright 1999-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/uceil_log2.c b/Build/source/libs/mpfr/mpfr-src/src/uceil_log2.c
index 45349477930..d82af18ff7d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/uceil_log2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/uceil_log2.c
@@ -1,6 +1,6 @@
/* __gmpfr_ceil_log2 - returns ceil(log(d)/log(2))
-Copyright 1999-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ufloor_log2.c b/Build/source/libs/mpfr/mpfr-src/src/ufloor_log2.c
index 425f2d8dc3d..6d3ee5f8f47 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ufloor_log2.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ufloor_log2.c
@@ -1,6 +1,6 @@
/* __gmpfr_floor_log2 - returns floor(log(d)/log(2))
-Copyright 1999-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 1999-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ui_div.c b/Build/source/libs/mpfr/mpfr-src/src/ui_div.c
index 23b5cdf0d7b..03629555e19 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ui_div.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ui_div.c
@@ -1,6 +1,6 @@
/* mpfr_ui_div -- divide a machine integer by a floating-point number
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -66,23 +66,38 @@ 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_t uu;
- mp_limb_t up[1];
- int cnt;
int inex;
-
MPFR_SAVE_EXPO_DECL (expo);
- MPFR_TMP_INIT1(up, uu, GMP_NUMB_BITS);
- MPFR_ASSERTN(u == (mp_limb_t) u);
- count_leading_zeros(cnt, (mp_limb_t) u);
- up[0] = (mp_limb_t) u << cnt;
-
/* Optimization note: Exponent save/restore operations may be
removed if mpfr_div works even when uu is out-of-range. */
MPFR_SAVE_EXPO_MARK (expo);
- MPFR_SET_EXP (uu, GMP_NUMB_BITS - cnt);
+
+#ifdef MPFR_LONG_WITHIN_LIMB
+ {
+ mpfr_t uu;
+ mp_limb_t up[1];
+ int cnt;
+
+ MPFR_TMP_INIT1(up, uu, GMP_NUMB_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, GMP_NUMB_BITS - cnt);
+ inex = mpfr_div (y, uu, x, rnd_mode);
+ }
+#else
+ {
+ mpfr_t uu;
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
inex = mpfr_div (y, uu, x, rnd_mode);
+ mpfr_clear (uu);
+ }
+#endif
+
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inex, rnd_mode);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ui_pow.c b/Build/source/libs/mpfr/mpfr-src/src/ui_pow.c
index 42edf51dc1b..6d8930b784e 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ui_pow.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ui_pow.c
@@ -1,6 +1,6 @@
/* mpfr_ui_pow -- power of n function n^x
-Copyright 2001-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2001-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ui_pow_ui.c b/Build/source/libs/mpfr/mpfr-src/src/ui_pow_ui.c
index e75423052c9..79b25bf5fb7 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ui_pow_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ui_pow_ui.c
@@ -1,6 +1,6 @@
/* mpfr_ui_pow_ui -- compute the power between two machine integers
-Copyright 1999-2019 Free Software Foundation, Inc.
+Copyright 1999-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -66,7 +66,7 @@ mpfr_ui_pow_ui (mpfr_ptr x, unsigned long int y, unsigned long int n,
/* now 2^(i-1) <= n < 2^i: i=1+floor(log2(n)) */
for (i -= 2; i >= 0; i--)
{
- inexact |= mpfr_mul (res, res, res, MPFR_RNDU);
+ inexact |= mpfr_sqr (res, res, MPFR_RNDU);
err++;
if (n & (1UL << i))
inexact |= mpfr_mul_ui (res, res, y, MPFR_RNDU);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/ui_sub.c b/Build/source/libs/mpfr/mpfr-src/src/ui_sub.c
index 8d7f0ed49f3..c0b8fadb664 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/ui_sub.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/ui_sub.c
@@ -1,6 +1,6 @@
/* mpfr_ui_sub -- subtract a floating-point number from an integer
-Copyright 2000-2019 Free Software Foundation, Inc.
+Copyright 2000-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -57,24 +57,38 @@ mpfr_ui_sub (mpfr_ptr y, unsigned long int u, mpfr_srcptr x, mpfr_rnd_t rnd_mode
/* Main code */
{
- mpfr_t uu;
- mp_limb_t up[1];
- int cnt;
int inex;
MPFR_SAVE_EXPO_DECL (expo);
- MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
- MPFR_STAT_STATIC_ASSERT (MPFR_LIMB_MAX >= ULONG_MAX);
- /* So, u fits in a mp_limb_t, which justifies the casts below. */
- MPFR_ASSERTD (u != 0);
- count_leading_zeros (cnt, (mp_limb_t) u);
- up[0] = (mp_limb_t) u << cnt;
-
/* 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, GMP_NUMB_BITS - cnt);
- inex = mpfr_sub (y, uu, x, rnd_mode);
+
+#ifdef MPFR_LONG_WITHIN_LIMB
+ {
+ mpfr_t uu;
+ mp_limb_t up[1];
+ int cnt;
+
+ MPFR_TMP_INIT1 (up, uu, GMP_NUMB_BITS);
+ /* So, u fits in a mp_limb_t, which justifies the casts below. */
+ MPFR_ASSERTD (u != 0);
+ count_leading_zeros (cnt, (mp_limb_t) u);
+ up[0] = (mp_limb_t) u << cnt;
+ MPFR_SET_EXP (uu, GMP_NUMB_BITS - cnt);
+ inex = mpfr_sub (y, uu, x, rnd_mode);
+ }
+#else
+ {
+ mpfr_t uu;
+
+ mpfr_init2 (uu, sizeof (unsigned long) * CHAR_BIT);
+ mpfr_set_ui (uu, u, MPFR_RNDZ);
+ inex = mpfr_sub (y, uu, x, rnd_mode);
+ mpfr_clear (uu);
+ }
+#endif
+
MPFR_SAVE_EXPO_UPDATE_FLAGS (expo, __gmpfr_flags);
MPFR_SAVE_EXPO_FREE (expo);
return mpfr_check_range (y, inex, rnd_mode);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/urandom.c b/Build/source/libs/mpfr/mpfr-src/src/urandom.c
index f77865653e2..13a83b279c9 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/urandom.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/urandom.c
@@ -2,7 +2,7 @@
real number between 0 and 1 (exclusive) and round it to the precision of rop
according to the given rounding mode.
-Copyright 2000-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/urandomb.c b/Build/source/libs/mpfr/mpfr-src/src/urandomb.c
index d256a35f57b..ee1b5b3c912 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/urandomb.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/urandomb.c
@@ -3,7 +3,7 @@
using STATE as the random state previously initialized by a call to
gmp_randinit_lc_2exp_size().
-Copyright 2000-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2000-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/vasprintf.c b/Build/source/libs/mpfr/mpfr-src/src/vasprintf.c
index e37167e033a..6173f149c97 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/vasprintf.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/vasprintf.c
@@ -1,7 +1,7 @@
/* mpfr_vasnprintf_aux -- helper function for the formatted output functions
(printf functions family).
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -22,16 +22,15 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
/* If the number of output characters is larger than INT_MAX, the
- ISO C99 standard is silent, but POSIX says concerning the snprintf()
- function:
- "[EOVERFLOW] The value of n is greater than {INT_MAX} or the
- number of bytes needed to hold the output excluding the
- terminating null is greater than {INT_MAX}." See:
- http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html
- But it doesn't say anything concerning the other printf-like functions.
- A defect report has been submitted to austin-review-l (item 2532).
- So, for the time being, we return a negative value and set the erange
- flag, and set errno to EOVERFLOW in POSIX system. */
+ ISO C99 / C11 standards are silent, but POSIX[*] requires the
+ function to return a negative value and set errno to EOVERFLOW.
+ [*] The Open Group Base Specifications Issue 7, 2018 edition
+ IEEE Std 1003.1-2017 (Revision of IEEE Std 1003.1-2008)
+ http://pubs.opengroup.org/onlinepubs/9699919799/functions/fprintf.html
+ This follows a defect report submitted in 2007 to austin-review-l.
+ Even in case of such a failure (just because of the limitation on int),
+ we try to support %n, %ln, %jn when possible. That's why the sizes (or
+ lengths) are expressed using mpfr_intmax_t in the code below. */
/* Notes about limitations on some platforms:
@@ -50,6 +49,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
but the requirement is the same). Here, MPFR just follows ISO C.
*/
+/* Needed due to the tests on HAVE_STDARG and MPFR_USE_MINI_GMP */
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
@@ -84,7 +84,7 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#include <errno.h>
#define MPFR_NEED_LONGLONG_H
-#include "mpfr-intmax.h"
+#define MPFR_NEED_INTMAX_H
#include "mpfr-impl.h"
/* Define a length modifier corresponding to mpfr_prec_t.
@@ -111,45 +111,49 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
#define MPFR_INF_STRING_UC "INF"
#define MPFR_INF_STRING_LENGTH 3
+#define DEFAULT_DECIMAL_PREC 6
+
/* The implicit \0 is useless, but we do not write num_to_text[16]
otherwise g++ complains. */
static const char num_to_text[] = "0123456789abcdef";
/* some macro and functions for parsing format string */
-/* Read an integer; saturate to INT_MAX. */
-#define READ_INT(ap, format, specinfo, field, label_out) \
+/* Read an integer var of type mpfr_intmax_t. In case of overflow, set
+ overflow to 1.
+ Note: Since mpfr_intmax_t = int is theoretically possible, all values
+ of var are potentially valid values (via '*'). Hence the need of an
+ overflow flag instead of a special value that would indicate overflow.
+ Saturating would not be OK either as the maximum value could be
+ meaningful with %jn and/or in the case mpfr_intmax_t = int, for
+ MPFR_PREC_ARG.
+*/
+#define READ_INT(ap, format, var) \
do { \
- while (*(format)) \
+ MPFR_ASSERTD ((var) == 0); \
+ if (*(format) == '*') \
{ \
- int _i; \
- switch (*(format)) \
+ (var) = va_arg ((ap), int); \
+ ++(format); \
+ } \
+ else \
+ for ( ; *(format) >= '0' && *(format) <= '9' ; ++(format)) \
+ if (!(overflow)) \
{ \
- case '0': \
- case '1': \
- case '2': \
- case '3': \
- case '4': \
- case '5': \
- case '6': \
- case '7': \
- case '8': \
- case '9': \
- specinfo.field = (specinfo.field <= INT_MAX / 10) ? \
- specinfo.field * 10 : INT_MAX; \
- _i = *(format) - '0'; \
- MPFR_ASSERTN (_i >= 0 && _i <= 9); \
- specinfo.field = (specinfo.field <= INT_MAX - _i) ? \
- specinfo.field + _i : INT_MAX; \
- ++(format); \
- break; \
- case '*': \
- specinfo.field = va_arg ((ap), int); \
- ++(format); \
- default: \
- goto label_out; \
+ if ((var) > MPFR_INTMAX_MAX / 10) \
+ (overflow) = 1; \
+ else \
+ { \
+ int _i; \
+ (var) *= 10; \
+ _i = *(format) - '0'; \
+ MPFR_ASSERTN (_i >= 0 && _i <= 9); \
+ if ((var) > MPFR_INTMAX_MAX - _i) \
+ (overflow) = 1; \
+ else \
+ (var) += _i; \
+ } \
} \
- } \
} while (0)
/* arg_t contains all the types described by the 'type' field of the
@@ -186,8 +190,8 @@ struct printf_spec
unsigned int showsign:1; /* + flag */
unsigned int group:1; /* ' flag */
- int width; /* Width */
- int prec; /* Precision */
+ mpfr_intmax_t width; /* Width */
+ mpfr_intmax_t prec; /* Precision, or negative if omitted */
size_t size; /* Wanted size (0 iff snprintf with size=0) */
enum arg_t arg_type; /* Type of argument */
@@ -261,7 +265,7 @@ specinfo_is_valid (struct printf_spec spec)
/* Note: additional flags should be added to the MPFR_PREC_ARG code
for gmp_asprintf (when supported). */
-static const char *
+MPFR_RETURNS_NONNULL static const char *
parse_flags (const char *format, struct printf_spec *specinfo)
{
while (*format)
@@ -300,7 +304,7 @@ parse_flags (const char *format, struct printf_spec *specinfo)
return format;
}
-static const char *
+MPFR_RETURNS_NONNULL static const char *
parse_arg_type (const char *format, struct printf_spec *specinfo)
{
switch (*format)
@@ -440,6 +444,8 @@ typedef wint_t mpfr_va_wint;
#define CASE_LONG_LONG_ARG(specinfo, ap)
#endif
+/* Note: (specinfo).width may be incorrect in case of overflow,
+ but it is not used by CONSUME_VA_ARG. */
#define CONSUME_VA_ARG(specinfo, ap) \
do { \
switch ((specinfo).arg_type) \
@@ -507,11 +513,14 @@ typedef wint_t mpfr_va_wint;
} \
} while (0)
-/* process the format part which does not deal with mpfr types,
- jump to external label 'error' if gmp_asprintf return -1.
+/* Process the format part which does not deal with mpfr types,
+ Jump to external label 'error' if gmp_asprintf return -1.
Note: start and end are pointers to the format string, so that
size_t is the best type to express the difference.
- */
+ FIXME: If buf.size = 0 or size != 0, gmp_vsnprintf should be called
+ instead of gmp_vasprintf, outputting data directly to the buffer
+ when applicable.
+*/
#define FLUSH(flag, start, end, ap, buf_ptr) \
do { \
const size_t n = (end) - (start); \
@@ -523,7 +532,7 @@ typedef wint_t mpfr_va_wint;
int length; \
\
MPFR_TMP_MARK (marker); \
- fmt_copy = (char*) MPFR_TMP_ALLOC (n + 1); \
+ fmt_copy = (char *) MPFR_TMP_ALLOC (n + 1); \
strncpy (fmt_copy, (start), n); \
fmt_copy[n] = '\0'; \
length = gmp_vasprintf (&s, fmt_copy, (ap)); \
@@ -567,7 +576,7 @@ buffer_init (struct string_buffer *b, size_t s)
/* Increase the len field of the buffer. Return non-zero iff overflow. */
static int
-buffer_incr_len (struct string_buffer *b, size_t len)
+buffer_incr_len (struct string_buffer *b, mpfr_intmax_t len)
{
if (b->len == -1)
return 1;
@@ -583,6 +592,7 @@ buffer_incr_len (struct string_buffer *b, size_t len)
if (MPFR_UNLIKELY (newlen < len || newlen > MPFR_INTMAX_MAX))
{
+ MPFR_LOG_MSG (("Overflow\n", 0));
b->len = -1;
return 1;
}
@@ -595,7 +605,7 @@ buffer_incr_len (struct string_buffer *b, size_t len)
}
/* Increase buffer size by a number of character being the least multiple of
- 4096 greater than LEN+1. */
+ 4096 greater than len+1. */
static void
buffer_widen (struct string_buffer *b, size_t len)
{
@@ -612,8 +622,7 @@ buffer_widen (struct string_buffer *b, size_t len)
MPFR_ASSERTN (b->size < ((size_t) -1) - n);
- b->start =
- (char *) mpfr_reallocate_func (b->start, b->size, b->size + n);
+ b->start = (char *) mpfr_reallocate_func (b->start, b->size, b->size + n);
b->size += n;
b->curr = b->start + pos;
@@ -621,7 +630,7 @@ buffer_widen (struct string_buffer *b, size_t len)
MPFR_ASSERTD (*b->curr == '\0');
}
-/* Concatenate the LEN first characters of the string S to the buffer B and
+/* Concatenate the first len characters of the string s to the buffer b and
expand it if needed. Return non-zero if overflow. */
static int
buffer_cat (struct string_buffer *b, const char *s, size_t len)
@@ -651,9 +660,9 @@ buffer_cat (struct string_buffer *b, const char *s, size_t len)
return 0;
}
-/* Add N characters C to the end of buffer B. Return non-zero if overflow. */
+/* Add n characters c to the end of buffer b. Return non-zero if overflow. */
static int
-buffer_pad (struct string_buffer *b, const char c, const size_t n)
+buffer_pad (struct string_buffer *b, const char c, const mpfr_intmax_t n)
{
MPFR_ASSERTD (n > 0);
@@ -663,7 +672,14 @@ buffer_pad (struct string_buffer *b, const char c, const size_t n)
if (b->size != 0)
{
MPFR_ASSERTD (*b->curr == '\0');
- MPFR_ASSERTN (b->size < ((size_t) -1) - n);
+
+ if (n > (size_t) -1 || b->size > ((size_t) -1) - n)
+ {
+ /* Reallocation will not be possible. Regard this as an overflow. */
+ b->len = -1;
+ return 1;
+ }
+
if (MPFR_UNLIKELY (b->curr + n >= b->start + b->size))
buffer_widen (b, n);
@@ -680,108 +696,104 @@ buffer_pad (struct string_buffer *b, const char c, const size_t n)
return 0;
}
-/* Form a string by concatenating the first LEN characters of STR to TZ
- zero(s), insert into one character C each 3 characters starting from end
- to beginning and concatenate the result to the buffer B. */
+/* Form a string by concatenating the first len characters of str to tz
+ zero(s), insert into one character c each 3 characters starting from end
+ to beginning and concatenate the result to the buffer b.
+ Assume c is not null (\0). Return non-zero if overflow. */
static int
buffer_sandwich (struct string_buffer *b, char *str, size_t len,
const size_t tz, const char c)
{
- MPFR_ASSERTD (len <= strlen (str));
+ const size_t step = 3;
+ size_t size, q, r, fullsize, i;
+ char *oldcurr;
- if (c == '\0')
- return
- buffer_cat (b, str, len) ||
- buffer_pad (b, '0', tz);
- else
- {
- const size_t step = 3;
- size_t size, q, r, fullsize;
+ MPFR_ASSERTD (b->size != 0);
+ MPFR_ASSERTD (tz == 0 || tz == 1);
- /* check that len + tz does not overflow */
- if (len > (size_t) -1 - tz)
- return 1;
+ if (len <= ULONG_MAX)
+ MPFR_LOG_MSG (("len=%lu\n", (unsigned long) len));
+ if (tz <= ULONG_MAX)
+ MPFR_LOG_MSG (("tz=%lu\n", (unsigned long) tz));
- size = len + tz; /* number of digits */
- MPFR_ASSERTD (size > 0);
+ MPFR_ASSERTD (len <= strlen (str));
+ MPFR_ASSERTD (c != '\0');
- q = (size - 1) / step; /* number of separators C */
- r = ((size - 1) % step) + 1; /* number of digits in the leftmost block */
+ /* check that len + tz does not overflow */
+ if (len > (size_t) -1 - tz)
+ return 1;
- /* check that size + q does not overflow */
- if (size > (size_t) -1 - q)
- return 1;
+ size = len + tz; /* number of digits */
+ MPFR_ASSERTD (size > 0);
- fullsize = size + q; /* number of digits and separators */
+ q = (size - 1) / step; /* number of separators C */
+ r = ((size - 1) % step) + 1; /* number of digits in the leftmost block */
+ MPFR_ASSERTD (r >= 1 && r <= step);
- if (buffer_incr_len (b, fullsize))
- return 1;
+ /* check that size + q does not overflow */
+ if (size > (size_t) -1 - q)
+ return 1;
- if (b->size != 0)
- {
- char *oldcurr;
- size_t i;
+ fullsize = size + q; /* number of digits and separators */
- MPFR_ASSERTD (*b->curr == '\0');
- MPFR_ASSERTN (b->size < ((size_t) -1) - fullsize);
- if (MPFR_UNLIKELY (b->curr + fullsize >= b->start + b->size))
- buffer_widen (b, fullsize);
+ if (buffer_incr_len (b, fullsize))
+ return 1;
- MPFR_DBGRES (oldcurr = b->curr);
+ MPFR_ASSERTD (*b->curr == '\0');
+ MPFR_ASSERTN (b->size < ((size_t) -1) - fullsize);
+ if (MPFR_UNLIKELY (b->curr + fullsize >= b->start + b->size))
+ buffer_widen (b, fullsize);
- /* first r significant digits (leftmost block) */
- if (r <= len)
- {
- memcpy (b->curr, str, r);
- str += r;
- len -= r;
- }
- else
- {
- MPFR_ASSERTD (r > len);
- memcpy (b->curr, str, len);
- memset (b->curr + len, '0', r - len);
- len = 0;
- }
- b->curr += r;
+ MPFR_DBGRES (oldcurr = b->curr);
- /* blocks of thousands. Warning: STR might end in the middle of a block */
- for (i = 0; i < q; ++i)
- {
- *b->curr++ = c;
- if (MPFR_LIKELY (len > 0))
- {
- if (MPFR_LIKELY (len >= step))
- /* step significant digits */
- {
- memcpy (b->curr, str, step);
- len -= step;
- str += step;
- }
- else
- /* last digits in STR, fill up thousand block with zeros */
- {
- memcpy (b->curr, str, len);
- memset (b->curr + len, '0', step - len);
- len = 0;
- }
- }
- else
- /* trailing zeros */
- memset (b->curr, '0', step);
+ /* first r significant digits (leftmost block) */
+ if (r <= len)
+ {
+ memcpy (b->curr, str, r);
+ str += r;
+ len -= r;
+ }
+ else
+ {
+ MPFR_ASSERTD (r > len);
+ MPFR_ASSERTD (len < step); /* as a consequence */
+ MPFR_ASSERTD (size <= step); /* as a consequence */
+ MPFR_ASSERTD (q == 0); /* as a consequence */
+ MPFR_ASSERTD (r == size); /* as a consequence */
+ MPFR_ASSERTD (tz == 1); /* as a consequence */
+ memcpy (b->curr, str, len);
+ *(b->curr + len) = '0'; /* trailing zero */
+ /* We do not need to set len to 0 since it will not be read again
+ (q = 0, so that the loop below will have 0 iterations). */
+ }
+ b->curr += r;
- b->curr += step;
- }
+ for (i = 0; i < q; ++i)
+ {
+ *b->curr++ = c;
+ if (MPFR_LIKELY (len >= step))
+ {
+ memcpy (b->curr, str, step);
+ len -= step;
+ str += step;
+ }
+ else
+ {
+ /* last digits */
+ MPFR_ASSERTD (i == q - 1 && step - len == 1);
+ memcpy (b->curr, str, len);
+ *(b->curr + len) = '0'; /* trailing zero */
+ }
+ b->curr += step;
+ }
- MPFR_ASSERTD (b->curr - oldcurr == fullsize);
+ MPFR_ASSERTD (b->curr - oldcurr == fullsize);
- *b->curr = '\0';
+ *b->curr = '\0';
- MPFR_ASSERTD (b->curr < b->start + b->size);
- }
+ MPFR_ASSERTD (b->curr < b->start + b->size);
- return 0;
- }
+ return 0;
}
/* Helper struct and functions for temporary strings management */
@@ -824,7 +836,7 @@ register_string (struct string_list *sl, char *new_string)
while (sl->next)
sl = sl->next;
- sl->next = (struct string_list*)
+ sl->next = (struct string_list *)
mpfr_allocate_func (sizeof (struct string_list));
sl = sl->next;
@@ -845,7 +857,7 @@ enum pad_t
struct number_parts
{
enum pad_t pad_type; /* Padding type */
- size_t pad_size; /* Number of padding characters */
+ mpfr_intmax_t pad_size; /* Number of padding characters */
char sign; /* Sign character */
@@ -856,17 +868,17 @@ struct number_parts
char *ip_ptr; /* Pointer to integral part characters*/
size_t ip_size; /* Number of digits in *ip_ptr */
- int ip_trailing_zeros; /* Number of additional null digits in integral
- part */
+ int ip_trailing_digits; /* Number of additional digits in integral part
+ (if spec.size != 0, this can only be a zero) */
char point; /* Decimal point character */
- int fp_leading_zeros; /* Number of additional leading zeros in fractional
- part */
+ mpfr_intmax_t fp_leading_zeros; /* Number of additional leading zeros in
+ fractional part */
char *fp_ptr; /* Pointer to fractional part characters */
size_t fp_size; /* Number of digits in *fp_ptr */
- int fp_trailing_zeros; /* Number of additional trailing zeros in fractional
- part */
+ mpfr_intmax_t fp_trailing_zeros; /* Number of additional trailing zeros in
+ fractional part */
char *exp_ptr; /* Pointer to exponent part */
size_t exp_size; /* Number of characters in *exp_ptr */
@@ -950,23 +962,24 @@ floor_log10 (mpfr_srcptr x)
#define NDIGITS 8
-static char*
-mpfr_get_str_aux (mpfr_exp_t *exp, int base, size_t n, const mpfr_t op,
- const struct printf_spec spec)
+MPFR_RETURNS_NONNULL static char *
+mpfr_get_str_wrapper (mpfr_exp_t *exp, int base, size_t n, const mpfr_t op,
+ const struct printf_spec spec)
{
size_t ndigits;
char *str, *s, nine;
int neg;
+ /* Possibles bases for the *printf functions. */
+ MPFR_ASSERTD (base == 2 || base == 10 || base == 16);
+
if (spec.size != 0)
return mpfr_get_str (NULL, exp, base, n, op, spec.rnd_mode);
/* Special case size = 0, i.e., xxx_snprintf with size = 0: we only want
to compute the number of printed characters. Try to deduce it from
a small number of significant digits. */
- nine = (base <= 10) ? '0' + base - 1
- : (base <= 36) ? 'a' + base - 11
- : 'a' + base - 37;
+ nine = base == 2 ? '1' : base == 10 ? '9' : 'f';
for (ndigits = NDIGITS; ; ndigits *= 2)
{
mpfr_rnd_t rnd = MPFR_RNDZ;
@@ -995,9 +1008,9 @@ mpfr_get_str_aux (mpfr_exp_t *exp, int base, size_t n, const mpfr_t op,
}
/* Determine the different parts of the string representation of the regular
- number P when SPEC.SPEC is 'a', 'A', or 'b'.
+ number P when spec.spec is 'a', 'A', or 'b'.
- return -1 if some field > INT_MAX */
+ Return -1 in case of overflow on the sizes. */
static int
regular_ab (struct number_parts *np, mpfr_srcptr p,
const struct printf_spec spec)
@@ -1038,10 +1051,17 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
- if no given precision, let mpfr_get_str determine it;
- if a non-zero precision is specified, then one digit before decimal
point plus SPEC.PREC after it (which will give nsd > 1 below). */
- MPFR_ASSERTD (np->ip_size == 1); /* thus no integer overflow below */
- nsd = spec.prec < 0 ? 0 : (size_t) spec.prec + np->ip_size;
- MPFR_ASSERTD (nsd != 1);
- str = mpfr_get_str_aux (&exp, base, nsd, p, spec);
+ MPFR_ASSERTD (np->ip_size == 1); /* thus the + 1 below */
+ if (spec.prec < 0)
+ nsd = 0;
+ else
+ {
+ if (MPFR_UNLIKELY (spec.prec > (size_t) -2)) /* overflow */
+ return -1;
+ nsd = (size_t) spec.prec + 1;
+ MPFR_ASSERTD (nsd != 1);
+ }
+ str = mpfr_get_str_wrapper (&exp, base, nsd, p, spec);
register_string (np->sl, str);
np->ip_ptr = MPFR_IS_NEG (p) ? ++str : str; /* skip sign if any */
@@ -1067,7 +1087,7 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
}
else if (next_base_power_p (p, base, spec.rnd_mode))
{
- str = (char *)mpfr_allocate_func (2);
+ str = (char *) mpfr_allocate_func (2);
str[0] = '1';
str[1] = '\0';
np->ip_ptr = register_string (np->sl, str);
@@ -1076,7 +1096,7 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
}
else if (base == 2)
{
- str = (char *)mpfr_allocate_func (2);
+ str = (char *) mpfr_allocate_func (2);
str[0] = '1';
str[1] = '\0';
np->ip_ptr = register_string (np->sl, str);
@@ -1090,7 +1110,7 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
int rnd_bit = GMP_NUMB_BITS - 5;
/* pick up the 4 first bits */
- digit = msl >> (rnd_bit+1);
+ digit = msl >> (rnd_bit + 1);
if (spec.rnd_mode == MPFR_RNDA
|| (spec.rnd_mode == MPFR_RNDU && MPFR_IS_POS (p))
|| (spec.rnd_mode == MPFR_RNDD && MPFR_IS_NEG (p))
@@ -1099,7 +1119,7 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
digit++;
MPFR_ASSERTD (0 <= digit && digit <= 15);
- str = (char *)mpfr_allocate_func (1 + np->ip_size);
+ str = (char *) mpfr_allocate_func (1 + np->ip_size);
str[0] = num_to_text [digit];
str[1] = '\0';
np->ip_ptr = register_string (np->sl, str);
@@ -1159,18 +1179,17 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
}
}
- if (str_len > INT_MAX)
- /* too many digits in fractional part */
- return -1;
-
if (str_len != 0)
/* there are some non-zero digits in fractional part */
{
np->fp_ptr = str;
np->fp_size = str_len;
- MPFR_ASSERTD (str_len > 0 && str_len <= INT_MAX);
- if ((int) str_len < spec.prec)
- np->fp_trailing_zeros = spec.prec - str_len;
+ /* Warning! str_len has type size_t, which is unsigned. */
+ if (spec.prec > 0 && str_len < spec.prec)
+ {
+ np->fp_trailing_zeros = spec.prec - str_len;
+ MPFR_ASSERTD (np->fp_trailing_zeros >= 0);
+ }
}
}
@@ -1203,7 +1222,7 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
exp_fmt[1] = '\0';
strcat (exp_fmt, "%+.1" MPFR_EXP_FSPEC "d");
- if (sprintf (str, exp_fmt, (mpfr_eexp_t) exp) < 0)
+ if (MPFR_UNLIKELY (sprintf (str, exp_fmt, (mpfr_eexp_t) exp) < 0))
return -1;
}
@@ -1212,20 +1231,19 @@ regular_ab (struct number_parts *np, mpfr_srcptr p,
/* Determine the different parts of the string representation of the regular
number P when spec.spec is 'e', 'E', 'g', or 'G'.
- dec_info contains the previously computed exponent and string or is NULL.
+ dec_info contains the previously computed exponent and string or is
+ a null pointer.
- return -1 if some field > INT_MAX */
+ Return -1 in case of overflow on the sizes. */
static int
regular_eg (struct number_parts *np, mpfr_srcptr p,
- const struct printf_spec spec, struct decimal_info *dec_info)
+ const struct printf_spec spec, struct decimal_info *dec_info,
+ int keep_trailing_zeros)
{
char *str;
mpfr_exp_t exp;
const int uppercase = spec.spec == 'E' || spec.spec == 'G';
- const int spec_g = spec.spec == 'g' || spec.spec == 'G';
- const int keep_trailing_zeros = (spec_g && spec.alt)
- || (!spec_g && (spec.prec > 0));
/* sign */
if (MPFR_IS_NEG (p))
@@ -1245,9 +1263,16 @@ regular_eg (struct number_parts *np, mpfr_srcptr p,
plus SPEC.PREC after it.
We use the fact here that mpfr_get_str allows us to ask for only one
significant digit when the base is not a power of 2. */
- MPFR_ASSERTD (np->ip_size == 1); /* thus no integer overflow below */
- nsd = spec.prec < 0 ? 0 : (size_t) spec.prec + np->ip_size;
- str = mpfr_get_str_aux (&exp, 10, nsd, p, spec);
+ MPFR_ASSERTD (np->ip_size == 1); /* thus the + 1 below */
+ if (spec.prec < 0)
+ nsd = 0;
+ else
+ {
+ if (MPFR_UNLIKELY (spec.prec > (size_t) -2)) /* overflow */
+ return -1;
+ nsd = (size_t) spec.prec + 1;
+ }
+ str = mpfr_get_str_wrapper (&exp, 10, nsd, p, spec);
register_string (np->sl, str);
}
else
@@ -1278,20 +1303,18 @@ regular_eg (struct number_parts *np, mpfr_srcptr p,
}
}
- if (str_len > INT_MAX)
- /* too many digits in fractional part */
- return -1;
-
if (str_len != 0)
/* there are some non-zero digits in fractional part */
{
np->fp_ptr = str;
np->fp_size = str_len;
- MPFR_ASSERTD (str_len > 0 && str_len <= INT_MAX);
- if ((!spec_g || spec.alt) && spec.prec > 0
- && (int) str_len < spec.prec)
- /* add missing trailing zeros */
- np->fp_trailing_zeros = spec.prec - str_len;
+ /* Warning! str_len has type size_t, which is unsigned. */
+ if (keep_trailing_zeros && spec.prec > 0 && str_len < spec.prec)
+ {
+ /* add missing trailing zeros */
+ np->fp_trailing_zeros = spec.prec - str_len;
+ MPFR_ASSERTD (np->fp_trailing_zeros >= 0);
+ }
}
}
@@ -1332,7 +1355,7 @@ regular_eg (struct number_parts *np, mpfr_srcptr p,
exp_fmt[1] = '\0';
strcat (exp_fmt, "%+.2" MPFR_EXP_FSPEC "d");
- if (sprintf (str, exp_fmt, (mpfr_eexp_t) exp) < 0)
+ if (MPFR_UNLIKELY (sprintf (str, exp_fmt, (mpfr_eexp_t) exp) < 0))
return -1;
}
@@ -1341,17 +1364,17 @@ regular_eg (struct number_parts *np, mpfr_srcptr p,
/* Determine the different parts of the string representation of the regular
number P when spec.spec is 'f', 'F', 'g', or 'G'.
- DEC_INFO contains the previously computed exponent and string or is NULL.
+ dec_info contains the previously computed exponent and string or is
+ a null pointer.
- return -1 if some field of number_parts is greater than INT_MAX */
+ Return -1 in case of overflow on the sizes. */
static int
regular_fg (struct number_parts *np, mpfr_srcptr p,
- const struct printf_spec spec, struct decimal_info *dec_info)
+ const struct printf_spec spec, struct decimal_info *dec_info,
+ int keep_trailing_zeros)
{
mpfr_exp_t exp;
char * str;
- const int spec_g = (spec.spec == 'g' || spec.spec == 'G');
- const int keep_trailing_zeros = !spec_g || spec.alt;
/* WARNING: an empty precision field is forbidden (it means precision = 6
and it should have been changed to 6 before the function call) */
@@ -1398,10 +1421,15 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
/* only the last digit may be non zero */
{
int round_away;
+
+ /* Due to mpfr_set_si below... */
+ if (MPFR_UNLIKELY (spec.prec > LONG_MAX)) /* overflow */
+ return -1;
+
switch (spec.rnd_mode)
{
case MPFR_RNDA:
- case MPFR_RNDF: /* round_away = 1 needed for spec_g */
+ case MPFR_RNDF: /* round_away = 1 needed for %Rg */
round_away = 1;
break;
case MPFR_RNDZ:
@@ -1448,8 +1476,7 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
np->fp_leading_zeros = spec.prec - 1;
np->fp_size = 1;
- str =
- (char *) mpfr_allocate_func (1 + np->fp_size);
+ str = (char *) mpfr_allocate_func (1 + np->fp_size);
str[0] = '1';
str[1] = '\0';
np->fp_ptr = register_string (np->sl, str);
@@ -1457,7 +1484,7 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
else
/* only zeros in fractional part */
{
- MPFR_ASSERTD (!spec_g);
+ MPFR_ASSERTD (spec.spec == 'f' || spec.spec == 'F');
np->fp_leading_zeros = spec.prec;
}
}
@@ -1473,19 +1500,17 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
{
size_t nsd;
- /* Consequences of earlier assertions (in r11307).
- They guarantee that the integers are representable
- (i.e., no integer overflow), assuming size_t >= int
- as usual. */
MPFR_ASSERTD (exp <= -1);
MPFR_ASSERTD (spec.prec + (exp + 1) >= 0);
+ if (MPFR_UNLIKELY (spec.prec + (exp + 1) > (size_t) -1))
+ return -1;
nsd = spec.prec + (exp + 1);
/* WARNING: nsd may equal 1, but here we use the
fact that mpfr_get_str can return one digit with
base ten (undocumented feature, see comments in
get_str.c) */
- str = mpfr_get_str_aux (&exp, 10, nsd, p, spec);
+ str = mpfr_get_str_wrapper (&exp, 10, nsd, p, spec);
register_string (np->sl, str);
}
else
@@ -1501,7 +1526,7 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
{
MPFR_ASSERTD (str[0] == '1');
np->ip_ptr[0] = '1';
- if (!spec_g || spec.alt)
+ if (keep_trailing_zeros)
np->fp_leading_zeros = spec.prec;
}
else
@@ -1523,19 +1548,23 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
}
}
- if (str_len > INT_MAX)
- /* too many digits in fractional part */
- return -1;
-
MPFR_ASSERTD (str_len > 0);
np->fp_size = str_len;
- if ((!spec_g || spec.alt)
+ /* The np->fp_size <= MPFR_INTMAX_MAX test and the
+ cast to mpfr_uintmax_t below allow one to avoid
+ integer overflow. */
+ if (keep_trailing_zeros
&& spec.prec > 0
- && (np->fp_leading_zeros + np->fp_size < spec.prec))
- /* add missing trailing zeros */
- np->fp_trailing_zeros = spec.prec - np->fp_leading_zeros
- - np->fp_size;
+ && np->fp_size <= MPFR_INTMAX_MAX
+ && ((mpfr_uintmax_t)
+ np->fp_leading_zeros + np->fp_size) < spec.prec)
+ {
+ /* add missing trailing zeros */
+ np->fp_trailing_zeros = spec.prec
+ - np->fp_leading_zeros - np->fp_size;
+ MPFR_ASSERTD (np->fp_trailing_zeros >= 0);
+ }
}
}
}
@@ -1552,17 +1581,21 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
/* Determine the position of the most significant decimal digit. */
exp = floor_log10 (p);
MPFR_ASSERTD (exp >= 0);
- if (exp > INT_MAX)
- /* P is too large to print all its integral part digits */
- return -1;
if (dec_info == NULL)
- { /* this case occurs with mpfr_printf ("%.0RUf", x) with x=9.5 */
- str = mpfr_get_str_aux (&exp, 10, spec.prec+exp+1, p, spec);
+ {
+ /* %f case */
+ mpfr_uintmax_t n;
+
+ n = (mpfr_uintmax_t) spec.prec + (exp + 1);
+ if (MPFR_UNLIKELY (n > (size_t) -1))
+ return -1;
+ str = mpfr_get_str_wrapper (&exp, 10, n, p, spec);
register_string (np->sl, str);
}
else
{
+ /* %g case */
exp = dec_info->exp;
str = dec_info->str;
}
@@ -1571,10 +1604,13 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
/* integral part */
if (exp > str_len)
- /* mpfr_get_str gives no trailing zero when p is rounded up to the next
- power of 10 (p integer, so no fractional part) */
{
- np->ip_trailing_zeros = exp - str_len;
+ /* When spec.size == 0, mpfr_get_str may be called in a reduced
+ precision, so that some trailing digits may have been ignored.
+ When spec.size != 0, this case is also possible in the case
+ where p is rounded up to the next power of 10: a zero must be
+ added since the exponent has been increased by 1. */
+ np->ip_trailing_digits = exp - str_len;
np->ip_size = str_len;
}
else
@@ -1602,20 +1638,19 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
if (str_len > 0)
/* some nonzero digits in fractional part */
{
- if (str_len > INT_MAX)
- /* too many digits in fractional part */
- return -1;
-
np->point = MPFR_DECIMAL_POINT;
np->fp_ptr = str;
np->fp_size = str_len;
}
+ /* Warning! str_len has type size_t, which is unsigned. */
+ MPFR_ASSERTD (spec.prec >= 0); /* let's recall this */
if (keep_trailing_zeros && str_len < spec.prec)
/* add missing trailing zeros */
{
np->point = MPFR_DECIMAL_POINT;
np->fp_trailing_zeros = spec.prec - np->fp_size;
+ MPFR_ASSERTD (np->fp_trailing_zeros >= 0);
}
if (spec.alt)
@@ -1630,15 +1665,16 @@ regular_fg (struct number_parts *np, mpfr_srcptr p,
representation of the number p according to the given specification.
partition_number initializes the given structure np, so all previous
information in that variable is lost.
- return the total number of characters to be written.
- return -1 if an error occurred, in that case np's fields are in an undefined
- state but all string buffers have been freed. */
+ Return the total number of characters to be written.
+ Return -1 if an error occurred, in that case np's fields are in an
+ undefined state but all string buffers have been freed. */
static mpfr_intmax_t
partition_number (struct number_parts *np, mpfr_srcptr p,
struct printf_spec spec)
{
char *str;
- unsigned int total; /* can hold the sum of two non-negative int's + 1 */
+ mpfr_uintmax_t total; /* can hold the sum of two non-negative
+ signed integers + 1 */
int uppercase;
/* WARNING: left justification means right space padding */
@@ -1650,7 +1686,7 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
np->thousands_sep = '\0';
np->ip_ptr = NULL;
np->ip_size = 0;
- np->ip_trailing_zeros = 0;
+ np->ip_trailing_digits = 0;
np->point = '\0';
np->fp_leading_zeros = 0;
np->fp_ptr = NULL;
@@ -1724,6 +1760,15 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
str[1] = '\0';
np->ip_ptr = register_string (np->sl, str);
+ if (spec.prec < 0) /* empty precision field */
+ {
+ if (spec.spec == 'e' || spec.spec == 'E')
+ spec.prec = mpfr_get_str_ndigits (10, MPFR_GET_PREC (p)) - 1;
+ else if (spec.spec == 'f' || spec.spec == 'F' ||
+ spec.spec == 'g' || spec.spec == 'G')
+ spec.prec = DEFAULT_DECIMAL_PREC;
+ }
+
if (spec.prec > 0
&& ((spec.spec != 'g' && spec.spec != 'G') || spec.alt))
/* fractional part */
@@ -1731,6 +1776,7 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
np->point = MPFR_DECIMAL_POINT;
np->fp_trailing_zeros = (spec.spec == 'g' || spec.spec == 'G') ?
spec.prec - 1 : spec.prec;
+ MPFR_ASSERTD (np->fp_trailing_zeros >= 0);
}
else if (spec.alt)
np->point = MPFR_DECIMAL_POINT;
@@ -1778,13 +1824,13 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
else if (spec.spec == 'f' || spec.spec == 'F')
{
if (spec.prec < 0)
- spec.prec = 6;
- if (regular_fg (np, p, spec, NULL) == -1)
+ spec.prec = DEFAULT_DECIMAL_PREC;
+ if (regular_fg (np, p, spec, NULL, 1) == -1)
goto error;
}
else if (spec.spec == 'e' || spec.spec == 'E')
{
- if (regular_eg (np, p, spec, NULL) == -1)
+ if (regular_eg (np, p, spec, NULL, 1) == -1)
goto error;
}
else
@@ -1801,9 +1847,11 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
mpfr_exp_t x, e, k;
struct decimal_info dec_info;
- threshold = (spec.prec < 0) ? 6 : (spec.prec == 0) ? 1 : spec.prec;
+ threshold = spec.prec < 0 ? DEFAULT_DECIMAL_PREC :
+ spec.prec == 0 ? 1 : spec.prec;
+ MPFR_ASSERTD (threshold >= 1);
- /* Here we cannot call mpfr_get_str_aux since we need the full
+ /* Here we cannot call mpfr_get_str_wrapper since we need the full
significand in dec_info.str.
Moreover, threshold may be huge while one can know that the
number of digits that are not trailing zeros remains limited;
@@ -1840,14 +1888,14 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
/* the conversion is with style 'f' */
spec.prec = threshold - x - 1;
- if (regular_fg (np, p, spec, &dec_info) == -1)
+ if (regular_fg (np, p, spec, &dec_info, spec.alt) == -1)
goto error;
}
else
{
spec.prec = threshold - 1;
- if (regular_eg (np, p, spec, &dec_info) == -1)
+ if (regular_eg (np, p, spec, &dec_info, spec.alt) == -1)
goto error;
}
}
@@ -1869,12 +1917,12 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
total = np->sign ? 1 : 0;
INCR_TOTAL (np->prefix_size);
INCR_TOTAL (np->ip_size);
- INCR_TOTAL (np->ip_trailing_zeros);
- MPFR_ASSERTD (np->ip_size + np->ip_trailing_zeros >= 1);
+ INCR_TOTAL (np->ip_trailing_digits);
+ MPFR_ASSERTD (np->ip_size + np->ip_trailing_digits >= 1);
if (np->thousands_sep)
/* ' flag, style f and the thousands separator in current locale is not
reduced to the null character */
- INCR_TOTAL ((np->ip_size + np->ip_trailing_zeros - 1) / 3);
+ INCR_TOTAL ((np->ip_size + np->ip_trailing_digits - 1) / 3);
if (np->point)
++total;
INCR_TOTAL (np->fp_leading_zeros);
@@ -1886,9 +1934,7 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
/* pad with spaces or zeros depending on np->pad_type */
{
np->pad_size = spec.width - total;
- total += np->pad_size; /* here total == spec.width,
- so 0 < total <= INT_MAX */
- MPFR_ASSERTD (total == spec.width);
+ total = spec.width;
}
MPFR_ASSERTD (total > 0 && total <= MPFR_INTMAX_MAX);
@@ -1905,8 +1951,8 @@ partition_number (struct number_parts *np, mpfr_srcptr p,
/* sprnt_fp prints a mpfr_t according to spec.spec specification.
- return the size of the string (not counting the terminating '\0')
- return -1 if the built string is too long (i.e. has more than
+ Return the size of the string (not counting the terminating '\0').
+ Return -1 if the built string is too long (i.e. has more than
INT_MAX or MPFR_INTMAX_MAX characters).
If spec.size is 0, we only want the size of the string.
@@ -1919,7 +1965,7 @@ sprnt_fp (struct string_buffer *buf, mpfr_srcptr p,
struct number_parts np;
length = partition_number (&np, p, spec);
- if (length < 0)
+ if (MPFR_UNLIKELY (length < 0))
{
buf->len = -1;
return -1;
@@ -1955,7 +2001,7 @@ sprnt_fp (struct string_buffer *buf, mpfr_srcptr p,
MPFR_ASSERTN (np.ip_ptr != NULL); /* never empty */
if (MPFR_UNLIKELY (np.thousands_sep))
{
- if (buffer_sandwich (buf, np.ip_ptr, np.ip_size, np.ip_trailing_zeros,
+ if (buffer_sandwich (buf, np.ip_ptr, np.ip_size, np.ip_trailing_digits,
np.thousands_sep))
{
buf->len = -1;
@@ -1966,9 +2012,10 @@ sprnt_fp (struct string_buffer *buf, mpfr_srcptr p,
{
buffer_cat (buf, np.ip_ptr, np.ip_size);
- /* trailing zeros in integral part */
- if (np.ip_trailing_zeros != 0)
- buffer_pad (buf, '0', np.ip_trailing_zeros);
+ /* possible trailing zero in integral part (spec.size != 0) */
+ MPFR_ASSERTD (np.ip_trailing_digits <= 1);
+ if (np.ip_trailing_digits != 0)
+ buffer_pad (buf, '0', 1);
}
/* decimal point */
@@ -2031,12 +2078,18 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
MPFR_SAVE_EXPO_DECL (expo);
MPFR_SAVE_EXPO_MARK (expo);
+ /* FIXME: Once buf.len >= size, switch to size = 0 for efficiency and
+ avoid potential DoS? i.e. we no longer need to generate the strings
+ (potentially huge), just compute the lengths. */
+
buffer_init (&buf, ptr != NULL || size != 0 ? 4096 : 0);
xgmp_fmt_flag = 0;
va_copy (ap2, ap);
start = fmt;
while (*fmt != '\0')
{
+ int overflow = 0;
+
/* Look for the next format specification */
while (*fmt != '\0' && *fmt != '%')
++fmt;
@@ -2060,24 +2113,34 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
specinfo_init (&spec);
fmt = parse_flags (fmt, &spec);
- READ_INT (ap, fmt, spec, width, width_analysis);
- width_analysis:
- if (spec.width < 0)
+ READ_INT (ap, fmt, spec.width);
+ if (spec.width < 0) /* integer read via '*', no overflow */
{
spec.left = 1;
- spec.width = -spec.width;
- MPFR_ASSERTN (spec.width < INT_MAX);
+ /* Since the type of the integer is int, spec.width >= INT_MIN,
+ so that an overflow is possible here only if mpfr_intmax_t
+ has the same size of int. The INT_MIN < - MPFR_INTMAX_MAX
+ test allows the compiler to optimize when it is false. */
+ if (MPFR_UNLIKELY (INT_MIN < - MPFR_INTMAX_MAX &&
+ spec.width < - MPFR_INTMAX_MAX))
+ overflow = 1;
+ else
+ spec.width = - spec.width;
}
+ /* Note: We will make sure that spec.width is not used in case of
+ overflow. */
+ MPFR_ASSERTD (overflow || spec.width >= 0);
+
if (*fmt == '.')
{
const char *f = ++fmt;
- READ_INT (ap, fmt, spec, prec, prec_analysis);
- prec_analysis:
- if (f == fmt)
+ READ_INT (ap, fmt, spec.prec);
+ if (f == fmt || spec.prec < 0)
spec.prec = -1;
}
else
spec.prec = -1;
+ MPFR_ASSERTD (spec.prec >= -1);
fmt = parse_arg_type (fmt, &spec);
if (spec.arg_type == UNSUPPORTED)
@@ -2115,6 +2178,7 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
break;
case 'N':
++fmt;
+ MPFR_FALLTHROUGH;
default:
spec.rnd_mode = MPFR_RNDN;
}
@@ -2226,6 +2290,17 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
size_t length;
mpfr_prec_t prec;
+ /* FIXME: With buf.size = 0 and a huge width or precision, this
+ can uselessly take much memory. And even with buf.size != 0,
+ this would take more memory than necessary and need a large
+ buffer_cat. A solution: compute a bound on the maximum
+ number of significant digits, and handle the additional
+ characters separately. Moreover, if buf.size = 0 or size != 0,
+ gmp_snprintf should be called instead of gmp_asprintf,
+ outputting data directly to the buffer when applicable.
+ See also: https://sourceware.org/bugzilla/show_bug.cgi?id=23432
+ Add testcases. */
+
prec = va_arg (ap, mpfr_prec_t);
FLUSH (xgmp_fmt_flag, start, end, ap2, &buf);
@@ -2233,6 +2308,28 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
va_copy (ap2, ap);
start = fmt;
+ /* The restriction to INT_MAX is a limitation due to the fact
+ that *.* is used below. If the width or precision field is
+ larger than INT_MAX, then there is a real overflow on the
+ return value due to the padding characters, thus the error
+ is correct. The only minor drawback is that some variables
+ corresponding to the 'n' conversion specifier with a type
+ larger than int may not be set. This is not a bug, as there
+ are no strong guarantees for such variables in case of error.
+ FIXME: If size = 0 and max(spec.width,spec.prec) is large
+ enough, there is no need to call gmp_asprintf since we are
+ just interested in the length, which should be this maximum;
+ in particular, this should avoid the overflow issue. */
+ if (overflow || spec.width > INT_MAX || spec.prec > INT_MAX)
+ {
+ buf.len = -1;
+ goto error;
+ }
+
+ /* Recalled from above. */
+ MPFR_ASSERTD (spec.width >= 0);
+ MPFR_ASSERTD (spec.prec >= -1);
+
/* construct format string, like "%*.*hd" "%*.*d" or "%*.*ld" */
sprintf (format, "%%%s%s%s%s%s%s*.*" MPFR_PREC_FORMAT_TYPE "%c",
spec.pad == '0' ? "0" : "",
@@ -2242,7 +2339,13 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
spec.left ? "-" : "",
spec.group ? "'" : "",
spec.spec);
- length = gmp_asprintf (&s, format, spec.width, spec.prec, prec);
+ MPFR_LOG_MSG (("MPFR_PREC_ARG: format for gmp_asprintf: \"%s\"\n",
+ format));
+ MPFR_LOG_MSG (("MPFR_PREC_ARG: width = %d, prec = %d, value = %"
+ MPFR_PREC_FORMAT_TYPE "d\n",
+ (int) spec.width, (int) spec.prec, prec));
+ length = gmp_asprintf (&s, format,
+ (int) spec.width, (int) spec.prec, prec);
MPFR_ASSERTN (length >= 0); /* guaranteed by GMP 6 */
buffer_cat (&buf, s, length);
mpfr_free_str (s);
@@ -2257,9 +2360,9 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
&& spec.spec != 'e' && spec.spec != 'E'
&& spec.spec != 'f' && spec.spec != 'F'
&& spec.spec != 'g' && spec.spec != 'G')
- /* the format specifier is invalid; skip the invalid format
- specifier so as to print it as a literal string. What may be
- printed after this string is undefined. */
+ /* The format specifier is invalid; skip the invalid format
+ specifier so as to print it as a literal string. What may
+ be printed after this string is undefined. */
continue;
p = va_arg (ap, mpfr_srcptr);
@@ -2269,6 +2372,12 @@ mpfr_vasnprintf_aux (char **ptr, char *Buf, size_t size, const char *fmt,
va_copy (ap2, ap);
start = fmt;
+ if (overflow)
+ {
+ buf.len = -1;
+ goto error;
+ }
+
if (ptr == NULL)
spec.size = size;
sprnt_fp (&buf, p, spec);
diff --git a/Build/source/libs/mpfr/mpfr-src/src/version.c b/Build/source/libs/mpfr/mpfr-src/src/version.c
index 7b66d8322a5..035f1580aa1 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/version.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/version.c
@@ -1,6 +1,6 @@
/* mpfr_get_version -- MPFR version
-Copyright 2004-2019 Free Software Foundation, Inc.
+Copyright 2004-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -25,5 +25,5 @@ https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
const char *
mpfr_get_version (void)
{
- return "4.0.2";
+ return "4.1.0";
}
diff --git a/Build/source/libs/mpfr/mpfr-src/src/volatile.c b/Build/source/libs/mpfr/mpfr-src/src/volatile.c
index 2f43852c635..7a77d58297d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/volatile.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/volatile.c
@@ -4,7 +4,7 @@
CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
FUTURE MPFR RELEASES.
-Copyright 2003-2004, 2006-2019 Free Software Foundation, Inc.
+Copyright 2003-2004, 2006-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/mpfr-src/src/x86/core2/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/x86/core2/mparam.h
deleted file mode 100644
index 9dc7b0a847c..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/x86/core2/mparam.h
+++ /dev/null
@@ -1,234 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.3.2 */
-/* gcc14.fsffrance.org (Intel(R) Xeon(R) CPU X5450 @ 3.00GHz) with gmp 5.0.2
- configured with ABI=32 */
-
-
-#define MPFR_MULHIGH_TAB \
- -1,0,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,0,10,10,0, \
- 11,11,0,13,13,0,0,17,17,16,19,19,19,18,18,22, \
- 20,18,19,26,26,28,23,24,28,29,26,28,29,28,30,32, \
- 29,30,38,30,34,32,33,37,34,36,37,38,38,38,38,38, \
- 38,44,36,52,44,48,52,56,51,52,56,56,52,52,56,58, \
- 52,60,60,56,60,55,52,68,60,68,68,68,68,72,72,67, \
- 68,68,68,76,76,68,75,75,68,72,76,68,68,75,72,72, \
- 78,73,74,72,76,74,76,72,76,74,76,72,76,76,75,76, \
- 75,74,76,76,99,99,104,76,76,111,104,102,99,99,99,104, \
- 93,105,99,104,99,104,99,99,99,96,102,99,104,104,104,108, \
- 104,105,111,110,110,111,111,111,109,111,110,111,111,114,108,111, \
- 111,111,105,105,111,108,111,110,111,110,111,111,110,111,110,134, \
- 111,141,153,153,153,140,141,165,141,153,151,153,153,153,152,152, \
- 153,165,153,152,153,153,153,163,165,164,165,153,153,164,163,164, \
- 165,165,153,168,168,173,174,165,176,177,177,164,176,177,165,165, \
- 165,172,164,165,165,165,168,177,175,176,177,176,165,175,176,176, \
- 165,177,176,177,204,204,204,204,204,203,177,218,217,220,204,219, \
- 220,217,220,220,220,218,219,220,220,220,220,217,217,219,220,220, \
- 217,204,217,219,220,220,217,218,218,219,220,219,220,219,219,220, \
- 220,220,220,220,219,220,220,220,220,251,220,219,220,220,220,236, \
- 249,220,251,250,249,249,251,248,251,251,251,250,251,251,251,249, \
- 248,248,240,250,250,250,249,251,246,251,250,251,251,251,250,250, \
- 251,249,249,250,251,251,249,251,250,306,305,306,306,306,306,306, \
- 306,306,306,251,306,306,305,305,306,306,305,305,306,306,306,305, \
- 330,305,306,305,306,306,306,330,306,306,305,305,330,330,327,330, \
- 330,330,306,329,330,330,330,330,330,329,330,306,330,330,329,329, \
- 329,330,329,330,330,330,330,330,330,327,328,329,330,329,329,330, \
- 330,329,330,330,328,330,330,330,330,330,354,330,329,330,330,354, \
- 330,329,330,353,354,330,354,354,330,353,354,354,354,354,354,354, \
- 354,354,353,354,352,354,354,354,330,354,354,353,354,354,354,378, \
- 353,408,408,408,408,407,408,407,407,408,408,408,408,407,408,408, \
- 407,407,407,440,407,408,408,407,439,408,408,408,407,408,440,440, \
- 440,440,440,440,440,439,440,437,439,440,439,439,440,440,439,440, \
- 439,439,440,439,440,440,440,439,438,439,440,440,439,440,438,439, \
- 440,440,440,439,440,440,440,440,438,440,439,439,440,440,440,439, \
- 440,440,440,440,440,440,439,440,440,471,472,471,439,440,439,472, \
- 472,472,472,472,472,472,440,472,439,440,471,472,471,471,439,472, \
- 496,496,496,472,440,471,472,480,495,496,496,495,472,534,536,534, \
- 534,536,536,536,536,536,536,536,536,536,535,536,536,536,536,536, \
- 534,535,536,536,536,535,534,534,535,536,536,534,535,536,536,535, \
- 536,536,536,536,535,536,536,536,536,536,535,536,568,535,536,536, \
- 536,535,536,568,536,536,568,536,568,568,568,536,568,536,536,566, \
- 567,567,535,568,568,536,535,536,535,536,536,536,567,536,568,536, \
- 568,567,568,568,567,600,597,568,567,567,568,600,568,568,568,598, \
- 566,567,568,568,566,568,568,568,567,568,567,568,568,568,568,568, \
- 600,567,568,600,568,600,568,568,568,568,568,600,599,566,568,600, \
- 568,568,600,567,568,599,567,600,599,600,568,600,567,599,600,599, \
- 568,597,600,598,600,599,599,599,600,600,598,600,598,600,597,600, \
- 600,600,600,600,600,599,600,600,598,599,600,599,600,639,600,600, \
- 600,600,568,639,600,568,567,568,568,568,600,640,600,599,600,599, \
- 600,600,600,598,600,599,568,600,598,600,600,599,600,597,639,598, \
- 600,600,600,600,599,600,600,600,600,600,600,687,736,598,599,600, \
- 736,600,600,688,736,736,600,688,735,736,736,734,736,736,735,736, \
- 640,734,735,736,734,733,736,736,731,735,736,736,736,736,736,736, \
- 736,735,736,736,736,736,784,735,784,735,784,783,783,736,736,735, \
- 784,784,784,736,783,784,784,784,784,783,783,784,784,784,784,784, \
- 781,782,782,784,784,784,784,784,784,734,784,783,784,784,784,736, \
- 808,783,784,784,784,783,784,783,784,783,784,783,784,832,832,829, \
- 832,824,823,832,824,784,784,824,831,832,784,783,784,783,784,832, \
- 784,784,784,783,784,784,781,784,784,784,784,783,824,832,831,784, \
- 832,831,832,830,832,807,784,832,830,784,832,808,832,824,823,832, \
- 824,808,831,824,824,824,832,823,832,824,832,831,832,832,829,830, \
- 831,832,832,832,831,831,832,832,830,832,832,832,832,831,831,832, \
- 879,832,832,880,832,831,832,831,832,832,832,832,832,832,832,831 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,-1,-1,-1,-1,-1,-1,-1,8,8,8,9,9, \
- 10,10,11,13,13,14,15,16,14,16,17,16,18,17,19,18, \
- 20,18,19,22,21,22,23,22,23,22,25,24,25,24,25,26, \
- 27,26,29,27,28,29,30,34,34,36,36,38,38,40,40,42, \
- 34,44,42,46,38,42,44,38,38,44,40,42,42,50,44,46, \
- 50,48,48,44,50,52,52,46,50,46,52,50,52,50,50,52, \
- 52,54,52,52,54,58,58,54,57,58,58,58,56,58,58,58, \
- 68,58,64,68,72,60,64,72,68,64,72,64,72,68,72,68, \
- 76,76,72,76,80,76,76,76,84,80,76,88,84,84,84,84, \
- 88,84,87,88,88,92,92,92,88,96,92,96,96,92,96,96, \
- 100,100,100,100,96,84,92,92,88,96,92,88,99,92,96,91, \
- 92,96,100,100,99,100,100,100,100,96,98,96,100,98,100,100, \
- 100,100,100,117,100,123,123,135,122,123,124,129,126,122,135,123, \
- 129,135,135,133,134,135,141,140,135,126,140,135,129,129,129,132, \
- 146,134,129,147,150,135,152,140,135,140,141,141,147,141,147,147, \
- 147,150,141,147,152,147,141,150,141,151,153,146,147,152,147,147, \
- 147,152,147,153,151,153,147,147,153,150,147,152,153,150,150,152, \
- 153,150,153,152,153,150,147,164,150,187,188,148,187,180,152,196, \
- 187,196,180,186,187,188,196,187,196,188,196,180,195,196,188,188, \
- 188,196,196,188,192,194,195,196,196,196,195,204,211,212,203,204, \
- 204,196,196,203,204,220,212,203,196,204,195,204,196,187,216,188, \
- 200,195,196,204,219,203,195,196,188,203,204,195,203,204,219,195, \
- 196,211,212,220,196,203,196,212,204,204,220,196,203,220,220,211, \
- 203,212,212,211,212,212,216,218,220,211,211,218,220,219,220,220, \
- 220,220,220,220,220,220,219,220,282,282,219,276,276,282,282,275, \
- 276,282,269,276,258,294,276,282,282,294,294,270,282,294,258,270, \
- 258,270,294,270,258,270,282,276,306,282,282,282,282,282,276,270, \
- 282,282,282,281,282,281,281,294,282,276,282,282,282,294,294,282, \
- 306,306,294,282,294,282,294,294,305,288,306,294,294,294,306,294, \
- 306,305,318,306,306,318,312,306,306,318,305,306,306,306,317,312, \
- 311,318,311,312,324,318,317,330,330,318,318,330,323,330,329,330, \
- 324,330,329,324,342,330,342,329,330,336,341,318,294,329,341,306, \
- 300,305,300,299,300,305,306,306,324,305,318,318,312,317,330,306, \
- 306,306,306,306,318,317,318,318,318,324,330,329,324,318,318,318, \
- 323,324,306,323,324,324,329,328,328,330,330,330,318,318,318,317, \
- 317,336,330,342,342,341,330,330,330,342,330,340,330,330,318,341, \
- 342,426,426,341,342,425,426,426,426,342,426,425,426,425,425,426, \
- 426,426,318,426,425,450,426,425,378,378,378,426,426,450,450,450, \
- 402,330,449,450,449,450,450,449,450,450,402,450,450,450,450,450, \
- 426,401,402,450,450,426,426,450,474,472,474,450,426,426,426,474, \
- 474,474,473,425,426,450,450,426,424,425,426,426,474,449,450,450, \
- 450,426,474,449,426,450,450,448,449,498,450,498,450,426,450,449, \
- 448,450,450,448,449,449,474,448,449,450,450,473,474,474,473,449, \
- 449,474,450,474,450,450,473,474,450,473,474,474,474,474,521,498, \
- 474,474,474,474,474,474,498,498,474,474,474,473,473,474,474,498, \
- 498,474,498,498,498,498,498,519,498,522,522,498,498,520,498,498, \
- 498,498,498,522,522,498,521,521,520,521,522,522,474,522,521,546, \
- 520,522,546,522,516,546,546,521,522,522,522,521,522,522,521,474, \
- 545,545,546,546,474,522,522,522,522,474,498,546,522,546,546,544, \
- 545,545,522,521,546,546,546,522,546,545,522,498,546,546,522,520, \
- 522,522,522,521,521,545,546,522,521,522,600,568,522,522,521,522, \
- 600,522,521,521,522,522,519,599,521,522,545,546,522,545,546,545, \
- 522,599,522,521,546,545,546,546,600,598,600,546,546,545,546,600, \
- 568,546,600,546,598,600,600,632,632,545,546,599,600,546,546,545, \
- 546,632,632,600,632,631,632,631,600,600,632,632,598,600,632,599, \
- 599,599,600,599,599,600,600,600,600,596,600,631,599,600,600,599, \
- 600,600,600,600,600,600,664,631,632,600,663,664,696,664,600,664, \
- 663,631,696,662,600,693,696,695,663,696,696,664,631,632,688,630, \
- 632,632,696,631,695,632,632,695,696,695,695,696,696,696,632,695, \
- 696,695,696,696,632,695,696,631,664,664,695,663,663,664,696,687, \
- 662,664,664,663,664,663,694,695,695,727,728,728,693,728,693,695, \
- 696,696,696,696,696,694,695,696,696,695,696,694,727,696,696,688, \
- 695,696,696,695,696,695,695,696,696,727,696,696,695,696,695,696, \
- 696,695,696,695,696,696,696,728,728,696,720,728,728,728,726,728 \
-
-#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,9,10,9,10,11,14,13, \
- 14,11,16,17,13,14,15,16,16,14,16,16,16,19,20,18, \
- 23,18,22,19,24,25,27,23,23,24,24,23,27,28,27,28, \
- 28,33,29,30,32,29,37,32,35,33,33,39,33,33,35,38, \
- 39,38,38,37,38,39,37,37,48,40,39,40,40,50,51,46, \
- 47,48,48,46,50,50,50,59,52,50,51,48,56,56,54,50, \
- 51,54,53,58,58,58,56,59,61,58,62,59,62,67,62,67, \
- 60,64,71,68,64,64,62,68,67,72,66,72,76,72,74,72, \
- 67,72,72,74,76,70,74,74,76,76,76,76,76,76,74,76, \
- 76,76,80,87,78,76,88,80,79,88,88,96,94,96,88,103, \
- 104,104,104,100,103,102,104,104,104,96,104,104,112,112,104,104, \
- 95,104,104,103,104,104,104,112,104,104,104,103,112,104,104,112, \
- 104,104,112,104,104,112,104,112,112,112,111,112,120,104,112,116, \
- 112,120,112,110,120,112,120,112,120,118,116,126,119,120,128,120, \
- 136,128,120,120,136,120,120,136,152,136,136,136,143,136,128,140, \
- 128,152,148,152,136,144,152,152,144,152,144,152,152,152,152,152, \
- 134,152,152,136,136,136,140,152,152,143,152,144,152,152,152,152, \
- 152,152,144,152,152,152,144,152,152,152,152,152,152,152,152,152, \
- 152,152,152,152,152,152,150,151,152,152,152,152,156,152,160,160, \
- 168,156,176,159,160,160,176,160,176,174,176,176,208,176,176,174, \
- 176,183,176,208,208,176,208,208,208,208,192,208,208,208,208,208, \
- 208,208,208,200,208,208,208,208,208,208,208,208,208,208,208,208, \
- 208,208,208,208,208,208,222,208,209,208,208,208,208,208,208,222, \
- 208,208,208,208,208,208,208,208,208,208,208,208,208,207,208,208, \
- 208,208,208,208,208,208,208,208,208,222,220,220,222,208,221,216, \
- 208,220,208,208,208,209,208,208,220,208,208,208,208,208,222,221, \
- 222,220,220,224,220,216,216,220,216,220,221,222,216,224,224,222, \
- 222,221,221,222,222,224,222,222,222,222,228,240,232,224,225,225, \
- 304,228,272,256,231,248,240,234,232,272,288,234,270,256,264,240, \
- 240,272,256,272,270,271,272,240,303,270,304,304,272,303,304,304, \
- 304,304,272,270,272,304,288,287,257,303,304,304,288,304,304,272, \
- 304,304,304,272,304,305,304,303,304,304,303,302,303,304,272,303, \
- 304,304,304,303,304,304,272,304,304,288,288,304,304,304,305,282, \
- 304,304,303,304,304,304,304,304,303,304,304,304,302,304,304,305, \
- 303,302,287,302,304,304,304,305,304,304,302,302,303,303,304,288, \
- 303,304,304,304,304,302,303,304,304,288,304,303,304,304,304,303, \
- 304,304,303,303,304,304,304,304,304,304,304,303,304,303,304,304, \
- 304,303,304,303,304,304,320,303,304,304,304,304,304,304,305,306, \
- 320,312,320,320,320,320,320,320,320,320,320,320,320,320,352,320, \
- 352,320,336,320,352,320,319,320,336,336,352,348,348,344,348,348, \
- 352,348,351,351,351,352,352,354,350,352,352,352,360,353,416,359, \
- 352,360,416,352,352,370,416,352,353,416,352,416,416,416,352,416, \
- 352,416,416,416,416,352,408,416,416,384,416,352,416,392,416,416, \
- 416,401,408,416,416,416,416,416,416,416,416,407,416,408,416,416, \
- 416,408,408,416,416,416,416,432,416,416,416,436,440,416,416,440, \
- 440,416,416,416,432,416,440,416,440,438,440,416,440,416,440,438, \
- 440,444,416,448,416,440,440,440,416,448,448,415,447,440,416,440, \
- 416,416,408,408,416,416,416,448,416,416,416,416,416,416,416,416, \
- 416,416,416,416,416,416,440,416,417,416,416,416,416,416,416,416, \
- 416,416,416,440,416,416,440,416,416,448,416,416,416,416,416,416, \
- 448,416,416,416,448,416,416,416,416,416,440,416,416,416,432,440, \
- 416,416,416,416,416,432,416,432,432,440,440,416,416,416,440,440, \
- 440,448,448,438,440,433,440,439,440,448,440,440,440,439,440,447, \
- 444,439,440,440,440,440,448,448,448,440,440,448,444,448,443,440, \
- 440,440,440,440,440,448,448,440,448,439,440,444,447,448,448,448, \
- 448,448,448,448,448,448,448,447,448,448,448,448,448,448,512,608, \
- 480,608,464,480,608,456,464,608,608,480,608,480,608,480,480,480, \
- 608,480,512,480,608,513,512,608,512,512,608,512,608,496,480,496, \
- 608,516,496,608,480,512,608,512,608,512,512,608,608,608,608,608, \
- 608,576,608,607,608,608,512,608,607,609,607,608,608,609,608,608, \
- 609,608,608,608,607,608,607,608,607,608,608,608,608,608,608,607, \
- 607,608,608,608,608,608,607,607,608,607,608,608,608,607,608,608, \
- 608,608,609,609,608,608,609,608,608,608,606,606,608,608,609,607, \
- 606,607,608,608,610,608,608,609,608,608,608,608,608,608,607,608 \
-
-#define MPFR_MUL_THRESHOLD 15 /* limbs */
-#define MPFR_SQR_THRESHOLD 18 /* limbs */
-#define MPFR_DIV_THRESHOLD 22 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 649 /* bits */
-#define MPFR_EXP_THRESHOLD 10653 /* bits */
-#define MPFR_SINCOS_THRESHOLD 36331 /* bits */
-#define MPFR_AI_THRESHOLD1 -21595 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 2333
-#define MPFR_AI_THRESHOLD3 33925
-/* Tuneup completed successfully, took 1155 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/x86/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/x86/mparam.h
index abedcf43156..955bd4f0f36 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/x86/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/x86/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -19,215 +19,216 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.4.2 */
-/* contributed by Jim Cloos <cloos at jhcloos dot com> with GMP 5.0.2 on a
- Pentium3-M, where __i386, __i686, __pentiumpro are defined */
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 6.3.0 */
+/* gcc14.fsffrance.org (Intel(R) Xeon(R) CPU X5450 @ 3.00GHz)
+ with GMP 6.1.2 configured with ABI=32,
+ MPFR configured with CFLAGS='-O2 -m32 -march=i686 -mtune=generic' */
#define MPFR_MULHIGH_TAB \
- -1,0,-1,-1,-1,-1,-1,-1,-1,7,8,9,10,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,28,30,30,30,30,32, \
- 32,32,34,34,34,32,34,34,34,36,36,36,36,40,40,40, \
- 42,44,48,48,48,48,48,48,48,48,48,52,52,52,52,52, \
- 52,52,56,56,60,56,60,60,60,60,60,64,64,64,64,64, \
- 64,64,64,64,64,64,68,64,64,68,68,68,68,72,72,81, \
- 81,80,81,81,87,87,87,87,87,87,87,87,87,87,93,87, \
- 93,93,93,93,93,93,93,93,99,99,93,93,93,92,93,99, \
- 99,99,99,99,99,99,99,99,105,105,99,105,105,104,105,105, \
- 105,105,111,117,117,117,117,117,117,117,117,117,117,117,117,117, \
- 123,123,123,123,141,141,141,141,141,141,141,141,141,141,141,141, \
- 141,141,141,141,141,141,141,141,141,153,153,153,153,153,153,153, \
- 153,153,153,153,153,165,165,165,153,165,165,165,165,165,165,165, \
- 165,165,165,165,165,177,177,165,177,177,177,177,165,177,177,177, \
- 177,177,177,177,177,177,177,177,177,177,177,177,177,177,177,177, \
- 177,177,189,204,189,204,204,204,204,204,204,189,204,189,204,204, \
- 204,204,204,204,204,204,204,204,203,204,204,204,204,204,204,204, \
- 220,204,220,220,220,220,220,220,220,220,220,220,220,220,220,220, \
- 236,220,236,236,236,236,236,235,236,235,236,236,236,236,235,236, \
- 236,236,236,236,236,236,236,236,236,252,252,252,252,252,252,252, \
- 252,252,252,252,252,252,252,252,282,282,282,282,282,282,282,282, \
- 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282, \
- 282,282,282,282,282,282,282,306,306,282,306,306,306,306,306,306, \
- 306,306,306,306,306,306,306,306,306,306,306,306,306,306,306,306, \
- 306,306,306,306,306,330,330,330,329,330,330,330,330,330,330,330, \
- 330,330,330,330,330,330,330,330,330,330,330,330,330,330,354,354, \
- 354,354,354,354,354,354,354,354,354,354,354,354,354,354,354,354, \
- 354,354,354,354,354,354,354,354,354,378,378,378,378,378,378,378, \
- 378,377,378,378,378,378,378,378,378,378,378,378,378,378,378,378, \
- 408,408,408,408,408,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,408,408,408,408,407,408,407,408,408,407,408,408,408,408, \
- 408,408,439,408,440,440,439,440,440,440,440,439,440,440,439,440, \
- 439,440,439,440,439,439,440,440,440,440,439,440,439,440,439,440, \
- 440,440,439,439,440,440,472,440,472,439,440,439,440,440,440,472, \
- 472,472,469,471,471,472,471,471,472,471,470,470,472,472,471,472, \
- 472,504,504,463,471,455,438,501,462,497,501,503,459,471,451,467, \
- 448,501,503,485,504,453,469,470,503,472,496,496,480,467,504,460, \
- 504,488,488,532,535,497,480,470,504,497,504,492,497,498,536,468, \
- 504,510,519,528,500,500,495,504,504,504,504,534,504,504,498,504, \
- 504,511,504,504,504,503,504,563,504,511,504,504,504,504,504,504, \
- 504,504,533,504,536,536,536,533,536,536,536,536,536,536,536,536, \
- 536,536,536,536,536,536,536,536,536,536,536,536,536,536,566,536, \
- 536,536,536,568,568,568,568,568,568,568,568,568,568,568,568,568, \
- 568,568,568,568,568,568,568,568,568,568,568,568,568,568,592,592, \
- 592,592,592,592,592,592,592,592,640,592,640,592,640,639,640,640, \
- 640,640,640,639,640,639,640,640,640,639,640,640,640,640,640,640, \
- 640,640,640,640,640,640,640,640,640,640,640,640,640,640,640,640, \
- 639,640,639,639,688,688,688,639,640,639,640,640,640,687,688,688, \
- 688,687,687,688,688,688,688,688,688,688,688,687,688,736,688,688, \
- 688,687,636,688,688,688,688,688,688,688,688,688,688,688,688,688, \
- 688,688,688,688,688,688,688,688,688,688,687,688,688,688,688,688, \
- 688,688,688,688,688,688,688,688,688,688,688,688,736,736,736,736, \
- 736,736,736,736,736,736,736,736,688,735,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,735,736,735,736,736, \
- 736,735,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,735,736,736,736,736,736,736,736,736, \
- 736,736,736,736,784,736,784,784,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 784,736,784,784,784,784,784,784,736,784,736,784,784,784,784,736, \
- 784,783,784,784,784,784,784,784,784,784,784,784,784,784,784,784, \
- 784,784,784,784,784,784,784,784,784,784,784,832,784,784,784,784, \
- 832,784,832,831,832,831,832,832,832,832,832,784,784,784,784,784, \
- 832,784,832,784,832,832,832,832,832,832,832,832,832,832,832,832 \
+ -1,0,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,15,0,0,0,16,0,17,18,19, \
+ 21,18,19,20,21,21,22,23,24,26,23,28,25,30,30,28, \
+ 29,30,34,32,32,34,34,36,36,38,38,38,40,42,42,42, \
+ 40,46,42,46,44,44,46,52,48,49,50,50,52,52,54,60, \
+ 56,56,58,59,60,60,60,63,64,64,64,64,68,68,68,68, \
+ 68,68,64,68,64,68,68,68,68,68,68,68,68,68,76,76, \
+ 76,76,68,80,84,68,68,84,84,84,84,84,84,84,84,77, \
+ 84,76,80,84,84,76,84,92,84,76,84,84,84,84,92,92, \
+ 93,93,84,110,111,99,93,99,111,99,110,111,106,105,108,104, \
+ 110,111,111,110,111,111,111,110,110,123,116,110,123,123,120,117, \
+ 116,117,116,123,123,123,120,126,123,123,123,129,126,123,129,129, \
+ 126,135,132,135,135,135,135,135,134,135,141,141,154,135,156,141, \
+ 134,148,156,156,156,147,148,164,164,155,156,156,164,163,164,163, \
+ 163,164,164,164,164,164,164,163,171,163,164,172,172,171,172,163, \
+ 164,171,180,177,180,179,180,184,172,179,180,180,176,179,180,171, \
+ 180,180,188,188,180,187,200,204,180,204,204,187,196,203,204,203, \
+ 204,203,204,203,204,203,220,204,220,204,220,220,219,203,204,220, \
+ 220,219,220,219,204,219,220,203,220,204,204,219,220,252,236,251, \
+ 250,251,252,249,252,249,252,251,252,252,252,251,252,251,252,249, \
+ 252,252,252,251,252,252,252,251,252,267,251,252,252,251,268,252, \
+ 252,249,250,252,252,252,268,252,252,268,252,268,268,268,268,252, \
+ 252,265,251,268,268,268,266,265,267,268,268,268,268,268,268,268, \
+ 268,267,268,268,268,268,268,267,268,306,306,306,306,268,306,306, \
+ 306,305,305,306,306,268,306,306,305,305,306,306,306,330,306,306, \
+ 306,306,306,306,306,306,330,306,306,306,306,330,330,330,330,306, \
+ 329,330,330,330,328,329,330,330,354,329,330,329,330,330,354,330, \
+ 330,354,329,330,330,354,330,352,354,329,354,330,354,330,330,354, \
+ 354,329,354,330,360,330,330,354,352,354,378,371,378,377,354,378, \
+ 378,402,354,402,378,378,378,401,402,378,402,378,354,401,377,378, \
+ 377,378,402,401,378,378,378,402,401,402,402,402,401,401,402,402, \
+ 401,402,401,402,402,402,402,402,402,402,402,402,402,402,401,402, \
+ 402,401,402,402,401,402,402,401,402,402,402,402,402,402,402,402, \
+ 402,401,402,402,402,401,402,439,439,440,402,440,402,402,426,439, \
+ 439,440,440,440,426,426,426,438,439,440,472,439,471,440,440,472, \
+ 472,440,440,440,471,439,472,440,472,472,472,440,470,472,471,472, \
+ 470,472,504,470,472,472,469,472,496,472,472,472,471,502,472,472, \
+ 471,472,471,504,472,472,472,472,480,504,472,496,503,503,504,504, \
+ 503,503,472,504,504,472,496,503,502,472,504,496,472,504,503,472, \
+ 504,496,504,504,503,536,470,536,472,536,535,535,536,534,504,536, \
+ 536,503,504,536,536,544,536,503,504,536,535,503,480,504,504,536, \
+ 535,568,568,504,568,568,568,544,568,536,535,568,568,535,504,535, \
+ 568,568,568,536,504,567,544,568,568,536,544,567,544,544,568,584, \
+ 544,568,560,568,600,559,568,584,583,568,568,600,599,567,568,567, \
+ 568,567,568,567,600,568,568,599,599,568,584,568,567,568,599,568, \
+ 567,568,567,600,600,568,600,584,568,599,599,568,600,568,600,599, \
+ 608,599,600,568,600,600,568,600,600,568,568,598,599,600,599,600, \
+ 600,600,600,664,664,600,632,584,600,664,663,600,664,600,632,663, \
+ 663,631,632,600,600,600,600,664,600,656,599,664,600,600,656,600, \
+ 600,664,664,664,664,663,663,663,664,664,664,664,663,664,662,663, \
+ 664,663,664,664,664,632,632,663,664,663,664,632,664,664,664,664, \
+ 664,664,663,664,664,664,662,664,663,664,664,664,664,663,663,664, \
+ 664,664,662,663,663,664,664,664,664,664,662,663,664,664,664,664, \
+ 664,664,664,664,663,664,664,664,664,664,663,664,663,664,664,664, \
+ 663,664,664,687,688,662,663,664,664,663,664,734,664,664,688,736, \
+ 736,664,664,664,664,663,664,663,664,736,735,664,664,663,736,733, \
+ 736,734,735,736,736,735,736,735,736,736,736,784,736,784,784,736, \
+ 736,784,735,736,736,783,736,783,736,736,736,735,784,784,736,736, \
+ 735,784,736,784,736,784,784,736,784,784,784,784,784,783,784,783, \
+ 783,783,784,784,784,784,784,784,784,783,824,784,782,831,832,783, \
+ 824,831,832,832,832,784,784,831,784,784,784,784,784,824,831,824, \
+ 823,824,824,824,824,824,831,832,824,822,824,832,824,824,832,823, \
+ 832,832,831,831,832,832,832,832,832,856,822,832,832,832,824,856, \
+ 824,824,832,832,824,832,856,831,832,832,856,831,832,856,832,830 \
#define MPFR_SQRHIGH_TAB \
- -1,0,0,-1,-1,-1,-1,5,6,6,7,7,8,8,9,9, \
- 10,11,12,11,12,13,14,13,14,15,16,15,16,16,17,17, \
- 18,19,19,19,20,20,21,22,23,22,23,24,25,24,25,26, \
- 27,26,27,27,28,28,29,29,30,31,32,31,32,32,33,34, \
- 35,34,35,36,36,38,38,38,39,40,40,40,41,41,41,41, \
- 42,43,44,44,48,48,48,48,48,50,52,50,52,52,54,54, \
- 56,56,58,54,54,54,56,56,56,56,58,58,60,60,62,64, \
- 64,64,62,62,64,64,64,64,64,66,66,68,68,70,68,72, \
- 70,72,74,72,74,72,72,72,74,74,76,72,72,72,74,74, \
- 76,76,76,76,78,78,78,80,80,80,80,80,80,80,87,90, \
- 87,90,90,93,93,90,90,90,90,93,93,93,90,96,96,93, \
- 96,96,96,96,96,93,99,96,102,99,99,99,96,102,102,102, \
- 108,102,105,105,105,108,111,111,108,111,111,111,111,111,111,117, \
- 114,117,114,117,117,120,120,120,120,120,120,120,123,126,126,126, \
- 126,129,129,129,129,129,132,132,132,135,135,135,141,141,141,141, \
- 141,141,148,148,148,152,148,152,152,148,152,156,156,156,156,156, \
- 160,135,141,152,141,141,141,141,141,141,141,141,141,141,141,141, \
- 141,141,152,141,156,152,156,156,160,160,160,152,160,156,156,156, \
- 160,160,156,168,160,168,164,164,168,160,168,176,172,168,168,172, \
- 172,172,176,176,188,176,176,172,188,188,188,188,188,187,188,188, \
- 188,188,188,188,196,188,196,196,196,196,196,204,204,204,204,204, \
- 204,204,204,212,212,212,212,212,212,212,212,220,220,220,220,220, \
- 220,220,220,219,220,220,220,228,220,228,220,220,228,228,220,220, \
- 220,236,236,228,228,236,228,236,228,244,244,228,244,244,236,236, \
- 258,236,258,258,258,258,258,258,258,264,258,264,264,264,264,264, \
- 264,264,264,264,264,258,264,258,264,282,258,264,282,282,282,282, \
- 282,264,264,282,282,276,264,264,282,294,282,282,282,282,282,282, \
- 282,282,282,282,282,282,282,282,282,282,282,282,294,282,282,282, \
- 282,282,282,306,282,282,306,306,282,306,306,306,306,318,306,318, \
- 318,318,318,318,318,318,318,318,318,318,318,330,330,318,318,318, \
- 330,318,318,330,330,318,318,318,318,318,318,330,342,330,330,330, \
- 330,330,330,330,330,330,330,330,330,318,330,318,318,342,342,318, \
- 342,318,318,342,318,330,330,330,330,330,318,330,330,318,330,318, \
- 342,330,342,342,342,342,342,342,342,330,342,342,330,342,342,342, \
- 342,354,342,342,342,342,342,342,342,354,342,342,354,354,354,342, \
- 354,354,354,354,354,354,354,378,366,366,366,366,378,366,366,366, \
- 378,408,366,378,378,378,378,378,378,378,378,378,378,424,424,424, \
- 424,424,424,424,424,408,408,408,408,408,408,408,408,408,408,408, \
- 408,408,424,424,408,424,408,424,424,408,408,424,424,424,424,424, \
- 424,424,424,424,424,424,408,424,424,424,424,424,440,424,440,424, \
- 424,440,424,424,424,424,440,440,440,440,424,424,440,440,424,424, \
- 424,424,440,424,440,456,456,424,440,440,440,440,456,424,424,424, \
- 440,440,456,440,472,456,440,440,472,440,456,440,440,440,456,440, \
- 440,440,456,456,456,472,471,472,456,472,440,472,488,488,455,455, \
- 456,456,488,456,472,488,504,472,456,504,488,488,456,472,472,471, \
- 472,502,472,472,496,488,487,503,456,504,504,503,504,456,456,487, \
- 488,488,504,488,487,504,503,503,504,504,503,503,503,504,502,503, \
- 502,504,519,501,504,551,502,520,520,488,504,479,517,503,488,463, \
- 472,456,504,503,487,519,552,534,485,480,486,502,499,552,504,534, \
- 486,440,504,511,512,533,516,472,536,567,534,494,519,440,542,534, \
- 528,592,468,536,516,485,472,583,550,509,537,471,493,533,526,446, \
- 558,498,499,495,487,571,500,544,471,583,545,530,470,566,520,536, \
- 558,463,504,544,534,494,520,542,522,520,552,520,514,483,434,607, \
- 566,538,536,552,486,607,623,606,520,453,588,476,614,497,472,504, \
- 504,566,552,504,504,504,504,504,504,504,504,504,504,552,520,504, \
- 520,520,520,504,520,520,504,520,536,520,520,536,536,536,536,536, \
- 536,536,536,586,536,536,520,555,504,565,520,552,536,552,552,552, \
- 552,552,552,552,552,552,552,552,552,552,552,552,552,552,568,552, \
- 568,552,568,568,568,568,559,560,568,552,552,568,568,552,568,584, \
- 552,552,552,552,552,552,568,568,552,568,568,552,568,568,552,552, \
- 584,568,568,568,568,568,568,568,568,568,552,568,584,584,568,552, \
- 584,584,584,584,584,584,584,568,568,568,568,616,568,568,616,568, \
- 600,584,600,600,600,632,616,600,584,616,616,632,632,584,632,616, \
- 616,616,616,616,616,632,632,616,616,632,632,616,616,632,616,616 \
+ -1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,9,8,9,10, \
+ 11,12,13,11,13,12,13,14,15,14,15,16,16,18,17,19, \
+ 19,18,19,19,20,20,22,23,23,22,23,24,25,25,26,27, \
+ 28,30,30,27,28,29,30,31,32,33,38,40,40,42,42,44, \
+ 40,40,42,42,44,44,42,42,44,42,50,50,42,46,50,44, \
+ 46,44,46,46,50,48,50,50,50,50,48,54,50,54,50,50, \
+ 54,50,54,54,54,62,60,53,54,54,56,56,58,56,60,58, \
+ 58,60,60,62,62,60,76,62,76,68,72,66,68,72,76,72, \
+ 72,72,76,76,76,80,80,80,76,80,80,88,84,80,84,88, \
+ 84,92,88,88,92,92,88,88,80,92,96,92,92,87,96,96, \
+ 100,100,100,100,96,100,96,104,96,104,100,100,100,100,108,100, \
+ 96,100,104,103,104,104,100,100,104,104,104,104,104,108,108,99, \
+ 100,108,108,100,112,100,106,123,108,108,128,123,112,129,112,108, \
+ 129,135,134,135,128,129,138,135,123,141,135,127,128,141,129,147, \
+ 128,141,134,135,135,141,138,139,135,141,138,141,135,153,146,147, \
+ 147,153,141,141,147,153,141,150,135,147,147,159,147,147,147,159, \
+ 135,141,135,146,147,165,146,147,159,152,147,147,147,147,146,158, \
+ 151,147,153,146,147,157,153,153,188,159,159,188,188,164,164,195, \
+ 196,160,180,187,188,180,187,188,180,188,188,165,187,188,196,188, \
+ 188,180,188,196,188,188,195,188,187,188,188,196,196,188,195,196, \
+ 196,195,196,195,196,196,195,196,196,188,211,203,212,195,196,196, \
+ 196,196,212,211,211,195,196,220,220,212,220,225,212,196,216,220, \
+ 216,220,220,195,196,196,220,220,196,220,228,203,212,212,212,212, \
+ 211,212,212,212,212,212,212,220,212,219,220,220,220,220,212,228, \
+ 227,220,228,228,228,228,228,212,212,228,227,211,228,236,276,219, \
+ 220,228,212,219,220,244,219,219,244,244,220,227,228,228,244,227, \
+ 282,244,294,270,264,282,269,276,264,270,294,276,282,270,270,276, \
+ 276,276,282,270,270,276,281,276,282,282,282,282,276,282,294,282, \
+ 282,294,270,294,282,294,282,294,294,294,294,294,276,282,282,282, \
+ 276,294,282,282,294,282,282,294,306,294,294,294,312,294,294,294, \
+ 294,294,294,294,317,318,318,294,293,318,294,306,306,318,330,324, \
+ 324,330,318,306,330,312,318,318,324,324,318,324,324,330,317,330, \
+ 324,323,324,318,318,330,330,329,329,330,330,318,324,329,329,330, \
+ 336,330,329,330,324,342,354,342,318,324,354,342,341,348,348,318, \
+ 330,354,354,342,318,368,354,376,368,354,375,330,376,392,392,376, \
+ 330,376,376,376,368,392,392,392,384,392,392,392,392,392,392,392, \
+ 392,392,392,408,392,392,407,392,392,392,392,406,408,408,407,407, \
+ 408,392,408,416,408,392,424,408,375,376,376,408,408,424,376,423, \
+ 416,424,392,408,424,408,376,431,432,424,424,423,424,424,424,407, \
+ 432,424,392,431,432,392,432,424,407,440,392,440,440,440,408,432, \
+ 439,440,424,440,416,440,424,407,423,424,424,424,424,456,424,424, \
+ 432,423,424,432,416,424,432,423,424,423,440,424,424,424,424,439, \
+ 440,472,424,424,424,424,440,439,440,456,440,456,438,408,456,440, \
+ 424,440,424,456,464,488,456,424,456,456,424,439,424,472,472,479, \
+ 456,456,432,480,480,455,480,440,472,488,480,488,440,440,464,440, \
+ 488,439,488,488,488,488,456,487,488,488,488,456,432,487,504,488, \
+ 480,456,488,488,487,488,488,487,488,520,520,520,488,520,520,439, \
+ 480,472,480,479,456,487,488,488,496,487,472,488,488,520,520,488, \
+ 520,488,520,520,496,488,520,488,488,504,488,520,440,600,536,600, \
+ 456,520,536,536,600,600,568,567,600,600,568,599,600,600,600,599, \
+ 598,600,600,568,599,600,568,600,600,599,600,600,600,568,568,599, \
+ 600,600,600,600,599,600,600,599,600,599,600,600,599,599,600,599, \
+ 599,599,600,600,600,599,600,600,599,599,600,600,632,600,600,600, \
+ 664,599,600,600,600,600,600,600,631,632,632,632,600,632,632,599, \
+ 663,664,624,631,632,632,664,662,663,664,664,632,632,664,632,663, \
+ 664,631,664,662,662,664,664,662,664,663,664,663,663,663,664,664, \
+ 664,662,663,664,664,664,664,663,664,663,664,664,664,664,664,663, \
+ 664,632,663,664,664,663,664,664,664,631,664,663,696,696,696,664, \
+ 600,664,664,662,664,664,664,664,664,663,664,663,664,664,663,664, \
+ 664,663,664,664,632,664,664,663,664,663,664,663,664,664,728,663, \
+ 664,727,663,664,664,663,664,664,696,632,728,728,663,663,664,696, \
+ 664,664,696,728,664,664,728,728,696,663,664,663,728,664,664,655, \
+ 696,663,664,661,664,695,696,663,656,728,664,663,664,663,664,664, \
+ 696,664,663,663,664,695,696,664,664,695,696,662,664,663,664,663 \
#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,7,10,9,10,11,12,13, \
- 14,15,16,17,18,16,14,16,16,19,19,18,20,19,20,18, \
- 24,19,20,23,24,21,21,23,27,24,28,29,28,28,28,28, \
- 31,31,30,28,34,29,32,32,33,34,35,31,34,38,38,34, \
- 35,36,38,38,38,40,41,43,39,42,43,42,42,43,44,43, \
- 45,48,49,48,51,50,50,48,50,48,51,50,51,52,53,50, \
- 55,51,53,54,56,59,56,59,58,55,57,59,59,63,64,63, \
- 63,64,64,59,64,64,67,64,63,67,67,71,67,67,71,66, \
- 75,75,75,75,73,75,73,75,75,75,73,75,84,73,74,73, \
- 76,76,75,81,76,79,81,84,81,83,84,84,84,84,88,86, \
- 83,88,96,94,96,96,96,96,96,96,96,95,96,96,96,104, \
- 96,100,100,104,104,104,96,96,96,104,100,96,102,96,104,104, \
- 102,104,100,104,112,104,104,112,112,112,104,112,120,112,112,112, \
- 112,120,110,118,118,118,119,112,120,118,120,112,118,127,128,128, \
- 128,128,128,128,128,128,128,128,128,128,128,128,128,136,128,136, \
- 128,128,128,128,128,128,128,128,127,128,128,128,128,128,130,133, \
- 134,136,136,135,136,136,150,136,136,138,148,140,136,143,148,150, \
- 150,150,150,148,150,148,148,150,156,149,168,150,160,161,168,168, \
- 168,168,168,162,168,162,167,168,168,168,168,168,162,174,168,168, \
- 174,174,184,168,168,176,162,168,192,174,168,168,173,174,186,174, \
- 174,168,192,174,168,174,168,168,186,192,192,180,174,176,192,192, \
- 185,192,192,180,192,192,186,192,192,192,192,192,184,192,208,208, \
- 208,208,190,192,190,192,192,191,186,192,192,208,192,192,192,192, \
- 192,192,196,204,204,192,204,192,208,192,191,192,208,208,198,208, \
- 205,220,197,218,222,208,216,199,207,220,206,224,214,204,208,219, \
- 221,209,227,207,221,216,208,236,222,244,225,208,208,212,224,222, \
- 229,230,225,221,222,256,227,240,221,224,240,216,240,231,224,263, \
- 246,232,240,240,240,240,239,240,240,234,234,240,234,238,240,240, \
- 240,240,256,256,240,256,240,240,240,234,256,240,240,256,234,256, \
- 256,239,272,244,256,255,256,240,256,240,256,255,240,255,256,256, \
- 256,254,254,256,244,256,256,256,256,256,256,256,256,253,272,255, \
- 256,256,252,256,256,256,256,256,256,272,256,256,256,256,257,272, \
- 272,272,272,272,264,270,272,288,272,280,282,282,280,280,270,282, \
- 282,282,288,282,288,282,282,300,286,288,300,282,282,288,300,312, \
- 300,298,306,300,304,304,304,300,300,300,316,306,300,288,306,311, \
- 324,312,320,300,306,336,320,300,324,320,336,336,336,328,336,324, \
- 336,336,328,336,322,328,336,336,336,336,312,336,336,336,336,336, \
- 336,336,336,335,336,344,348,336,353,349,336,336,348,348,346,336, \
- 352,320,336,336,336,336,352,336,336,336,336,336,336,336,336,336, \
- 336,336,336,330,336,336,336,336,334,335,336,336,344,344,348,336, \
- 348,336,352,336,336,348,336,348,336,348,352,351,348,336,336,336, \
- 352,352,352,348,352,336,336,384,336,336,352,348,336,348,376,352, \
- 352,372,384,352,384,352,352,352,348,384,348,349,384,351,384,353, \
- 368,352,350,353,378,372,372,372,384,352,384,352,408,384,378,368, \
- 383,384,408,356,371,368,372,371,384,376,384,408,384,407,372,384, \
- 408,369,406,383,377,384,394,382,370,416,408,378,369,372,381,400, \
- 378,408,376,402,417,408,376,384,382,384,384,408,384,384,384,408, \
- 384,416,408,408,416,384,384,384,408,384,384,384,396,408,408,408, \
- 408,408,408,406,408,408,416,416,408,408,408,408,408,416,408,416, \
- 408,405,416,408,408,440,408,416,416,416,440,408,408,408,440,444, \
- 408,440,440,408,415,419,440,440,444,443,436,436,440,447,448,440, \
- 440,416,440,439,440,444,440,444,468,448,440,416,440,416,465,465, \
- 468,436,468,440,472,439,440,468,472,448,465,468,464,439,440,480, \
- 480,472,439,468,440,440,468,440,468,468,444,440,448,480,438,440, \
- 504,439,440,467,480,468,448,465,466,440,468,464,440,472,448,468, \
- 468,469,456,465,448,460,472,472,468,469,465,480,480,468,472,512, \
- 468,464,465,469,480,468,504,466,468,480,480,480,468,512,504,469, \
- 466,466,472,468,480,480,512,469,472,480,480,480,504,477,500,466, \
- 504,468,480,512,504,512,504,480,480,511,512,510,492,511,503,513, \
- 503,502,504,512,504,512,504,512,504,512,504,512,513,503,512,504, \
- 513,504,512,512,510,501,513,503,512,513,498,504,512,510,502,512, \
- 501,500,552,497,516,511,503,513,497,511,502,509,564,509,504,512, \
- 503,504,512,504,504,500,512,512,512,511,512,504,557,504,564,564, \
- 512,564,514,512,516,512,560,564,560,564,564,512,564,564,564,560 \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,0,0,0,20,23,23,23,23,24,23,24,25,27,27, /*32-47*/ \
+ 27,27,31,29,32,29,30,30,32,31,33,31,35,35,36,35, /*48-63*/ \
+ 36,36,42,42,37,41,41,45,42,42,46,43,44,45,42,45, /*64-79*/ \
+ 44,45,49,47,46,49,50,54,50,56,51,56,56,58,54,56, /*80-95*/ \
+ 60,54,56,59,55,58,54,56,63,60,62,56,60,66,64,66, /*96-111*/ \
+ 63,62,67,68,62,66,64,68,68,72,67,70,67,68,66,67, /*112-127*/ \
+ 70,68,74,83,72,70,83,76,84,84,83,84,84,84,82,82, /*128-143*/ \
+ 84,84,84,87,84,84,84,82,84,84,84,86,84,88,91,92, /*144-159*/ \
+ 88,98,99,84,88,91,90,104,87,99,96,94,100,100,92,94, /*160-175*/ \
+ 92,92,112,105,100,104,100,100,104,104,104,104,112,112,104,105, /*176-191*/ \
+ 99,112,112,103,104,111,112,112,104,104,112,112,111,112,112,112, /*192-207*/ \
+ 111,111,112,128,112,128,111,112,116,120,120,116,120,118,118,128, /*208-223*/ \
+ 127,128,128,120,136,136,136,128,135,136,136,132,136,130,128,136, /*224-239*/ \
+ 128,136,136,136,126,136,136,136,135,136,136,136,136,136,136,136, /*240-255*/ \
+ 136,136,136,136,144,148,168,136,144,136,168,143,142,144,150,143, /*256-271*/ \
+ 168,168,143,168,167,167,168,176,176,166,168,171,168,168,172,168, /*272-287*/ \
+ 168,176,168,167,168,176,176,176,176,168,176,176,176,172,176,175, /*288-303*/ \
+ 176,176,175,176,176,176,174,175,176,168,168,167,168,168,168,183, /*304-319*/ \
+ 175,176,176,176,168,176,176,173,176,175,176,176,174,175,175,171, /*320-335*/ \
+ 176,184,198,176,176,184,175,175,208,186,186,198,208,184,186,177, /*336-351*/ \
+ 208,208,208,209,207,208,209,184,192,197,208,184,192,208,192,208, /*352-367*/ \
+ 224,192,222,198,208,196,198,198,210,207,222,216,208,222,222,222, /*368-383*/ \
+ 198,198,210,207,224,208,222,222,224,208,224,222,224,224,222,208, /*384-399*/ \
+ 210,216,222,222,208,216,222,222,208,224,224,224,222,224,224,228, /*400-415*/ \
+ 224,223,224,224,240,224,240,222,248,224,224,222,240,256,240,224, /*416-431*/ \
+ 256,257,222,255,224,228,224,256,240,256,240,255,256,255,256,240, /*432-447*/ \
+ 256,255,256,257,256,252,256,256,256,256,256,256,264,256,255,256, /*448-463*/ \
+ 257,272,256,255,272,270,256,256,272,256,240,257,288,272,252,254, /*464-479*/ \
+ 257,256,256,257,256,270,272,255,256,256,267,256,256,255,254,256, /*480-495*/ \
+ 255,256,257,268,264,269,256,255,256,256,288,256,269,270,267,336, /*496-511*/ \
+ 272,272,272,267,270,264,272,269,288,270,288,288,288,272,272,337, /*512-527*/ \
+ 288,336,336,335,288,352,336,334,286,344,288,296,344,288,288,293, /*528-543*/ \
+ 288,304,336,336,336,336,336,336,336,288,336,336,304,352,352,336, /*544-559*/ \
+ 336,336,336,336,336,336,336,336,336,343,344,340,336,335,336,336, /*560-575*/ \
+ 336,336,336,336,342,336,336,336,336,344,352,336,342,335,336,335, /*576-591*/ \
+ 336,352,344,344,352,352,352,344,352,352,336,351,350,352,352,352, /*592-607*/ \
+ 352,352,341,336,352,335,336,336,352,335,336,344,336,336,334,336, /*608-623*/ \
+ 336,343,336,344,344,344,352,344,352,336,344,335,352,343,351,344, /*624-639*/ \
+ 344,341,342,352,344,351,352,336,352,336,352,344,336,336,341,344, /*640-655*/ \
+ 336,336,344,336,352,336,352,342,352,344,344,344,347,344,344,341, /*656-671*/ \
+ 344,352,353,352,352,351,352,359,352,351,352,352,352,352,352,352, /*672-687*/ \
+ 352,349,350,351,352,367,368,352,357,352,352,352,360,352,353,353, /*688-703*/ \
+ 391,408,408,360,368,388,384,368,392,408,400,416,416,384,392,367, /*704-719*/ \
+ 384,408,408,416,408,408,408,392,392,416,416,408,416,415,408,415, /*720-735*/ \
+ 416,416,412,408,414,420,448,417,408,408,416,408,408,413,416,408, /*736-751*/ \
+ 416,408,415,415,416,431,416,416,416,392,448,415,416,432,416,444, /*752-767*/ \
+ 416,448,408,416,416,416,408,408,448,444,416,416,416,416,408,416, /*768-783*/ \
+ 408,448,414,415,416,417,418,448,444,416,416,406,416,416,414,432, /*784-799*/ \
+ 448,448,416,416,432,448,416,432,448,444,438,448,448,416,448,416, /*800-815*/ \
+ 444,448,444,448,416,432,416,416,416,432,416,448,448,416,432,448, /*816-831*/ \
+ 444,448,444,448,447,466,448,432,432,448,448,432,448,448,440,444, /*832-847*/ \
+ 454,432,448,480,438,447,504,432,448,448,448,448,448,447,448,447, /*848-863*/ \
+ 448,446,448,444,443,448,444,448,446,448,448,503,536,448,448,448, /*864-879*/ \
+ 448,448,448,448,448,447,450,448,514,448,512,480,448,512,480,454, /*880-895*/ \
+ 512,500,504,476,480,536,536,536,504,536,480,504,504,480,536,504, /*896-911*/ \
+ 480,504,504,504,480,504,512,480,480,512,480,512,512,480,478,536, /*912-927*/ \
+ 480,489,504,513,536,504,511,479,480,480,534,511,511,512,536,512, /*928-943*/ \
+ 512,504,504,504,504,504,504,512,511,509,512,512,504,511,544,504, /*944-959*/ \
+ 544,504,512,544,544,536,512,504,543,511,512,513,540,511,511,504, /*960-975*/ \
+ 544,511,508,504,512,536,536,504,504,512,536,544,504,544,512,536, /*976-991*/ \
+ 535,512,512,541,504,536,536,536,536,504,544,511,544,511,544,512, /*992-1007*/ \
+ 511,512,544,514,544,535,544,544,544,536,536,536,536,536,544,544 /*1008-1023*/ \
-#define MPFR_MUL_THRESHOLD 15 /* limbs */
-#define MPFR_SQR_THRESHOLD 14 /* limbs */
-#define MPFR_DIV_THRESHOLD 27 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 562 /* bits */
-#define MPFR_EXP_THRESHOLD 9671 /* bits */
-#define MPFR_SINCOS_THRESHOLD 30620 /* bits */
-#define MPFR_AI_THRESHOLD1 -28021 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 2991
-#define MPFR_AI_THRESHOLD3 37474
-/* Tuneup completed successfully, took 6469 seconds */
+#define MPFR_MUL_THRESHOLD 13 /* limbs */
+#define MPFR_SQR_THRESHOLD 18 /* limbs */
+#define MPFR_DIV_THRESHOLD 3 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 522 /* bits */
+#define MPFR_EXP_THRESHOLD 6920 /* bits */
+#define MPFR_SINCOS_THRESHOLD 28160 /* bits */
+#define MPFR_AI_THRESHOLD1 -24100 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 2303
+#define MPFR_AI_THRESHOLD3 37484
+/* Tuneup completed successfully, took 787 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/x86_64/core2/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/x86_64/core2/mparam.h
index 0726481684a..340114c0bc4 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/x86_64/core2/mparam.h
+++ b/Build/source/libs/mpfr/mpfr-src/src/x86_64/core2/mparam.h
@@ -1,6 +1,6 @@
/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
This file is part of the GNU MPFR Library.
@@ -19,218 +19,214 @@ along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-/* Generated by MPFR's tuneup.c, 2011-07-31, gcc 4.3.2 */
-/* gcc14.fsffrance.org (Intel(R) Xeon(R) CPU X5450 @ 3.00GHz) with gmp 5.0.2 */
-
-/* very similar timings were obtained on 2012-01-25 with gcc 4.1.3
- on gcc70.fsffrance.org (Intel(R) Xeon(TM) CPU 3.20GHz) with gmp 5.0.2,
- where GMP defines -mtune=nocona, thus we share the parameters */
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 6.3.0 */
+/* gcc14.fsffrance.org (Intel(R) Xeon(R) CPU X5450 @ 3.00GHz) with gmp 6.1.2 */
#define MPFR_MULHIGH_TAB \
- -1,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,9, \
- 10,10,12,12,13,13,13,13,14,16,16,17,18,19,20,24, \
- 24,24,24,24,26,26,26,26,28,28,28,30,30,32,32,28, \
- 28,30,30,32,32,32,32,32,32,32,32,34,36,48,38,36, \
- 40,46,48,48,48,48,48,48,48,48,48,48,48,56,56,56, \
- 56,48,48,48,56,60,60,60,64,64,56,56,56,60,60,60, \
- 64,69,64,64,64,69,69,69,69,69,69,69,64,64,75,81, \
- 81,80,80,80,81,81,81,81,81,81,87,81,87,87,92,93, \
- 92,87,93,92,87,90,93,92,93,92,90,93,92,93,92,93, \
- 92,93,93,93,104,93,99,93,99,104,105,104,105,104,105,104, \
- 111,104,111,110,104,117,117,117,117,117,117,104,105,141,141,140, \
- 141,141,141,141,141,141,141,141,141,141,141,141,141,140,141,141, \
- 141,141,141,141,141,141,141,141,140,141,141,141,141,138,140,141, \
- 141,141,140,141,141,141,141,141,141,141,141,141,165,141,153,141, \
- 153,165,188,188,188,188,188,188,188,188,188,188,188,188,188,188, \
- 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, \
- 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,188, \
- 188,188,204,204,188,203,188,188,204,204,188,188,216,220,220,220, \
- 220,204,204,220,220,220,220,220,220,220,220,220,220,220,220,220, \
- 220,220,220,235,236,219,220,220,236,236,236,236,236,236,236,236, \
- 236,236,236,236,236,236,236,282,282,282,282,282,282,282,282,282, \
- 282,282,282,282,282,282,282,282,282,281,282,280,282,282,282,282, \
- 282,282,282,282,282,282,282,281,281,282,281,281,282,282,282,282, \
- 282,282,282,282,282,282,282,282,282,282,282,281,282,280,281,282, \
- 282,282,282,282,306,282,306,330,330,306,281,330,282,282,330,330, \
- 330,282,330,329,330,330,330,330,330,330,330,330,330,330,330,330, \
- 330,330,330,330,330,330,330,330,330,330,354,354,330,330,330,329, \
- 330,330,330,330,330,330,330,329,330,330,354,354,330,330,330,330, \
- 330,330,378,330,354,330,354,354,354,354,354,377,378,354,354,354, \
- 378,354,378,378,354,353,354,378,354,378,378,377,378,378,378,408, \
- 408,408,378,408,408,408,378,416,408,408,377,378,378,408,408,407, \
- 408,408,408,408,408,408,408,440,408,440,440,440,439,440,440,440, \
- 432,439,440,440,440,439,440,440,440,439,440,439,440,439,440,440, \
- 440,440,440,439,440,440,440,440,440,439,440,440,440,440,439,440, \
- 440,440,440,439,471,440,440,440,440,440,440,439,440,440,440,440, \
- 440,440,440,440,440,440,472,440,440,439,440,440,440,439,440,440, \
- 440,472,439,440,440,440,472,440,471,472,472,472,472,472,472,471, \
- 471,472,471,472,472,472,504,504,504,504,504,504,504,504,472,471, \
- 472,472,504,472,471,472,504,504,504,504,504,503,504,504,504,504, \
- 504,503,504,504,504,504,503,504,504,504,504,504,503,504,504,504, \
- 504,504,503,504,504,504,504,504,504,504,504,504,504,504,504,504, \
- 504,504,504,504,544,544,544,544,544,544,544,544,544,544,544,544, \
- 542,543,544,544,544,544,544,544,544,544,544,544,544,544,544,544, \
- 543,544,544,544,544,544,544,544,544,544,544,544,544,544,544,544, \
- 544,592,544,544,592,592,544,592,592,591,592,592,632,631,592,592, \
- 592,592,592,592,592,640,640,640,640,640,616,616,616,616,616,616, \
- 632,592,616,616,632,630,631,632,632,632,616,632,640,632,632,640, \
- 640,640,640,640,640,640,639,640,632,632,639,640,640,640,632,632, \
- 640,639,640,640,632,640,640,640,640,640,640,640,640,640,640,640, \
- 640,640,640,640,640,640,632,640,640,640,640,640,640,640,640,640, \
- 640,640,640,640,640,640,640,640,640,640,632,688,640,640,632,632, \
- 640,640,640,640,639,640,640,640,688,632,687,640,712,688,640,640, \
- 640,640,640,712,640,640,640,712,736,640,640,640,711,712,736,736, \
- 640,640,688,712,712,712,712,712,728,736,728,728,736,736,736,736, \
- 736,736,736,736,734,736,728,736,736,736,728,736,736,736,736,736, \
- 736,736,736,736,735,712,736,736,736,712,736,736,736,736,736,736, \
- 736,736,736,712,736,736,712,736,728,712,736,712,736,736,736,736, \
- 728,712,736,736,735,736,736,736,735,736,736,736,736,735,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,734,736,736, \
- 736,736,735,736,736,736,735,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,735,736, \
- 736,736,736,736,736,736,736,736,736,736,736,736,736,736,736,736, \
- 824,824,832,832,832,832,824,832,832,832,832,832,824,831,832,832 \
+ -1,0,-1,0,0,0,0,0,0,0,0,0,9,9,9,9, \
+ 10,10,11,12,13,12,13,14,15,16,17,18,17,18,19,20, \
+ 23,24,24,24,24,26,26,28,28,24,24,24,28,30,28,28, \
+ 32,32,30,32,32,34,36,36,36,34,38,38,40,38,40,40, \
+ 48,48,46,48,48,48,48,48,48,48,48,48,48,52,56,56, \
+ 56,56,56,56,56,60,60,60,64,56,56,64,64,60,60,60, \
+ 64,64,64,64,75,64,75,64,64,69,75,75,64,81,84,84, \
+ 80,81,81,80,81,81,81,84,87,87,87,87,84,92,87,81, \
+ 81,90,93,92,93,93,87,90,90,93,92,93,93,93,92,93, \
+ 92,93,104,93,105,93,99,105,105,104,105,108,105,105,108,105, \
+ 105,108,110,111,111,110,111,114,117,114,117,116,105,117,116,117, \
+ 141,141,141,141,141,141,141,141,140,141,141,141,141,141,141,141, \
+ 140,141,141,141,141,141,141,141,141,140,141,141,141,153,140,140, \
+ 141,141,141,141,141,141,165,165,165,165,165,153,165,165,165,165, \
+ 153,165,165,165,165,177,165,188,165,165,188,165,165,188,165,165, \
+ 188,188,165,188,188,188,188,188,188,188,188,188,188,188,186,188, \
+ 188,188,188,188,188,188,188,188,188,188,188,188,188,188,188,204, \
+ 204,188,204,204,204,204,204,202,204,204,204,204,220,220,220,208, \
+ 203,204,204,220,220,220,220,220,220,220,220,220,220,220,220,220, \
+ 220,220,220,236,236,236,236,236,236,236,236,236,236,236,236,236, \
+ 236,236,236,236,236,236,236,236,236,236,236,282,282,282,282,282, \
+ 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282, \
+ 282,282,282,282,282,282,282,282,282,282,282,282,282,282,282,282, \
+ 282,282,282,282,282,282,282,282,281,282,306,282,282,282,306,282, \
+ 282,282,330,329,330,330,330,330,306,330,306,330,306,306,330,306, \
+ 306,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330, \
+ 330,330,330,330,329,330,330,330,330,330,360,360,330,330,360,360, \
+ 360,330,360,360,360,360,360,360,360,360,360,360,368,368,360,376, \
+ 376,376,368,376,368,376,376,376,376,376,376,376,376,376,368,368, \
+ 376,376,376,376,376,376,375,376,376,376,376,376,368,368,376,376, \
+ 408,408,408,408,408,376,408,408,376,375,376,439,376,440,440,376, \
+ 408,376,376,376,376,376,408,376,440,440,440,440,440,440,440,440, \
+ 440,440,432,432,440,440,440,440,440,440,439,440,440,440,440,439, \
+ 439,440,408,440,440,440,439,440,440,440,440,440,440,440,472,440, \
+ 440,472,472,440,440,440,440,440,440,440,440,439,440,440,440,440, \
+ 440,440,440,440,440,439,440,440,440,440,440,440,440,440,440,440, \
+ 440,440,440,440,440,472,439,440,440,440,472,472,472,472,472,472, \
+ 472,470,472,472,504,471,472,472,480,472,472,472,472,472,472,503, \
+ 472,472,472,472,472,472,472,472,504,503,504,504,504,504,504,504, \
+ 472,504,504,504,504,504,504,504,504,504,504,504,504,496,504,504, \
+ 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
+ 504,504,504,504,504,504,504,504,544,544,544,544,544,544,544,544, \
+ 544,536,544,544,544,544,544,544,544,544,544,544,544,544,544,544, \
+ 544,544,544,544,544,544,544,544,544,544,592,592,592,592,592,592, \
+ 591,592,592,591,592,592,568,568,592,591,592,592,592,592,592,640, \
+ 592,592,592,592,592,592,592,592,592,592,592,591,592,592,592,592, \
+ 592,592,592,624,624,623,630,631,632,632,632,632,632,592,632,639, \
+ 640,640,640,639,640,640,640,640,640,632,640,632,632,632,632,632, \
+ 640,632,632,639,632,632,632,640,639,640,640,640,664,664,640,640, \
+ 640,640,640,664,664,664,664,664,664,664,640,663,640,640,664,664, \
+ 640,664,640,664,664,664,664,664,640,664,688,688,688,687,688,688, \
+ 680,640,664,664,664,664,688,664,664,688,664,688,640,664,664,664, \
+ 639,688,640,640,640,640,712,640,711,712,712,736,688,712,712,712, \
+ 736,664,664,664,688,664,664,664,728,664,728,728,728,728,736,736, \
+ 736,735,736,736,736,736,728,728,735,736,736,736,736,736,736,736, \
+ 735,736,735,736,728,736,736,728,728,735,736,735,736,736,736,736, \
+ 736,736,735,736,735,736,736,735,736,728,728,728,728,736,736,735, \
+ 735,736,736,736,736,736,736,728,735,736,736,736,736,736,736,736, \
+ 735,736,736,736,736,736,736,736,736,736,736,736,736,735,734,736, \
+ 736,735,736,736,736,736,736,736,735,736,736,735,736,736,735,735, \
+ 736,736,736,784,736,735,784,784,784,784,736,736,824,783,736,735, \
+ 783,784,784,736,784,824,784,784,784,784,784,784,832,736,735,832, \
+ 824,784,736,736,824,736,824,784,784,784,784,832,832,784,824,824, \
+ 824,856,822,824,824,824,824,824,824,824,824,824,824,824,824,824 \
#define MPFR_SQRHIGH_TAB \
- -1,0,0,0,0,0,0,5,6,6,7,8,8,8,10,9, \
- 10,11,11,11,12,13,13,13,14,16,16,17,17,17,17,17, \
- 18,19,20,21,20,23,24,21,26,23,23,24,24,24,25,28, \
- 26,28,28,34,32,34,32,32,34,34,32,34,34,34,34,34, \
- 34,36,40,38,38,36,42,42,40,40,40,40,42,42,42,42, \
- 46,42,48,48,48,46,52,52,52,52,52,52,56,56,56,56, \
- 64,56,64,64,64,64,68,56,64,64,64,68,63,64,64,68, \
- 68,68,68,68,64,68,68,68,72,64,68,68,68,64,67,68, \
- 68,68,68,68,68,68,72,84,80,72,72,72,72,72,76,76, \
- 76,76,80,80,76,76,80,84,80,80,80,84,84,84,84,84, \
- 84,84,84,96,84,84,92,92,96,96,96,99,92,92,92,95, \
- 96,105,111,105,104,105,104,104,105,105,105,105,104,105,104,105, \
- 99,114,105,116,117,117,117,123,117,123,116,123,116,111,123,123, \
- 123,123,123,123,123,117,117,117,123,123,123,117,123,117,123,123, \
- 123,123,123,123,117,123,123,123,156,123,123,141,123,123,135,135, \
- 123,148,123,141,141,156,156,129,156,163,156,164,156,156,156,135, \
- 156,141,155,164,156,156,164,148,148,147,141,164,164,164,164,156, \
- 164,164,164,164,163,164,164,164,164,164,164,164,164,164,164,164, \
- 164,156,164,164,156,164,164,164,188,163,164,164,164,164,187,188, \
- 180,164,204,204,164,188,196,188,188,204,196,180,196,204,188,196, \
- 220,187,204,220,204,180,220,220,204,204,196,204,220,204,220,220, \
- 220,220,204,220,220,220,220,220,220,220,220,220,220,220,220,220, \
- 252,220,220,220,220,220,252,220,252,220,220,220,220,252,252,252, \
- 252,252,252,252,252,252,252,252,252,252,252,252,267,268,252,252, \
- 252,250,252,252,252,268,251,252,268,252,268,268,268,252,252,252, \
- 265,268,268,268,268,268,268,268,268,268,268,268,268,268,268,268, \
- 268,267,268,268,268,267,268,268,268,267,268,268,268,268,268,268, \
- 268,268,252,268,252,268,268,268,268,268,268,265,268,268,268,268, \
- 268,268,268,268,268,268,268,268,268,268,268,268,265,268,268,268, \
- 252,268,268,266,268,268,268,328,265,282,312,268,268,268,268,268, \
- 268,268,268,268,268,268,268,311,310,282,282,294,312,282,281,294, \
- 282,268,312,312,268,311,312,268,268,312,268,312,312,268,312,327, \
- 268,312,328,268,328,268,328,328,328,312,328,312,327,328,328,312, \
- 327,328,328,327,325,327,327,359,328,328,327,328,328,328,328,328, \
- 311,328,360,360,360,360,360,360,360,360,360,360,328,360,360,360, \
- 328,312,328,360,327,328,328,359,360,328,359,328,312,360,360,327, \
- 312,408,328,440,328,328,328,328,328,392,328,328,408,408,408,392, \
- 407,408,408,408,392,407,408,408,407,407,408,408,408,392,408,408, \
- 407,408,392,408,408,440,406,408,408,408,440,408,408,408,440,440, \
- 440,440,440,392,440,392,440,440,440,440,440,440,440,440,440,440, \
- 408,392,440,440,440,438,439,440,440,440,440,440,440,439,440,439, \
- 440,440,440,504,408,504,408,408,408,472,408,408,407,408,440,439, \
- 439,440,440,440,440,440,440,440,437,440,440,440,439,504,503,504, \
- 504,503,504,504,440,502,504,503,503,504,504,503,504,504,504,504, \
- 504,503,504,504,499,503,502,504,504,536,502,504,504,504,536,504, \
- 504,504,503,504,504,503,536,504,502,536,503,504,504,504,536,536, \
- 504,504,504,536,536,535,504,536,535,504,504,504,504,504,504,536, \
- 536,536,503,536,504,503,536,536,504,535,536,536,504,535,520,536, \
- 504,504,504,536,535,536,520,536,535,520,536,535,535,536,536,535, \
- 504,536,536,535,536,535,535,536,536,536,536,536,535,504,536,536, \
- 536,536,536,536,536,536,536,536,536,535,536,536,536,535,504,536, \
- 536,536,536,536,504,535,536,536,536,535,535,536,536,536,536,536, \
- 536,535,536,504,536,535,536,536,536,536,536,504,504,536,504,535, \
- 536,504,536,535,536,504,504,504,536,536,504,536,504,536,504,536, \
- 536,504,535,536,632,535,536,536,535,536,536,536,536,536,632,632, \
- 536,631,536,536,535,536,536,536,536,535,536,536,536,631,632,632, \
- 536,536,630,535,536,536,600,632,631,600,536,536,536,536,535,632, \
- 536,598,536,600,536,631,600,568,632,568,568,568,568,568,664,566, \
- 568,568,632,632,664,568,664,663,632,629,632,535,600,536,536,536, \
- 632,536,536,599,536,630,536,632,631,632,600,600,600,664,600,664, \
- 664,632,600,599,664,600,662,663,664,599,598,616,632,625,632,630, \
- 628,627,630,631,632,663,632,631,632,630,632,631,632,626,632,632, \
- 632,663,631,631,632,632,632,664,632,632,600,632,632,600,632,632, \
- 600,600,632,632,632,662,663,663,663,600,664,632,664,663,664,632 \
+ -1,-1,-1,-1,-1,-1,-1,-1,6,6,7,7,8,9,9,9, \
+ 10,10,11,12,13,14,13,14,15,16,17,17,17,18,20,20, \
+ 21,22,19,19,20,21,24,25,22,22,23,24,24,25,26,27, \
+ 26,27,27,27,34,34,30,34,34,34,34,34,38,38,38,38, \
+ 38,42,40,40,44,46,44,38,40,46,42,42,44,44,46,46, \
+ 46,48,48,48,48,48,50,48,48,50,48,48,50,60,60,60, \
+ 50,60,52,60,60,60,60,60,60,64,68,64,64,68,64,64, \
+ 68,64,64,68,68,68,68,72,68,68,76,76,76,76,76,76, \
+ 76,80,80,80,80,80,80,80,80,76,80,84,84,88,84,84, \
+ 76,80,76,80,80,84,80,84,84,84,88,88,88,92,91,92, \
+ 92,92,96,96,96,88,92,92,92,92,96,96,96,92,96,96, \
+ 95,105,96,110,111,111,117,111,117,117,117,117,117,117,117,123, \
+ 123,117,123,117,117,117,117,117,116,129,135,129,123,135,135,123, \
+ 123,129,129,135,135,135,134,135,129,135,140,135,140,141,141,141, \
+ 141,141,141,141,141,141,141,141,140,141,140,140,141,141,141,141, \
+ 141,140,147,140,141,141,141,153,147,153,147,147,172,141,140,141, \
+ 140,164,172,164,171,164,172,172,141,141,172,180,180,188,180,180, \
+ 180,180,188,180,188,188,188,188,187,188,188,180,188,172,188,188, \
+ 187,188,187,188,188,180,172,180,180,196,179,180,188,188,188,187, \
+ 188,188,186,185,188,188,188,188,188,196,188,188,188,196,188,188, \
+ 188,188,188,196,195,188,188,188,196,196,187,188,188,188,188,196, \
+ 195,195,195,196,195,196,204,204,212,212,204,188,196,196,196,204, \
+ 212,212,212,212,212,204,234,234,234,258,234,246,234,246,234,234, \
+ 246,246,246,234,246,258,258,246,246,234,258,258,258,258,258,246, \
+ 258,270,258,258,258,258,258,270,258,270,257,258,270,258,258,270, \
+ 270,282,270,282,282,270,282,281,282,282,282,282,282,282,282,282, \
+ 282,282,270,282,282,282,282,282,282,282,282,282,282,282,282,282, \
+ 282,282,282,282,282,282,282,282,282,282,282,282,282,282,312,312, \
+ 282,312,312,312,312,312,312,312,312,328,312,282,282,328,282,270, \
+ 282,282,328,282,328,328,328,328,282,328,344,282,282,282,328,344, \
+ 328,344,344,344,344,360,344,344,360,344,360,344,344,344,344,344, \
+ 344,360,360,344,344,360,360,344,344,360,344,344,360,360,360,360, \
+ 360,360,328,360,328,360,328,344,360,328,328,360,344,360,360,344, \
+ 360,360,344,360,344,344,360,344,360,344,344,344,344,360,344,344, \
+ 360,360,360,359,360,360,360,360,360,360,360,360,360,360,359,360, \
+ 360,360,360,360,360,360,359,359,360,360,360,344,360,360,360,360, \
+ 360,360,360,360,360,360,360,360,391,360,392,360,360,359,360,359, \
+ 360,360,360,360,360,360,360,360,360,360,359,360,360,360,424,424, \
+ 423,424,424,424,472,424,472,424,424,424,424,424,424,471,472,472, \
+ 424,472,472,424,472,472,472,472,472,424,424,472,472,424,424,472, \
+ 472,424,472,472,472,472,472,472,472,472,472,471,472,472,472,472, \
+ 472,472,472,472,472,472,471,472,471,472,472,472,472,472,472,472, \
+ 472,471,472,472,472,504,504,472,472,472,472,472,504,504,472,504, \
+ 472,504,504,504,472,504,504,472,472,472,471,472,472,472,472,471, \
+ 472,472,472,472,472,472,472,472,472,472,471,472,472,504,504,472, \
+ 472,504,472,536,472,472,471,472,472,472,536,472,472,536,536,536, \
+ 536,536,536,536,504,504,504,536,536,504,536,536,504,536,504,504, \
+ 536,504,568,504,568,568,568,568,568,568,568,568,568,568,568,568, \
+ 568,567,568,536,568,536,568,568,568,536,568,568,536,536,536,536, \
+ 536,568,536,536,536,536,568,536,536,568,536,536,568,536,536,568, \
+ 568,568,568,568,568,568,568,568,568,568,567,568,568,568,568,568, \
+ 568,568,568,568,568,568,567,568,567,568,568,600,600,568,568,568, \
+ 568,600,600,568,600,600,568,600,600,600,568,600,600,600,600,600, \
+ 600,600,600,600,600,632,599,600,600,600,600,600,600,600,600,600, \
+ 632,600,568,600,568,600,568,568,632,568,631,600,568,568,568,568, \
+ 632,632,632,632,624,632,631,600,624,632,632,600,600,632,632,632, \
+ 600,600,600,600,600,600,632,600,632,600,600,600,664,664,632,664, \
+ 664,600,568,600,664,568,600,664,568,568,600,600,568,632,632,632, \
+ 599,600,568,600,632,632,632,632,600,600,568,600,600,632,632,600, \
+ 600,632,599,600,600,632,599,600,600,600,600,600,600,600,664,600, \
+ 600,664,600,664,632,696,696,696,696,696,696,696,695,696,696,695, \
+ 696,696,632,632,632,632,632,632,632,632,632,632,632,632,632,631, \
+ 632,632,632,632,632,631,728,728,632,632,696,632,696,696,696,664, \
+ 696,696,696,664,662,664,664,664,664,664,664,664,664,664,664,664 \
#define MPFR_DIVHIGH_TAB \
- 0,1,2,3,4,5,6,7,8,9,10,11,12,13,12,13, \
- 14,15,16,13,14,14,14,15,15,17,17,17,19,19,19,19, \
- 23,23,19,25,23,25,23,25,25,22,26,28,25,28,25,25, \
- 28,27,31,27,29,28,33,31,32,33,31,32,33,33,35,35, \
- 35,39,37,43,39,37,39,41,39,40,39,40,41,45,41,47, \
- 45,45,47,43,44,45,50,54,49,46,53,47,55,56,52,55, \
- 52,60,60,52,60,64,62,55,55,62,55,58,56,64,61,59, \
- 63,63,64,59,60,60,63,64,64,63,64,64,68,68,66,66, \
- 68,69,71,71,70,71,71,72,78,74,74,71,72,78,78,74, \
- 76,77,78,79,78,80,79,79,84,83,80,80,82,95,96,83, \
- 92,92,88,91,92,84,95,95,92,96,94,91,94,92,96,94, \
- 96,96,96,104,94,94,112,112,104,112,112,112,96,112,112,112, \
- 112,112,110,104,112,112,112,111,112,108,110,120,112,112,112,112, \
- 112,112,120,112,120,120,112,120,120,120,120,120,128,120,120,116, \
- 128,128,124,128,120,128,128,120,120,120,128,120,128,120,124,128, \
- 128,128,128,127,128,128,126,128,128,128,128,127,136,128,138,137, \
- 137,135,138,138,138,137,135,138,150,150,138,147,150,138,150,150, \
- 150,150,160,160,156,150,156,148,150,158,162,160,161,160,150,160, \
- 160,160,168,156,156,160,168,173,162,156,180,160,160,157,168,160, \
- 160,160,162,168,168,160,184,162,184,162,160,160,174,160,184,180, \
- 184,184,180,184,184,186,180,184,184,184,184,184,186,188,188,192, \
- 185,184,184,186,192,192,192,186,182,192,192,185,184,184,192,208, \
- 192,184,184,180,192,184,192,186,186,184,192,186,186,191,186,185, \
- 192,216,192,192,208,192,191,192,192,192,204,192,207,192,216,208, \
- 208,216,216,197,196,216,216,208,216,222,216,222,208,222,208,222, \
- 224,208,209,216,216,209,224,207,216,222,224,224,208,223,224,224, \
- 224,216,222,222,224,224,224,216,224,216,222,221,222,224,224,224, \
- 224,224,224,232,224,222,224,232,225,233,224,240,224,232,256,240, \
- 256,256,240,255,240,256,256,240,232,240,232,232,240,232,256,256, \
- 256,256,256,256,256,256,255,256,256,240,256,240,256,240,254,252, \
- 256,256,256,256,256,256,256,256,254,256,256,282,276,256,254,256, \
- 256,255,282,256,255,256,255,256,255,288,256,264,264,256,274,276, \
- 276,269,273,273,282,269,276,276,276,276,273,282,276,282,276,277, \
- 280,312,282,281,288,282,276,282,276,276,288,312,276,288,300,276, \
- 304,276,288,300,304,312,312,312,312,312,306,312,312,312,316,300, \
- 324,312,320,320,300,312,312,312,312,324,312,330,300,320,312,312, \
- 316,318,324,324,318,312,312,324,336,336,324,312,312,336,324,320, \
- 312,336,312,324,336,336,336,368,324,348,312,336,368,312,312,320, \
- 368,372,368,312,324,376,372,312,368,376,376,372,370,372,318,376, \
- 320,372,372,368,372,324,376,376,376,376,368,372,376,376,376,376, \
- 372,372,376,376,376,372,384,376,372,368,384,376,376,370,376,376, \
- 376,371,372,368,384,336,370,370,376,372,376,376,368,376,376,372, \
- 376,370,376,368,376,372,376,376,368,376,376,368,368,376,368,368, \
- 370,370,372,368,372,376,376,376,376,368,370,368,368,372,376,376, \
- 372,376,368,376,376,376,372,376,376,372,376,376,368,376,372,376, \
- 372,368,376,370,376,372,376,372,376,376,372,370,376,376,370,372, \
- 372,373,376,376,384,384,384,376,376,376,376,384,376,376,384,384, \
- 384,416,384,384,408,384,416,384,384,384,384,408,416,416,416,432, \
- 408,408,416,408,408,416,408,416,416,416,416,416,416,408,407,440, \
- 432,408,416,408,416,440,416,408,416,416,432,416,416,440,416,416, \
- 416,440,432,440,408,448,448,408,408,432,440,432,448,416,416,416, \
- 440,432,432,416,448,432,465,440,432,440,480,448,416,448,432,432, \
- 480,432,448,440,466,448,432,440,432,440,440,440,480,430,448,448, \
- 448,439,440,432,438,447,448,440,440,440,448,448,480,432,448,448, \
- 448,448,448,447,448,448,448,447,448,448,440,465,448,467,448,448, \
- 448,448,464,464,448,448,466,480,480,480,468,480,448,464,480,464, \
- 466,466,464,479,480,480,512,480,540,480,496,480,552,512,480,479, \
- 504,480,552,552,512,480,504,552,564,512,480,480,504,561,564,564, \
- 512,552,560,564,564,480,564,480,552,480,564,564,564,564,536,564, \
- 540,564,552,564,564,564,564,552,564,552,564,480,564,552,552,564, \
- 512,564,546,564,564,564,512,552,552,559,560,561,564,564,560,560, \
- 552,561,564,564,560,564,561,564,564,564,564,564,564,564,564,560, \
- 561,560,564,564,560,564,564,552,564,564,564,552,564,564,564,564, \
- 564,563,564,564,564,564,560,564,564,564,564,552,564,564,560,564 \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*32-47*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*64-79*/ \
+ 0,0,0,0,0,0,0,0,48,0,0,0,0,0,0,50, /*80-95*/ \
+ 54,55,0,52,56,52,56,56,58,55,58,60,59,60,64,59, /*96-111*/ \
+ 64,59,62,68,60,60,64,64,68,62,64,66,72,68,66,68, /*112-127*/ \
+ 68,68,68,68,71,69,74,76,70,78,72,72,72,72,78,74, /*128-143*/ \
+ 77,75,78,78,78,78,84,77,84,79,80,79,80,86,92,92, /*144-159*/ \
+ 83,83,92,92,96,96,96,92,96,96,96,92,92,104,96,104, /*160-175*/ \
+ 92,104,96,104,96,96,96,104,104,104,112,104,104,104,112,116, /*176-191*/ \
+ 112,112,112,104,112,120,116,112,116,120,112,112,118,104,119,120, /*192-207*/ \
+ 112,120,124,124,112,128,112,120,116,116,128,112,120,128,116,120, /*208-223*/ \
+ 128,116,120,120,120,128,120,128,128,120,128,128,128,128,124,128, /*224-239*/ \
+ 128,124,128,128,128,128,128,128,128,128,128,128,135,136,136,132, /*240-255*/ \
+ 136,136,132,134,135,136,137,149,135,160,136,136,156,150,160,160, /*256-271*/ \
+ 144,160,144,148,160,160,161,144,144,156,160,156,156,160,160,160, /*272-287*/ \
+ 160,150,162,148,160,150,158,158,160,174,156,160,164,160,160,162, /*288-303*/ \
+ 156,160,160,168,160,168,158,172,160,159,160,184,162,192,184,174, /*304-319*/ \
+ 184,173,168,192,185,186,184,184,184,184,192,192,168,184,184,191, /*320-335*/ \
+ 172,184,184,185,192,186,185,184,185,186,192,184,184,184,184,192, /*336-351*/ \
+ 184,182,192,191,185,189,192,184,192,192,192,184,184,208,192,185, /*352-367*/ \
+ 192,216,208,216,208,192,192,208,192,192,192,192,192,208,208,224, /*368-383*/ \
+ 216,216,208,207,222,208,224,224,208,216,232,224,208,208,208,208, /*384-399*/ \
+ 232,208,224,224,224,208,216,224,228,216,208,224,232,240,224,222, /*400-415*/ \
+ 224,224,224,224,224,216,232,224,232,232,216,216,232,224,232,232, /*416-431*/ \
+ 240,240,224,224,224,224,232,228,246,240,232,232,240,240,239,240, /*432-447*/ \
+ 240,240,232,232,240,240,240,256,256,240,240,256,240,256,253,240, /*448-463*/ \
+ 256,256,256,240,255,256,240,256,256,264,256,240,240,240,256,256, /*464-479*/ \
+ 256,256,248,256,257,256,256,256,256,256,256,256,264,256,256,256, /*480-495*/ \
+ 256,256,256,256,256,288,256,270,288,256,288,256,270,256,276,288, /*496-511*/ \
+ 272,270,282,288,276,276,270,288,288,288,288,276,276,288,288,288, /*512-527*/ \
+ 288,288,280,288,276,272,288,288,288,276,272,280,288,312,276,288, /*528-543*/ \
+ 284,288,288,312,288,288,288,288,312,316,288,306,288,288,312,312, /*544-559*/ \
+ 288,312,288,312,320,304,305,288,312,320,320,312,336,288,312,312, /*560-575*/ \
+ 312,330,312,312,330,320,300,336,312,320,312,312,312,312,320,336, /*576-591*/ \
+ 316,312,312,312,320,312,348,322,318,312,336,336,312,320,336,312, /*592-607*/ \
+ 316,324,336,312,336,384,312,324,384,368,336,320,384,320,336,384, /*608-623*/ \
+ 384,320,316,336,320,368,384,384,368,330,384,368,384,336,384,368, /*624-639*/ \
+ 384,368,384,336,384,336,336,336,384,336,336,384,384,384,384,370, /*640-655*/ \
+ 384,368,384,368,384,384,384,384,368,354,359,368,336,368,368,368, /*656-671*/ \
+ 384,384,384,368,384,384,368,384,384,376,368,384,369,384,384,368, /*672-687*/ \
+ 372,384,384,384,384,384,368,368,384,368,368,384,383,368,369,368, /*688-703*/ \
+ 370,368,368,369,416,384,384,384,384,384,384,384,368,384,384,384, /*704-719*/ \
+ 384,416,416,384,384,369,368,416,368,368,384,384,384,384,384,384, /*720-735*/ \
+ 384,384,384,384,384,384,384,384,384,384,384,384,382,376,384,408, /*736-751*/ \
+ 384,384,384,382,408,384,384,416,384,384,416,384,384,384,448,416, /*752-767*/ \
+ 416,432,416,416,416,416,416,416,416,416,416,432,432,416,408,432, /*768-783*/ \
+ 432,416,416,416,416,416,416,416,432,416,432,416,432,416,416,416, /*784-799*/ \
+ 432,440,416,432,432,416,448,416,416,416,448,416,416,416,448,464, /*800-815*/ \
+ 464,432,432,416,448,416,448,464,448,464,464,464,440,456,440,448, /*816-831*/ \
+ 480,472,480,432,432,464,448,432,480,464,480,432,464,480,432,480, /*832-847*/ \
+ 432,440,432,432,448,440,480,464,480,480,440,448,480,448,448,440, /*848-863*/ \
+ 448,464,448,466,448,448,480,448,448,448,512,466,480,480,480,456, /*864-879*/ \
+ 464,448,464,464,464,448,464,464,512,464,512,480,480,480,464,480, /*880-895*/ \
+ 480,480,480,480,512,480,480,480,480,456,464,464,466,464,512,464, /*896-911*/ \
+ 480,480,512,464,512,468,512,472,512,466,480,464,512,480,512,480, /*912-927*/ \
+ 480,480,510,512,480,480,480,480,480,512,480,562,512,480,512,480, /*928-943*/ \
+ 512,512,480,480,480,538,480,480,480,528,540,480,564,512,540,512, /*944-959*/ \
+ 540,512,564,512,512,512,564,550,564,512,512,512,561,512,563,563, /*960-975*/ \
+ 512,512,512,512,564,512,512,512,564,564,512,564,563,564,512,540, /*976-991*/ \
+ 562,540,528,512,540,512,552,512,552,560,512,512,552,564,540,552, /*992-1007*/ \
+ 540,561,562,552,576,564,540,562,552,562,563,562,564,562,564,564 /*1008-1023*/ \
-#define MPFR_MUL_THRESHOLD 7 /* limbs */
-#define MPFR_SQR_THRESHOLD 12 /* limbs */
-#define MPFR_DIV_THRESHOLD 20 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 1024 /* bits */
-#define MPFR_EXP_THRESHOLD 9670 /* bits */
-#define MPFR_SINCOS_THRESHOLD 23808 /* bits */
-#define MPFR_AI_THRESHOLD1 -13250 /* threshold for negative input of mpfr_ai */
-#define MPFR_AI_THRESHOLD2 1430
-#define MPFR_AI_THRESHOLD3 21190
-/* Tuneup completed successfully, took 770 seconds */
+#define MPFR_MUL_THRESHOLD 10 /* limbs */
+#define MPFR_SQR_THRESHOLD 13 /* limbs */
+#define MPFR_DIV_THRESHOLD 5 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 1023 /* bits */
+#define MPFR_EXP_THRESHOLD 10090 /* bits */
+#define MPFR_SINCOS_THRESHOLD 23323 /* bits */
+#define MPFR_AI_THRESHOLD1 -14098 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 1378
+#define MPFR_AI_THRESHOLD3 21450
+/* Tuneup completed successfully, took 699 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/x86_64/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/x86_64/mparam.h
new file mode 100644
index 00000000000..8dc7acb2a6a
--- /dev/null
+++ b/Build/source/libs/mpfr/mpfr-src/src/x86_64/mparam.h
@@ -0,0 +1,233 @@
+/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
+
+Copyright 2005-2020 Free Software Foundation, Inc.
+
+This file is part of the GNU MPFR Library.
+
+The GNU MPFR Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU Lesser General Public License as published by
+the Free Software Foundation; either version 3 of the License, or (at your
+option) any later version.
+
+The GNU MPFR Library is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+License for more details.
+
+You should have received a copy of the GNU Lesser General Public License
+along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
+https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
+51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
+
+/* Generated by MPFR's tuneup.c, 2018-02-22, gcc 7.3.0 */
+/* tomate.loria.fr Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz with GMP 6.1.2,
+ where GMP defines -mtune=haswell */
+
+#define MPFR_MULHIGH_TAB \
+ -1,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,0,0,0,0,24,26,28,28,28,28,28, \
+ 30,30,32,32,30,32,30,34,36,36,38,36,38,38,44,44, \
+ 44,44,44,44,44,48,44,44,48,44,48,52,52,48,56,56, \
+ 56,56,56,56,56,56,56,56,60,56,60,64,64,64,60,64, \
+ 64,68,64,64,64,64,72,68,68,72,63,72,64,64,68,64, \
+ 81,72,72,84,81,81,86,81,81,81,87,87,81,87,87,84, \
+ 80,84,87,90,87,86,93,87,92,93,93,96,96,93,96,93, \
+ 96,93,104,104,105,105,105,105,104,105,105,108,105,108,104,108, \
+ 104,108,111,104,117,108,114,116,116,116,117,114,116,129,117,114, \
+ 128,129,129,132,132,134,132,117,141,141,132,140,141,132,138,141, \
+ 141,141,141,144,140,141,138,141,144,144,141,144,141,141,140,141, \
+ 141,141,140,141,141,141,144,165,144,165,165,164,163,165,164,164, \
+ 164,168,165,168,164,164,164,165,165,164,165,168,168,165,164,165, \
+ 164,164,164,176,165,177,164,165,168,168,165,165,168,168,168,174, \
+ 177,176,177,177,177,189,188,189,177,180,177,180,189,187,188,188, \
+ 189,189,189,189,189,188,189,192,220,192,220,220,219,220,220,219, \
+ 220,219,220,220,220,219,220,220,219,220,220,219,220,219,220,220, \
+ 220,220,220,219,220,220,220,224,219,224,220,234,234,236,236,236, \
+ 236,235,235,240,235,236,236,236,236,236,235,236,236,251,235,236, \
+ 236,252,252,252,252,252,252,252,236,251,251,256,252,252,252,252, \
+ 250,251,252,252,251,252,251,252,284,252,264,280,251,252,252,284, \
+ 252,284,284,284,284,284,284,283,284,284,284,284,284,283,284,284, \
+ 283,284,284,282,284,284,283,306,306,306,306,306,306,330,330,330, \
+ 330,330,330,330,330,330,330,329,330,329,330,329,330,330,330,330, \
+ 330,330,330,330,330,330,330,330,330,330,330,330,330,330,330,330, \
+ 330,330,330,330,329,330,354,330,330,330,330,330,354,354,354,353, \
+ 354,354,354,353,354,330,354,354,330,354,354,330,330,354,330,378, \
+ 330,378,378,330,330,330,378,354,378,378,354,378,378,354,378,377, \
+ 378,378,377,378,354,354,354,354,354,354,354,378,354,354,378,378, \
+ 378,378,378,378,378,378,378,378,378,378,378,378,378,378,378,440, \
+ 440,439,439,378,440,440,440,440,440,440,440,439,440,439,440,440, \
+ 439,440,440,440,440,440,440,440,440,440,440,440,440,439,440,439, \
+ 439,440,439,440,440,440,440,440,440,440,440,440,440,440,440,440, \
+ 440,440,440,440,440,440,439,440,440,440,440,440,440,440,439,440, \
+ 440,440,440,472,472,439,440,472,471,472,440,439,440,440,440,472, \
+ 472,440,472,472,471,472,472,472,472,472,472,472,472,472,472,472, \
+ 504,472,471,504,504,504,472,504,472,472,470,472,472,472,472,472, \
+ 504,472,472,504,504,504,503,504,504,504,504,503,504,504,503,504, \
+ 504,504,504,504,504,503,504,504,504,504,504,503,504,504,504,504, \
+ 504,504,504,504,504,504,504,504,504,504,504,504,504,504,504,504, \
+ 504,504,504,504,504,504,504,503,503,504,504,504,504,536,536,536, \
+ 568,504,568,568,567,568,568,568,567,568,568,567,568,568,568,568, \
+ 566,568,568,568,567,568,568,568,567,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,568,568,568,567,568,568,568,568,568,568,568, \
+ 568,568,568,568,568,567,568,567,568,568,566,568,568,568,568,568, \
+ 640,568,640,639,640,640,568,568,640,640,640,640,640,640,640,640, \
+ 639,640,640,640,640,640,640,640,639,640,640,639,640,640,640,640, \
+ 640,639,640,640,640,640,640,640,640,640,640,638,640,640,640,640, \
+ 640,640,640,640,640,640,640,640,640,640,640,640,664,664,664,639, \
+ 639,640,664,640,640,639,640,639,640,640,640,639,640,640,640,640, \
+ 640,640,640,639,640,688,688,640,640,688,688,640,687,688,664,663, \
+ 640,664,688,688,688,688,663,664,736,663,664,664,663,664,712,664, \
+ 664,664,688,664,712,712,736,640,688,736,736,736,736,736,736,736, \
+ 688,736,736,736,736,736,736,736,735,736,736,736,736,736,736,736, \
+ 736,736,736,736,736,736,736,736,735,735,736,736,736,735,736,736, \
+ 735,736,736,736,735,736,736,735,735,736,735,736,736,736,735,736, \
+ 736,736,736,736,736,736,735,736,735,736,736,736,736,736,736,736, \
+ 736,736,735,736,736,736,736,736,736,736,736,736,736,736,735,736, \
+ 736,736,736,735,736,736,736,735,736,736,760,736,734,736,736,736, \
+ 832,736,784,760,830,760,832,760,736,832,832,832,736,832,832,832, \
+ 832,832,832,831,832,832,831,831,832,831,831,832,832,831,832,831, \
+ 832,832,832,832,832,831,736,831,832,832,832,832,832,831,831,832 \
+
+#define MPFR_SQRHIGH_TAB \
+ -1,-1,-1,-1,-1,-1,-1,-1,-1,7,8,7,8,8,9,9, \
+ 10,10,12,12,12,12,13,13,14,15,15,16,17,17,18,19, \
+ 19,19,19,20,21,22,22,23,23,23,23,23,24,24,26,25, \
+ 26,27,28,27,29,29,31,29,31,30,33,32,33,33,33,33, \
+ 40,38,40,40,40,44,42,40,42,44,44,46,44,42,48,48, \
+ 48,48,50,52,50,50,48,50,50,52,52,56,54,56,58,55, \
+ 56,58,58,61,60,61,62,64,64,56,66,68,60,62,58,72, \
+ 72,76,76,76,76,72,80,80,80,72,76,76,76,76,76,80, \
+ 88,80,76,76,80,76,76,80,88,76,79,84,84,88,84,88, \
+ 85,88,92,92,84,92,92,90,91,92,96,92,94,92,94,100, \
+ 96,92,92,94,85,100,92,96,88,100,96,96,100,91,94,92, \
+ 100,94,95,96,98,96,101,100,100,117,100,100,112,100,104,108, \
+ 106,108,111,117,117,117,126,123,120,120,120,117,126,126,123,129, \
+ 128,128,128,128,126,131,128,129,132,129,132,135,129,137,136,135, \
+ 138,135,132,141,136,144,140,144,141,138,150,147,147,147,142,138, \
+ 146,138,147,144,144,150,152,144,147,147,147,162,156,164,165,162, \
+ 158,152,162,156,161,162,168,156,168,170,168,171,167,170,171,168, \
+ 174,175,174,171,159,164,170,170,150,183,176,176,168,168,177,180, \
+ 176,170,160,174,176,171,177,171,176,176,177,183,176,174,177,174, \
+ 174,177,176,183,176,177,180,177,180,175,176,183,195,180,194,182, \
+ 183,189,192,192,189,177,183,189,195,192,189,201,195,195,186,195, \
+ 201,201,201,200,200,198,225,219,224,225,204,213,213,225,213,222, \
+ 222,219,227,221,222,212,231,222,228,225,224,224,228,227,228,240, \
+ 225,219,225,228,228,224,224,227,237,227,228,228,225,225,225,228, \
+ 228,237,231,237,231,236,249,237,249,243,240,240,237,249,249,243, \
+ 249,237,261,260,261,261,249,260,249,248,261,249,261,261,261,261, \
+ 261,261,260,261,264,272,273,273,236,237,273,261,273,237,273,261, \
+ 273,273,273,273,264,240,273,261,273,261,273,273,273,273,261,248, \
+ 249,267,273,273,261,261,261,261,261,264,273,264,261,273,270,272, \
+ 273,272,273,276,273,272,273,267,273,273,272,276,285,285,285,285, \
+ 276,276,285,285,283,288,285,296,296,285,285,273,285,294,297,273, \
+ 297,297,296,273,309,297,273,285,297,296,285,308,309,272,285,297, \
+ 297,276,309,297,297,321,297,296,297,295,285,297,297,297,297,295, \
+ 297,297,309,297,309,309,297,296,321,295,307,321,321,312,348,309, \
+ 348,348,309,348,309,347,348,348,324,321,321,363,319,347,364,356, \
+ 363,348,333,363,361,348,348,364,364,347,348,362,364,364,380,346, \
+ 364,348,347,347,364,348,364,362,364,363,362,364,364,364,363,364, \
+ 364,371,364,364,364,363,364,364,363,380,363,377,372,380,380,364, \
+ 364,379,371,379,380,364,380,380,379,380,379,380,364,384,363,364, \
+ 395,396,395,396,380,395,380,378,396,396,378,396,387,396,396,395, \
+ 379,410,396,395,396,395,396,395,411,426,412,412,396,425,396,426, \
+ 412,409,410,411,410,450,425,426,394,450,462,419,426,410,431,426, \
+ 425,426,432,438,432,450,432,426,432,450,438,449,450,450,456,450, \
+ 432,456,456,450,450,461,462,456,474,450,462,450,450,450,474,474, \
+ 450,474,474,474,474,474,473,474,474,474,462,474,474,474,474,474, \
+ 546,474,474,474,474,474,474,474,486,498,498,498,498,474,497,497, \
+ 498,498,498,474,498,522,521,522,522,498,522,522,521,520,521,522, \
+ 522,521,522,522,522,522,522,522,522,522,522,522,522,522,522,522, \
+ 522,522,522,522,522,545,546,546,546,546,546,545,546,544,522,546, \
+ 546,546,567,568,520,567,522,545,567,546,568,545,568,568,568,546, \
+ 568,545,546,545,546,546,546,568,568,568,568,567,568,568,568,567, \
+ 568,568,568,568,568,568,584,568,567,568,600,568,568,599,600,600, \
+ 568,600,600,600,600,600,600,567,600,600,568,600,599,600,600,600, \
+ 600,600,600,600,600,600,600,600,600,600,600,600,600,600,632,600, \
+ 600,600,632,632,616,632,600,600,600,631,600,632,600,616,600,632, \
+ 632,600,600,632,632,600,632,600,632,600,600,600,600,600,600,599, \
+ 600,599,600,600,600,599,600,631,600,600,600,600,600,600,600,632, \
+ 599,640,600,600,600,632,632,600,600,632,632,631,632,632,632,630, \
+ 632,632,632,631,640,696,632,632,632,632,630,631,632,631,648,695, \
+ 632,695,696,695,632,631,632,647,648,648,648,696,695,696,696,712, \
+ 695,664,695,696,695,695,696,695,696,696,696,696,664,695,696,728, \
+ 712,727,728,727,696,728,664,663,696,664,664,728,728,664,696,696, \
+ 696,696,696,696,696,695,696,696,696,695,696,696,695,695,696,696, \
+ 695,696,695,695,695,696,696,696,696,728,726,728,728,728,727,728 \
+
+#define MPFR_DIVHIGH_TAB \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*0-15*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*16-31*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*32-47*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*48-63*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*64-79*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*80-95*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*96-111*/ \
+ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /*112-127*/ \
+ 68,68,0,0,75,69,0,0,71,78,72,73,74,72,78,74, /*128-143*/ \
+ 77,84,78,79,78,84,84,77,80,79,80,82,80,80,88,84, /*144-159*/ \
+ 84,84,83,93,84,91,86,92,90,88,92,90,90,94,96,95, /*160-175*/ \
+ 94,94,96,96,96,96,98,94,100,98,100,96,97,104,106,100, /*176-191*/ \
+ 98,98,102,106,102,106,106,112,109,103,112,112,110,104,112,111, /*192-207*/ \
+ 109,112,110,118,110,128,112,116,126,112,128,132,128,128,128,128, /*208-223*/ \
+ 124,127,128,122,129,128,125,126,127,125,128,127,128,125,136,128, /*224-239*/ \
+ 128,128,136,128,136,128,144,132,130,144,135,132,132,136,136,134, /*240-255*/ \
+ 142,144,144,134,144,137,136,150,135,143,136,146,140,144,144,142, /*256-271*/ \
+ 144,144,144,143,144,149,162,144,144,162,144,144,156,144,167,146, /*272-287*/ \
+ 148,150,162,150,155,150,150,158,154,156,162,168,164,160,168,162, /*288-303*/ \
+ 156,168,160,164,160,160,158,158,160,159,160,168,166,166,180,164, /*304-319*/ \
+ 168,168,184,180,165,174,174,174,172,179,174,174,190,185,186,180, /*320-335*/ \
+ 182,184,185,185,186,186,186,192,192,184,187,200,188,184,184,180, /*336-351*/ \
+ 196,180,184,186,186,198,192,189,185,186,192,184,191,186,196,186, /*352-367*/ \
+ 189,192,190,216,196,189,195,200,192,197,192,192,192,206,204,196, /*368-383*/ \
+ 200,214,210,207,216,198,216,210,198,216,214,216,216,208,216,216, /*384-399*/ \
+ 208,216,222,224,228,216,216,216,208,216,216,232,228,214,212,218, /*400-415*/ \
+ 216,216,218,220,214,216,221,228,220,224,218,224,220,216,224,232, /*416-431*/ \
+ 232,220,228,228,264,233,232,228,228,233,232,256,252,228,228,256, /*432-447*/ \
+ 232,264,232,264,256,254,256,232,264,255,252,257,258,264,268,276, /*448-463*/ \
+ 254,251,264,268,264,248,256,268,254,264,256,256,252,255,258,256, /*464-479*/ \
+ 256,257,264,252,264,256,268,272,256,267,256,276,272,287,272,264, /*480-495*/ \
+ 256,257,272,276,268,264,264,264,270,272,288,268,269,280,288,288, /*496-511*/ \
+ 280,284,282,288,276,288,279,288,288,281,286,288,280,272,272,280, /*512-527*/ \
+ 288,288,294,281,276,288,288,288,288,288,280,288,288,287,288,288, /*528-543*/ \
+ 284,288,288,287,288,291,288,288,288,288,324,324,287,288,287,312, /*544-559*/ \
+ 288,288,288,305,324,292,309,288,312,328,288,311,336,327,330,300, /*560-575*/ \
+ 318,330,312,336,327,321,324,336,330,324,335,327,335,336,336,336, /*576-591*/ \
+ 336,324,352,335,360,329,344,329,318,329,336,328,336,336,324,335, /*592-607*/ \
+ 323,336,336,336,336,328,336,325,360,324,336,328,316,335,336,332, /*608-623*/ \
+ 324,360,334,323,328,360,360,384,328,360,330,336,336,336,368,328, /*624-639*/ \
+ 335,371,336,335,372,372,335,336,372,336,336,348,330,356,360,370, /*640-655*/ \
+ 336,336,384,336,340,368,336,384,346,360,348,372,348,366,376,368, /*656-671*/ \
+ 340,347,368,360,384,384,372,348,384,376,368,360,384,344,369,384, /*672-687*/ \
+ 372,360,384,360,366,372,368,352,392,360,377,384,383,368,384,384, /*688-703*/ \
+ 384,384,372,369,384,383,384,376,382,364,376,384,378,376,384,384, /*704-719*/ \
+ 376,382,372,375,384,383,372,384,408,378,384,384,384,384,416,432, /*720-735*/ \
+ 384,384,432,419,384,424,384,440,417,440,392,380,408,376,424,378, /*736-751*/ \
+ 432,384,440,392,444,400,440,440,384,384,440,384,448,384,448,432, /*752-767*/ \
+ 448,432,432,432,416,440,440,400,440,440,438,432,432,432,448,440, /*768-783*/ \
+ 444,444,440,436,440,444,420,436,432,432,440,456,420,443,420,420, /*784-799*/ \
+ 456,432,431,432,424,432,464,440,432,466,432,448,456,463,460,448, /*800-815*/ \
+ 440,420,448,448,444,431,440,440,416,440,433,439,440,456,440,456, /*816-831*/ \
+ 434,454,432,432,431,440,440,440,464,428,428,436,440,440,432,440, /*832-847*/ \
+ 432,436,436,439,436,440,432,440,438,445,456,440,456,448,456,440, /*848-863*/ \
+ 456,464,464,440,456,448,451,440,447,512,440,440,446,446,448,456, /*864-879*/ \
+ 448,456,452,460,453,455,456,456,448,455,463,464,480,464,463,464, /*880-895*/ \
+ 480,452,480,528,466,468,456,457,480,467,464,468,504,504,460,467, /*896-911*/ \
+ 480,512,464,484,466,468,512,472,504,504,504,504,504,528,478,479, /*912-927*/ \
+ 504,480,504,520,504,520,504,504,512,512,472,512,512,528,512,512, /*928-943*/ \
+ 528,512,502,528,504,536,536,520,528,528,552,536,512,511,528,512, /*944-959*/ \
+ 536,560,512,512,488,528,512,536,552,528,512,576,560,560,576,576, /*960-975*/ \
+ 504,560,512,560,560,511,512,552,528,512,512,512,568,576,512,512, /*976-991*/ \
+ 512,528,528,568,528,512,504,576,576,528,512,576,544,504,576,512, /*992-1007*/ \
+ 512,536,528,560,528,540,536,576,568,536,544,536,536,576,527,544 /*1008-1023*/ \
+
+#define MPFR_MUL_THRESHOLD 12 /* limbs */
+#define MPFR_SQR_THRESHOLD 19 /* limbs */
+#define MPFR_DIV_THRESHOLD 3 /* limbs */
+#define MPFR_EXP_2_THRESHOLD 894 /* bits */
+#define MPFR_EXP_THRESHOLD 6522 /* bits */
+#define MPFR_SINCOS_THRESHOLD 23540 /* bits */
+#define MPFR_AI_THRESHOLD1 -14260 /* threshold for negative input of mpfr_ai */
+#define MPFR_AI_THRESHOLD2 1680
+#define MPFR_AI_THRESHOLD3 24368
+/* Tuneup completed successfully, took 342 seconds */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/x86_64/pentium4/mparam.h b/Build/source/libs/mpfr/mpfr-src/src/x86_64/pentium4/mparam.h
deleted file mode 100644
index 83647c9a8dd..00000000000
--- a/Build/source/libs/mpfr/mpfr-src/src/x86_64/pentium4/mparam.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/* Various Thresholds of MPFR, not exported. -*- mode: C -*-
-
-Copyright 2005-2019 Free Software Foundation, Inc.
-
-This file is part of the GNU MPFR Library.
-
-The GNU MPFR Library is free software; you can redistribute it and/or modify
-it under the terms of the GNU Lesser General Public License as published by
-the Free Software Foundation; either version 3 of the License, or (at your
-option) any later version.
-
-The GNU MPFR Library is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
-License for more details.
-
-You should have received a copy of the GNU Lesser General Public License
-along with the GNU MPFR Library; see the file COPYING.LESSER. If not, see
-https://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc.,
-51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. */
-
-/* Generated by MPFR's tuneup.c, 2009-02-09, gcc 4.3 */
-/* crumble.loria.fr with gmp-4.2.4 */
-
-
-#define MPFR_MULHIGH_TAB \
- -1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, \
- 0,0,0,19,20,20,24,26,0,0,24,26,28,27,26,28, \
- 30,32,32,32,30,30,34,34,32,34,34,36,32,34,36,34, \
- 35,0,0,36,36,0,37,48,0,0,48,48,51,0,48,52, \
- 51,0,52,52,51,55,52,56,55,0,56,60,59,59,60,64, \
- 63,63,64,64,67,67,68,72,63,71,72,60,67,67,60,72, \
- 63,61,64,64,63,71,68,68,71,67,68,68,67,71,68,72, \
- 68,68,72,72,76,76,69,69,72,72,71,103,104,72,73,96, \
- 103,94,95,104,96,96,94,103,104,104,96,96,103,103,104,104, \
- 120,120,103,103,104,104,120,111,103,112,104,104,120,120,109,103, \
- 119,119,120,120,127,112,128,128,120,120,136,127,128,128,120,126, \
- 121,129,126,134,135,135,136,120,113,113,114,118,127,127,136,120, \
- 121,125,126,118,119,119,120,136,121,153,122,122,127,119,120,128, \
- 165,153,162,134,163,159,136,136,153,153,134,158,135,135,136,136, \
- 153,153,162,158,159,159,156,152,153,189,158,186,187,163,156,168, \
- 189,159,165,165,176,176,172,172,183,173,164,174,165,165,176,176, \
- 177,177,183,188,189,189,180,185,176,186,177,177,193,188,189,189, \
- 200,200,201,201,177,207,188,198,199,189,200,200,186,201,207,207, \
- 213,203,189,189,200,210,201,196,212,207,208,213,189,199,200,200, \
- 203,209,216,204,199,223,206,200,213,225,208,208,203,203,216,204, \
- 205,205,224,212,213,213,184,208,209,203,198,210,199,187,206,200, \
- 201,189,208,208,203,185,216,198,187,199,200,212,213,213,202,208, \
- 203,197,198,198,199,211,212,212,285,213,280,274,227,275,288,204, \
- 284,284,278,285,307,216,273,308,309,309,275,219,213,311,305,284, \
- 306,306,307,307,308,308,309,309,303,303,311,311,284,312,285,285, \
- 307,286,287,308,309,309,303,303,304,332,305,305,306,299,328,300, \
- 308,301,309,309,303,310,311,311,333,305,285,285,307,314,308,308, \
- 321,305,354,322,331,355,332,308,309,333,334,334,303,303,304,312, \
- 305,305,306,306,307,307,308,308,309,309,302,302,375,311,312,360, \
- 353,305,330,354,307,355,380,308,357,309,358,358,359,311,312,312, \
- 345,329,378,354,331,355,356,356,357,357,374,334,375,311,336,384, \
- 356,329,330,357,331,358,404,332,369,333,334,334,335,353,354,354, \
- 355,382,356,347,357,357,358,358,377,359,405,333,352,379,353,353, \
- 354,354,355,355,356,356,357,357,358,376,359,377,369,360,379,370, \
- 380,380,354,372,355,382,383,401,357,357,376,358,377,377,405,378, \
- 379,379,380,380,381,381,402,402,353,403,404,404,405,405,376,376, \
- 377,357,368,358,379,379,360,400,401,381,372,452,373,383,454,384, \
- 405,405,456,356,357,357,358,378,379,379,490,370,381,381,492,402, \
- 463,403,404,404,405,405,456,456,527,357,448,448,489,449,400,450, \
- 453,453,454,454,455,455,456,456,468,490,491,491,492,404,405,482, \
- 472,450,451,462,463,463,464,453,465,465,455,455,456,489,490,490, \
- 491,491,492,492,405,526,483,527,484,484,452,452,486,453,454,454, \
- 455,477,456,522,490,490,491,524,481,492,526,482,483,527,495,517, \
- 521,533,522,474,499,523,524,524,489,489,490,526,527,527,528,528, \
- 529,529,518,554,495,483,496,472,521,557,486,522,535,535,524,512, \
- 525,561,526,526,491,527,528,528,529,517,518,554,531,519,544,520, \
- 521,521,558,546,559,535,560,536,489,573,490,514,491,563,492,492, \
- 528,489,555,555,491,491,492,596,597,545,546,546,560,599,600,600, \
- 523,562,563,511,564,525,526,630,553,527,528,528,607,555,595,543, \
- 544,531,532,571,559,559,599,560,535,535,562,562,563,537,564,564, \
- 565,630,514,631,528,632,555,542,634,595,557,557,597,558,559,559, \
- 571,599,530,530,559,545,546,616,561,547,548,534,633,563,564,564, \
- 607,537,594,636,567,539,624,554,555,555,598,598,557,557,558,572, \
- 559,559,560,574,603,561,562,632,563,563,578,592,593,607,580,608, \
- 553,609,624,596,597,597,598,612,627,585,600,614,573,629,616,602, \
- 599,599,585,585,616,616,587,632,603,603,634,634,635,605,636,621, \
- 622,607,623,593,609,609,625,610,611,626,612,597,628,598,599,599, \
- 600,630,631,616,602,632,633,603,634,634,635,635,636,636,607,637, \
- 668,608,609,609,610,610,611,611,597,657,628,628,629,629,630,630, \
- 609,625,562,626,627,563,564,628,629,629,630,630,631,599,664,632, \
- 681,633,634,634,635,635,620,636,621,621,622,622,623,639,672,592, \
- 609,641,594,594,595,627,596,564,629,597,598,598,631,599,600,600, \
- 601,681,618,634,603,635,636,636,557,621,622,606,623,623,608,608 \
-
-#define MPFR_SQRHIGH_TAB \
- -1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,8,8,9,9, \
- 10,10,11,11,12,12,13,13,14,14,15,15,16,16,17,17, \
- 18,18,19,19,20,20,21,21,22,22,23,23,26,24,25,25, \
- 26,26,27,27,28,28,29,29,30,30,31,31,32,32,33,33, \
- 34,34,35,35,36,36,37,38,39,39,39,39,40,40,41,41, \
- 42,42,43,43,44,44,45,46,46,46,47,47,48,48,49,49, \
- 50,50,51,51,52,52,53,53,54,54,55,55,56,56,57,57, \
- 58,58,59,59,60,60,61,61,62,62,63,68,64,64,65,65, \
- 66,68,67,69,68,68,71,69,70,75,76,76,72,72,73,73, \
- 74,82,75,80,78,76,77,77,78,83,79,81,82,80,81,81, \
- 82,82,83,85,84,84,85,85,86,86,87,87,88,88,89,89, \
- 90,92,91,93,94,92,93,93,94,94,95,95,96,96,97,97, \
- 98,98,99,99,100,100,101,101,102,102,103,103,104,104,105,105, \
- 106,106,107,107,108,108,109,112,110,110,111,118,112,112,113,113, \
- 114,114,115,122,123,116,117,117,118,118,119,119,120,120,121,121, \
- 122,122,123,123,124,124,125,125,126,126,127,127,128,128,129,129, \
- 130,154,135,131,132,132,133,133,134,134,135,135,136,140,151,137, \
- 142,138,139,143,144,154,155,150,151,156,152,143,153,158,145,145, \
- 165,146,147,147,152,162,149,149,150,150,151,151,152,171,153,153, \
- 154,154,155,155,156,156,157,157,158,158,159,159,160,160,161,161, \
- 162,162,163,163,164,164,165,165,166,166,167,167,168,168,169,169, \
- 170,170,171,171,172,183,173,173,174,174,175,175,176,187,194,182, \
- 183,178,179,179,180,180,181,181,182,182,183,183,195,184,185,185, \
- 186,197,187,187,188,188,189,189,190,190,191,191,192,192,193,204, \
- 207,200,201,208,209,196,197,203,204,198,199,199,200,200,201,201, \
- 202,215,216,230,217,210,211,218,212,206,207,207,208,208,209,209, \
- 210,230,231,231,232,225,226,226,227,227,228,242,222,257,217,217, \
- 218,245,246,219,220,240,241,234,235,235,236,264,230,258,225,225, \
- 226,226,227,227,228,228,229,260,261,230,231,270,247,232,233,233, \
- 234,234,235,235,236,236,237,237,238,238,239,239,240,240,241,241, \
- 242,242,243,243,244,244,245,245,246,246,247,247,248,248,249,249, \
- 250,250,251,251,252,252,253,253,254,254,255,255,256,256,257,257, \
- 258,258,259,259,260,260,261,261,262,262,263,263,264,264,265,265, \
- 266,266,267,267,268,268,269,269,270,270,279,271,272,272,273,273, \
- 274,274,275,275,276,276,277,277,278,278,279,279,280,280,281,281, \
- 282,282,283,283,284,284,285,285,294,286,287,287,288,288,289,289, \
- 290,290,291,291,292,292,293,293,294,294,295,295,296,296,297,297, \
- 298,298,299,299,300,300,301,301,302,302,303,303,304,304,305,305, \
- 306,306,307,307,308,308,309,309,310,310,311,311,312,312,313,313, \
- 314,314,315,315,316,316,317,317,318,318,319,319,320,320,321,321, \
- 322,322,323,323,324,324,325,325,326,326,327,337,349,338,329,329, \
- 330,330,331,331,332,332,333,333,334,334,335,335,336,336,337,337, \
- 338,338,339,360,340,340,341,341,342,342,343,343,344,354,355,345, \
- 346,346,368,368,369,369,359,349,393,382,383,361,362,362,363,363, \
- 365,365,366,390,367,391,380,404,358,393,406,382,383,395,396,396, \
- 385,409,386,410,387,399,388,412,413,401,390,367,368,403,404,416, \
- 417,405,382,406,407,407,408,408,409,409,410,410,435,411,412,412, \
- 413,413,414,379,439,427,428,392,393,441,442,430,479,455,444,432, \
- 437,386,451,387,465,439,427,389,390,454,455,455,404,417,444,444, \
- 394,394,395,446,460,460,461,487,410,475,399,476,477,464,401,465, \
- 402,492,403,403,404,404,405,405,406,406,407,419,408,408,409,409, \
- 410,410,411,411,412,412,413,413,414,414,415,415,416,416,417,417, \
- 418,418,419,419,420,420,421,421,422,422,423,423,424,424,425,508, \
- 426,426,427,427,428,428,429,429,430,430,431,431,432,432,433,433, \
- 434,434,435,435,436,436,437,437,438,438,439,536,440,440,441,441, \
- 442,442,443,443,444,444,445,445,446,446,447,447,448,448,449,476, \
- 450,450,451,451,452,452,482,453,454,454,455,455,456,456,457,457, \
- 458,458,459,459,460,460,461,461,462,462,463,463,464,464,465,465, \
- 466,466,467,467,468,468,469,469,470,470,471,471,472,472,473,473, \
- 474,474,475,475,476,476,477,477,478,478,479,479,480,480,481,481, \
- 482,482,483,483,484,484,485,485,486,486,487,487,488,488,489,489, \
- 490,490,491,491,492,492,493,493,494,494,495,495,496,496,497,497, \
- 498,498,499,499,500,500,501,501,502,502,503,503,504,504,505,505, \
- 506,506,507,507,508,508,509,509,510,510,511,511,512,512,513,513 \
-
-#define MPFR_MUL_THRESHOLD 8 /* limbs */
-#define MPFR_EXP_2_THRESHOLD 519 /* bits */
-#define MPFR_EXP_THRESHOLD 6533 /* bits */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/yn.c b/Build/source/libs/mpfr/mpfr-src/src/yn.c
index da27f457007..1ff9074e706 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/yn.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/yn.c
@@ -1,7 +1,7 @@
/* mpfr_y0, mpfr_y1, mpfr_yn -- Bessel functions of 2nd kind, integer order.
http://www.opengroup.org/onlinepubs/009695399/functions/y0.html
-Copyright 2007-2019 Free Software Foundation, Inc.
+Copyright 2007-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -228,29 +228,29 @@ mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
/* first enclose log(z) + euler - log(2) = log(z/2) + euler */
mpfr_log (logz, z, MPFR_RNDD); /* lower bound of log(z) */
mpfr_set (h, logz, MPFR_RNDU); /* exact */
- mpfr_nextabove (h); /* upper bound of log(z) */
+ mpfr_nextabove (h); /* upper bound of log(z) */
mpfr_const_euler (t, MPFR_RNDD); /* lower bound of euler */
mpfr_add (l, logz, t, MPFR_RNDD); /* lower bound of log(z) + euler */
- mpfr_nextabove (t); /* upper bound of euler */
+ mpfr_nextabove (t); /* upper bound of euler */
mpfr_add (h, h, t, MPFR_RNDU); /* upper bound of log(z) + euler */
mpfr_const_log2 (t, MPFR_RNDU); /* upper bound of log(2) */
mpfr_sub (l, l, t, MPFR_RNDD); /* lower bound of log(z/2) + euler */
- mpfr_nextbelow (t); /* lower bound of log(2) */
+ mpfr_nextbelow (t); /* lower bound of log(2) */
mpfr_sub (h, h, t, MPFR_RNDU); /* upper bound of log(z/2) + euler */
mpfr_const_pi (t, MPFR_RNDU); /* upper bound of Pi */
mpfr_div (l, l, t, MPFR_RNDD); /* lower bound of (log(z/2)+euler)/Pi */
- mpfr_nextbelow (t); /* lower bound of Pi */
+ mpfr_nextbelow (t); /* lower bound of Pi */
mpfr_div (h, h, t, MPFR_RNDD); /* upper bound of (log(z/2)+euler)/Pi */
mpfr_mul_2ui (l, l, 1, MPFR_RNDD); /* lower bound on g(z)*log(z) */
mpfr_mul_2ui (h, h, 1, MPFR_RNDU); /* upper bound on g(z)*log(z) */
/* we now have l <= g(z)*log(z) <= h, and we need to add -z^2/2*log(z)
to h */
- mpfr_mul (t, z, z, MPFR_RNDU); /* upper bound on z^2 */
+ mpfr_sqr (t, z, MPFR_RNDU); /* upper bound on z^2 */
/* since logz is negative, a lower bound corresponds to an upper bound
for its absolute value */
mpfr_neg (t, t, MPFR_RNDD);
mpfr_div_2ui (t, t, 1, MPFR_RNDD);
- mpfr_mul (t, t, logz, MPFR_RNDU); /* upper bound on z^2/2*log(z) */
+ mpfr_mul (t, t, logz, MPFR_RNDU); /* upper bound on z^2/2*log(z) */
mpfr_add (h, h, t, MPFR_RNDU);
inex = mpfr_prec_round (l, MPFR_PREC(res), r);
inex2 = mpfr_prec_round (h, MPFR_PREC(res), r);
@@ -338,7 +338,7 @@ mpfr_yn (mpfr_ptr res, long n, mpfr_srcptr z, mpfr_rnd_t r)
mpfr_set_prec (s2, prec);
mpfr_set_prec (s3, prec);
- mpfr_mul (y, z, z, MPFR_RNDN);
+ mpfr_sqr (y, z, MPFR_RNDN);
mpfr_div_2ui (y, y, 2, MPFR_RNDN); /* z^2/4 */
/* store (z/2)^n temporarily in s2 */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/zeta.c b/Build/source/libs/mpfr/mpfr-src/src/zeta.c
index dc7e12b2501..ec2d88de7ec 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/zeta.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/zeta.c
@@ -1,6 +1,6 @@
/* mpfr_zeta -- compute the Riemann Zeta function
-Copyright 2003-2019 Free Software Foundation, Inc.
+Copyright 2003-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
@@ -82,16 +82,33 @@ mpfr_zeta_part_b (mpfr_t b, mpfr_srcptr s, int n, int p, mpfr_t *tc)
/* Input: p - an integer
Output: fills tc[1..p], tc[i] = bernoulli(2i)/(2i)!
tc[1]=1/12, tc[2]=-1/720, tc[3]=1/30240, ...
+ Assumes all the tc[i] have the same precision.
+
+ Uses the recurrence (4.60) from the book "Modern Computer Arithmetic"
+ by Brent and Zimmermann for C_k = bernoulli(2k)/(2k)!:
+ sum(C_k/(2k+1-2j)!/4^(k-j), j=0..k) = 1/(2k)!/4^k
+ If we put together the terms involving C_0 and C_1 we get:
+ sum(D_k/(2k+1-2j)!/4^(k-j), j=1..k) = 0
+ with D_1 = C_0/4/(2k+1)/(2k)+C_1-1/(2k)/4=(k-1)/(12k+6),
+ and D_k = C_k for k >= 2.
+
+ FIXME: we have C_k = (-1)^(k-1) 2/(2pi)^(2k) * zeta(2k),
+ see for example formula (4.65) from the above book,
+ thus since |zeta(2k)-1| < 2^(1-2k) for k >= 2, we have:
+ |C_k - E_k| < E_k * 2^(1-2k) for k >= 2 and E_k := (-1)^(k-1) 2/(2pi)^(2k).
+ Then if 2k-1 >= prec we can evaluate E_k instead, which only requires one
+ multiplication per term, instead of O(k) small divisions.
*/
static void
mpfr_zeta_c (int p, mpfr_t *tc)
{
- mpfr_t d;
- int k, l;
-
if (p > 0)
{
- mpfr_init2 (d, MPFR_PREC (tc[1]));
+ mpfr_t d;
+ int k, l;
+ mpfr_prec_t prec = MPFR_PREC (tc[1]);
+
+ mpfr_init2 (d, prec);
mpfr_div_ui (tc[1], __gmpfr_one, 12, MPFR_RNDN);
for (k = 2; k <= p; k++)
{
@@ -306,7 +323,7 @@ compute_add (mpfr_srcptr s, mpfr_prec_t precz)
/* since 1/eps = 2^(precz+14), if EXP(sd) >= precz+14, then
sd >= 1/2*2^(precz+14) thus 2*sd >= 2^(precz+14) >= 1/eps */
if (mpfr_get_exp (t) >= precz + 14)
- mpfr_mul_2exp (t, t, 1, MPFR_RNDU);
+ mpfr_mul_2ui (t, t, 1, MPFR_RNDU);
else
mpfr_set_ui_2exp (t, 1, precz + 14, MPFR_RNDU);
/* now t = max(1/eps,2*sd) */
@@ -318,7 +335,7 @@ compute_add (mpfr_srcptr s, mpfr_prec_t precz)
else
mpfr_set (t, m1, MPFR_RNDU);
/* now t = max(8,m1) */
- mpfr_div_2exp (t, t, precz + 14, MPFR_RNDU); /* eps*max(8,m1) */
+ mpfr_div_2ui (t, t, precz + 14, MPFR_RNDU); /* eps*max(8,m1) */
mpfr_add_ui (t, t, 1, MPFR_RNDU); /* 1+eps*max(8,m1) */
mpfr_mul (t, t, u, MPFR_RNDU); /* t = c */
mpfr_add_ui (u, m1, 13, MPFR_RNDU); /* 13+m1 */
diff --git a/Build/source/libs/mpfr/mpfr-src/src/zeta_ui.c b/Build/source/libs/mpfr/mpfr-src/src/zeta_ui.c
index a58eba2c8ec..d7ad99a8d7d 100644
--- a/Build/source/libs/mpfr/mpfr-src/src/zeta_ui.c
+++ b/Build/source/libs/mpfr/mpfr-src/src/zeta_ui.c
@@ -1,6 +1,6 @@
/* mpfr_zeta_ui -- compute the Riemann Zeta function for integer argument.
-Copyright 2005-2019 Free Software Foundation, Inc.
+Copyright 2005-2020 Free Software Foundation, Inc.
Contributed by the AriC and Caramba projects, INRIA.
This file is part of the GNU MPFR Library.
diff --git a/Build/source/libs/mpfr/version.ac b/Build/source/libs/mpfr/version.ac
index 13ec7bf4062..5133b63bb01 100644
--- a/Build/source/libs/mpfr/version.ac
+++ b/Build/source/libs/mpfr/version.ac
@@ -8,4 +8,4 @@ dnl
dnl --------------------------------------------------------
dnl
dnl m4-include this file to define the current mpfr version
-m4_define([mpfr_version], [4.0.2])
+m4_define([mpfr_version], [4.1.0])