texlive[53461] Build/source/libs: gmp-6.2.0
commits+kakuto at tug.org
commits+kakuto at tug.org
Mon Jan 20 00:36:31 CET 2020
Revision: 53461
http://tug.org/svn/texlive?view=revision&revision=53461
Author: kakuto
Date: 2020-01-20 00:36:31 +0100 (Mon, 20 Jan 2020)
Log Message:
-----------
gmp-6.2.0
Modified Paths:
--------------
trunk/Build/source/libs/README
trunk/Build/source/libs/gmp/ChangeLog
trunk/Build/source/libs/gmp/Makefile.am
trunk/Build/source/libs/gmp/Makefile.in
trunk/Build/source/libs/gmp/README
trunk/Build/source/libs/gmp/TLpatches/ChangeLog
trunk/Build/source/libs/gmp/TLpatches/TL-Changes
trunk/Build/source/libs/gmp/configure
trunk/Build/source/libs/gmp/gmp-src/AUTHORS
trunk/Build/source/libs/gmp/gmp-src/ChangeLog
trunk/Build/source/libs/gmp/gmp-src/Makefile.am
trunk/Build/source/libs/gmp/gmp-src/NEWS
trunk/Build/source/libs/gmp/gmp-src/acinclude.m4
trunk/Build/source/libs/gmp/gmp-src/assert.c
trunk/Build/source/libs/gmp/gmp-src/bootstrap.c
trunk/Build/source/libs/gmp/gmp-src/compat.c
trunk/Build/source/libs/gmp/gmp-src/config.in
trunk/Build/source/libs/gmp/gmp-src/configgmp.guess
trunk/Build/source/libs/gmp/gmp-src/configgmp.sub
trunk/Build/source/libs/gmp/gmp-src/configure.ac
trunk/Build/source/libs/gmp/gmp-src/errno.c
trunk/Build/source/libs/gmp/gmp-src/extract-dbl.c
trunk/Build/source/libs/gmp/gmp-src/gen-bases.c
trunk/Build/source/libs/gmp/gmp-src/gen-fac.c
trunk/Build/source/libs/gmp/gmp-src/gen-trialdivtab.c
trunk/Build/source/libs/gmp/gmp-src/gmp-h.in
trunk/Build/source/libs/gmp/gmp-src/gmp-impl.h
trunk/Build/source/libs/gmp/gmp-src/gmpxx.h
trunk/Build/source/libs/gmp/gmp-src/invalid.c
trunk/Build/source/libs/gmp/gmp-src/longlong.h
trunk/Build/source/libs/gmp/gmp-src/memory.c
trunk/Build/source/libs/gmp/gmp-src/mini-gmp/README
trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c
trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.h
trunk/Build/source/libs/gmp/gmp-src/mp_bpl.c
trunk/Build/source/libs/gmp/gmp-src/mp_clz_tab.c
trunk/Build/source/libs/gmp/gmp-src/mp_dv_tab.c
trunk/Build/source/libs/gmp/gmp-src/mp_get_fns.c
trunk/Build/source/libs/gmp/gmp-src/mp_minv_tab.c
trunk/Build/source/libs/gmp/gmp-src/mp_set_fns.c
trunk/Build/source/libs/gmp/gmp-src/mpf/abs.c
trunk/Build/source/libs/gmp/gmp-src/mpf/add.c
trunk/Build/source/libs/gmp/gmp-src/mpf/add_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/ceilfloor.c
trunk/Build/source/libs/gmp/gmp-src/mpf/clear.c
trunk/Build/source/libs/gmp/gmp-src/mpf/clears.c
trunk/Build/source/libs/gmp/gmp-src/mpf/cmp.c
trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_d.c
trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_si.c
trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_z.c
trunk/Build/source/libs/gmp/gmp-src/mpf/div.c
trunk/Build/source/libs/gmp/gmp-src/mpf/div_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpf/div_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/dump.c
trunk/Build/source/libs/gmp/gmp-src/mpf/eq.c
trunk/Build/source/libs/gmp/gmp-src/mpf/fits_s.h
trunk/Build/source/libs/gmp/gmp-src/mpf/fits_u.h
trunk/Build/source/libs/gmp/gmp-src/mpf/get_d.c
trunk/Build/source/libs/gmp/gmp-src/mpf/get_d_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpf/get_dfl_prec.c
trunk/Build/source/libs/gmp/gmp-src/mpf/get_prc.c
trunk/Build/source/libs/gmp/gmp-src/mpf/get_si.c
trunk/Build/source/libs/gmp/gmp-src/mpf/get_str.c
trunk/Build/source/libs/gmp/gmp-src/mpf/get_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/init.c
trunk/Build/source/libs/gmp/gmp-src/mpf/init2.c
trunk/Build/source/libs/gmp/gmp-src/mpf/inits.c
trunk/Build/source/libs/gmp/gmp-src/mpf/inp_str.c
trunk/Build/source/libs/gmp/gmp-src/mpf/int_p.c
trunk/Build/source/libs/gmp/gmp-src/mpf/iset.c
trunk/Build/source/libs/gmp/gmp-src/mpf/iset_d.c
trunk/Build/source/libs/gmp/gmp-src/mpf/iset_si.c
trunk/Build/source/libs/gmp/gmp-src/mpf/iset_str.c
trunk/Build/source/libs/gmp/gmp-src/mpf/iset_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/mul.c
trunk/Build/source/libs/gmp/gmp-src/mpf/mul_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpf/mul_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/neg.c
trunk/Build/source/libs/gmp/gmp-src/mpf/out_str.c
trunk/Build/source/libs/gmp/gmp-src/mpf/pow_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/random2.c
trunk/Build/source/libs/gmp/gmp-src/mpf/reldiff.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_d.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_dfl_prec.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc_raw.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_q.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_si.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_str.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/set_z.c
trunk/Build/source/libs/gmp/gmp-src/mpf/size.c
trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt.c
trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/sub.c
trunk/Build/source/libs/gmp/gmp-src/mpf/sub_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpf/swap.c
trunk/Build/source/libs/gmp/gmp-src/mpf/trunc.c
trunk/Build/source/libs/gmp/gmp-src/mpf/ui_div.c
trunk/Build/source/libs/gmp/gmp-src/mpf/ui_sub.c
trunk/Build/source/libs/gmp/gmp-src/mpf/urandomb.c
trunk/Build/source/libs/gmp/gmp-src/mpn/Makefile.am
trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/dive_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev5/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/aorslsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/arm-defs.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_dbm1c.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/cnd_aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/com.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/dive_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/invert_limb.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/logops_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mod_34lsub1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mode1o.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lorrshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rsh1aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/sec_tabselect.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/udiv.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_3.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora7/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cnd_aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/com.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/logops_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mod_34lsub1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sec_tabselect.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/asm-defs.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/add_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/addmul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/mul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/submul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/hamdist.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/addmul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/invert_limb.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/sqr_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/submul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/lshift.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/mulww.f
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/popcount.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/rshift.c
trunk/Build/source/libs/gmp/gmp-src/mpn/cray/sub_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err1_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err2_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err3_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n_sub_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/addmul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_dbm1c.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/binvert.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/broot.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/brootinv.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrt.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrtinv.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cmp.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_add_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_sub_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_swap.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/com.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/comb_tables.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyd.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyi.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_divappr_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1u_pi2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2n_pi1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2u_pi1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dive_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/diveby3.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divexact.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divis.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dump.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_subdiv_step.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_lehmer.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_d.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_str.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2_jacobi.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_appr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_jacobi.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_matrix.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_reduce.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_step.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invert.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invertappr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacbase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi_2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/logops_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshift.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshiftc.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul1_inverse_vector.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_3.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_4.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_34lsub1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mode1o.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_divappr_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_fft.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmod_bnm1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/neg.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/nussbaumer_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfpow.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfsqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/popham.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pow_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powlo.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powm.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_divrem_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_mod_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/remove.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rootrem.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rshift.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_divappr_q.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan0.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_aors_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_div.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_invert.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_pi1_div.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_powm.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_tabselect.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/set_str.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sizeinbase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo_basecase.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrmod_bnm1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrtrem.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err1_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err2_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err3_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_n.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/submul_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/tdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom22_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom2_sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom32_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom33_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom3_sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mulmid.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom43_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom44_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom4_sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom52_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom53_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom54_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom62_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom63_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6_sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6h_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8_sqr.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8h_mul.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_couple_handling.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2rexp.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_12pts.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_16pts.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_5pts.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_6pts.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_7pts.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_8pts.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/trialdiv.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/udiv_w_sdiv.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero_p.c
trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/lisp/gmpasm-mode.el
trunk/Build/source/libs/gmp/gmp-src/mpn/pa64/umul.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/divrem_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p4/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p7/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/powerpc-defs.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/aix.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/darwin.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/p4/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/submul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/dive_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/divrem_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p4/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/invert_limb.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/README
trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc32/sparc-defs.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/dive_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/divrem_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1_4.c
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mode1o.c
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/sparc64.h
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/cnd_aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/atom/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd1/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/core2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreihwl/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreinhm/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreisbr/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/fat/fat.c
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k10/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k7/addlsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k7/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k7/sublsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k8/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/p6/mmx/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/p6/sse2/submul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/pentium/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/pentium4/sse2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/pentium4/sse2/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/x86-defs.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/aorrlshC_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/rshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/sublshC_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreibwl/addmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreibwl/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreibwl/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreibwl/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreibwl/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/mullo_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreinhm/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreinhm/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreinhm/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreinhm/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/aorrlsh2_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/darwin.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/div_qr_1n_pi1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/divrem_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/dos64.m4
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/com-palignr.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/com.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/copyi-palignr.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fastsse/sec_tabselect.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fat/fat.c
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fat/fat_entry.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/invert_limb.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/rshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k8/div_qr_1n_pi1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k8/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/logops_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mod_1_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mod_1_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mod_1_4.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mod_34lsub1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mulx/adx/addmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/popham.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/skylake/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/sqr_diag_addlsh1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/x86_64-defs.m4
trunk/Build/source/libs/gmp/gmp-src/mpq/abs.c
trunk/Build/source/libs/gmp/gmp-src/mpq/aors.c
trunk/Build/source/libs/gmp/gmp-src/mpq/canonicalize.c
trunk/Build/source/libs/gmp/gmp-src/mpq/clear.c
trunk/Build/source/libs/gmp/gmp-src/mpq/clears.c
trunk/Build/source/libs/gmp/gmp-src/mpq/cmp.c
trunk/Build/source/libs/gmp/gmp-src/mpq/cmp_si.c
trunk/Build/source/libs/gmp/gmp-src/mpq/cmp_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpq/div.c
trunk/Build/source/libs/gmp/gmp-src/mpq/equal.c
trunk/Build/source/libs/gmp/gmp-src/mpq/get_d.c
trunk/Build/source/libs/gmp/gmp-src/mpq/get_den.c
trunk/Build/source/libs/gmp/gmp-src/mpq/get_num.c
trunk/Build/source/libs/gmp/gmp-src/mpq/get_str.c
trunk/Build/source/libs/gmp/gmp-src/mpq/init.c
trunk/Build/source/libs/gmp/gmp-src/mpq/inits.c
trunk/Build/source/libs/gmp/gmp-src/mpq/inp_str.c
trunk/Build/source/libs/gmp/gmp-src/mpq/inv.c
trunk/Build/source/libs/gmp/gmp-src/mpq/md_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpq/mul.c
trunk/Build/source/libs/gmp/gmp-src/mpq/neg.c
trunk/Build/source/libs/gmp/gmp-src/mpq/out_str.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_d.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_den.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_f.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_num.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_si.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_str.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpq/set_z.c
trunk/Build/source/libs/gmp/gmp-src/mpq/swap.c
trunk/Build/source/libs/gmp/gmp-src/mpz/2fac_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/Makefile.am
trunk/Build/source/libs/gmp/gmp-src/mpz/abs.c
trunk/Build/source/libs/gmp/gmp-src/mpz/and.c
trunk/Build/source/libs/gmp/gmp-src/mpz/aors.h
trunk/Build/source/libs/gmp/gmp-src/mpz/aors_ui.h
trunk/Build/source/libs/gmp/gmp-src/mpz/aorsmul.c
trunk/Build/source/libs/gmp/gmp-src/mpz/aorsmul_i.c
trunk/Build/source/libs/gmp/gmp-src/mpz/array_init.c
trunk/Build/source/libs/gmp/gmp-src/mpz/bin_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/bin_uiui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_q_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_qr_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_r.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_r_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cdiv_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cfdiv_q_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cfdiv_r_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/clear.c
trunk/Build/source/libs/gmp/gmp-src/mpz/clears.c
trunk/Build/source/libs/gmp/gmp-src/mpz/clrbit.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmp_d.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmp_si.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmp_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmpabs.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmpabs_d.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cmpabs_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/com.c
trunk/Build/source/libs/gmp/gmp-src/mpz/combit.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cong.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cong_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/cong_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/dive_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/divegcd.c
trunk/Build/source/libs/gmp/gmp-src/mpz/divexact.c
trunk/Build/source/libs/gmp/gmp-src/mpz/divis.c
trunk/Build/source/libs/gmp/gmp-src/mpz/divis_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/divis_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/dump.c
trunk/Build/source/libs/gmp/gmp-src/mpz/export.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fac_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_q_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_qr_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_r.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_r_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fdiv_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fib2_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fib_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fits_s.h
trunk/Build/source/libs/gmp/gmp-src/mpz/fits_uint.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fits_ulong.c
trunk/Build/source/libs/gmp/gmp-src/mpz/fits_ushort.c
trunk/Build/source/libs/gmp/gmp-src/mpz/gcd.c
trunk/Build/source/libs/gmp/gmp-src/mpz/gcd_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/gcdext.c
trunk/Build/source/libs/gmp/gmp-src/mpz/get_d.c
trunk/Build/source/libs/gmp/gmp-src/mpz/get_d_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/get_si.c
trunk/Build/source/libs/gmp/gmp-src/mpz/get_str.c
trunk/Build/source/libs/gmp/gmp-src/mpz/get_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/getlimbn.c
trunk/Build/source/libs/gmp/gmp-src/mpz/hamdist.c
trunk/Build/source/libs/gmp/gmp-src/mpz/import.c
trunk/Build/source/libs/gmp/gmp-src/mpz/init.c
trunk/Build/source/libs/gmp/gmp-src/mpz/init2.c
trunk/Build/source/libs/gmp/gmp-src/mpz/inits.c
trunk/Build/source/libs/gmp/gmp-src/mpz/inp_raw.c
trunk/Build/source/libs/gmp/gmp-src/mpz/inp_str.c
trunk/Build/source/libs/gmp/gmp-src/mpz/invert.c
trunk/Build/source/libs/gmp/gmp-src/mpz/ior.c
trunk/Build/source/libs/gmp/gmp-src/mpz/iset.c
trunk/Build/source/libs/gmp/gmp-src/mpz/iset_d.c
trunk/Build/source/libs/gmp/gmp-src/mpz/iset_si.c
trunk/Build/source/libs/gmp/gmp-src/mpz/iset_str.c
trunk/Build/source/libs/gmp/gmp-src/mpz/iset_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/jacobi.c
trunk/Build/source/libs/gmp/gmp-src/mpz/kronsz.c
trunk/Build/source/libs/gmp/gmp-src/mpz/kronuz.c
trunk/Build/source/libs/gmp/gmp-src/mpz/kronzs.c
trunk/Build/source/libs/gmp/gmp-src/mpz/kronzu.c
trunk/Build/source/libs/gmp/gmp-src/mpz/lcm.c
trunk/Build/source/libs/gmp/gmp-src/mpz/lcm_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/limbs_finish.c
trunk/Build/source/libs/gmp/gmp-src/mpz/limbs_modify.c
trunk/Build/source/libs/gmp/gmp-src/mpz/limbs_read.c
trunk/Build/source/libs/gmp/gmp-src/mpz/limbs_write.c
trunk/Build/source/libs/gmp/gmp-src/mpz/lucnum2_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/lucnum_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/mfac_uiui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/millerrabin.c
trunk/Build/source/libs/gmp/gmp-src/mpz/mod.c
trunk/Build/source/libs/gmp/gmp-src/mpz/mul.c
trunk/Build/source/libs/gmp/gmp-src/mpz/mul_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/mul_i.h
trunk/Build/source/libs/gmp/gmp-src/mpz/n_pow_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/neg.c
trunk/Build/source/libs/gmp/gmp-src/mpz/nextprime.c
trunk/Build/source/libs/gmp/gmp-src/mpz/oddfac_1.c
trunk/Build/source/libs/gmp/gmp-src/mpz/out_raw.c
trunk/Build/source/libs/gmp/gmp-src/mpz/out_str.c
trunk/Build/source/libs/gmp/gmp-src/mpz/perfpow.c
trunk/Build/source/libs/gmp/gmp-src/mpz/perfsqr.c
trunk/Build/source/libs/gmp/gmp-src/mpz/popcount.c
trunk/Build/source/libs/gmp/gmp-src/mpz/pow_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/powm.c
trunk/Build/source/libs/gmp/gmp-src/mpz/powm_sec.c
trunk/Build/source/libs/gmp/gmp-src/mpz/powm_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/pprime_p.c
trunk/Build/source/libs/gmp/gmp-src/mpz/primorial_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/prodlimbs.c
trunk/Build/source/libs/gmp/gmp-src/mpz/random.c
trunk/Build/source/libs/gmp/gmp-src/mpz/random2.c
trunk/Build/source/libs/gmp/gmp-src/mpz/realloc.c
trunk/Build/source/libs/gmp/gmp-src/mpz/realloc2.c
trunk/Build/source/libs/gmp/gmp-src/mpz/remove.c
trunk/Build/source/libs/gmp/gmp-src/mpz/roinit_n.c
trunk/Build/source/libs/gmp/gmp-src/mpz/root.c
trunk/Build/source/libs/gmp/gmp-src/mpz/rootrem.c
trunk/Build/source/libs/gmp/gmp-src/mpz/rrandomb.c
trunk/Build/source/libs/gmp/gmp-src/mpz/scan0.c
trunk/Build/source/libs/gmp/gmp-src/mpz/scan1.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set_d.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set_f.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set_q.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set_si.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set_str.c
trunk/Build/source/libs/gmp/gmp-src/mpz/set_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/setbit.c
trunk/Build/source/libs/gmp/gmp-src/mpz/size.c
trunk/Build/source/libs/gmp/gmp-src/mpz/sizeinbase.c
trunk/Build/source/libs/gmp/gmp-src/mpz/sqrt.c
trunk/Build/source/libs/gmp/gmp-src/mpz/sqrtrem.c
trunk/Build/source/libs/gmp/gmp-src/mpz/swap.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_q.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_q_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_q_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_qr.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_qr_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_r.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_r_2exp.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_r_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tdiv_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/tstbit.c
trunk/Build/source/libs/gmp/gmp-src/mpz/ui_pow_ui.c
trunk/Build/source/libs/gmp/gmp-src/mpz/ui_sub.c
trunk/Build/source/libs/gmp/gmp-src/mpz/urandomb.c
trunk/Build/source/libs/gmp/gmp-src/mpz/urandomm.c
trunk/Build/source/libs/gmp/gmp-src/mpz/xor.c
trunk/Build/source/libs/gmp/gmp-src/nextprime.c
trunk/Build/source/libs/gmp/gmp-src/primesieve.c
trunk/Build/source/libs/gmp/gmp-src/printf/asprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/asprntffuns.c
trunk/Build/source/libs/gmp/gmp-src/printf/doprnt.c
trunk/Build/source/libs/gmp/gmp-src/printf/doprntf.c
trunk/Build/source/libs/gmp/gmp-src/printf/doprnti.c
trunk/Build/source/libs/gmp/gmp-src/printf/fprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/obprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/obprntffuns.c
trunk/Build/source/libs/gmp/gmp-src/printf/obvprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/printf.c
trunk/Build/source/libs/gmp/gmp-src/printf/printffuns.c
trunk/Build/source/libs/gmp/gmp-src/printf/repl-vsnprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/snprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/snprntffuns.c
trunk/Build/source/libs/gmp/gmp-src/printf/sprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/sprintffuns.c
trunk/Build/source/libs/gmp/gmp-src/printf/vasprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/vfprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/vprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/vsnprintf.c
trunk/Build/source/libs/gmp/gmp-src/printf/vsprintf.c
trunk/Build/source/libs/gmp/gmp-src/rand/rand.c
trunk/Build/source/libs/gmp/gmp-src/rand/randbui.c
trunk/Build/source/libs/gmp/gmp-src/rand/randclr.c
trunk/Build/source/libs/gmp/gmp-src/rand/randdef.c
trunk/Build/source/libs/gmp/gmp-src/rand/randiset.c
trunk/Build/source/libs/gmp/gmp-src/rand/randlc2s.c
trunk/Build/source/libs/gmp/gmp-src/rand/randlc2x.c
trunk/Build/source/libs/gmp/gmp-src/rand/randmt.c
trunk/Build/source/libs/gmp/gmp-src/rand/randmts.c
trunk/Build/source/libs/gmp/gmp-src/rand/randmui.c
trunk/Build/source/libs/gmp/gmp-src/rand/rands.c
trunk/Build/source/libs/gmp/gmp-src/rand/randsd.c
trunk/Build/source/libs/gmp/gmp-src/rand/randsdui.c
trunk/Build/source/libs/gmp/gmp-src/scanf/doscan.c
trunk/Build/source/libs/gmp/gmp-src/scanf/fscanf.c
trunk/Build/source/libs/gmp/gmp-src/scanf/fscanffuns.c
trunk/Build/source/libs/gmp/gmp-src/scanf/scanf.c
trunk/Build/source/libs/gmp/gmp-src/scanf/sscanf.c
trunk/Build/source/libs/gmp/gmp-src/scanf/sscanffuns.c
trunk/Build/source/libs/gmp/gmp-src/scanf/vfscanf.c
trunk/Build/source/libs/gmp/gmp-src/scanf/vscanf.c
trunk/Build/source/libs/gmp/gmp-src/scanf/vsscanf.c
trunk/Build/source/libs/gmp/gmp-src/tal-debug.c
trunk/Build/source/libs/gmp/gmp-src/tal-notreent.c
trunk/Build/source/libs/gmp/gmp-src/tal-reent.c
trunk/Build/source/libs/gmp/gmp-src/version.c
trunk/Build/source/libs/gmp/version.ac
Added Paths:
-----------
trunk/Build/source/libs/gmp/gmp-src/asl.h
trunk/Build/source/libs/gmp/gmp-src/gmp.pc.in
trunk/Build/source/libs/gmp/gmp-src/gmpxx.pc.in
trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.c
trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.h
trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/addmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mod_34lsub1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/submul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora5/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora5/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh2_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlshC_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/cnd_aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora57/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora57/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora72/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora72/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora73/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora73/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rsh1aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sqr_diag_addlsh1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/xgene1/
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/xgene1/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/compute_powtab.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2m.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_11.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_22.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_r.c
trunk/Build/source/libs/gmp/gmp-src/mpn/generic/strongfibo.c
trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/addmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/sqr_diagonal.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/submul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/umul.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/add_n_sub_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/
trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/
trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct45/
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct45/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd4/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd4/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt1/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt1/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt2/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreibwl/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreibwl/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/goldmont/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/goldmont/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k7/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/p6/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/silvermont/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/silvermont/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/skylake/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/skylake/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/zn1/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/zn1/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/zn2/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/zn2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/cnd_add_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/atom/cnd_sub_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/aorrlsh_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd2/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd2/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd4/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd4/aorrlsh_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd4/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd4/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd4/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/redc_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt1/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/com.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bt2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/com.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/logops_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreibwl/mullo_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/aorrlsh_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreihwl/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/cnd_add_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/cnd_sub_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/fat/addmul_2.c
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/aorrlsh_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/goldmont/redc_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k8/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k8/bdiv_q_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/nano/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/mul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/mullo_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/redc_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/pentium4/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/aorrlsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/aorrlsh2_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/aors_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/mullo_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/rshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/silvermont/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/aorrlsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/aorrlsh_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/com.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/copyd.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/copyi.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/gcd_11.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/gcd_22.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/hamdist.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/lshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/lshiftc.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/mul_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/mullo_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/rshift.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/sbpi1_bdiv_r.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/sqr_basecase.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen/sublsh1_n.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen2/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/zen2/gmp-mparam.h
trunk/Build/source/libs/gmp/gmp-src/mpz/lucmod.c
trunk/Build/source/libs/gmp/gmp-src/mpz/stronglucas.c
Removed Paths:
-------------
trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/addmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/sqr_diagonal.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/submul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/umul.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bobcat/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/fat/gcd_1.c
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k6/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/k7/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86/p6/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/addmul_2.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bd1/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/bobcat/
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/core2/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/coreisbr/popcount.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/k10/gcd_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mulx/aorsmul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/mulx/mul_1.asm
trunk/Build/source/libs/gmp/gmp-src/mpn/x86_64/nano/gcd_1.asm
Modified: trunk/Build/source/libs/README
===================================================================
--- trunk/Build/source/libs/README 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/README 2020-01-19 23:36:31 UTC (rev 53461)
@@ -18,7 +18,7 @@
gd 2.2.5 - checked 30aug17
https://github.com/libgd/libgd/releases
-gmp 6.1.2 - checked 16dec16
+gmp 6.2.0 - checked 20jan20
http://ftp.gnu.org/gnu/gmp/
graphite2 1.3.13 - checked 21dec18
Modified: trunk/Build/source/libs/gmp/ChangeLog
===================================================================
--- trunk/Build/source/libs/gmp/ChangeLog 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/ChangeLog 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,3 +1,8 @@
+2020-01-20 Akira Kakuto <kakuto at w32tex.org>
+
+ Import gmp-6.2.0.
+ * Makefile.am, version.ac: Updated for 6.2.0.
+
2017-12-27 Akira Kakuto <kakuto at fuk.kindai.ac.jp>
Makefile.am: Move several files from unused to used
Modified: trunk/Build/source/libs/gmp/Makefile.am
===================================================================
--- trunk/Build/source/libs/gmp/Makefile.am 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/Makefile.am 2020-01-19 23:36:31 UTC (rev 53461)
@@ -86,9 +86,11 @@
@GMP_TREE@/mpn/generic/addmul_1.c \
@GMP_TREE@/mpn/generic/bdiv_dbm1c.c \
@GMP_TREE@/mpn/generic/bdiv_q.c \
+ @GMP_TREE@/mpn/generic/bdiv_q_1.c \
@GMP_TREE@/mpn/generic/binvert.c \
@GMP_TREE@/mpn/generic/cmp.c \
@GMP_TREE@/mpn/generic/com.c \
+ @GMP_TREE@/mpn/generic/compute_powtab.c \
@GMP_TREE@/mpn/generic/copyd.c \
@GMP_TREE@/mpn/generic/copyi.c \
@GMP_TREE@/mpn/generic/dcpi1_bdiv_q.c \
@@ -199,7 +201,6 @@
@GMP_TREE@/mpn/generic/add_err2_n.c \
@GMP_TREE@/mpn/generic/add_err3_n.c \
@GMP_TREE@/mpn/generic/add_n_sub_n.c \
- @GMP_TREE@/mpn/generic/bdiv_q_1.c \
@GMP_TREE@/mpn/generic/bdiv_qr.c \
@GMP_TREE@/mpn/generic/broot.c \
@GMP_TREE@/mpn/generic/brootinv.c \
@@ -216,8 +217,11 @@
@GMP_TREE@/mpn/generic/divis.c \
@GMP_TREE@/mpn/generic/dump.c \
@GMP_TREE@/mpn/generic/fib2_ui.c \
+ @GMP_TREE@/mpn/generic/fib2m.c \
@GMP_TREE@/mpn/generic/gcd.c \
@GMP_TREE@/mpn/generic/gcd_1.c \
+ @GMP_TREE@/mpn/generic/gcd_11.c \
+ @GMP_TREE@/mpn/generic/gcd_22.c \
@GMP_TREE@/mpn/generic/get_d.c \
@GMP_TREE@/mpn/generic/hgcd2_jacobi.c \
@GMP_TREE@/mpn/generic/hgcd_jacobi.c \
@@ -245,6 +249,7 @@
@GMP_TREE@/mpn/generic/redc_2.c \
@GMP_TREE@/mpn/generic/remove.c \
@GMP_TREE@/mpn/generic/rootrem.c \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_r.c \
@GMP_TREE@/mpn/generic/scan0.c \
@GMP_TREE@/mpn/generic/sec_invert.c \
@GMP_TREE@/mpn/generic/sec_mul.c \
@@ -252,6 +257,7 @@
@GMP_TREE@/mpn/generic/sec_sqr.c \
@GMP_TREE@/mpn/generic/sec_tabselect.c \
@GMP_TREE@/mpn/generic/sizeinbase.c \
+ @GMP_TREE@/mpn/generic/strongfibo.c \
@GMP_TREE@/mpn/generic/sub_err1_n.c \
@GMP_TREE@/mpn/generic/sub_err2_n.c \
@GMP_TREE@/mpn/generic/sub_err3_n.c \
Modified: trunk/Build/source/libs/gmp/Makefile.in
===================================================================
--- trunk/Build/source/libs/gmp/Makefile.in 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/Makefile.in 2020-01-19 23:36:31 UTC (rev 53461)
@@ -137,9 +137,11 @@
@GMP_TREE@/mpn/generic/addmul_1.$(OBJEXT) \
@GMP_TREE@/mpn/generic/bdiv_dbm1c.$(OBJEXT) \
@GMP_TREE@/mpn/generic/bdiv_q.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/bdiv_q_1.$(OBJEXT) \
@GMP_TREE@/mpn/generic/binvert.$(OBJEXT) \
@GMP_TREE@/mpn/generic/cmp.$(OBJEXT) \
@GMP_TREE@/mpn/generic/com.$(OBJEXT) \
+ @GMP_TREE@/mpn/generic/compute_powtab.$(OBJEXT) \
@GMP_TREE@/mpn/generic/copyd.$(OBJEXT) \
@GMP_TREE@/mpn/generic/copyi.$(OBJEXT) \
@GMP_TREE@/mpn/generic/dcpi1_bdiv_q.$(OBJEXT) \
@@ -322,9 +324,11 @@
@GMP_TREE@/mpn/generic/$(DEPDIR)/addmul_1.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_dbm1c.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q.Po \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q_1.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/binvert.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/cmp.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/com.Po \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/compute_powtab.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/copyd.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/copyi.Po \
@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_bdiv_q.Po \
@@ -956,9 +960,11 @@
@GMP_TREE@/mpn/generic/addmul_1.c \
@GMP_TREE@/mpn/generic/bdiv_dbm1c.c \
@GMP_TREE@/mpn/generic/bdiv_q.c \
+ @GMP_TREE@/mpn/generic/bdiv_q_1.c \
@GMP_TREE@/mpn/generic/binvert.c \
@GMP_TREE@/mpn/generic/cmp.c \
@GMP_TREE@/mpn/generic/com.c \
+ @GMP_TREE@/mpn/generic/compute_powtab.c \
@GMP_TREE@/mpn/generic/copyd.c \
@GMP_TREE@/mpn/generic/copyi.c \
@GMP_TREE@/mpn/generic/dcpi1_bdiv_q.c \
@@ -1069,7 +1075,6 @@
@GMP_TREE@/mpn/generic/add_err2_n.c \
@GMP_TREE@/mpn/generic/add_err3_n.c \
@GMP_TREE@/mpn/generic/add_n_sub_n.c \
- @GMP_TREE@/mpn/generic/bdiv_q_1.c \
@GMP_TREE@/mpn/generic/bdiv_qr.c \
@GMP_TREE@/mpn/generic/broot.c \
@GMP_TREE@/mpn/generic/brootinv.c \
@@ -1086,8 +1091,11 @@
@GMP_TREE@/mpn/generic/divis.c \
@GMP_TREE@/mpn/generic/dump.c \
@GMP_TREE@/mpn/generic/fib2_ui.c \
+ @GMP_TREE@/mpn/generic/fib2m.c \
@GMP_TREE@/mpn/generic/gcd.c \
@GMP_TREE@/mpn/generic/gcd_1.c \
+ @GMP_TREE@/mpn/generic/gcd_11.c \
+ @GMP_TREE@/mpn/generic/gcd_22.c \
@GMP_TREE@/mpn/generic/get_d.c \
@GMP_TREE@/mpn/generic/hgcd2_jacobi.c \
@GMP_TREE@/mpn/generic/hgcd_jacobi.c \
@@ -1115,6 +1123,7 @@
@GMP_TREE@/mpn/generic/redc_2.c \
@GMP_TREE@/mpn/generic/remove.c \
@GMP_TREE@/mpn/generic/rootrem.c \
+ @GMP_TREE@/mpn/generic/sbpi1_bdiv_r.c \
@GMP_TREE@/mpn/generic/scan0.c \
@GMP_TREE@/mpn/generic/sec_invert.c \
@GMP_TREE@/mpn/generic/sec_mul.c \
@@ -1122,6 +1131,7 @@
@GMP_TREE@/mpn/generic/sec_sqr.c \
@GMP_TREE@/mpn/generic/sec_tabselect.c \
@GMP_TREE@/mpn/generic/sizeinbase.c \
+ @GMP_TREE@/mpn/generic/strongfibo.c \
@GMP_TREE@/mpn/generic/sub_err1_n.c \
@GMP_TREE@/mpn/generic/sub_err2_n.c \
@GMP_TREE@/mpn/generic/sub_err3_n.c \
@@ -1432,6 +1442,9 @@
@GMP_TREE@/mpn/generic/bdiv_q.$(OBJEXT): \
@GMP_TREE@/mpn/generic/$(am__dirstamp) \
@GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+ at GMP_TREE@/mpn/generic/bdiv_q_1.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
@GMP_TREE@/mpn/generic/binvert.$(OBJEXT): \
@GMP_TREE@/mpn/generic/$(am__dirstamp) \
@GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
@@ -1441,6 +1454,9 @@
@GMP_TREE@/mpn/generic/com.$(OBJEXT): \
@GMP_TREE@/mpn/generic/$(am__dirstamp) \
@GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
+ at GMP_TREE@/mpn/generic/compute_powtab.$(OBJEXT): \
+ @GMP_TREE@/mpn/generic/$(am__dirstamp) \
+ @GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
@GMP_TREE@/mpn/generic/copyd.$(OBJEXT): \
@GMP_TREE@/mpn/generic/$(am__dirstamp) \
@GMP_TREE@/mpn/generic/$(DEPDIR)/$(am__dirstamp)
@@ -1887,9 +1903,11 @@
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/addmul_1.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_dbm1c.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q.Po at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q_1.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/binvert.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/cmp.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/com.Po at am__quote@ # am--include-marker
+ at AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/compute_powtab.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/copyd.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/copyi.Po at am__quote@ # am--include-marker
@AMDEP_TRUE@@am__include@ @am__quote@@GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_bdiv_q.Po at am__quote@ # am--include-marker
@@ -2613,9 +2631,11 @@
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/addmul_1.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_dbm1c.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q.Po
+ -rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q_1.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/binvert.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/cmp.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/com.Po
+ -rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/compute_powtab.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/copyd.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/copyi.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_bdiv_q.Po
@@ -2837,9 +2857,11 @@
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/addmul_1.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_dbm1c.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q.Po
+ -rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/bdiv_q_1.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/binvert.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/cmp.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/com.Po
+ -rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/compute_powtab.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/copyd.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/copyi.Po
-rm -f @GMP_TREE@/mpn/generic/$(DEPDIR)/dcpi1_bdiv_q.Po
Modified: trunk/Build/source/libs/gmp/README
===================================================================
--- trunk/Build/source/libs/gmp/README 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/README 2020-01-19 23:36:31 UTC (rev 53461)
@@ -15,4 +15,4 @@
=============================
2014-03-31 Taco Hoekwater <taco at metatex.org>
-2015-12-28 Akira Kakuto <kakuto at fuk.kindai.ac.jp>
+2020-01-20 Akira Kakuto <kakuto at fuk.kindai.ac.jp>
Modified: trunk/Build/source/libs/gmp/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/libs/gmp/TLpatches/ChangeLog 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/TLpatches/ChangeLog 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,3 +1,7 @@
+2020-01-20 Akira Kakuto <kakuto at w32tex.org>
+
+ * Import 6.2.0.
+
2016-12-16 Akira Kakuto <kakuto at fuk.kindai.ac.jp>
* Import 6.1.2.
Modified: trunk/Build/source/libs/gmp/TLpatches/TL-Changes
===================================================================
--- trunk/Build/source/libs/gmp/TLpatches/TL-Changes 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/TLpatches/TL-Changes 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,4 +1,4 @@
-Changes applied to the gmp-6.1.2/ tree as obtained from:
+Changes applied to the gmp-6.2.0/ tree as obtained from:
http://ftp.gnu.org/gnu/gmp/
Removed:
Modified: trunk/Build/source/libs/gmp/configure
===================================================================
--- trunk/Build/source/libs/gmp/configure 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/configure 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for gmp (TeX Live) 6.1.2.
+# Generated by GNU Autoconf 2.69 for gmp (TeX Live) 6.2.0.
#
# Report bugs to <tex-k at tug.org>.
#
@@ -580,8 +580,8 @@
# Identity of this package.
PACKAGE_NAME='gmp (TeX Live)'
PACKAGE_TARNAME='gmp--tex-live-'
-PACKAGE_VERSION='6.1.2'
-PACKAGE_STRING='gmp (TeX Live) 6.1.2'
+PACKAGE_VERSION='6.2.0'
+PACKAGE_STRING='gmp (TeX Live) 6.2.0'
PACKAGE_BUGREPORT='tex-k at tug.org'
PACKAGE_URL=''
@@ -1294,7 +1294,7 @@
# 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 gmp (TeX Live) 6.1.2 to adapt to many kinds of systems.
+\`configure' configures gmp (TeX Live) 6.2.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1364,7 +1364,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of gmp (TeX Live) 6.1.2:";;
+ short | recursive ) echo "Configuration of gmp (TeX Live) 6.2.0:";;
esac
cat <<\_ACEOF
@@ -1461,7 +1461,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-gmp (TeX Live) configure 6.1.2
+gmp (TeX Live) configure 6.2.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1976,7 +1976,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by gmp (TeX Live) $as_me 6.1.2, which was
+It was created by gmp (TeX Live) $as_me 6.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3900,7 +3900,7 @@
# Define the identity of the package.
PACKAGE='gmp--tex-live-'
- VERSION='6.1.2'
+ VERSION='6.2.0'
cat >>confdefs.h <<_ACEOF
@@ -7004,7 +7004,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by gmp (TeX Live) $as_me 6.1.2, which was
+This file was extended by gmp (TeX Live) $as_me 6.2.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -7070,7 +7070,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-gmp (TeX Live) config.status 6.1.2
+gmp (TeX Live) config.status 6.2.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
Modified: trunk/Build/source/libs/gmp/gmp-src/AUTHORS
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/AUTHORS 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/AUTHORS 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,10 +33,10 @@
Niels Möller gen-jacobitab.c,
mpn/generic/hgcd2.c, hgcd.c, hgcd_step.c,
hgcd_appr.c, hgcd_matrix.c, hgcd_reduce.c,
- gcd.c, gcdext.c, matrix22_mul.c,
+ gcd.c, gcd_11.c, gcd_22.c, gcdext.c, matrix22_mul.c,
gcdext_1.c, gcd_subdiv_step.c, gcd_lehmer.c,
gcdext_subdiv_step.c, gcdext_lehmer.c,
- jacobi_2.c, jacbase.c, hgcd_jacobi.c, hgcd2_jacobi.c
+ jacobi_2.c, jacbase.c, hgcd_jacobi.c, hgcd2_jacobi.c,
matrix22_mul1_inverse_vector.c,
toom_interpolate_7pts, mulmod_bnm1.c, dcpi1_bdiv_qr.c,
dcpi1_bdiv_q.c, sbpi1_bdiv_qr.c, sbpi1_bdiv_q.c,
@@ -62,9 +62,15 @@
toom8h_mul.c, toom8_sqr.c, toom_interpolate_16pts.c,
mulmod_bnm1.c, sqrmod_bnm1.c, nussbaumer_mul.c,
toom_eval_pm2.c, toom_eval_pm2rexp.c,
+ fib2m.c, strongfibo.c,
mullo_n.c, sqrlo.c, invert.c, invertappr.c;
+ mpn/x86/atom/aors_n.asm, aorslshC_n.asm,
+ aorrlsh{1,2,C}_n.asm, aorsmul_1.asm, logops_n.asm,
+ sublsh2_n.asm, rshift.asm; primesieve.c;
mpz/fac_ui.c, 2fac_ui.c, mfac_uiui.c, oddfac_1.c,
- primorial_ui.c, prodlimbs.c, goetgheluck_bin_uiui.c.
+ primorial_ui.c, prodlimbs.c, bin_ui.c,
+ lucmod.c, stronglucas.c,
+ goetgheluck_bin_uiui.c; mini-gmp/mini-mpq.c.
David Harvey mpn/generic/add_err1_n.c, add_err2_n.c,
add_err3_n.c, sub_err1_n.c, sub_err2_n.c,
Modified: trunk/Build/source/libs/gmp/gmp-src/ChangeLog
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/ChangeLog 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/ChangeLog 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,53 +1,1516 @@
-2016-12-16 Torbjörn Granlund <tg at gmplib.org>
+2020-01-17 Torbjörn Granlund <tg at gmplib.org>
- * Version 6.1.2 released.
+ * Version 6.2.0 released.
-2016-12-13 Torbjörn Granlund <tg at gmplib.org>
+ * gmp-h.in (__GNU_MP__): Bump.
+ (__GNU_MP_VERSION,__GNU_MP_VERSION_MINOR,__GNU_MP_VERSION_PATCHLEVEL):
+ Bump version info.
+ * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*, LIBMP_LT_*):
+ Bump version info.
- * longlong.h: Test LONGLONG_STANDALONE in two more places.
+2020-01-15 Torbjörn Granlund <tg at gmplib.org>
-2016-12-07 Torbjörn Granlund <tg at gmplib.org>
+ * mpn/x86_64/bt1/gcd_11.asm: Add missing FUNC_EXIT.
- * gmp-h.in: Check yet another symbol for FILE.
+2020-01-10 Torbjörn Granlund <tg at gmplib.org>
-2016-12-02 Torbjörn Granlund <tg at gmplib.org>
+ * longlong.h (powerpc): Add clobbers, make formatting cleanups.
- Merge configure changes from before 6.1.1:
+ * configure.ac (HAVE_NATIVE): Add mpn_sbpi1_bdiv_r.
- 2016-03-25 Torbjörn Granlund <torbjorng at google.com>
+ * tune/tune-gcd-p.c (main): Use %zu for size_t printing.
- * config.guess: Prefix all arm CPUs with "arm" to accommodate our
- matchers.
- * configure.ac (arm): Match arm CPUs consistently.
+ * configfsf.guess: Update from upstream.
- 2016-03-21 Torbjörn Granlund <torbjorng at google.com>
+ * mpn/x86/pentium4/sse2/popcount.asm: For simplicity and correctness
+ use LEAL directly.
- * configure.ac: Support many arm64 processors.
+2020-01-03 Niels Möller <nisse at lysator.liu.se>
- 2016-03-20 Torbjörn Granlund <torbjorng at google.com>
+ * configure.ac: Delete suggestion to use TESTS_ENVIRONMENT to run
+ wine. It worked only with older versions of automake.
- * config.guess (arm*): Handle big.LITTLE CPUs by extracting the
- lexically largest id.
- * config.guess (arm*): Add many aarch64 CPUs.
- * config.guess (main): Corresponding changes.
+2019-12-23 Torbjörn Granlund <tg at gmplib.org>
- * configure.ac (arm*): Support cortex-a5 better.
+ * mpf/mul.c: Rewrite to invoke mpn_sqr when appropriate.
- 2016-01-15 Torbjörn Granlund <torbjorng at google.com>
+2019-12-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * config.guess (s390): Don't assume /proc/cpuinfo exists.
+ * mpz/powm.c: Full normalisation when e=1 & b<0.
+ * tests/mpz/t-powm.c: More tests for the e=1 case.
- 2016-01-13 Torbjörn Granlund <torbjorng at google.com>
+2019-12-02 Torbjörn Granlund <tg at gmplib.org>
- * config.guess: Reorder and generalise ppc code.
+ * mpn/generic/gcd_11.c: Remove check for NATIVE_ implementation.
+2019-11-24 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/gcdext_1.c [USE_ZEROTAB]: Delete code variant for
+ USE_ZEROTAB != 0. Was used in the currently disabled binary
+ gcdext.
+
+2019-11-20 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/powm.c (MPN_REDC_1): Prefer mpn_sbpi1_bdiv_r when it is
+ provided.
+ * mpn/generic/sec_powm.c (MPN_REDC_1_SEC): Likewise.
+
+2019-11-17 Torbjörn Granlund <tg at gmplib.org>
+
+ * config.guess: Recognise zen2.
+ * configure.ac: Likewise.
+
+ * mpn/x86_64/bt1/aorsmul_1.asm: Rewrite.
+ * mpn/x86_64/bt1/mul_1.asm: Rewrite.
+
+ * mpn/arm/v6t2/gcd_11.asm: Increase alignment; update x/l table.
+
+2019-11-16 Seth Troisi <sethtroisi at google.com>
+
+ * tune/common.c (speed_mpn_perfect_power_p): New function.
+ (speed_mpn_perfect_power_p): New function.
+ * tune/speed.h: Declare both.
+ * tune/speed.c (routine): Add mpn_perfect_{power,square}_p.
+
+ * tune/common.c (speed_mpz_nextprime): New function.
+ * tune/speed.h: Declare it.
+ * tune/speed.c (routine): Add mpz_nextprime.
+
+2019-11-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * tune/speed.c (routine_t): Add R flag to mpz_powm
+ * tune/speed.h (SPEED_ROUTINE_MPZ_POWM): Use R flag as the base.
+
+2019-10-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Make more path distinctions for the benefit of
+ gmp-mparam.h.
+
+2019-10-01 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (arm64): Let cortex-a7x look in a57 folder.
+
+2019-10-01 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/gcdext_1.c (mpn_gcdext_1) [GCDEXT_1_USE_BINARY]: Fix
+ canonicalization condition.
+
+2019-09-30 Niels Möller <nisse at lysator.liu.se>
+
+ * tests/mpn/t-gcdext_1.c: New test.
+
+2019-09-23 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/hgcd2.c: Mark added div1 variants as static.
+
+ * tune/tuneup.c, tune/speed.c, tune/speed.h, tune/common.c,
+ tune/Makefile.am: Add measuring of mpn_hgcd2 method 4 and 5.
+ * tune/hgcd2-4.c, tune/hgcd2-5.c: New files.
+
+2019-09-23 Niels Möller <nisse at lysator.liu.se>
+
+ * gmp-impl.h (hgcd2_func_t) [TUNE_PROGRAM_BUILD]: New typedef.
+ (hgcd2_func) [TUNE_PROGRAM_BUILD]: New function pointer.
+
+ * tune/hgcd2.c (mpn_hgcd2): New file, with a redefined function to
+ invoke an implementation via the hgcd2_func function pointer.
+ Initially points to the default implementation in
+ mpn/generic/hgcd2.c.
+ * tune/Makefile.am (tuneup_SOURCES): Add hgcd2.c.
+
+ * tune/tuneup.c (one_method): Return index of selected function.
+ (tune_hgcd2): Set hgcd2_func to point to selected function. So
+ that the later tuning of mpn_hgcd and mpn_gcd uses the right
+ implementation of hgcd2.
+
+2019-09-23 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/hgcd2.c: Improve method 4 and 5 by using the division
+ free methods optimistically, detecting errors. Tweak table values.
+
+2019-09-22 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/hgcd2.c: Add a 4th and 5th div1 method.
+
+2019-09-18 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/hgcd2.c (div1, div2): Rearrange things to allow for asm.
+ (div2): Avoid out-of-specs shift.
+ (div2): Use same variable naming in all variants.
+
+2019-09-16 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/hgcd2.c (HGCD2_DIV2_METHOD): New define.
+ (div2): Replaced, since the old implementation had lots of poorly
+ predicted and expensive branches. Two new implementaions, selected
+ by HGCD2_DIV2_METHOD.
+ (div2) [HGCD2_DIV2_METHOD == 1]: Calls div1 on the high limbs,
+ with unlikely case handling large quotients.
+ (div2) [HGCD2_DIV2_METHOD == 2]: The previously #if:ed out
+ version. A bitwise division, relying on fast count_leading_zeros,
+ and with fewer branches than the previous code.
+
+2019-09-15 Torbjörn Granlund <tg at gmplib.org>
+
+ * acinclude.m4 (GMP_ASM_X86_ADX): Remove unused.
+
+ * configure.ac (x86): Amend last change.
+
+2019-09-14 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/hgcd2.c (HGCD2_DIV1_METHOD): Rename, and change
+ default to 3. Updated all usage.
+ (HGCD2_METHOD): ... the old name, deleted.
+
+2019-09-14 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Remove obsolete path-triggered invocation of
+ GMP_ASM_X86_ADX and GMP_ASM_X86_MULX.
+
+ * acinclude.m4 (GMP_ASM_X86_MULX): Set X86_ASM_MULX to config.h.
+ * configure.ac (x86): Set x86_have_mulx for relevant CPUs.
+ Use if to conditionally invoke GMP_ASM_X86_MULX.
+ * longlong.h (x86 umul_ppmm): Test also X86_ASM_MULX for when to use
+ mulx variant.
+
+2019-09-13 Niels Möller <nisse at lysator.liu.se>
+
+ * tune/tuneup.c (one_method): New helper function, to measure
+ several functions for a fix size.
+ (tune_hgcd2, tune_div_qr_1, tune_mod_1, tune_jacobi_base): Use it.
+
+2019-09-13 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (HAVE_HOST_CPU_1): Add many x86_64 CPU types.
+ * longlong.h (x86 umul_ppmm): Fix criterion for when to use mulx.
+ (count_leading_zeros): Use lzcnt for appropriate CPUs.
+ (count_trailing_zeros): Use tzcnt for appropriate CPUs.
+
+ * mpn/generic/hgcd2.c (HGCD2_METHOD=2 div1): Rewrite.
+
+2019-09-09 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/mul.c: Call mpn_mul_basecase early when in range. Never
+ call mpn_sqr.
+
+ * mpn/generic/gcd.c: Rewrite tail of function, for n <= 2.
+
+2019-09-08 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (arm): Select arch armv7ve for a7, a12, a15, and a17,
+ this enables the use of the udiv instruction.
+
+ * mpn/generic/hgcd2.c (disabled div2): Micro-optimise.
+
+2019-09-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/hgcd2.c (HGCD2_METHOD=3 div1): Micro-optimise.
+
+2019-09-07 Vincent Lefevre <vincent at vinc17.net>
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Append EXEEXT for executable.
+
+2019-09-05 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/gcd_22.asm: Rewrite to make better use of Arm conditional
+ execution.
+ * mpn/arm32/gcd_22.asm: Likewise.
+
+2019-09-05 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/hgcd2.c (div1): Return both r and q as a
+ mp_double_limb_t, replacing the DIV1 macro.
+ (div1) [HGCD2_METHOD == 3]: New implementation handling q <= 7
+ specially and without branches. Based on Torbjörn's mail to the
+ gmp-devel list.
+ * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
+ corresponding speed support.
+ * tune/hgcd2-3.c: New file.
+ * tune/tuneup.c (print_define_with_speedup): New function, to
+ output a comment with speedup compared to next-best method.
+ (tune_hgcd2): Update tuning.
+
+2019-09-04 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/hgcd2.c (HGCD2_METHOD): New parameter.
+ (DIV1): New macro, using either the div1 function or plain
+ division, depending on the value of HGCD2_METHOD.
+ (mpn_hgcd2): Use DIV1.
+ * tune/speed.c, tune/speed.h, tune/common.c, tune/Makefile.am: Add
+ measuring of mpn_hgcd2 methods.
+ * tune/hgcd2-1.c, tune/hgcd2-2.c: New files.
+ * tune/tuneup.c: Tune HGCD2_METHOD.
+
+ * tune/speed.h (SPEED_ROUTINE_MPN_HGCD2): New macro.
+ * tune/common.c (speed_mpn_hgcd2): New function.
+ * tune/speed.c (routine): Add mpn_hgcd2.
+
+2019-09-04 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm/v6t2/gcd_22.asm: New file.
+ * mpn/arm64/gcd_22.asm: New file.
+ * mpn/ia64/gcd_11.asm: New file.
+
+2019-09-01 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bt1/gcd_11.asm: Replace grabber with bt1 optimised code.
+
+2019-08-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd4/gcd_22.asm: New grabber file.
+
+ * mpn/x86_64/zen/gcd_22.asm: Use coreihwl instead of bd2 gcd_22.
+
+ * mpn/x86_64/bd2/gcd_22.asm: Fix typo in FUNC_ENTRY (currently unused).
+ Avoid a register copy before return.
+ * mpn/x86_64/core2/gcd_22.asm: Likewise.
+ * mpn/x86_64/k10/gcd_22.asm: Likewise.
+ * mpn/x86_64/gcd_22.asm: Likewise.
+
+ * mpn/x86_64/coreihwl/gcd_22.asm: Optimise, now runs well on more CPUs.
+
+ * mpn/x86_64/gcd_11.asm: Remove PROTECT from symbols as they are
+ actually local.
+ * mpn/x86_64/gcd_22.asm: Likewise.
+
+2019-08-25 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd2/gcd_22.asm: Repeat tzcnt for exceptional lowz case.
+ Remove dead code.
+
+ * mpn/powerpc64/mode64/p7/gcd_22.asm: Make logic for determining ABI
+ wrt struct return more robust.
+ * mpn/powerpc64/mode64/p9/gcd_22.asm: Likewise.
+
+2019-08-24 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bt1/gcd_11.asm: New grabber.
+ * mpn/x86_64/bt1/gcd_22.asm: New grabber.
+ * mpn/x86_64/bt2/gcd_22.asm: New grabber.
+
+ * mpn/x86_64/atom/gcd_22.asm: Remove stale grabber file.
+ * mpn/x86_64/zen/gcd_22.asm: Grab bd2 instead of hwl code.
+ * mpn/x86_64/bd2/gcd_22.asm: New file.
+ * mpn/x86_64/k8/gcd_22.asm: Remove, rely on top-level code instead.
+ * mpn/x86_64/bt1/gcd_22.asm: Remove.
+ * x86_64/gcd_22.asm: New file, improved version of removed bt1 code.
+
+2019-08-22 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreihwl/gcd_11.asm: Remove as it was never beneficial.
+
+ * mpn/x86_64/bd2/gcd_11.asm: Make sure rdx is zero on return to benefit
+ gcd_22's private calls. Make gcd_11 files more similar in register use.
+ * mpn/x86_64/bd4/gcd_11.asm: Likewise.
+ * mpn/x86_64/core2/gcd_11.asm: Likewise.
+ * mpn/x86_64/gcd_11.asm:: Likewise.
+
+2019-08-22 Niels Möller <nisse at lysator.liu.se>
+
+ From Hugh McMaster:
+ * gmp.pc.in, gmpxx.pc.in: New files.
+ * configure.ac: New output files gmp.pc and gmpxx.pc.
+ * Makefile.am (pkgconfigdir, pkgconfig_DATA): New automake
+ settings, to install gmp.pc and optionally gmpxx.pc for use with
+ pkg-config.
+
+2019-08-21 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/core2/gcd_22.asm: New file.
+ * mpn/x86_64/k8/gcd_22.asm: New file.
+ * mpn/x86_64/k10/gcd_22.asm: New file.
+ * mpn/x86_64/coreihwl/gcd_22.asm: New file.
+ * mpn/x86_64/bt1/gcd_22.asm: New file.
+ * mpn/x86_64/bd4/gcd_22.asm: New grabber.
+ * mpn/x86_64/zen/gcd_22.asm: New grabber.
+ * mpn/x86_64/atom/gcd_22.asm: New grabber.
+
+2019-08-19 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Check for ELFv1 ABI on PowerPC.
+
+2019-08-18 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (arm32 sub_ddmmss): Define separately for thumb and
+ non-thumb as rsc instruction is missing for thumb.
+
+ * mpn/powerpc64/mode64/p7/gcd_22.asm: New file.
+ * mpn/powerpc64/mode64/p9/gcd_22.asm: New file.
+
+2019-08-17 Torbjörn Granlund <tg at gmplib.org>
+
+ * demos/expr/t-expr.c: #include gmp-impl.h as it includes tests.h.
+
+ * mpn/asm-defs.m4: Add gcd_22.
+
+ * tests/refmpn.c (refmpn_gcd_22): New function.
+ * tests/tests.h: Declare it.
+
+ * tests/t-constants.c: #include gmp-impl.h.
+ * tests/mpf/t-get_d.c: Likewise.
+
+2019-08-17 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/gcd_22.c (mpn_gcd_22): New implementation with less
+ branches.
+
+2019-08-16 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/brootinv.c: Shorten computations, using even exponent.
+ * mpn/generic/powlo.c: Avoid copies with a flipflop.
+
+2019-08-16 Niels Möller <nisse at lysator.liu.se>
+
+ Speed support for gcd_22. Calls mpn_gcd_22(al, al, bl, bl), so
+ that B+1 is a common factor.
+ * tune/speed.h (SPEED_ROUTINE_MPN_GCD_22): New macro.
+ * tune/speed.c (routine): Add mpn_gcd_22.
+ * tune/common.c (speed_mpn_gcd_22): New function.
+
+ * mpn/generic/gcd.c (gcd_2): Moved to gcd_22.c below.
+ (mpn_gcd): Adapt for calling gcd_22.
+ * mpn/generic/gcd_22.c (mpn_gcd_22): New file and function.
+ * gmp-impl.h (mp_double_limb_t): New (typedef) struct.
+ * configure.ac (gmp_mpn_functions): Added gcd_22.
+
+ * tests/mpn/t-gcd_22.c: New test.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-gcd_22.
+ * tests/refmpz.c (refmpz_gcd): New function (plain binary gcd).
+
+2019-08-15 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/gcd_11.asm: Use bd2 instead of bd4 code.
+
+2019-08-13 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64: Add more gcd_11 variants of of x86_64 gcd_11.asm and
+ tweak existing ones.
+
+2019-08-13 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ From Seth Troisi:
+ * doc/gmp.texi: Update mpz_millerrabin documentation.
+
+ * mpn/x86_64/bd2/gcd_11.asm: Micro-optimisation.
+ * doc/gmp.texi: Further update in mpz_millerrabin.
+ * tests/misc.c: Silence a warning.
+ * tests/mpz/t-pprime_p.c (const primes): One more prime in the list.
+ * mpz/millerrabin.c: Return 2 for surely prime numbers (BPSW checked).
+
+2019-08-08 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86/gcd_11.asm: New file.
+
+ * config.sub: Make arm cpu types match what config.guess returns.
+
+2019-08-08 Niels Möller <nisse at lysator.liu.se>
+
+ * tests/refmpn.c (refmpn_gcd_11): New function, based on refmpn_gcd_1.
+ (refmpn_gcd_1): Use it.
+ * tests/mpn/t-gcd_11.c: New file, test mpn_gcd_11.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-gcd_11.
+
+2019-08-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/alpha/ev67/gcd_11.asm: New file, mostly extracted from gcd_1.asm.
+ * mpn/arm/v5/gcd_11.asm: Likewise.
+ * mpn/arm/v6t2/gcd_11.asm: Likewise.
+ * mpn/arm64/gcd_11.asm: Likewise.
+ * mpn/powerpc64/mode64/gcd_11.asm: Likewise.
+ * mpn/powerpc64/mode64/p7/gcd_11.asm: Likewise.
+ * mpn/powerpc64/mode64/p9/gcd_11.asm: Likewise.
+ * mpn/sparc64/gcd_11.asm: Likewise.
+ * mpn/x86/k7/gcd_11.asm: Likewise.
+ * mpn/x86/p6/gcd_11.asm: Likewise.
+ * mpn/x86_64/bd2/gcd_11.asm: Likewise.
+ * mpn/x86_64/core2/gcd_11.asm: Likewise.
+ * mpn/x86_64/gcd_11.asm: Likewise.
+ * mpn/asm-defs.m4: Add gcd_11.
+
+2019-08-06 Niels Möller <nisse at lysator.liu.se>
+
+ * tune/common.c (speed_mpn_gcd_11): New function.
+ * tune/speed.h (speed_mpn_gcd_11): Declare it.
+ (SPEED_ROUTINE_MPN_GCD_11): New macro.
+ * tune/speed.c (routine): Add mpn_gcd_11.
+
+ * configure.ac (gmp_mpn_functions): Added gcd_11. Also add
+ HAVE_NATIVE_mpn_gcd_11.
+ * mpn/generic/gcd_11.c (mpn_gcd_11): New file and function,
+ extracted from mpn_gcd_1.
+ * gmp-h.in (mpn_gcd_11): Declare it.
+ * mpn/generic/gcd_1.c (mpn_gcd_1): Adapted to call mpn_gcd_11.
+
+2019-08-04 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bt2/gcd_1.asm: New grabber file.
+ * mpn/x86_64/zen/gcd_1.asm: Grab from "bd2" directory, was "core2".
+
+2019-08-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd2/gcd_1.asm: New file.
+
+2019-08-01 Torbjörn Granlund <tg at gmplib.org>
+
+ * tests/mpf/t-conv.c: Add several more fixed test cases.
+
+ * mpf/set_str.c: Ignore leading zeros including ones after radix point
+ to avoid invalid output formats.
+
+2019-07-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/gcd_1.asm: New file.
+
+2019-07-30 Niels Möller <nisse at lysator.liu.se>
+
+ From Seth Troisi:
+ * doc/gmp.texi (Jacobi Symbol): Update algorithm documentation.
+ * tests/mpz/t-jac.c: Comment update.
+
+2019-07-13 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (arm): Generalise arm a72 pattern to match a73...a79.
+
+2019-07-08 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm/arm-defs.m4 (ASM_START): Rewrite (fix broken error handling).
+
+2019-07-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * acinclude.m4 (GMP_C_DOUBLE_FORMAT): Compile conftest.c to executable
+ in order to trigger final compile in case of LTO.
+
+2019-06-17 Torbjörn Granlund <tg at gmplib.org>
+
+ * config.guess: Work around upstream configfsf.guess's regression wrt
+ mips vs mips64.
+
+2019-06-14 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (mips64): Provide r6 asm code as default expression yields
+ libcall.
+
+ * configure.ac (mips64): Use separate paths for r6 and non-r6 as these
+ architectures are mutually incompatible.
+
+ * mpn/mips64/{addmul_1,mul_1,sqr_diagonal,submul_1,umul}.asm:
+ Move into hilo subdir.
+
+2019-05-28 Torbjörn Granlund <tg at gmplib.org>
+
+ * config.sub: Fixes to which cpu types end with a "*".
+
+2019-04-20 Niels Möller <nisse at lysator.liu.se>
+
+ * doc/gmp.texi (References): Link to paper on subquadratic GCD.
+
+2019-04-19 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd1/hamdist.asm: Really make 2017-06-01 change: Use
+ 3-operand DEF_OBJECT.
+
+ * mpn/x86_64/invert_limb.asm: Simplify mpn_invert_limb_table ref.
+
+ * mpn/x86_64/x86_64-defs.m4 (LEA): Use rip addressing for non-PIC.
+
+2019-04-17 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/jacobi.c (mpn_jacobi_n): Use JACOBI_DC_THRESHOLD,
+ not GCD_DC_THRESHOLD. Inconsistency spotted by Seth Troisi.
+
+2019-04-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init):
+ Split out silvermont handling, add handling of goldmont.
+
+ * configure.ac: Setup distinct paths for silvermont and goldmont.
+ (fat_path): Add missing x86_64/goldmont.
+
+ * config.guess: Recognise "Goldmont Plus".
+
+2018-12-09 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/mul_fft.c (mpn_fft_add_sub_modF): New function.
+ (mpn_fft_fft, mpn_fft_fftinv): Use it.
+
+2018-11-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/gmp-mparam.h: New file.
+
+ * mpn/powerpc64/mode64/p9/add_n_sub_n.asm: New file.
+
+2018-11-28 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/sqr_basecase.asm: New file.
+ * mpn/powerpc64/mode64/p9/mul_1.asm: New file.
+
+2018-11-18 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/mul_basecase.asm: New file.
+
+ * mpn/powerpc64/mode64/p9/addmul_1.asm: Optimise.
+
+2018-11-12 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/aorsmul_1.asm: New file, providing fast
+ submul_1 (and redundant addmul_1).
+
+2018-11-11 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/addmul_1.asm: Tweak for slightly better
+ speed.
+
+ * mpn/powerpc32/powerpc-defs.m4: Define addex.
+ * mpn/powerpc64/mode64/p9/mul_2.asm: Use it.
+ * mpn/powerpc64/mode64/p9/addmul_2.asm: Likewise.
+
+2018-11-08 Torbjörn Granlund <tg at gmplib.org>
+
+ * tests/devel/cnd_aors_n.c: New file.
+
+ * mpn/arm/neon/lorrshift.asm: Declare use of neon insns.
+ * mpn/arm/neon/lshiftc.asm: Likewise + cleanup.
+
+ * tests/devel/Makefile.am (EXTRA_PROGRAMS): Add missing files.
+
+ * mpn/powerpc64/mode64/p9/mul_2.asm: New file.
+ * mpn/powerpc64/mode64/p9/addmul_2.asm: New file.
+
+2018-11-07 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/lucnum2_ui.c: Use mpn_rsblsh1_n if available.
+ * tests/mpz/t-nextprime.c: Add one more interval.
+ * tests/mpz/t-pprime_p.c (check_fermat_mersenne): New tests.
+ * mpn/generic/mod_1_3.c: typo in a comment.
+ * mpz/nextprime.c: Use tdiv instead of fdiv.
+
+ * mpn/generic/fib2m.c: New file, Fibonacci numbers modulo.
+ * configure.ac (gmp_mpn_functions): Add it.
+ * gmp-impl.h: Declare mpn_fib2m.
+ * tests/mpn/t-fib2m.c: New file, tests for mpn_fib2m.
+ * tests/mpn/Makefile.am (check_PROGRAMS): Add t-fib2m.
+
+ * mpn/generic/mod_34lsub1.c: Initialise c[012] once.
+ * tests/mpz/t-pprime_p.c (check_primes): Two more primes.
+ * tests/mp?: Use TESTS_REPS in many files.
+
+ * mpn/generic/strongfibo.c: New file, Fibonacci primality test.
+ * configure.ac (gmp_mpn_functions): Add it.
+ * gmp-impl.h: Declare mpn_strongfibo.
+
+ * mpz/stronglucas.c: New file, strong Lucas primality test.
+ * Makefile.am (MPZ_OBJECTS): Add it.
+ * mpz/Makefile.am (libmpz_la_SOURCES): Add it.
+ * gmp-impl.h: Declare mpz_stronglucas.
+
+ * mpz/millerrabin.c: Implement BPSW test for primality.
+
+2018-11-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (arm): Support a12 and a17.
+ * config.sub: Generalise arm matching.
+ * config.guess: Recognise additional arm CPUs.
+
+ * mpn/arm/arm-defs.m4 (ASM_START): Provide local definition.
+
+2018-10-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm/v7a/cora17/mod_34lsub1.asm: New file.
+ * mpn/arm/v7a/cora17/gmp-mparam.h: New file.
+ * mpn/arm/v7a/cora17/mul_1.asm: New grabber file.
+ * mpn/arm/v7a/cora17/addmul_1.asm: Likewise.
+ * mpn/arm/v7a/cora17/submul_1.asm: Likewise.
+
+2018-10-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/fib2_ui.c: Simplify the possible -2 case.
+
+2018-07-19 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/millerrabin.c (mod_eq_m1): New function, equality with -1.
+ * mpz/powm_ui.c: Small optimisations.
+
+2018-07-03 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/lshift.asm: Remove cnt = 1 special code.
+
+ * mpn/x86_64/silvermont/popcount.asm: Add missing ABI_SUPPORT decls.
+ * mpn/x86_64/silvermont/hamdist.asm: Likewise.
+ * mpn/x86_64/zen/mul_1.asm: Likewise.
+
+ * mpn/x86_64/fastsse/lshift.asm: Support DOS64.
+ * mpn/x86_64/fastsse/lshiftc.asm: Likewise.
+
+ * mpn/x86_64/pentium4/gmp-mparam.h: Retune.
+
+2018-07-01 Torbjörn Granlund <tg at gmplib.org>
+
+ * lshift.asm: Replace with grabber file.
+ * lshiftc.asm: Replace with grabber file.
+ * x86_64/pentium4/addmul_2.asm: New grabber file.
+ * x86_64/pentium4/aorsmul_1.asm: New grabber file.
+ * x86_64/pentium4/mul_1.asm: New grabber file.
+ * x86_64/pentium4/mul_2.asm: New grabber file.
+ * x86_64/pentium4/mul_basecase.asm: New grabber file.
+ * x86_64/pentium4/mullo_basecase.asm: New grabber file.
+ * x86_64/pentium4/redc_1.asm: New grabber file.
+ * x86_64/pentium4/sqr_basecase.asm: New grabber file.
+
+2018-06-13 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/gcd_1.c (mpn_gcd_1): Delete unused code variant for
+ GCD_1_METHOD == 1, and delete GCD_1_METHOD macro. Simplify the
+ structure of the remaining code variant, without gotos to the
+ mid-loop strip_u_maybe label.
+
+2018-05-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (x86): Provide goldmont specific path.
+
+ * mpn/x86_64/goldmont/gmp-mparam.h: New file.
+
+2018-05-29 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (x86): Pass more exact arch/tune options for nehalem.
+
+2018-05-28 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/gcd_1.c (mpn_gcd_1) [USE_ZEROTAB]: Delete unused code
+ variant for USE_ZEROTAB != 0.
+
+2018-05-20 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * bootstrap.c: Define DONT_USE_FLOAT_H before including mini-gmp.
+
+2018-05-14 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q_n): Decl. static.
+ (mpn_dcpi1_bdiv_q_n_itch): Declare static.
+ * mpn/generic/dcpi1_divappr_q.c (mpn_dcpi1_divappr_q_n): static.
+ * mpn/generic/matrix22_mul.c (mpn_matrix22_mul_strassen): static.
+ * mpn/generic/mu_div_qr.c (mpn_mu_div_qr_choose_in): static.
+ * mpn/generic/mu_divappr_q.c (mpn_preinv_mu_divappr_q): static.
+ (mpn_mu_divappr_q_choose_in): static.
+ * gmp-impl.h: Remove declaration of previous functions.
+
+ * mpn/generic/get_d.c: Enhance generic code using DBL_MANT_DIG.
+
+ * printf/repl-vsnprintf.c: Better handling floating-point
+ specifiers "EeGgFf" (Thanks Vincent Lefevre).
+
+2018-05-04 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * doc/gmp.texi (mpq_*_str): Document the full base allowed range.
+ * mpq/get_str.c: Make all bases either work or return an error.
+
+ * doc/gmp.texi (Integer Internals): Lazy allocation and read-only.
+
+2018-04-27 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/div_q.c (mpn_div_q): Replace dead code with ASSERT.
+ Spotted by Paul Zimmermann and Raphaël Rieu-Hleft.
+
+ * tests/mpn/t-div.c (main): Fill quotient area with junk before
+ calling mpn_div_q.
+
+2018-04-26 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * Makefile.am (EXTRA_DIST): Add mini-gmp/mini-mpq.[ch].
+
+2018-04-23 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/toom2_sqr.c: Handle the cy=-1 branch slightly faster.
+ * mpn/generic/toom22_mul.c: Likewise. (Thanks Paul and Raphaël!)
+
+2018-04-22 Niels Möller <nisse at lysator.liu.se>
+
+ From Martin Storsjö:
+ * configure.ac (aarch64): Just as on windows/x86_64, "long" still
+ is 32 bit on aarch64. To distinguish between 32-bit and 64-bit
+ ABI, test sizeof(void*) instead of sizeof(long). Use long long for
+ mp_limb_t for mingw targets.
+ * acinclude.m4 (GMP_C_TEST_SIZEOF): Allow '*' in the type name,
+ e.g., void*.
+
+2018-04-18 Marc Glisse <marc.glisse at inria.fr>
+
+ * mpq/clear.c: Handle lazy numerator.
+ * mpq/clears.c: Likewise.
+ * mpq/init.c: Likewise.
+ * mpq/set_si.c: Likewise.
+ * mpq/set_ui.c: Likewise.
+
+ * tests/cxx/t-ops2z.cc: Add parentheses to quiet a warning.
+
+2018-03-28 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (mips): Recognise "mipsisa64*".
+
+2018-03-23 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/sec_powm.c: Remove unused macros.
+ Simplify code for choosing between redc_1 and redc_2.
+ Compute power table with squaring for even powers.
+
+2018-02-28 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * gmpxx.h (__gmp_binary_plus): Special case for mpq + 1.
+ (__gmp_binary_minus): Special case for mpq - 1.
+ (__gmp_binary_equal): Optimised comparison mpq == integer.
+ * tests/cxx/t-ops2qf.cc (checkqf): Some check for +/- 1, +/- 0.
+
+2018-02-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * tune/Makefile.am: Disallow parallel make (thanks Vincent Lefevre).
+ * mpq/swap.c: Use *_SWAP_* macros.
+ * mpq/cmp_ui.c: One more little shortcut, comparing fractions to 1.
+ * mpq/get_d.c: Compare (zeros > 0) once, replace tdiv_qr with div_q.
+ * mpq/equal.c: Check size early.
+
+ * printf/obprintf.c: Adda dummy typedef to avoid empty unit.
+ * printf/obvprintf.c: Likewise.
+ * printf/obprntffuns.c: Likewise.
+ * printf/repl-vsnprintf.c: Move #ifdef after #include gmp-impl.h .
+
+2018-02-09 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm: Really revert 2018-01-04 changes.
+
+2018-02-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * printf/snprntffuns.c: Report -1 as an error.
+ * acinclude.m4 (GMP_FUNC_VSNPRINTF): Refuse -1 as return value.
+
+ * mpz/bin_uiui.c (mpz_smallk_bin_uiui): One more shortcut for small k.
+ * gmp-impl.h (popc_limb): Use fewer constants (GMP_LIMB_BITS == 16).
+ * mpz/divegcd.c (mpz_divexact_limb): Use MPN_DIVREM_OR_DIVEXACT_1.
+ * primesieve.c (fill_bitpattern): Use MPN_FILL.
+
+2018-02-01 Marc Glisse <marc.glisse at inria.fr>
+
+ * longlong.h (i586): Remove assert.
+
+2018-01-30 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/and.c: Rearrange the 3 cases, both <0, both >=0, one and one.
+ * mpz/ior.c: Likewise.
+ * mpz/xor.c: Likewise.
+
+ * mpz/bin_uiui.c (mul[4-8]): Reduce the number of multiplications.
+
+ * printf/doprnt.c: Use __GMP_FREE_FUNC_TYPE.
+ * printf/doprntf.c: Likewise.
+ * printf/snprntffuns.c: Likewise, and use size_t instead of int.
+
+2018-01-15 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * tests/mpz/t-bin.c: Extended tests for bin_ui and uint border cases.
+
+2018-01-10 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Fix old pentium recog.
+ * config.guess: Likewise.
+
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Add many 64-bit CPUs.
+
+2018-01-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm: Revert last change, it hides a symbol needed for testing.
+
+2018-01-04 Torbjörn Granlund <tg at gmplib.org>
+
+ * bdiv_q_1.asm (binvert_limb_table): Declare as ".hidden".
+ * v7a/cora8/bdiv_q_1.asm: Likewise.
+ * dive_1.asm: Likewise.
+ * v6/dive_1.asm: Likewise.
+
+ * mode1o.asm (binvert_limb_table): Remove ".protected", add ".hidden".
+ * v6/mode1o.asm: Likewise.
+
+2018-01-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/divrem_2.asm: Use different rlwinm variant (to
+ appease clang).
+
+2018-01-01 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc32/powerpc-defs.m4: Define maddld, maddhdu, popcntd, and
+ divdeu.
+ * mpn/powerpc64/mode64/p8/invert_limb.asm: Use new insn defs.
+ * mpn/powerpc64/mode64/p9/addmul_1.asm: Use new insn defs.
+ * mpn/powerpc64/p7/hamdist.asm: Use new insn defs.
+ * mpn/powerpc64/p7/popcount.asm: Use new insn defs.
+
+2017-12-31 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/p9/addmul_1.asm: Moved from
+ mpn/powerpc64/p9/addmul_1.asm.
+
+2017-12-30 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/bin_ui.c: Rewrite, using Fredrik Johansson's suggestions.
+
+2017-12-27 Niels Möller <nisse at lysator.liu.se>
+
+ * longlong.h (arm32/arm64): Leave COUNT_LEADING_ZEROS_0 undefined,
+ since we use gcc's __builtin_clzl, which doesn't allow zero inputs.
+
+2017-12-27 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/mode64/bdiv_q_1.asm: Use 64-bit cmp for sizes.
+
+ * mpn/powerpc64/p9/addmul_1.asm: New file.
+
+ * configure.ac: Separate handling of POWER8 and POWER9.
+
+ * config.guess: Recognise POWER9 and more variants of POWER8.
+ Reorder recog code to favour PVR over proc/cpuinfo.
+
+2017-12-14 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/fastsse/com.asm: Adhere to DOS64 xmm callee-saves rules.
+ * mpn/x86_64/fastsse/com-palignr.asm: Likewise.
+ * mpn/x86_64/fastsse/copyd.asm: Likewise.
+ * mpn/x86_64/fastsse/copyi.asm: Likewise.
+ * mpn/x86_64/fastsse/lshiftc.asm: Likewise.
+ * mpn/x86_64/fastsse/sec_tabselect.asm: Likewise.
+
+2017-12-11 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd1/aorrlsh_n.asm: New grabber file.
+
+2017-12-10 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd1/aors_n.asm: New grabber file.
+
+ * mpn/x86_64/bd4/aorrlsh_n.asm: New grabber file.
+
+2017-08-31 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/sparc32/sparc-defs.m4 (LEA64): Rewrite for both PIC and non-PIC.
+
+ * mpn/sparc64/ultrasparct3/cnd_aors_n.asm: Allow arbitrary cnd arg.
+
+2017-08-29 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/silvermont/gmp-mparam.h: Disable mul_2 and addmul_2.
+
+2017-08-28 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/sparc64: Revert 2017-07-23 PIC changes.
+
+ * mpn/powerpc32/divrem_2.asm: Avoid bc+ insn form to accommodate clang.
+
+ * mpn/generic/sbpi1_bdiv_qr.c: Correct ASSERT.
+ * mpn/generic/sbpi1_bdiv_q.c: Likewise.
+ * mpn/generic/sbpi1_bdiv_r.c: Likewise.
+
+2017-08-18 Torbjörn Granlund <tg at gmplib.org>
+
+ * acinclude.m4 (X86_64_PATTERN): Match zen*.
+
+ * configure.ac (x86): Support AVX challenged systems for Zen.
+
+2017-07-24 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/sbpi1_bdiv_q.c: Add ASSERT for inverse correctness.
+ * mpn/generic/sbpi1_bdiv_qr.c: Likewise.
+
+ * tests/mpn/t-bdiv.c (main): Amend last change.
+
+ * tests/devel/try.c (choice_array): Amend 2013-05-03 change to include
+ more functions.
+
+2017-07-23 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/sparc64/gcd_1.asm: Enforce PIC as GNU/Linux toolchain workaround.
+ * mpn/sparc64/ultrasparct3/bdiv_q_1.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/dive_1.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/invert_limb.asm: Likewise.
+ * mpn/sparc64/ultrasparct3/mode1o.asm: Likewise.
+
+ * gmp-impl.h: Reorganise foolshC_ip1 -> foolshC -> foolsh chain to make
+ it transitive.
+
+2017-07-23 Niels Möller <nisse at lysator.liu.se>
+
+ * longlong.h: Purge definitions of obsolete UMUL_TIME and
+ UDIV_TIME constants. Also mentioned (but unused) in
+ mpn/cray/gmp-mparam.h and tune/common.c.
+
+2017-07-21 Torbjörn Granlund <tg at gmplib.org>
+
+ * tests/mpn/t-bdiv.c (main): Test mpn_sbpi1_bdiv_r.
+
+ * tune/common.c (speed_mpn_sbpi1_bdiv_r): New function.
+ * tune/speed.h: Declare it.
+ (SPEED_ROUTINE_MPN_PI1_BDIV_R): New macro.
+ * tune/speed.c (routine): Add mpn_sbpi1_bdiv_r.
+
+2017-07-20 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (gmp_mpn_functions): Add sbpi1_bdiv_r.
+
+ * gmp-impl.h (mpn_sbpi1_bdiv_r): Declare.
+
+ * mpn/asm-defs.m4 (define_mpn): Add sbpi1_bdiv_q, sbpi1_bdiv_qr,
+ sbpi1_bdiv_r.
+
+ * mpn/generic/sbpi1_bdiv_r.c: New file.
+ * mpn/x86_64/zen/sbpi1_bdiv_r.asm: New file.
+
+2017-07-19 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86/p6/sse2/submul_1.asm: Get pentium4 code instead of k6 code
+ for better speed on modern Intel P6 cores.
+
+2017-07-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * tune/tuneup.c (tune_mullo): For MULLO_BASECASE_THRESHOLD start at 2.
+ (tune_sqrlo): Likewise.
+
+2017-06-28 Torbjörn Granlund <tg at gmplib.org>
+
+ * tests/Makefile.am tests/*/Makefile.am tune/Makefile.am (AM_LDFLAGS):
+ Define. (Thanks to Emmanuel Thomé and Vincent Lefevre.)
+
+2017-06-27 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/sqr_basecase.asm: Expand to use 4 addmul_1 loops.
+
+ * mpn/x86_64/x86_64-defs.m4 (sarx): New macro.
+
+2017-06-26 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreibwl/sqr_basecase.asm: Rewrite to do 2x and limb
+ squaring in main loop.
+
+2017-06-20 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/atom/cnd_add_n.asm: New grabber file.
+ * mpn/x86_64/atom/cnd_sub_n.asm: Likewise.
+
+ * mpn/x86_64/coreihwl/aorrlsh_n.asm: New grabber file.
+
+2017-06-16 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/mul_basecase.asm: Do overlapped software pipelining.
+
+ * mpn/x86_64/silvermont/mul_basecase.asm: New grabber file.
+ * mpn/x86_64/silvermont/sqr_basecase.asm: Likewise.
+ * mpn/x86_64/silvermont/mullo_basecase.asm: Likewise.
+
+2017-06-14 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/mullo_basecase.asm: New file.
+ * mpn/x86_64/coreibwl/mullo_basecase.asm: New file.
+
+2017-06-11 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/popham.asm: Crossjump for code size and mix lead-in insns
+ for lower overhead.
+
+2017-06-09 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Set GMP_NONSTD_ABI protecting against dots in the abi.
+ (hppa): Remove old GNU/Linux restriction to 32-bit ABI.
+
+2017-06-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd1/addmul_2.asm: New file.
+
+2017-06-06 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreihwl/aors_n.asm: New file.
+
+ * mpn/x86_64/x86_64-defs.m4 (c4_helper): New macro.
+ (mulx, shlx, shrx): Use c4_helper.
+
+ * mpn/x86_64/zen/mul_basecase.asm: Use 8-bit imm operands for "test".
+
+ * mpn/x86_64/zen/aorrlsh1_n.asm: New grabber file.
+ * mpn/x86_64/zen/sublsh1_n.asm: Likewise.
+ * mpn/x86_64/zen/aorrlsh_n.asm: New file
+
+2017-06-04 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Use bt1/bt2 for bobcat and jaguar dirs.
+ (fat_path): Add x86_64/bt2.
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Adapt to bt1/bt2 changes.
+ Make zen path correspond to non-fat path.
+ * mpn/x86/fat/fat.c (__gmpn_cpuvec_init): Adapt to bt1/bt2 changes.
+
+ * mpn/x86_64/bt2/copyi.asm: New grabber file.
+ * mpn/x86_64/bt2/copyd.asm: New grabber file.
+ * mpn/x86_64/bt2/com.asm: New grabber file.
+
+2017-06-03 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd1/popcount.asm: Expand some instructions as .byte
+ sequences.
+ * mpn/x86_64/bd1/hamdist.asm: Likewise.
+
+2017-06-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/x86_64-defs.m4 (DEF_OBJECT): Fix quoting (amends recent
+ change).
+ (JUMPTABSECT): Get rid of spurious "w".
+
+2017-06-02 Marc Glisse <marc.glisse at inria.fr>
+
+ * gmpxx.h (mpf_class::operator bool): Use mpf_sgn to access _mp_size.
+
+2017-06-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/bd1/popcount.asm: Use both SSE and XOP trickery, and
+ plain popcnt insn.
+ * mpn/x86_64/bd1/hamdist.asm: Likewise.
+
+2017-06-01 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/x86_64-defs.m4 (DEF_OBJECT): Allow 3rd argument defining
+ section, while making alignment argument non-optional.
+
+ * mpn/x86_64/core2/popcount.asm: Use 3-operand DEF_OBJECT.
+ * mpn/x86_64/core2/hamdist.asm: Likewise.
+ * mpn/x86_64/bd1/popcount.asm: Likewise.
+ * mpn/x86_64/bd1/hamdist.asm: Likewise.
+
+ * configure.ac (GMP_AVX_NOT_REALLY_AVAILABLE): New m4 define.
+ * mpn/x86_64/bd1/popcount.asm: Use GMP_AVX_NOT_REALLY_AVAILABLE.
+ * mpn/x86_64/bd1/hamdist.asm: Likewise.
+
+ * mpn/x86_64/silvermont/popcount.asm: Reinstate, grabbing nehalem code.
+ * mpn/x86_64/silvermont/hamdist.asm: Replace with grabber.
+
+2017-05-31 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/silvermont/popcount.asm: Remove.
+
+ * mpn/x86_64/core2/logops_n.asm: New file.
+
+2017-05-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreisbr/popcount.asm: Remove.
+
+2017-05-29 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreinhm/popcount.asm: Replace grabber code with
+ implementation proper.
+ * mpn/x86_64/coreinhm/hamdist.asm: Likewise.
+ * mpn/x86_64/bd1/popcount.asm: Likewise.
+ * mpn/x86_64/bd1/hamdist.asm: Likewise.
+ * mpn/x86_64/core2/popcount.asm: Likewise.
+ * mpn/x86_64/core2/hamdist.asm: New file.
+
+2017-05-22 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/core2/com.asm: New grabber file.
+
+ * mpn/x86_64/core2/lshift.asm: Rewrite.
+ * mpn/x86_64/core2/rshift.asm: Rewrite.
+ * mpn/x86_64/core2/lshiftc.asm: Rewrite.
+
+2017-05-16 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/mul_1.asm: Port to DOS64.
+ * mpn/x86_64/zen/aorsmul_1.asm: Likewise.
+ * mpn/x86_64/coreibwl/addmul_1.asm: Likewise.
+
+2017-05-16 Niels Möller <nisse at lysator.liu.se>
+
+ * mpn/generic/divis.c (mpn_divisible_p): Updated the divisibility
+ test; bdiv now returns R = D rather than R = 0 when D divides a
+ non-zero U.
+
+ * mpn/generic/binvert.c (mpn_binvert): Negate bdiv quotient.
+ * mpn/generic/divexact.c (mpn_divexact): Likewise.
+ * mpn/generic/remove.c (mpn_remove): Likewise.
+ * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): Likewise.
+
+ * tests/mpn/t-bdiv.c (check_one): Updated to new convention,
+ B^{qn} R = U + QD.
+
+ * mpn/generic/sbpi1_bdiv_qr.c (mpn_sbpi1_bdiv_qr): Reimplemented,
+ for new bdiv convention.
+ * mpn/generic/sbpi1_bdiv_q.c (mpn_sbpi1_bdiv_q): Likewise.
+ * mpn/generic/dcpi1_bdiv_q.c (mpn_dcpi1_bdiv_q_n)
+ (mpn_dcpi1_bdiv_q): Adapted to new bdiv convention.
+ * mpn/generic/dcpi1_bdiv_qr.c (mpn_dcpi1_bdiv_qr_n)
+ (mpn_dcpi1_bdiv_qr): Likewise.
+ * mpn/generic/mu_bdiv_qr.c (mpn_mu_bdiv_qr): Adapted to new bdiv
+ convention, using a wrapper calling the old function.
+ * mpn/generic/mu_bdiv_q.c (mpn_mu_bdiv_q): Likewise.
+
+2017-05-03 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreisbr/cnd_aors_n.asm: New file.
+ * mpn/x86_64/coreisbr/cnd_add_n.asm: New file.
+
+ * mpn/x86_64/core2/aorsmul_1.asm: Tune.
+
+ * mpn/x86_64/silvermont/mul_1.asm: New file, grabbing another asm file.
+ * mpn/x86_64/silvermont/aorsmul_1.asm: Likewise.
+ * mpn/x86_64/silvermont/aorrlsh1_n.asm: Likewise.
+ * mpn/x86_64/silvermont/aorrlsh2_n.asm: Likewise.
+ * mpn/x86_64/silvermont/lshift.asm: Likewise.
+ * mpn/x86_64/silvermont/rshift.asm: Likewise.
+ * mpn/x86_64/silvermont/lshiftc.asm: Likewise.
+
+ * mpn/x86_64/zen/mul_basecase.asm: Split outer loop into 4 loops.
+
+2017-05-02 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/sqr_basecase.asm: Use .byte for encoding all mulx.
+ Misc tuning.
+
+2017-04-27 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/sqr_basecase.asm: Rewrite to do 2x and limb squaring
+ in main loop.
+
+2017-04-25 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/fat/fat_entry.asm: Allocate correct DOS64 frame.
+ * mpn/x86_64/divrem_2.asm: Likewise.
+ * mpn/x86_64/mod_1_2.asm: Likewise.
+ * mpn/x86_64/mod_1_4.asm: Likewise.
+ * mpn/x86_64/mod_1_1.asm: Likewise.
+
+2017-04-23 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/coreisbr/mul_1.asm: Rewrite feed-in code and add mul_1c
+ entry point.
+
+2017-04-17 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/fat/fat.c (__gmpn_cpuvec_init): Amend last change.
+
+ * mpn/x86_64/zen/mul_basecase.asm: New file.
+ * mpn/x86_64/zen/sqr_basecase.asm: New file.
+
+2017-04-16 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/sqr_basecase.c (addmul_1 variant): Rewrite to compute
+ in-place and to avoid a re-computation.
+
+ * configure.ac: Remove k8, k10 from zen path.
+
+2017-04-15 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/zen/gmp-mparam.h: New file.
+
+ * mpn/x86_64/zen/com.asm: New file, grabbing another asm file.
+ * mpn/x86_64/zen/copyd.asm: Likewise.
+ * mpn/x86_64/zen/copyi.asm: Likewise.
+ * mpn/x86_64/zen/gcd_1.asm: Likewise.
+ * mpn/x86_64/zen/hamdist.asm: Likewise.
+ * mpn/x86_64/zen/lshift.asm: Likewise.
+ * mpn/x86_64/zen/lshiftc.asm: Likewise.
+ * mpn/x86_64/zen/popcount.asm: Likewise.
+ * mpn/x86_64/zen/rshift.asm: Likewise.
+
+ * config.guess: Recognise AMD zen.
+ * acinclude.m4 (X86_64_PATTERN): Add zen.
+ * config.sub: Corresponding changes.
+ * configure.ac: Corresponding changes.
+ * mpn/x86_64/fat/fat.c: Corresponding changes.
+
+2017-03-27 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/oddfac_1.c (limb_apprsqrt): Better approximation.
+ * mpz/bin_uiui.c (limb_apprsqrt): Likewise.
+
+2017-03-12 Torbjörn Granlund <tg at gmplib.org>
+
+ * tests/mpf/t-get_d_2exp.c (check_data): Rewrite of check_onebit.
+
+2017-03-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/sqrtrem.c: Direct use of sqrtrem2 when n==2.
+ * mpn/generic/div_qr_2.c (udiv_qr_4by2): Replace add_csaac with add_sssaaaa.
+
+2017-03-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpf/get_d_2exp.c: Return negative value for negative input.
+
+2017-03-06 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (aarch64): Provide asm-free umul_ppmm.
+ * longlong.h (powerpc64): Enable asm-free umul_ppmm.
+
+2017-03-04 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/sqr_diag_addlsh1.asm: Complete rewrite.
+
+2017-02-27 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (arm32/arm64): Remove useless comparison to 0 introduced
+ in last change (spotted by Marco).
+
+2017-02-26 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpn/generic/pow_1.c: Use umul_ppmm for a single limb.
+
+2017-02-25 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Allow MP_SIZE_T_MAX for thresholds exported to
+ config.m4.
+
+ * mpn/x86_64/gcd_1.asm: Handle BMOD_1_TO_MOD_1_THRESHOLD=MP_SIZE_T_MAX.
+ Streamline non-reduction path.
+ * mpn/x86_64/core2/gcd_1.asm: Streamline small operands cases similarly
+ to top-level code.
+
+2017-02-24 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (arm32/arm64 add_ssaaaa): Use "subs" for some immediates.
+ * longlong.h (arm32/arm64 sub_ddmmss): Use "adds" for some immediates.
+
+ * mpn/arm64/copyi.asm: Avoid branching on flags.
+ * mpn/arm64/copyd.asm: Likewise.
+
+ * mpn/generic/div_qr_2.c (aarch64 add_sssaaaa): New.
+ * mpn/generic/div_qr_1n_pi2.c: Same.
+ * mpn/generic/div_qr_1u_pi2.c: Same.
+
+ * mpn/generic/div_qr_2.c (powerpc add_sssaaaa): Fix typo.
+ * mpn/generic/div_qr_1n_pi2.c: Same.
+ * mpn/generic/div_qr_1u_pi2.c: Same.
+
+2017-02-23 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * tests/devel/sqrtrem_1_2.c: New exhaustive test for sqrtrem_[12].
+ * tests/devel/Makefile.am (EXTRA_PROGRAMS): add it.
+
+2017-02-23 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/silvermont/gmp-mparam.h: New file.
+
+2017-02-22 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/aorsmul_1.asm: Rewrite.
+
+ * mpn/arm64/lshiftc.asm: New file.
+
+2017-02-21 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/lshift.asm: Rewrite.
+ * mpn/arm64/rshift.asm: Rewrite.
+
+ * mpn/arm64/rsh1aors_n.asm: New file.
+
+2017-02-19 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/mul_1.asm: Rewrite.
+ * mpn/arm64/xgene1/mul_1.asm: Remove.
+
+2017-02-17 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/cora53/cnd_aors_n.asm: Moved from "..".
+
+ * mpn/arm64/xgene1/cnd_aors_n.asm: Remove file since default code
+ performs better.
+
+ * mpn/arm64/cnd_aors_n.asm: Rewrite.
+
+ * mpn/arm64/logops_n.asm: Rewrite based on new aors_n.asm.
+
+2017-02-16 Pedro Gimeno <pggimeno at wanadoo.es>
+
+ * rand/randmt.c (__gmp_randiset_mt): Set generator functions from
+ source.
+
+2017-02-16 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm64/aorsorrlshC_n.asm: New file.
+ * mpn/arm64/aorsorrlsh2_n.asm: New file.
+ * mpn/arm64/aorsorrlsh1_n.asm: New file.
+
+ * mpn/arm64/xgene1/aors_n.asm: Remove file since default code now
+ performs similarly.
+
+ * mpn/arm64/aors_n.asm: Rewrite to use 4x unrolling.
+
+2017-02-15 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/silvermont/hamdist.asm: New file, based on k10 code.
+
+ * mpn/x86_64/silvermont/popcount.asm: Grab coreisbr/popcount.asm.
+
+2017-02-14 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/x86_64/silvermont/aors_n.asm: New file, grabbing coreisbr code.
+
+ * mpn/x86_64/atom/aors_n.asm: Replace coreisbr grabbing code with
+ code based on Marco's x64/atom/aors_n.asm.
+
+2017-02-12 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/powerpc64/aix.m4 (AIX): New define.
+
+ * mpn/powerpc64/mode64/bdiv_q_1.asm: For AIX, don't jump from
+ mpn_bdiv_q_1 to middle of mpn_pi1_bdiv_q_1. Streamline.
+
+ * mpn/powerpc64/darwin.m4 (LEA): Put code in lea_list instead of in
+ EPILOGUE_cpu.
+ (EPILOGUE_cpu): Output lea_list, the zap it.
+
+ * mpn/sparc64/ultrasparct3/bdiv_q_1.asm: New file, based on dive_1.asm.
+
+2017-02-11 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm/v7a/cora8/bdiv_q_1.asm: New file, based on v6/dive_1.asm.
+ * mpn/arm/v7a/cora9/bdiv_q_1.asm: New file, grabbing cora8 code.
+ * mpn/arm/v7a/cora15/bdiv_q_1.asm: Likewise.
+
+ * mpn/arm64/aors_n.asm: (SETCY, RETVAL): Shorten insn sequences.
+ * mpn/arm64/cnd_aors_n.asm: Likewise.
+ * mpn/arm64/xgene1/aors_n.asm: Likewise.
+ * mpn/arm64/xgene1/cnd_aors_n.asm: Likewise.
+
+ * mpn/arm/bdiv_q_1.asm: New file, based on dive_1.asm.
+
+ * mpn/generic/bdiv_q_1.c (mpn_bdiv_q_1): Remove odd d special case.
+
+ * mpn/powerpc64/mode64/bdiv_q_1.asm: New file.
+
+ * mpn/arm64/bdiv_q_1.asm: New file.
+
+2017-02-10 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/arm/arm-defs.m4 (EPILOGUE_cpu): Zap lea_list to avoid repetition.
+
+ * mpn/x86_64/bdiv_q_1.asm: Rewrite, base on atom/dive_1.asm.
+
+2017-02-08 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/compute_powtab.c: Choose mpn_pi1_bdiv_q_1 vs
+ mpn_divexact_1 more wisely (spotted by Marco).
+
+2017-02-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * tune/tuneup.c (relspeed_div_1_vs_mul_1): Prefer mpn_pi1_bdiv_q_1.
+
+ * mpn/generic/compute_powtab.c: Use mpn_pi1_bdiv_q_1/mpn_bdiv_q_1
+ instead of mpn_divexact_1.
+
+ * gen-bases.c (binvert): New function, computing modular inverse and
+ low zero count.
+ (header): Print MP_BASES_BIG_BASE_CTZ_10 and
+ MP_BASES_BIG_BASE_BINVERTED_10.
+
+2017-02-06 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/bdiv_q_1.c: Make return value consistent.
+
+ * mpn/x86/p6/mmx/gmp-mparam.h (SQR_TOOM2_THRESHOLD): Revert to bogus
+ value to accommodate p6/sqr_basecase.asm fragility.
+
+2017-01-29 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/and.c: Simplify branches.
+ * mpz/ior.c: Likewise.
+ * mpz/xor.c: Likewise.
+
+ * gen-bases.c: In generated file, include just gmp-impl.h, not gmp.h
+
+2017-01-29 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac: Don't check if we got a C99 compiler for now (partially
+ revert 2017-01-24 change as C++ compilers become rejected).
+
+2017-01-24 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/generic/compute_powtab.c: New file, providing mpn_compute_powtab
+ for both get_str and set_str.
+
+ * gmp-impl.h (mpn_str_powtab_alloc): New macro.
+ (mpn_dc_set_str_powtab_alloc, mpn_dc_get_str_powtab_alloc): Remove.
+ (mpn_compute_powtab): Declare.
+
+ * mpn/generic/set_str.c: Use mpn_compute_powtab.
+ (mpn_set_str_compute_powtab): Remove.
+
+ * mpn/generic/get_str.c: Use mpn_compute_powtab.
+ (mpn_get_str_compute_powtab): Remove.
+ (mpn_bc_get_str): New name for mpn_sb_get_str.
+
+ * configure.ac (gmp_mpn_functions): Add compute_powtab.
+
+ * tune/tuneup.c (speed_mpn_pre_set_str): Call mpn_compute_powtab.
+ * tune/set_strb.c: Remove mpn_set_str_compute_powtab name mangling.
+ * tune/set_strs.c: Likewise.
+
+ * configure.ac: Invoke AC_PROG_CC_C99 instead of AC_PROG_CC_STDC.
+
+2017-01-03 Torbjörn Granlund <tg at gmplib.org>
+
+ * configure.ac (arm*-*-*): Properly point to cortex-a5 subdir.
+
+2016-12-31 Torbjörn Granlund <tg at gmplib.org>
+
+ * tune/tuneup.c (relspeed_div_1_vs_mul_1): New function.
+
+2016-12-28 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * tune/common.c (speed_mpz_mfac_uiui, speed_mpz_invert): New
+ functions.
+ * tune/speed.h: Declare them.
+ * tune/speed.c (routine): Add mpz_mfac_uiui, mpz_invert.
+
+ * tests/mpz/t-primorial_ui.c: Add randomization to the test.
+ * mpz/tdiv_r.c: Reduce allocation in some corner-case conditions.
+ * mpz/tdiv_r_2exp.c: Rearrange counting non-zero limbs.
+ * mpz/tdiv_q.c: Move common code out of some branches.
+ * mpz/and.c: Alloc only when needed.
+ * mpz/xor.c: Reorder branches.
+ * mpz/gcd.c: Reorder branches.
+ * mpz/pprime_p.c: Save the initial branch of a loop.
+ * mpn/generic/divrem.c: Save an allocation.
+
+2016-12-26 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h (x86_64 umul_ppmm): Add mulx variant (not automatically
+ used).
+
+2016-12-17 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/gcdext.c: Save an allocation if both cofactors are needed.
+ * mpz/oddfac_1.c: Revision of all ASSERTs.
+ * tests/mpz/t-invert.c: All elements are invertible in the zero ring.
+
+2016-12-13 Torbjörn Granlund <tg at gmplib.org>
+
+ * longlong.h: Test LONGLONG_STANDALONE in two more places.
+
+2016-12-07 Torbjörn Granlund <tg at gmplib.org>
+
+ * gmp-h.in: Check yet another symbol for FILE.
+
+2016-12-04 Torbjörn Granlund <tg at gmplib.org>
+
+ * tests/mpz/reuse.c: Use mpz_clobber. Split mpz_gcdext macros to avoid
+ spurious res3 dependency.
+
+ * tests/misc.c (mpz_clobber): New function.
+
+2016-12-03 Niels Möller <nisse at lysator.liu.se>
+
+ * doc/gmp.texi (Number Theoretic Functions): Tweak mpz_gcdext
+ documentation. The first and third argument may be NULL, but not
+ the second.
+
+2016-12-02 Niels Möller <nisse at lysator.liu.se>
+
+ * tests/mpz/reuse.c (main): Test additional cases of reuse for
+ mpz_gcd and mpz_gcdext.
+
2016-12-01 Torbjörn Granlund <tg at gmplib.org>
- * tests/misc.c (tests_rand_start): Make shift well-defined.
+ * tests/misc.c (seed_from_tod): Make shift well-defined.
- * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
- * gmp-h.in: Bump version.
-
2016-11-29 Torbjörn Granlund <tg at gmplib.org>
* gmp-h.in (__GNU_MP__): Bump.
@@ -56,8 +1519,15 @@
* mpz/kronsz.c: Use ABS_CAST to avoid undefined code.
+2016-11-27 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/gcd.c, mpz/gcdext.c: Use NEWALLOC.
+ * mpz/oddfac_1.c: Disable an ASSERT that needs a revision.
+
2016-11-27 Torbjörn Granlund <tg at gmplib.org>
+ * tests/mpz/reuse.c: Rewrite operand randomisation to use fixed ranges.
+
* tune/time.c (cgt_works_p): Add a missing verbosity check.
* configure.ac: Make udiv_w_sdiv use conditional on enable_assembly.
@@ -64,8 +1534,14 @@
2016-11-25 Marc Glisse <marc.glisse at inria.fr>
- * tests/cxx/t-ops2.cc (checkz): Avoid left shift of negative number.
+ * mpz/gcdext.c (mpz_gcdext): Allow a first argument of NULL.
+ * doc/gmp.texi (Number Theoretic Functions): Document it.
+ * tests/mpz/t-gcd.c (main): Test it.
+2016-11-25 Marc Glisse <marc.glisse at inria.fr>
+
+ * tests/cxx/t-ops2z.cc (checkz): Avoid left shift of negative number.
+
2016-11-22 Torbjörn Granlund <tg at gmplib.org>
* configure.ac (x86): Define LINUX for GNU/Linux systems.
@@ -73,10 +1549,31 @@
2016-11-21 Torbjörn Granlund <tg at gmplib.org>
+ * configure.ac (powerpc): Never use -O3.
+
* acinclude.m4 (mpn_lshift_com optimization 2): Make it well-defined
also for 32-bit systems.
(mpn_lshift_com optimization 2): Free allocated memory.
+2016-11-19 Niels Möller <nisse at lysator.liu.se>
+
+ * Makefile.am (check-mini-gmp): Override CFLAGS and CPPFLAGS
+ instead of the deleted EXTRA_CFLAGS. Set TEST_LIBRARY_PATH,
+ instead of LD_LIBRARY_PATH and DYLD_LIBRARY_PATH, to avoid getting
+ gcc linked with an unexpected version of gmp.
+
+2016-11-18 Niels Möller <nisse at lysator.liu.se>
+
+ * Makefile.am (check-mini-gmp): Get CC and EXTRA_CFLAGS right.
+
+2016-11-17 Torbjörn Granlund <tg at gmplib.org>
+
+ * asl.h: Initial support for artificially small limbs.
+
+2016-11-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * pz/iset_str.c: Lazy allocation.
+
2016-11-01 Torbjörn Granlund <tg at gmplib.org>
* mpn/generic/dive_1.c: Remove a forgotten dummy while-loop. (Spotted
@@ -86,6 +1583,15 @@
* gmp-impl.h (x86_64 MPN_IORD_U): Use proper asm constraint.
+2016-10-30 Torbjörn Granlund <tg at gmplib.org>
+
+ * mpn/Makefile.am (TARG_DIST): Add riscv.
+
+2016-10-28 Marc Glisse <marc.glisse at inria.fr>
+
+ * gmpxx.h (__gmp_binary_divides): Let 1/q call mpq_inv.
+ * tests/cxx/t-ops.cc (check_mpq): Test it.
+
2016-10-24 Torbjörn Granlund <tg at gmplib.org>
* config.guess: Recognise Itanium Poulson.
@@ -96,9 +1602,30 @@
2016-10-14 Torbjörn Granlund <tg at gmplib.org>
- * configure.ac
+ * longlong.h (riscv umul_ppmm): New.
+
+ * mpn/riscv/64/aors_n.asm: New file.
+ * mpn/riscv/64/mul_1.asm: New file.
+ * mpn/riscv/64/aorsmul_1.asm: New file.
+
+ * mpn/generic/addmul_1.c: Rewrite for shallower recurrency.
+ * mpn/generic/submul_1.c: Likewise.
+
+ * configure.ac (riscv-*-*): New.
(arm*-*-*): Rewrite arm support to handle armv8 CPUs in 32-bit mode.
+2016-08-29 Torbjörn Granlund <tg at gmplib.org>
+
+ * All C files: Include just gmp-impl.h, make gmp-impl.h grab gmp.h.
+
+ * mpf/get_str.c: Use __GMP_ALLOCATE_FUNC_TYPE and friends.
+ * mpf/inp_str.c: Likewise.
+ * mpq/get_str.c: Likewise.
+ * mpz/get_str.c: Likewise.
+ * mpz/inp_str.c: Likewise.
+ * scanf/vsscanf.c: Likewise.
+ * tal-reent.c: Likewise.
+
2016-08-24 Vlad Zakharov <vzakhar at synopsys.com>
* longlong.h (arc add_ssaaaa, sub_ddmmss): Replace obsolete 'J'
@@ -109,30 +1636,107 @@
* longlong.h (umul_ppmm from __umulsidi3): Protect with do ...
while (0).
-2016-06-18 Torbjörn Granlund <tg at gmplib.org>
+2016-06-02 Torbjörn Granlund <tg at gmplib.org>
+ Vincent Lefevre <vincent at vinc17.net>
- * Version 6.1.1 released.
+ * doc/gmp.texi: Various clarifications about variable conventions.
-2015-03-20 Marc Glisse <marc.glisse at inria.fr>
+2016-04-07 Marc Glisse <marc.glisse at inria.fr>
+ * gmp-h.in (__GMP_NOTHROW): Prefer noexcept to throw().
+ (mpz_init, mpz_inits): Mark as __GMP_NOTHROW.
+ * mpz/init.c, mpz/inits.c: Likewise.
+ * gmpxx.h (mpz_class): Mark default and move constructors noexcept.
+ * tests/cxx/t-cxx11.cc: Check noexcept.
+
+2016-04-02 Torbjörn Granlund <torbjorng at google.com>
+
+ * mpf/set_q.c: Rewrite, mainly to use mpn_div_q.
+
+2016-03-29 Torbjörn Granlund <torbjorng at google.com>
+
+ * mpn/x86_64/fat/addmul_2.c: New file.
+
+2016-03-28 Torbjörn Granlund <torbjorng at google.com>
+
+ * mpn/x86_64/addmul_2.asm: Move from here...
+ * mpn/x86_64/k8/addmul_2.asm: ...to here.
+
+2016-03-26 Torbjörn Granlund <torbjorng at google.com>
+
+ * mpn/arm64/sqr_diag_addlsh1.asm: New file.
+
+2016-03-25 Torbjörn Granlund <torbjorng at google.com>
+
+ * mpn/arm64/xgene1/aors_n.asm: New file.
+ * mpn/arm64/xgene1/aorsmul_1.asm: New file.
+ * mpn/arm64/xgene1/cnd_aors_n.asm: New file.
+ * mpn/arm64/xgene1/gmp-mparam.h: New file.
+ * mpn/arm64/xgene1/mul_1.asm: New file.
+
+ * config.guess: Prefix all arm CPUs with "arm" to accommodate our
+ matchers.
+ * configure.ac (arm): Match arm CPUs consistently.
+
+2016-03-21 Torbjörn Granlund <torbjorng at google.com>
+
+ * configure.ac: Support many arm64 processors.
+
+2016-03-20 Marc Glisse <marc.glisse at inria.fr>
+
* configure.ac (WANT_ASSEMBLY): Remove.
(NO_ASM): Remove from CFLAGS, add to AC_DEFINE.
* tests/misc.c: Test NO_ASM instead of WANT_ASSEMBLY.
+2016-03-20 Torbjörn Granlund <torbjorng at google.com>
+
+ * config.guess (arm*): Handle big.LITTLE CPUs by extracting the
+ lexically largest id.
+ * config.guess (arm*): Add many aarch64 CPUs.
+ * config.guess (main): Corresponding changes.
+
+ * mpn/arm/v7a/cora5/gmp-mparam.h: New file.
+
+ * configure.ac (arm*): Support cortex-a5 better.
+
2016-02-25 Pavel Kopyl <p.kopyl at samsung.com>
* acinclude.m4 (GMP_ASM_UNDERSCORE): Tighten gurkmacka detection.
-2016-01-04 Marco Bodrato <bodrato at mail.dm.unipi.it>
+2016-01-27 Niels Möller <nisse at lysator.liu.se>
- * Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
- * gmp-h.in: Bump version.
+ * errno.c (__gmp_exception): Use raise(SIGFPE) when available.
+2016-01-15 Torbjörn Granlund <torbjorng at google.com>
+
+ * config.guess (s390): Don't assume /proc/cpuinfo exists.
+
+2016-01-13 Torbjörn Granlund <torbjorng at google.com>
+
+ * config.guess: Reorder and generalise ppc code.
+
2016-01-01 Marco Bodrato <bodrato at mail.dm.unipi.it>
* tests/cxx/clocale.c: Do not re-define localeconv for mingw.
* tests/misc/t-locale.c: Likewise (Thanks Alexander).
+ * primesieve.c: Heal a speed regression on small values.
+ * mpz/bin_uiui.c (mpz_bdiv_bin_uiui): 2 factors all at once.
+ (mpz_goetgheluck_bin_uiui): Use STOP/CONT for loops on primesieve.
+ * mpz/oddfac_1.c: Likewise.
+ * mpz/primorial_ui.c (LOOP_ON_SIEVE_CONTINUE): Define prime locally.
+
+ * gen-fac.c: Use unsigned types for sizes.
+
+ * mpn/generic/invert.c: Use MPN_FILL macro.
+ * mpn/generic/invertappr.c: Likewise.
+ * mpn/generic/toom53_mul.c: Use _ip1 when available.
+
+2015-12-28 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpq/set_str.c: Use __GMP_FREE_FUNC_TYPE.
+ * tests/mpz/t-nextprime.c: Speedup using swap, and correct type.
+
2015-12-26 Torbjörn Granlund <torbjorng at google.com>
* tests/misc.c (tests_start): Assert library version.
@@ -150,6 +1754,8 @@
2015-12-13 Marco Bodrato <bodrato at mail.dm.unipi.it>
+ * mpf/clears.c, mpf/inits.c, mpq/clears.c, mpq/inits.c,
+ * mpz/clears.c, mpz/inits.c: Stop supporting empty list.
* tests/arm32call.asm: bx->ret to support thumb-less chips
(thanks Martin Husemann).
@@ -164,6 +1770,11 @@
* tests/misc/t-printf.c: Test a sequence of '%'.
* printf/doprnt.c: Avoid buffer overread with long long limbs.
+ * mpn/generic/toom_interpolate_7.c: Use the rsh1 functions,
+ when available, also for negatives (clearing the carry).
+ * mpn/generic/toom_interpolate_12.c: Likewise.
+ * mpn/generic/toom_interpolate_16.c: Likewise.
+
2015-12-06 Torbjörn Granlund <torbjorng at google.com>
* configure.ac (arm*): Conditionally define NOTHUMB.
@@ -185,7 +1796,117 @@
* gmp-impl.h (MPN_TOOM22_MUL_MINSIZE): Consider ToomX2 limits
(thanks Paul).
* tests/mpn/t-toom22.c: Keep on testing small sizes.
+ * tests/mpz/t-primorial_ui.c: Test a single "large" number.
+ * tune/common.c (speed_mpz_primorial_ui): New function.
+ * tune/speed.h: Declare it.
+ * tune/speed.c (routine): Add mpz_primorial_ui.
+
+ * primesieve.c: Use two presieved patterns on 64-bits CPUs.
+
+2015-11-13 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpq/init.c: Remove conditional code for __CHECKER__.
+ * mpq/set.c: Shorten scope of local variables.
+ * mpq/set_den.c: Likewise.
+ * mpq/set_num.c: Likewise.
+ * mpq/set_z.c: Likewise.
+
+ * primesieve.c: Fill sieve with a presieved 70bits pattern.
+
+2015-11-12 Marc Glisse <marc.glisse at inria.fr>
+
+ * gmpxx.h (__gmp_fibonacci_function): New class.
+ (fibonacci, mpz_class::fibonacci): New functions.
+ (__gmp_fac_function, __gmp_primorial_function): Add braces.
+ * tests/cxx/t-ops2z.cc: Test fibonacci.
+ * doc/gmp.texi (C++ Interface Integers): Document fibonacci.
+ Warn about factorial and primorial of negative numbers.
+
+2015-11-10 Marc Glisse <marc.glisse at inria.fr>
+
+ * gmpxx.h (__gmp_primorial_function): Throw on negative operands.
+ * tests/cxx/t-ops2z.cc: Test it.
+
+2015-11-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz: Experimental, lazy allocation.
+
+2015-11-09 Marc Glisse <marc.glisse at inria.fr>
+
+ * tests/cxx/Makefile.am: Move EXTRA_DIST out of WANT_CXX.
+
+2015-11-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/urandomm.c: Use mpn_zero_p to shorten code.
+
+2015-11-08 Marc Glisse <marc.glisse at inria.fr>
+
+ * gmpxx.h (__gmp_fac_function, __gmp_primorial_function): New classes.
+ (__GMPP_DECLARE_UNARY_STATIC_MEMFUN,
+ __GMPNN_DECLARE_UNARY_STATIC_MEMFUN,
+ __GMPNS_DECLARE_UNARY_STATIC_MEMFUN,
+ __GMPNU_DECLARE_UNARY_STATIC_MEMFUN,
+ __GMPND_DECLARE_UNARY_STATIC_MEMFUN,
+ __GMPN_DECLARE_UNARY_STATIC_MEMFUN,
+ __GMP_DECLARE_UNARY_STATIC_MEMFUN, __GMPP_DEFINE_UNARY_STATIC_MEMFUN,
+ __GMPNN_DEFINE_UNARY_STATIC_MEMFUN,
+ __GMPNS_DEFINE_UNARY_STATIC_MEMFUN,
+ __GMPNU_DEFINE_UNARY_STATIC_MEMFUN,
+ __GMPND_DEFINE_UNARY_STATIC_MEMFUN, __GMPN_DEFINE_UNARY_STATIC_MEMFUN,
+ __GMP_DEFINE_UNARY_STATIC_MEMFUN): New macros.
+ (factorial, mpz_class::factorial, primorial, mpz_class::primorial):
+ New functions.
+ * tests/cxx/t-ops2.cc: Test factorial and primorial.
+ * tests/cxx/Makefile.am: Move t-ops2 after
+ t-do-exceptions-work-at-all-with-this-compiler.
+ * doc/gmp.texi: Document factorial and primorial.
+ * NEWS: Likewise.
+
+ * tests/cxx/t-ops2.cc: Remove and split into ...
+ * tests/cxx/t-ops2z.cc, tests/cxx/t-ops2qf.cc, tests/cxx/t-ops2f.cc,
+ tests/cxx/t-ops2.h: New files.
+ * tests/cxx/Makefile.am: Update for the split.
+
+2015-11-07 Marc Glisse <marc.glisse at inria.fr>
+
+ * gmpxx.h (__GMP_DEFINE_UNARY_FUNCTION_1,
+ __GMPP_DEFINE_BINARY_FUNCTION_1, __GMPNN_DEFINE_BINARY_FUNCTION_1,
+ __GMPNS_DEFINE_BINARY_FUNCTION_1, __GMPNU_DEFINE_BINARY_FUNCTION_1,
+ __GMPND_DEFINE_BINARY_FUNCTION_1, __GMPNLD_DEFINE_BINARY_FUNCTION_1,
+ __GMPN_DEFINE_BINARY_FUNCTION_1, __GMP_DEFINE_BINARY_FUNCTION_1):
+ New macros.
+ (operator~, trunc, floor, ceil, sqrt, operator%, operator&, operator|,
+ operator^, hypot, gcd, lcm): Use them.
+
+2015-11-06 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/and.c: Use MPZ_NEWALLOC.
+ * mpz/ior.c: Remove duplicated branches, add branch hints.
+ * mpz/xor.c: Likewise, and use NORMALIZE_NOT_ZERO.
+
+ * mpz/init.c: Remove conditional code for __CHECKER__.
+ * mpz/init2.c: Likewise.
+ * mpz/inits.c: Likewise.
+ * mpz/iset.c: Likewise.
+ * mpz/iset_str.c: Likewise.
+
+2015-11-04 Torbjörn Granlund <torbjorng at google.com>
+
+ * mpz/xor.c: Use MPZ_REALLOC.
+ * mpz/ior.c: Likewise
+
+2015-11-03 Marco Bodrato <bodrato at mail.dm.unipi.it>
+
+ * mpz/xor.c: Use the return value of _mpz_realloc.
+ * mpz/ior.c: Likewise.
+ * mpn/generic/sec_div.c: Remove unused var.
+
+2015-11-01 Torbjörn Granlund <torbjorng at google.com>
+
+ * tests/misc.c (seed_from_tod, seed_from_urandom): New functions.
+ (tests_rand_start): Use them.
+
2015-11-01 Marco Bodrato <bodrato at mail.dm.unipi.it>
* Version 6.1.0 released.
@@ -206,7 +1927,6 @@
* demos/perl/GMP.xs: Likewise.
* tests/mpf/t-pow_ui.c: Use reference value to check the size.
- * mini-gmp/mini-gmp.c: Removed a typo (spotted by Paul Zimmermann).
* doc/gmp.texi (Floating-point): Remove "infinite precision" claim.
* gmp-h.in: Update version.
@@ -504,7 +2224,7 @@
2015-06-24 Torbjörn Granlund <torbjorng at google.com>
- * mpn/x86_64/fastsse/com.asm: Disalllow zero size operands.
+ * mpn/x86_64/fastsse/com.asm: Disallow zero size operands.
* mpn/x86_64/fastsse/copyi.asm: Suppress looping in basecase code.
@@ -592,9 +2312,6 @@
* tests/mpn/t-div.c: Likewise.
* tests/mpn/t-minvert.c: Likewise.
- * mini-gmp/mini-gmp.h: Declare mpn_zero_p.
- * mini-gmp/mini-gmp.c: Define mpn_zero_p as a function, not a macro.
-
2015-05-28 Niels Möller <nisse at lysator.liu.se>
* doc/gmp.texi (Low-level Functions): Document mpn_divexact_1 and
@@ -671,7 +2388,7 @@
(speed_mpn_add_1, speed_mpn_add_1_inplace): New functions.
(speed_mpn_sub_1, speed_mpn_sub_1_inplace): New functions.
* tune/speed.h: Declare them all.
- * tune/speed.c (routine): Added mpn_neg, mpn_add_1, mpn_sub_1,
+ * tune/speed.c (routine): Added mpn_neg, mpn_add_1, mpn_sub_1,
mpn_add_1_inplace, mpn_sub_1_inplace, and mpz_2fac_ui.
2015-04-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
@@ -953,11 +2670,6 @@
* mpn/arm64/mod_34lsub1.asm: New file.
-2014-08-27 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/mini-gmp.c (mpz_abs_sub_bit): Do full normalization,
- needed if mpz_clrbit clears the most significant one bit.
-
2014-08-23 Torbjörn Granlund <tege at gmplib.org>
* mpn/arm64/bdiv_dbm1c.asm: New file.
@@ -994,8 +2706,6 @@
* tests/mpf/t-fits.c: use ui_sub instead of sub_ui+neg.
- * mini-gmp/mini-gmp.c: Remove some useless variables.
-
2014-07-27 Torbjörn Granlund <tege at gmplib.org>
* mpn/x86/k7/gcd_1.asm: Use LEAL.
@@ -1136,7 +2846,6 @@
* gen-fac.c: +1 in the init2 argument before setbit.
* gen-fib.c: Likewise. (Thanks Niels)
- * mini-gmp/mini-gmp.c: Likewise.
* rand/randmts.c: Likewise.
* mpn/generic/invert.c: Remove unused TMP_MARK.
@@ -1145,8 +2854,6 @@
2014-05-15 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * mini-gmp/mini-gmp.c: Micro-optimisations.
-
* gen-fib.c: Use mpz_setbit.
* gen-psqr.c: Skip even numbers when looking for primes.
@@ -1237,10 +2944,6 @@
* mpn/Makefile.am (TARG_DIST): Purge removed directories.
* doc/gmp.texi: Remove special mentions of removed architectures.
-2014-03-12 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpz_probab_prime_p): Micro-optimisation.
-
2014-03-12 Torbjorn Granlund <tege at gmplib.org>
* mpn/x86/bd2/gmp-mparam.h: New file.
@@ -1252,27 +2955,6 @@
(check_primes): New function.
(main): Call them. Also use TESTS_REPS.
- * mini-gmp/mini-gmp.c (gmp_millerrabin): New internal function.
- (mpz_probab_prime_p): New function.
- * mini-gmp/mini-gmp.h (mpz_probab_prime_p): Declare it.
- * mini-gmp/tests/t-pprime_p.c: New test program.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-pprime_p.
-
-2014-03-03 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/mini-gmp.c (mpz_congruent_p): New function.
- * mini-gmp/mini-gmp.h: Declare it.
- * mini-gmp/tests/t-cong.c: New file, based on tests/mpz/t-cong.c.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-cong.
-
- * mini-gmp/tests/testutils.c (dump): New function. Deleted static
- functions in other files.
- (mpz_set_str_or_abort): Moved function here, from...
- * mini-gmp/tests/t-cmp_d.c: ... old location.
-
- * mini-gmp/tests/t-reuse.c (dump3): Renamed, from ...
- (dump): ...old name.
-
2014-03-01 Niels Möller <nisse at lysator.liu.se>
* mpn/generic/sec_powm.c (mpn_sec_powm): Clarify comment and
@@ -1295,12 +2977,6 @@
(x86 cpuid, 2 variants): Zero ecx for the benefit of new BMI2 feature
test.
-2014-02-21 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpn_sqrtrem): New function.
- * mini-gmp/mini-gmp.h: Declare it.
- * mini-gmp/tests/t-sqrt.c: Test it.
-
2014-02-17 Niels Möller <nisse at lysator.liu.se>
* mpn/generic/div_qr_1.c (mpn_div_qr_1): Revert yesterday's fix.
@@ -1324,7 +3000,6 @@
* doc/gmp.texi (mpz_roinit_n, MPZ_ROINIT_N): Document that
at least a readable limb is required.
- * mini-gmp/mini-gmp.c (mpz_div_qr): init + set = init_set .
2014-02-14 Niels Möller <nisse at lysator.liu.se>
@@ -1349,11 +3024,6 @@
* tune/tuneup.c (tune_powm_sec): Likewise. Also deleted code
fiddling with the high exponent bits.
-2014-02-10 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/tests/t-limbs.c: New test for mpz_limbs_*.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Add it.
-
2014-02-09 Niels Möller <nisse at lysator.liu.se>
* tune/tuneup.c (tune_powm_sec): Avoid timing of the nonsensical
@@ -1365,16 +3035,6 @@
(mpn_sec_powm): Deleted handling of winsize > initial ebi. For
now, replaced with an ASSERT_ALWAYS.
-2014-02-08 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpz_realloc2, mpz_limbs_read, mpz_limbs_modify
- mpz_limbs_write, mpz_limbs_finish, mpz_roinit_n): New functions.
- (mpn_perfect_square_p): New function.
- * mini-gmp/mini-gmp.h: Declare them.
-
- * mini-gmp/tests/t-mul.c: Use roinit and limbs_read to test mpn.
- * mini-gmp/tests/t-sqrt.c: Test also mpn_perfect_square_p.
-
2014-02-08 Niels Möller <nisse at lysator.liu.se>
* mpn/generic/sec_invert.c (mpn_cnd_neg_itch): #if:ed out unused
@@ -1390,17 +3050,6 @@
* doc/gmp.texi (Low-level Functions): Document mpn_sec_add_1 and
mpn_sec_sub_1.
-2014-02-03 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpn_rootrem): Allow NULL argument.
-
- * mini-gmp/mini-gmp.c (mpn_zero): New function.
- (mpz_perfect_square_p): New function.
- * mini-gmp/mini-gmp.h: Declare them.
-
- * mini-gmp/tests/t-sqrt.c: Test mpz_perfect_square_p.
- * mini-gmp/tests/t-root.c: Test also 1-th root, allow perfect powers.
-
2014-01-29 Torbjorn Granlund <tege at gmplib.org>
* doc/gmp.texi (Floating-point Functions): Revise.
@@ -1446,9 +3095,6 @@
* printf/repl-vsnprintf.c: Feed case 'z' in switch (type) with case 'z'
in switch (fchar).
- * mini-gmp/tests/t-aorsmul.c: New file, test for mpz_{add,sub}mul{,_ui}
- * mini-gmp/tests/Makefile: Add t-aorsmul.
-
2014-01-21 Marco Bodrato <bodrato at mail.dm.unipi.it>
* acinclude.m4 (GMP_FUNC_VSNPRINTF): Get rid of varargs.
@@ -1506,13 +3152,6 @@
* mpz/clear.c: Add cast to avoid overflow of (later ignored) argument.
* mpf/clear.c: Likewise.
-2014-01-19 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpn_popcount): New function.
- (mpz_popcount): Use it.
- (mpz_addmul_ui, mpz_addmul, mpz_submul_ui, mpz_submul): Added.
- * mini-gmp/mini-gmp.h: Declare them.
-
2014-01-18 Niels Möller <nisse at lysator.liu.se>
* tests/mpn/t-aors_1.c: Test also mpn_sec_add_1 and mpn_sec_sub_1.
@@ -1548,9 +3187,6 @@
(SPEED_ROUTINE_MPN_SEC_MINVERT): New macro.
* tune/speed.c (routine): Added mpn_sec_minvert.
- * mini-gmp/mini-gmp.c (mp_bits_per_limb): New const value.
- * mini-gmp/mini-gmp.h: Declare it.
-
2014-01-12 Marc Glisse <marc.glisse at inria.fr>
* demos/expr/expr.h: Add extern "C" for C++.
@@ -2847,7 +4483,6 @@
2013-03-13 Marco Bodrato <bodrato at mail.dm.unipi.it>
* mpz/cong_2exp.c: Write loops in a cleaner way.
- * mini-gmp/mini-gmp.c: Likewise.
* gmp-impl.h (mpz_zero_p): Likewise.
2013-03-12 Niels Möller <nisse at lysator.liu.se>
@@ -3014,16 +4649,6 @@
* tune/common.c (speed_measure): Increase repetition count if we
get a zero measurement.
-2013-02-27 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpz_div_q_2exp): Adjust only if needed.
- (mpn_common_scan): New service function to unify scan loops.
- (mpz_scan0, mpz_scan1): Simplify by using mpn_common_scan.
- (mpz_make_odd): Simplify, assume in-place operation on positive.
- (mpn_scan0, mpn_scan1): New functions.
- * mini-gmp/mini-gmp.h (mpn_scan0, mpn_scan1): New declarations.
- * mini-gmp/tests/t-scan.c: Test also mpn_scan0 and mpn_scan1.
-
2013-02-26 Niels Möller <nisse at lysator.liu.se>
* tests/mpz/t-limbs.c (check_roinit): Test MPZ_ROINIT_N only if
@@ -3031,14 +4656,6 @@
2013-02-25 Niels Möller <nisse at lysator.liu.se>
- * mini-gmp/tests/t-double.c (testmain): Declare double variables
- as volatile, to drop extended precision.
-
- * mini-gmp/tests/testutils.c (testfree): New function. Use it
- everywhere where test programs deallocate storage allocated via
- the mini-gmp allocation functions, including uses of mpz_get_str
- for various test failure messages.
-
* mpz/limbs_finish.c (mpz_limbs_finish): New file and function.
* mpz/limbs_modify.c (mpz_limbs_modify): New file and function.
* mpz/limbs_read.c (mpz_limbs_read): New file and function.
@@ -3072,15 +4689,6 @@
* tests/tests.h (TESTS_REPS): Keep count >= 1.
-2013-02-19 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c: Move asserts to work-around a compiler bug.
- (mpz_export): Reorder branches.
- (mpz_mul_ui): Avoid temporary allocation (mpn_mul_1 can work in-place).
-
- * mini-gmp/tests/t-reuse.c: Fix typo causing the same negation
- condition to be applied to all operands. (See 2013-02-03, Torbjorn)
-
2013-02-17 Marco Bodrato <bodrato at mail.dm.unipi.it>
* gmpxx.h (mpq_class, mpf_class) [init_ui, init_si, assign_si]:
@@ -3087,18 +4695,6 @@
Optimise _si using _ui for positive arguments.
(__gmp_hypot_function): Use _mul_ui to square an ui, abs for si.
- * mini-gmp/mini-gmp.c (mpz_mul): Read sizes just once.
- (mpn_set_str_other): Remove a redundant variable.
- (mpz_abs_add): Use SWAP once, to order sizes.
- (mpz_mul_ui): Micro-optimisation.
- (mpz_rootrem): Use _init2 before _setbit.
- (mpz_set_str): Optimise-out a variable.
- (mpz_import): Normalise only if needed.
- (mpn_div_qr_1): Speed-up the d=1 case, delaying a branch.
-
- * rand/randmts.c: Use init2, as size of variables is known in advance.
- (mangle_seed): Get a single argument.
-
* mpz/remove.c: Delay allocation in the generic case; use swap
instead of set.
* mpn/generic/remove.c: Delay (possibly smaller) allocation.
@@ -3202,10 +4798,8 @@
* gmp-impl.h (MPZ_PROVOKE_REALLOC): Remove unused macro.
* gen-fac.c (gen_consts): Remove obsolete code, use swap instead of set.
- * mini-gmp/mini-gmp.c (fac_ui, bin_uiui): Use shorter and faster code.
* mpn/generic/mulmod_bnm1.c: Reorganise branches.
- * mini-gmp/mini-gmp.c: Reduce branches.
* mpz/bin_ui.c: Avoid a copy when n < 0.
* mpz/mfac_uiui.c: Reduce memory usage.
@@ -3286,17 +4880,6 @@
* tests/mpz/reuse.c: Fix typo in last change.
-2013-01-23 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpz_cmpabs_d, mpz_cmp_d): Simplify.
- (mpz_set_str): Behaviour more adherent to the real GMP.
-
- * mini-gmp/tests/t-str.c: Cast size_t to unsigned long, for printf.
- * mini-gmp/tests/t-import.c: Likewise.
- * mini-gmp/tests/t-comb.c: Remove an unused var.
- * mini-gmp/tests/t-div.c: Remove unused args passed to fprintf.
- * mini-gmp/tests/t-double.c: Use float immediates with float vars.
-
2013-01-22 Torbjorn Granlund <tege at gmplib.org>
* Makefile.am (LIBGMP_LT_*, LIBGMPXX_LT_*): Bump version info.
@@ -3307,26 +4890,6 @@
* Makefile.am (check-mini-gmp): Fix typo in last change.
-2013-01-22 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/mini-gmp.c (mpz_cmp_d): Simplified, just sort out
- signs, then call mpz_cmpabs_d.
-
- * mini-gmp/tests/testutils.h: Include stdio.h and stdlib.h.
- (numberof): New define.
-
- * mini-gmp/tests/t-cmp_d.c: New file, copied from
- tests/mpz/t-cmp_d.c with minor changes.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-cmp_d,
-
- * mini-gmp/mini-gmp.c (mpz_cmpabs_d): New function.
- * mini-gmp/mini-gmp.h: Declare it.
-
-2013-01-21 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/tests/t-str.c (testmain): Test mpz_out_str, using
- the tmpfile function for i/o.
-
2013-01-20 Torbjorn Granlund <tege at gmplib.org>
* Makefile.am (check-mini-gmp): Set also DYLD_LIBRARY_PATH for the
@@ -3342,17 +4905,6 @@
* tests/mpz/t-remove.c: Back out last change which left `divisor_size'
uninitialised; achieve change's aim with a parameter tweak.
-2013-01-20 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/tests/testutils.c (testhalves): New function, test default
- memory functions.
- * mini-gmp/tests/testutils.h (testhalves): Declare it
- * mini-gmp/tests/t-logops.c: Use testhalves.
-
- * mini-gmp/mini-gmp.c (mpz_init_set_str): New function.
- * mini-gmp/mini-gmp.h (mpz_init_set_str): Declare it.
- * mini-gmp/tests/t-str.c: Test mpz_init_set_str.
-
2013-01-20 Torbjorn Granlund <tege at gmplib.org>
* tests/memory.c (PTRLIMB): New macro, used for conformant casting.
@@ -3359,104 +4911,22 @@
2013-01-19 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * mini-gmp/tests/t-double.c (testmain): Get the current free
- function using mp_get_memory_functions.
- * mini-gmp/tests/t-str.c (testmain): Likewise.
-
- * mini-gmp/tests/testutils.h (tu_free): Remove declaration.
-
- * mini-gmp/tests/testutils.c (block_check, tu_free): Mark static.
-
* tests/mpz/t-set_str.c: Check also failing conditions.
* tests/mpz/t-remove.c: Test removal of 1.
-2013-01-18 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/tests/t-str.c (test_small): New function, exercising
- parsing of whitespace and base prefixes.
- (testmain): Call it.
-
- * mini-gmp/tests/t-gcd.c (gcdext_valid_p): Fixed memory leak.
-
- * mini-gmp/tests/t-double.c (testmain): Call tu_free rather than
- free, for storage allocated by mpz_get_str.
- * mini-gmp/tests/t-str.c (testmain): Likewise.
-
- * mini-gmp/tests/testutils.c (block_init, block_check): New
- functions.
- (tu_alloc, tu_realloc, tu_free): New functions.
- (main): Use mp_set_memory_functions.
- * mini-gmp/tests/testutils.h (tu_free): Declare.
-
- * mini-gmp/tests/testutils.h: New file, declarations for test
- programs.
-
- * mini-gmp/tests/testutils.c (main): New file, with shared main
- function for all the test programs. Also includes mini-gmp.c.
- Calls testmain after initialization. All other test programs
- updated to define testmain rather than main.
-
-2013-01-18 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/tests/t-signed.c: Slightly larger coverage.
- * mini-gmp/tests/t-double.c: Test also mpz_init_set_d.
-
2013-01-18 Torbjorn Granlund <tege at gmplib.org>
* mpn/generic/set_str.c (normalization_steps): Eliminate set-but-unused
variable.
- * mini-gmp/tests/t-div.c: Test mpz_divisible_p and mpz_divisible_ui_p.
-
* tests/tests.h (TESTS_REPS): Fix printf argument type clashes.
- * mini-gmp/tests/t-div.c: Test also mpz_mod, mpz_mod_ui. Compare
- mpz_divisible_p just to ceil, to save time.
-
- * mini-gmp/mini-gmp.c: Prefix some names with GMP_.
-
-2013-01-16 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/tests/t-double.c: Test mpz_cmp_d.
- * mini-gmp/mini-gmp.c (mpz_cmp_d): Correct multiword comparison.
-
- * mini-gmp/mini-gmp.c (mpz_set_str): Handle the empty string.
- * mini-gmp/tests/t-str.c: Test base <= 0.
-
-2013-01-15 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/tests/t-str.c (main): Use x->_mp_d rather than x[0]._mp_d.
- * mini-gmp/tests/t-invert.c (main): Likewise.
-
- * mini-gmp/tests/t-mul.c (main): Test mpn_mul_n and mpn_sqr.
-
- * mini-gmp/tests/hex-random.h (enum hex_random_op): New value
- OP_SQR.
-
- * mini-gmp/tests/mini-random.c (mini_random_op3): Renamed, from...
- (mini_random_op): ... old name. Updated callers.
- (mini_random_op2): New function.
-
- * mini-gmp/tests/hex-random.c (hex_random_op3): Renamed, from...
- (hex_random_op): ... old name. Updated callers.
- (hex_random_op2): New function.
-
-2013-01-15 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/tests/t-logops.c: Improve popcount/hamdist testing.
- * mini-gmp/tests/t-signed.c: Test more cases.
-
2013-01-15 Torbjorn Granlund <tege at gmplib.org>
From Mike Frysinger:
* configure.ac: Add x32 ABI for x86_64.
-2013-01-14 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/tests/t-str.c (main): Added tests for mpn_get_str and
- mpn_set_str.
-
2013-01-14 Marco Bodrato <bodrato at mail.dm.unipi.it>
* doc/gmp.texi (gmp_version): Remove "was used" repetition.
@@ -3467,80 +4937,19 @@
* doc/gmp.texi: Let mpn_sqrtrem reference mpn_perfect_square_p instead
of mpz_perfect_square_p.
-2013-01-11 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/tests/t-comb.c: New test program, testing both
- mpz_fac_ui and mpz_bin_uiui.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-comb.
-
- * mini-gmp/mini-gmp.c (mpz_mul_si): Simplify.
- (mpz_mul_ui, mpz_mul, mpz_div_qr): Replace init+REALLOC with init2.
-
- * mini-gmp/mini-gmp.c (NEG_CAST): New macro.
- (mpz_mul_si, mpz_set_si, mpz_cmp_si): Use NEG_CAST.
-
- * mini-gmp/mini-gmp.c (mpz_set_si, mpz_cmp_si): Simplify by using
- the _ui variant.
-
- * mini-gmp/tests/t-root.c: Use mpz_ui_pow_ui, when base fits an ui.
-
- * mini-gmp/tests/t-mul.c: Test also mpz_mul_si.
- * mini-gmp/tests/t-sub.c: Test also mpz_ui_sub.
-
- * mini-gmp/mini-gmp.c (mpz_fits_slong_p): Correct range.
- * mini-gmp/tests/t-signed.c: New test program, for get/set/cmp_si.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-signed.
-
- * mini-gmp/mini-gmp.c (mpz_hamdist): Handle different sizes.
- * mini-gmp/tests/t-logops.c: Test also popcount and hamdist.
-
2013-01-10 Marco Bodrato <bodrato at mail.dm.unipi.it>
* mpz/export.c: Less restrictive ASSERTs.
- * mini-gmp/mini-gmp.c (mpz_export, mpz_import): Likewise.
- * mini-gmp/tests/t-import.c: Test also size=0 or count=0.
2013-01-10 Torbjorn Granlund <tege at gmplib.org>
- * mini-gmp/tests/t-import.c (main): Don't drop off function end.
-
* Makefile.am (check-mini-gmp): Set LD_LIBRARY_PATH to allow testing
with dynamic main GMP build.
-2013-01-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/mini-gmp.c (mpz_export): Support op=0 countp=NULL.
-
-2013-01-08 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/tests/t-import.c: New test program, testing both
- mpz_import and mpz_export.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): Added t-import.
-
- * mini-gmp/tests/mini-random.c (mini_rrandomb_export): New
- function.
- * mini-gmp/tests/mini-random.h: Declare it.
- * mini-gmp/tests/hex-random.c (hex_rrandomb_export): New function.
- * mini-gmp/tests/hex-random.h: Declare it.
-
- * mini-gmp/mini-gmp.c (mpz_export): Compute accurate word count up
- front, to avoid generating any high zero words.
-
-2013-01-07 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- * mini-gmp/README: Document base limitation for conversions.
- * mini-gmp/mini-gmp.c (mpz_set_str): Remove goto.
- (mpz_import, mpz_export): Correctly use order/endianness.
-
2013-01-05 Torbjorn Granlund <tege at gmplib.org>
* longlong.h (aarch64): Make add_ssaaaa and sub_ddmmss actually work.
-2013-01-04 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
- From shuax:
- * mini-gmp/mini-gmp.c (mpz_import): Reset limb after storing it.
-
2013-01-04 Torbjorn Granlund <tege at gmplib.org>
From Marko Lindqvist:
@@ -3731,11 +5140,6 @@
* tests/mpn/t-get_d.c (check_onebit): Get vax bounds right.
(main): Switch off check_rand for vax.
-2012-11-22 Niels Möller <nisse at lysator.liu.se>
-
- * mini-gmp/tests/run-tests: Copied latest version from GNU Nettle.
- Minor fix to the use of $EMULATOR, and proper copyright notice.
-
2012-11-16 Torbjorn Granlund <tege at gmplib.org>
* mpn/generic/powm_sec.c (redcify): Use mpn_sb_div_r_sec.
@@ -3896,9 +5300,6 @@
* mpn/generic/powlo.c: Likewise.
* mpn/generic/powm.c: Likewise.
- * mini-gmp/mini-gmp.c (mpz_div_r_2exp, mpz_div_q_2exp): Improve
- adjustment condition.
-
2012-06-23 Marc Glisse <marc.glisse at inria.fr>
* gmpxx.h (numeric_limits): Make content public.
@@ -3926,8 +5327,6 @@
* mpz/oddfac_1.c: Likewise.
* mpz/prodlimbs.c: Likewise.
- * mini-gmp/mini-gmp.c (mpz_realloc): remove a branch.
-
2012-06-04 Torbjorn Granlund <tege at gmplib.org>
* mpn/powerpc64/aix.m4 (ASM_START): Claim machine type "any".
@@ -4012,12 +5411,6 @@
2012-05-25 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * mini-gmp/tests/t-div.c: Test all _qr, _q, _r variants.
- * mini-gmp/tests/t-lcm.c: Test the _ui variant.
-
- * mini-gmp/mini-gmp.c (mpz_mod, mpz_mod_ui): New functions.
- * mini-gmp/mini-gmp.h (mpz_mod, mpz_mod_ui): Prototypes.
-
* mpz/scan1.c: Simplify, and add a shortcut for scan1(z, 0).
2012-05-24 Torbjorn Granlund <tege at gmplib.org>
@@ -4111,8 +5504,6 @@
2012-05-09 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * mini-gmp/mini-gmp.c: merge mpz_rootrem and mpz_sqrtrem.
-
* mpn/generic/sqrtrem.c (invsqrttab): Reduce size removing common byte.
* mpz/bin_uiui.c (mul3, mul4, mul8): Remove unneeded shifts.
@@ -4425,10 +5816,6 @@
* mpz/bin_uiui.c: Rewrite (some parts are Torbjorn's).
* gen-fac_ui.c: Generate new constants for bin_uiui.
- * mini-gmp/mini-gmp.h (mpz_fac_ui, mpz_bin_uiui): New definitions.
- * mini-gmp/mini-gmp.c (mpz_fac_ui, mpz_bin_uiui): Trivial
- implementation.
-
* tests/mpz/t-fac_ui.c: Check Wilson's theorem on a big value.
* mpn/generic/invert.c: Remove support for scratch == NULL.
@@ -4466,24 +5853,14 @@
* Makefile.am (check-mini-gmp): Pass -I../.. in EXTRA_CFLAGS, to
locate gmp.h.
-2012-04-11 Marco Bodrato <bodrato at mail.dm.unipi.it>
+2012-04-10 Marco Bodrato <bodrato at mail.dm.unipi.it>
- * mini-gmp/mini-gmp.h (mpz_root, mpz_rootrem): define (correctly).
- * mini-gmp/mini-gmp.c (mpz_rootrem): Extended code from _root.
- (mpz_root): Use mpz_rootrem.
- (mpz_mul_ui): Correctly handle negative operands.
+ * Makefile.am (check-mini-gmp): Use $(MAKE).
+ (clean-mini-gmp): New target.
+ (clean-local, distclean-local): New automake targets. Depend on
+ clean-mini-gmp.
- * mini-gmp/tests/Makefile (CHECK_PROGRAMS): add t-root.
- * mini-gmp/tests/t-root.c: New file.
- * mini-gmp/tests/t-reuse.c: Enable root{,rem} tests.
-
-2012-04-10 Marco Bodrato <bodrato at mail.dm.unipi.it>
-
* gen-fac_ui.c (mpz_root): Remove.
- * mini-gmp/mini-gmp.c (mpz_root): New, support negative operands.
- * mini-gmp/mini-gmp.h (mpz_root): define.
- (mpz_out_str): Test also __STDIO_LOADED (for VMS).
- * mpz/2fac_ui.c: Cosmetic change.
2012-04-07 Torbjorn Granlund <tege at gmplib.org>
@@ -4735,19 +6112,6 @@
2012-02-29 Niels Möller <nisse at lysator.liu.se>
- * mini-gmp/tests/t-reuse.c: New test case, based on
- tests/mpz/reuse.c.
-
- * mini-gmp/mini-gmp.c (mpz_cdiv_r_ui): New function.
- (mpz_fdiv_r_ui): New function.
- (mpz_tdiv_r_ui): New function.
- (mpz_powm_ui): New function.
- (mpz_pow_ui): New function.
- (mpz_ui_pow_ui): Use mpz_pow_ui.
- (mpz_gcdext): Fixed input/output overlap, for the case of one
- input being zero.
- (mpz_sqrtrem): Fix for the case r NULL, U zero.
-
* Makefile.am (check-mini-gmp): Use $(MAKE).
(clean-mini-gmp): New target.
(clean-local, distclean-local): New automake targets. Depend on
@@ -4758,17 +6122,6 @@
* Makefile.am (check-mini-gmp): New target, for running the
mini-gmp testsuite.
- * mini-gmp/tests/Makefile (srcdir, MINI_GMP_DIR): New make
- variables. These can be overridden when using a separate build
- directory.
- (EXTRA_CFLAGS): Renamed, was OPTFLAGS.
-
- * mini-gmp/mini-gmp.c (mpz_abs_add): Don't cache limb pointers
- over MPZ_REALLOC, since that breaks in-place operation. Bug
- spotted by Torbjörn.
- (mpz_and, mpz_ior, mpz_xor): Likewise.
- (mpz_cmp): Fixed comparison of negative numbers.
-
2012-02-27 Torbjorn Granlund <tege at gmplib.org>
* mpn/x86_64/fastsse/lshiftc.asm: New file.
@@ -4804,10 +6157,6 @@
2012-02-26 Niels Möller <nisse at lysator.liu.se>
- * mini-gmp: New subdirectory. For use by GMP bootstrap, and as a
- fallback for applications needing bignums but not high
- performance.
-
* bootstrap.c: New file, replacing dumbmp.c. Uses mini-gmp for the
standard GMP functions, and then defines the few functions
particular for the bootstrap.
@@ -10049,7 +11398,7 @@
2009-10-29 Niels Möller <nisse at lysator.liu.se>
- * tune/speed.c: Added support for mpn_toom4_sqr,
+ * tune/speed.c: Added support for mpn_toom4_sqr.
* tune/speed.h (SPEED_ROUTINE_MPN_TOOM4_SQR): New macro.
(SPEED_ROUTINE_MPN_KARA_MUL_N): Deleted.
@@ -12406,7 +13755,7 @@
* demos/primes.c (find_primes): Increase mpz_probab_prime_p cnt to 10.
- * mpn/generic/addsub_n.c: Fix criteria form when to call _nc functions.
+ * mpn/generic/addsub_n.c: Fix criteria for when to call _nc functions.
2006-05-12 Torbjorn Granlund <tege at swox.com>
Modified: trunk/Build/source/libs/gmp/gmp-src/Makefile.am
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/Makefile.am 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/Makefile.am 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,8 +1,8 @@
## Process this file with automake to generate Makefile.in
-# Copyright 1991, 1993, 1994, 1996, 1997, 1999-2004, 2006-2009, 2011-2016 Free
-# Software Foundation, Inc.
+# Copyright 1991, 1993, 1994, 1996, 1997, 1999-2004, 2006-2009, 2011-2016,
+# 2018, 2020 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
@@ -89,6 +89,7 @@
# 6.1.0 13:0:3 9:0:5 -
# 6.1.1 13:1:3 9:1:5 -
# 6.1.2 13:2:3 9:2:5 -
+# 6.2.0 14:0:4 10:0:6 -
#
# Starting at 3:0:0 is a slight abuse of the versioning system, but it
# ensures we're past soname libgmp.so.2, which was used on Debian GNU/Linux
@@ -101,13 +102,13 @@
# it's still good to get the shared library filename (like
# libgmpxx.so.3.0.4) incrementing, to make it clear which GMP it's from.
-LIBGMP_LT_CURRENT = 13
-LIBGMP_LT_REVISION = 2
-LIBGMP_LT_AGE = 3
+LIBGMP_LT_CURRENT = 14
+LIBGMP_LT_REVISION = 0
+LIBGMP_LT_AGE = 4
-LIBGMPXX_LT_CURRENT = 9
-LIBGMPXX_LT_REVISION = 2
-LIBGMPXX_LT_AGE = 5
+LIBGMPXX_LT_CURRENT = 10
+LIBGMPXX_LT_REVISION = 0
+LIBGMPXX_LT_AGE = 6
SUBDIRS = tests mpn mpz mpq mpf printf scanf rand cxx demos tune doc
@@ -115,15 +116,21 @@
EXTRA_DIST = configfsf.guess configfsf.sub .gdbinit INSTALL.autoconf \
COPYING.LESSERv3 COPYINGv2 COPYINGv3
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gmp.pc
+# Put asl.h here for now.
+EXTRA_DIST += asl.h
+
if WANT_CXX
GMPXX_HEADERS_OPTION = gmpxx.h
+pkgconfig_DATA += gmpxx.pc
endif
EXTRA_DIST += gmpxx.h
-# gmp.h and mp.h are architecture dependent, mainly since they encode the
-# limb size used in libgmp. For that reason they belong under $exec_prefix
-# not $prefix, strictly speaking.
+# gmp.h is architecture dependent, mainly since it encodes the limb size used
+# in libgmp. For that reason it belongs under $exec_prefix not $prefix,
+# strictly speaking.
#
# $exec_prefix/include is not in the default include path for gcc built to
# the same $prefix and $exec_prefix, which might mean gmp.h is not found,
@@ -194,7 +201,7 @@
mpz/kronuz$U.lo mpz/kronzs$U.lo mpz/kronzu$U.lo \
mpz/lcm$U.lo mpz/lcm_ui$U.lo mpz/limbs_finish$U.lo \
mpz/limbs_modify$U.lo mpz/limbs_read$U.lo mpz/limbs_write$U.lo \
- mpz/lucnum_ui$U.lo mpz/lucnum2_ui$U.lo \
+ mpz/lucmod$U.lo mpz/lucnum_ui$U.lo mpz/lucnum2_ui$U.lo \
mpz/millerrabin$U.lo mpz/mod$U.lo mpz/mul$U.lo mpz/mul_2exp$U.lo \
mpz/mul_si$U.lo mpz/mul_ui$U.lo \
mpz/n_pow_ui$U.lo mpz/neg$U.lo mpz/nextprime$U.lo \
@@ -208,7 +215,8 @@
mpz/set_q$U.lo mpz/set_si$U.lo mpz/set_str$U.lo mpz/set_ui$U.lo \
mpz/setbit$U.lo \
mpz/size$U.lo mpz/sizeinbase$U.lo mpz/sqrt$U.lo \
- mpz/sqrtrem$U.lo mpz/sub$U.lo mpz/sub_ui$U.lo mpz/swap$U.lo \
+ mpz/sqrtrem$U.lo mpz/stronglucas$U.lo mpz/sub$U.lo \
+ mpz/sub_ui$U.lo mpz/swap$U.lo \
mpz/tdiv_ui$U.lo mpz/tdiv_q$U.lo mpz/tdiv_q_2exp$U.lo \
mpz/tdiv_q_ui$U.lo mpz/tdiv_qr$U.lo mpz/tdiv_qr_ui$U.lo \
mpz/tdiv_r$U.lo mpz/tdiv_r_2exp$U.lo mpz/tdiv_r_ui$U.lo \
@@ -404,6 +412,7 @@
# Distribute mini-gmp. Test sources copied by dist-hook.
EXTRA_DIST += mini-gmp/README mini-gmp/mini-gmp.c mini-gmp/mini-gmp.h \
+ mini-gmp/mini-mpq.c mini-gmp/mini-mpq.h \
mini-gmp/tests/Makefile mini-gmp/tests/run-tests
# Avoid: CVS - cvs directories
@@ -434,7 +443,7 @@
MINI_GMP_DIR="$$abs_srcdir/mini-gmp" \
LDFLAGS="-L../../.libs" \
LIBS="-lgmp -lm" \
- CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="-I../.." check
+ CC="$(CC)" CFLAGS="$(CFLAGS)" CPPFLAGS="$(CPPFLAGS) -I../.." check
clean-mini-gmp:
if [ -d mini-gmp/tests ] ; then \
Modified: trunk/Build/source/libs/gmp/gmp-src/NEWS
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/NEWS 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/NEWS 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,9 +1,70 @@
-Copyright 1996, 1999-2016 Free Software Foundation, Inc.
+Copyright 1996, 1999-2016, 2018-2020 Free Software Foundation, Inc.
Verbatim copying and distribution of this entire article is permitted in any
medium, provided this notice is preserved.
+Changes between GMP version 6.1.* and 6.2.0
+ BUGS FIXED
+ * gmp_snprintf now correctly reports an error (returns -1) when snprintf
+ does.
+
+ * Conversion to double is now more robust even if the configuration process
+ does not recognize the float format.
+
+ * mpz_powm could return a not completely normalised value, when the
+ exponent was 1 and the base < 0.
+
+ * mpf_set_str could create invalid mpf_t variables for input strings with
+ many leading zeros.
+
+ FEATURES
+ * New C++ functions factorial, primorial and fibonacci for mpz_class.
+
+ * Functions to detect primality now substitute the first 24 Miller-Rabin
+ iterations with the BPSW test.
+
+ * Mini-GMP: new functions mpz_2fac_ui and mpz_mfac_uiui.
+
+ * Mini-GMP: mpz_sizeinbase, mpz_get_str, and mpz_set_str now support bases up
+ to 62.
+
+ * Mini-GMP: added support for the mpq_t layer.
+
+ * MIPS r6 cores are now supported.
+
+ SPEEDUPS
+ * Major speedup for AMD Ryzen and Epyc thanks to an extensive set of assembly
+ code.
+
+ * Major speedup for IBM POWER9 thanks to assembly code making use of new madd
+ instruction.
+
+ * Speedup for 64-bit ARM CPUs thanks to new/improved assembly code.
+
+ * The n-over-k function mpz_bin_ui has been reimplemented for great speedups
+ for large operands.
+
+ * Speedup for the worst case of mpz_perfect_power_p.
+
+ * Speedup for gcd for small and medium size operands.
+
+ * Speedup for really huge multiplies thanks to much larger FFT tables.
+
+ MISC
+ * Internal representation of the mpz_t variables now supports lazy
+ allocation; memory is allocated only when a value is stored.
+
+ * Small improvements and better coverage for the test suite.
+
+ * The tune/speed program can measure some more functions.
+
+ * The low-level function mpn_mul no longer diverts to mpn_sqr, users should
+ call mpn_sqr directly when applicable.
+
+ * New installed files gmp.pc and gmpxx.pc, for use with pkg-config.
+ Contributed by Hugh McMaster.
+
Changes between GMP version 6.1.1 and 6.1.2
BUGS FIXED
Modified: trunk/Build/source/libs/gmp/gmp-src/acinclude.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/acinclude.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/acinclude.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,7 @@
dnl GMP specific autoconf macros
-dnl Copyright 2000-2006, 2009, 2011, 2013-2015 Free Software Foundation, Inc.
+dnl Copyright 2000-2006, 2009, 2011, 2013-2018 Free Software Foundation, Inc.
dnl
dnl This file is part of the GNU MP Library.
dnl
@@ -63,7 +63,7 @@
[[i?86*-*-* | k[5-8]*-*-* | pentium*-*-* | athlon-*-* | viac3*-*-* | geode*-*-* | atom-*-*]])
define(X86_64_PATTERN,
-[[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar*-*-* | bulldozer*-*-* | piledriver*-*-* | steamroller*-*-* | excavator*-*-* | pentium4-*-* | atom-*-* | silvermont-*-* | goldmont-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-* | nehalem*-*-* | westmere*-*-* | sandybridge*-*-* | ivybridge*-*-* | haswell*-*-* | broadwell*-*-* | skylake*-*-* | kabylake*-*-*]])
+[[athlon64-*-* | k8-*-* | k10-*-* | bobcat-*-* | jaguar*-*-* | bulldozer*-*-* | piledriver*-*-* | steamroller*-*-* | excavator*-*-* | zen*-*-* | pentium4-*-* | atom-*-* | silvermont-*-* | goldmont-*-* | core2-*-* | corei*-*-* | x86_64-*-* | nano-*-* | nehalem*-*-* | westmere*-*-* | sandybridge*-*-* | ivybridge*-*-* | haswell*-*-* | broadwell*-*-* | skylake*-*-* | kabylake*-*-*]])
dnl GMP_FAT_SUFFIX(DSTVAR, DIRECTORY)
dnl ---------------------------------
@@ -741,7 +741,7 @@
long i;
for (i = 0; i < 88 + 1; i++)
a[i] = ~0L;
- r = malloc (10000 * sizeof (unsigned long));
+ r = calloc (10000, sizeof (unsigned long));
r2 = r;
for (i = 0; i < 528; i += 23)
{
@@ -907,8 +907,8 @@
AC_DEFUN([GMP_C_TEST_SIZEOF],
[echo "configure: testlist $2" >&AC_FD_CC
-[gmp_sizeof_type=`echo "$2" | sed 's/sizeof-\([a-z]*\).*/\1/'`]
-[gmp_sizeof_want=`echo "$2" | sed 's/sizeof-[a-z]*-\([0-9]*\).*/\1/'`]
+[gmp_sizeof_type=`echo "$2" | sed 's/sizeof-\([a-z\*]*\).*/\1/'`]
+[gmp_sizeof_want=`echo "$2" | sed 's/sizeof-[a-z\*]*-\([0-9]*\).*/\1/'`]
AC_MSG_CHECKING([compiler $1 has sizeof($gmp_sizeof_type)==$gmp_sizeof_want])
cat >conftest.c <<EOF
[int
@@ -1803,8 +1803,8 @@
AC_CACHE_CHECK([if .align assembly directive is logarithmic],
gmp_cv_asm_align_log,
[GMP_TRY_ASSEMBLE(
-[ $gmp_cv_asm_data
- .align 4
+[ $gmp_cv_asm_data
+ .align 4
$gmp_cv_asm_globl foo
$gmp_cv_asm_byte 1
.align 4
@@ -1858,10 +1858,10 @@
AC_CACHE_CHECK([if the .align directive accepts an 0x90 fill in .text],
gmp_cv_asm_align_fill_0x90,
[GMP_TRY_ASSEMBLE(
-[ $gmp_cv_asm_text
- .align 4, 0x90
+[ $gmp_cv_asm_text
+ .align 4, 0x90
.byte 0
- .align 4, 0x90],
+ .align 4, 0x90],
[if grep "Warning: Fill parameter ignored for executable section" conftest.out >/dev/null; then
echo "Suppressing this warning by omitting 0x90" 1>&AC_FD_CC
gmp_cv_asm_align_fill_0x90=no
@@ -2659,6 +2659,8 @@
])
case $gmp_cv_asm_x86_mulx in
yes)
+ AC_DEFINE(X86_ASM_MULX, 1,
+ [Define to 1 if the assembler understands the mulx instruction])
ifelse([$1],,:,[$1])
;;
*)
@@ -2676,45 +2678,6 @@
])
-dnl GMP_ASM_X86_ADX([ACTION-IF-YES][,ACTION-IF-NO])
-dnl ------------------------------------------------
-dnl Determine whether the assembler supports the adcx and adox instructions
-dnl which debut with the Haswell shrink Broadwell.
-dnl
-dnl This macro is wanted before GMP_ASM_TEXT, so ".text" is hard coded
-dnl here. ".text" is believed to be correct on all x86 systems, certainly
-dnl it's all GMP_ASM_TEXT gives currently. Actually ".text" probably isn't
-dnl needed at all, at least for just checking instruction syntax.
-
-AC_DEFUN([GMP_ASM_X86_ADX],
-[AC_CACHE_CHECK([if the assembler knows about the adox instruction],
- gmp_cv_asm_x86_adx,
-[GMP_TRY_ASSEMBLE(
-[ .text
- adox %r8, %r9
- adcx %r8, %r9],
- [gmp_cv_asm_x86_adx=yes],
- [gmp_cv_asm_x86_adx=no])
-])
-case $gmp_cv_asm_x86_adx in
-yes)
- ifelse([$1],,:,[$1])
- ;;
-*)
- AC_MSG_WARN([+----------------------------------------------------------])
- AC_MSG_WARN([| WARNING WARNING WARNING])
- AC_MSG_WARN([| Host CPU has the adcx and adox instructions, but they])
- AC_MSG_WARN([| can't be assembled by])
- AC_MSG_WARN([| $CCAS $CFLAGS $CPPFLAGS])
- AC_MSG_WARN([| Older x86 instructions will be used.])
- AC_MSG_WARN([| This will be an inferior build.])
- AC_MSG_WARN([+----------------------------------------------------------])
- ifelse([$2],,:,[$2])
- ;;
-esac
-])
-
-
dnl GMP_ASM_X86_MCOUNT
dnl ------------------
dnl Find out how to call mcount for profiling on an x86 system.
@@ -3296,7 +3259,8 @@
gmp_cv_c_double_format,
[gmp_cv_c_double_format=unknown
cat >conftest.c <<\EOF
-[struct foo {
+[#include <stdio.h>
+struct foo {
char before[8];
double x;
char after[8];
@@ -3306,9 +3270,16 @@
{ '\001', '\043', '\105', '\147', '\211', '\253', '\315', '\357' },
-123456789.0,
{ '\376', '\334', '\272', '\230', '\166', '\124', '\062', '\020' },
-};]
+};
+int main(){
+ int i;
+ for (i = 0; i < 8; i++) {
+ printf ("%d %f\n", foo.before[i] + foo.after[i], foo.x);
+ }
+ return 0;
+}]
EOF
-gmp_compile="$CC $CFLAGS $CPPFLAGS -c conftest.c >&AC_FD_CC 2>&1"
+gmp_compile="$CC $CFLAGS $CPPFLAGS conftest.c -o conftest$EXEEXT >&AC_FD_CC 2>&1"
if AC_TRY_EVAL(gmp_compile); then
cat >conftest.awk <<\EOF
[
@@ -3404,7 +3375,7 @@
got[12] == "124" && \
got[13] == "000" && \
got[14] == "000" && \
- got[15] == "000")
+ got[15] == "000")
{
print "IEEE big endian"
found = 1
@@ -3461,11 +3432,11 @@
}
]
EOF
- gmp_cv_c_double_format=`od -b conftest.$OBJEXT | $AWK -f conftest.awk`
+ gmp_cv_c_double_format=`od -b conftest$EXEEXT | $AWK -f conftest.awk`
case $gmp_cv_c_double_format in
unknown*)
- echo "cannot match anything, conftest.$OBJEXT contains" >&AC_FD_CC
- od -b conftest.$OBJEXT >&AC_FD_CC
+ echo "cannot match anything, conftest$EXEEXT contains" >&AC_FD_CC
+ od -b conftest$EXEEXT >&AC_FD_CC
;;
esac
else
@@ -3729,11 +3700,11 @@
ret = vsnprintf (buf, 4, fmt, ap);
- if (strcmp (buf, "hel") != 0)
+ if (ret == -1 || strcmp (buf, "hel") != 0)
return 1;
/* allowed return values */
- if (ret != -1 && ret != 3 && ret != 11)
+ if (ret != 3 && ret != 11)
return 2;
return 0;
Added: trunk/Build/source/libs/gmp/gmp-src/asl.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/asl.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/asl.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,127 @@
+/* asl.h -- artificially small limbs support by means of C++ operator
+ overloading.
+
+Copyright 2016 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include <iostream>
+#include <cstdint>
+#include <cstdlib>
+// #include <stdexcept>
+
+#ifndef GMP_ASSERT_ALWAYS
+#define GMP_ASSERT_ALWAYS(cc) do {if (!(cc)) abort();} while (0)
+#endif
+
+// Missing: post++ post-- ++pre --prec bool(limb) !limb
+
+#ifndef GMP_LIMB_BITS
+#define GMP_LIMB_BITS 4
+#endif
+
+#define GMP_NUMB_MASK (2 * (1ul << (GMP_LIMB_BITS - 1)) - 1)
+
+#define BINOP_MASK(op, type) \
+ mp_limb_t& operator op##=(const type& rhs) { \
+ limbo = (limbo op rhs.limbo) & GMP_NUMB_MASK; \
+ return *this; \
+ }
+#define BINOP_NOMASK(op, type) \
+ mp_limb_t& operator op##=(const type& rhs) { \
+ limbo = limbo op rhs.limbo; \
+ return *this; \
+ }
+
+typedef std::conditional<(GMP_NUMB_MASK <= 0xffff), uint16_t, uint32_t >::type type24;
+typedef std::conditional<(GMP_NUMB_MASK <= 0xff), uint8_t, type24>::type mtype;
+
+class mp_limb_t {
+public:
+ mp_limb_t() {} // put random garbage in limbo?
+ mp_limb_t(const unsigned int rhs) { limbo = rhs & GMP_NUMB_MASK; }
+ // mp_limb_t(const mp_limb_t& rhs) { limbo = rhs.limbo; } // Causes havoc
+ BINOP_MASK(+, mp_limb_t)
+ BINOP_MASK(-, mp_limb_t)
+ BINOP_MASK(*, mp_limb_t)
+ BINOP_NOMASK(/, mp_limb_t)
+ BINOP_NOMASK(%, mp_limb_t)
+ BINOP_NOMASK(&, mp_limb_t)
+ BINOP_NOMASK(|, mp_limb_t)
+ BINOP_NOMASK(^, mp_limb_t)
+ mp_limb_t& operator<<=(const unsigned int rhs) {
+ GMP_ASSERT_ALWAYS (rhs < GMP_LIMB_BITS);
+ limbo = (limbo << rhs) & GMP_NUMB_MASK;
+ return *this;
+ }
+ mp_limb_t& operator>>=(const unsigned int rhs) {
+ GMP_ASSERT_ALWAYS (rhs < GMP_LIMB_BITS);
+ limbo = limbo >> rhs;
+ return *this;
+ }
+ mp_limb_t operator-() {
+ return static_cast<mp_limb_t>((-limbo) & GMP_NUMB_MASK);
+ // mp_limb_t x; x.limbo = (-limbo) & GMP_NUMB_MASK; return x;
+ }
+ mp_limb_t operator~() {
+ return static_cast<mp_limb_t>((~limbo) & GMP_NUMB_MASK);
+ // mp_limb_t x; x.limbo = (~limbo) & GMP_NUMB_MASK; return x;
+ }
+ operator unsigned int() const { return limbo; }
+ operator int() const { return limbo; }
+
+#define RELOP(op) \
+ inline bool operator op(const mp_limb_t rhs) { \
+ return limbo op rhs.limbo; \
+ }
+ RELOP(==)
+ RELOP(!=)
+ RELOP(<)
+ RELOP(>)
+ RELOP(<=)
+ RELOP(>=)
+
+private:
+ mtype limbo;
+};
+
+#define BINOP2(op, type) \
+ inline mp_limb_t operator op(mp_limb_t lhs, const type& rhs) { \
+ lhs op##= rhs; \
+ return lhs; \
+ }
+
+BINOP2(+, mp_limb_t)
+BINOP2(-, mp_limb_t)
+BINOP2(*, mp_limb_t)
+BINOP2(/, mp_limb_t)
+BINOP2(%, mp_limb_t)
+BINOP2(&, mp_limb_t)
+BINOP2(|, mp_limb_t)
+BINOP2(^, mp_limb_t)
+BINOP2(<<, unsigned int)
+BINOP2(>>, unsigned int)
Property changes on: trunk/Build/source/libs/gmp/gmp-src/asl.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/assert.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/assert.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/assert.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/bootstrap.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/bootstrap.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/bootstrap.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* Functions needed for bootstrapping the gmp build, based on mini-gmp.
-Copyright 2001, 2002, 2004, 2011, 2012 Free Software Foundation, Inc.
+Copyright 2001, 2002, 2004, 2011, 2012, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -29,6 +29,7 @@
see https://www.gnu.org/licenses/. */
+#define MINI_GMP_DONT_USE_FLOAT_H 1
#include "mini-gmp/mini-gmp.c"
#define MIN(l,o) ((l) < (o) ? (l) : (o))
@@ -88,7 +89,7 @@
/* Set inv to the inverse of d, in the style of invert_limb, ie. for
udiv_qrnnd_preinv. */
void
-mpz_preinv_invert (mpz_t inv, mpz_t d, int numb_bits)
+mpz_preinv_invert (mpz_t inv, const mpz_t d, int numb_bits)
{
mpz_t t;
int norm;
@@ -96,12 +97,10 @@
norm = numb_bits - mpz_sizeinbase (d, 2);
assert (norm >= 0);
- mpz_init_set_ui (t, 1L);
- mpz_mul_2exp (t, t, 2*numb_bits - norm);
+ mpz_init (t);
+ mpz_setbit (t, 2*numb_bits - norm);
mpz_tdiv_q (inv, t, d);
- mpz_set_ui (t, 1L);
- mpz_mul_2exp (t, t, numb_bits);
- mpz_sub (inv, inv, t);
+ mpz_clrbit (inv, numb_bits);
mpz_clear (t);
}
@@ -108,7 +107,7 @@
/* Calculate r satisfying r*d == 1 mod 2^n. */
void
-mpz_invert_2exp (mpz_t r, mpz_t a, unsigned long n)
+mpz_invert_2exp (mpz_t r, const mpz_t a, unsigned long n)
{
unsigned long i;
mpz_t inv, prod;
@@ -140,6 +139,7 @@
mpz_invert_ui_2exp (mpz_t r, unsigned long a, unsigned long n)
{
mpz_t az;
+
mpz_init_set_ui (az, a);
mpz_invert_2exp (r, az, n);
mpz_clear (az);
Modified: trunk/Build/source/libs/gmp/gmp-src/compat.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/compat.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/compat.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/config.in
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/config.in 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/config.in 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
/*
-Copyright 1996-2016 Free Software Foundation, Inc.
+Copyright 1996-2020 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -175,6 +175,26 @@
#undef HAVE_HOST_CPU_pentiumpro
#undef HAVE_HOST_CPU_pentium2
#undef HAVE_HOST_CPU_pentium3
+#undef HAVE_HOST_CPU_pentium4
+#undef HAVE_HOST_CPU_core2
+#undef HAVE_HOST_CPU_nehalem
+#undef HAVE_HOST_CPU_westmere
+#undef HAVE_HOST_CPU_sandybridge
+#undef HAVE_HOST_CPU_ivybridge
+#undef HAVE_HOST_CPU_haswell
+#undef HAVE_HOST_CPU_broadwell
+#undef HAVE_HOST_CPU_skylake
+#undef HAVE_HOST_CPU_silvermont
+#undef HAVE_HOST_CPU_goldmont
+#undef HAVE_HOST_CPU_k8
+#undef HAVE_HOST_CPU_k10
+#undef HAVE_HOST_CPU_bulldozer
+#undef HAVE_HOST_CPU_piledriver
+#undef HAVE_HOST_CPU_steamroller
+#undef HAVE_HOST_CPU_excavator
+#undef HAVE_HOST_CPU_zen
+#undef HAVE_HOST_CPU_bobcat
+#undef HAVE_HOST_CPU_jaguar
#undef HAVE_HOST_CPU_s390_z900
#undef HAVE_HOST_CPU_s390_z990
#undef HAVE_HOST_CPU_s390_z9
@@ -283,6 +303,8 @@
#undef HAVE_NATIVE_mpn_divrem_1c
#undef HAVE_NATIVE_mpn_divrem_2
#undef HAVE_NATIVE_mpn_gcd_1
+#undef HAVE_NATIVE_mpn_gcd_11
+#undef HAVE_NATIVE_mpn_gcd_22
#undef HAVE_NATIVE_mpn_hamdist
#undef HAVE_NATIVE_mpn_invert_limb
#undef HAVE_NATIVE_mpn_ior_n
@@ -325,6 +347,7 @@
#undef HAVE_NATIVE_mpn_rsh1sub_n
#undef HAVE_NATIVE_mpn_rsh1sub_nc
#undef HAVE_NATIVE_mpn_rshift
+#undef HAVE_NATIVE_mpn_sbpi1_bdiv_r
#undef HAVE_NATIVE_mpn_sqr_basecase
#undef HAVE_NATIVE_mpn_sqr_diagonal
#undef HAVE_NATIVE_mpn_sqr_diag_addlsh1
@@ -612,6 +635,9 @@
# endif
#endif
+/* Define to 1 if the assembler understands the mulx instruction */
+#undef X86_ASM_MULX
+
/* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a
`char[]'. */
#undef YYTEXT_POINTER
Modified: trunk/Build/source/libs/gmp/gmp-src/configgmp.guess
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/configgmp.guess 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/configgmp.guess 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
# GMP config.guess wrapper.
-# Copyright 2000-2006, 2008, 2011-2016 Free Software Foundation, Inc.
+# Copyright 2000-2019 Free Software Foundation, Inc.
#
# This file is part of the GNU MP Library.
#
@@ -204,14 +204,20 @@
0xc08) exact_cpu="armcortexa8";; # v7a
0xc09) exact_cpu="armcortexa9";; # v7a
0xc0f) exact_cpu="armcortexa15";; # v7a
+ 0xc0d) exact_cpu="armcortexa12";; # v7a
+ 0xc0e) exact_cpu="armcortexa17";; # v7a
0xc14) exact_cpu="armcortexr4";; # v7r
0xc15) exact_cpu="armcortexr5";; # v7r
0xc23) exact_cpu="armcortexm3";; # v7m
- 0xd04) exact_cpu="armcortexa35";; # v8-32
+ 0xd04) exact_cpu="armcortexa35";; # v8
0xd03) exact_cpu="armcortexa53";; # v8
+ 0xd05) exact_cpu="armcortexa55";; # v8.2
0xd07) exact_cpu="armcortexa57";; # v8
0xd08) exact_cpu="armcortexa72";; # v8
+ 0xd09) exact_cpu="armcortexa73";; # v8
+ 0xd0a) exact_cpu="armcortexa75";; # v8.2
+ 0xd0b) exact_cpu="armcortexa76";; # v8.3
*) exact_cpu=$guess_cpu;;
esac
fi
@@ -274,6 +280,18 @@
exact_cpu=mips64
;;
+mips-*-*)
+ case $(uname -m) in
+ mips64) exact_cpu=mips64;;
+ esac
+ ;;
+
+mipsel-*-*)
+ case $(uname -m) in
+ mips64) exact_cpu=mips64el;;
+ esac
+ ;;
+
m68k-*-*)
eval $set_cc_for_build
# NetBSD (and presumably other *BSD) "sysctl hw.model" gives for example
@@ -393,27 +411,9 @@
# development", so it doesn't seem wise to use it just yet, not while
# there's an alternative.
- # Grep the /proc/cpuinfo pseudo-file.
- # Anything unrecognised is ignored, since of course we mustn't spit out
- # a cpu type config.sub doesn't know.
- if test -z "$exact_cpu" && test -f /proc/cpuinfo; then
- x=`grep "^cpu[ ]" /proc/cpuinfo | head -n 1`
- x=`echo $x | sed -n 's/^cpu[ ]*:[ ]*\([A-Za-z0-9]*\).*/\1/p'`
- x=`echo $x | sed 's/PPC//'`
- case $x in
- 601) exact_cpu="power" ;;
- 603ev) exact_cpu="powerpc603e" ;;
- 604ev5) exact_cpu="powerpc604e" ;;
- 970??) exact_cpu="powerpc970" ;;
- 603 | 603e | 604 | 604e | 750 | 821 | 860)
- exact_cpu="powerpc$x" ;;
- POWER[4-9]*)
- exact_cpu=`echo $x | sed -e "s;POWER;power;" -e "s;[a-zA-Z]*$;;"` ;;
- esac
- fi
-
- # Try to read the PVR. mfpvr is a protected instruction, NetBSD, MacOS
- # and AIX don't allow it in user mode, but the Linux kernel does.
+ # Try to read the PVR. mfpvr is a protected instruction, NetBSD, MacOS and
+ # AIX don't allow it in user mode, but the Linux kernel does. We prefer this
+ # to /proc/cpuinfo since the latter lags for newer CPUs.
#
# Note this is no good on AIX, since a C function there is the address of
# a function descriptor, not actual code. But this doesn't matter since
@@ -442,7 +442,10 @@
case 0x000c: puts ("powerpc7400"); break;
case 0x0041: puts ("powerpc630"); break;
case 0x003f: puts ("power7"); break;
- case 0x004b: puts ("power8"); break;
+ case 0x004b:
+ case 0x004c:
+ case 0x004d: puts ("power8"); break;
+ case 0x004e: puts ("power9"); break;
case 0x0050: puts ("powerpc860"); break;
case 0x8000: puts ("powerpc7450"); break;
case 0x8001: puts ("powerpc7455"); break;
@@ -463,6 +466,27 @@
fi
fi
+
+ # Grep the /proc/cpuinfo pseudo-file.
+ # Anything unrecognised is ignored, since of course we mustn't spit out
+ # a cpu type config.sub doesn't know.
+ if test -z "$exact_cpu" && test -f /proc/cpuinfo; then
+ x=`grep "^cpu[ ]" /proc/cpuinfo | head -n 1`
+ x=`echo $x | sed -n 's/^cpu[ ]*:[ ]*\([A-Za-z0-9]*\).*/\1/p'`
+ x=`echo $x | sed 's/PPC//'`
+ case $x in
+ 601) exact_cpu="power" ;;
+ 603ev) exact_cpu="powerpc603e" ;;
+ 604ev5) exact_cpu="powerpc604e" ;;
+ 970??) exact_cpu="powerpc970" ;;
+ 603 | 603e | 604 | 604e | 750 | 821 | 860)
+ exact_cpu="powerpc$x" ;;
+ POWER[4-9]*)
+ exact_cpu=`echo $x | sed -e "s;POWER;power;" -e "s;[a-zA-Z]*$;;"` ;;
+ esac
+ fi
+
+
if test -z "$exact_cpu"; then
# On AIX, try looking at _system_configuration. This is present in
# version 4 at least.
@@ -514,6 +538,9 @@
#ifdef POWER_8
case POWER_8: puts ("power8"); break;
#endif
+#ifdef POWER_9
+ case POWER_9: puts ("power9"); break;
+#endif
default:
if (_system_configuration.architecture == POWER_RS)
puts ("power");
@@ -837,8 +864,8 @@
switch (family)
{
case 5:
- if (model <= 2) modelstr = "pentium";
- else if (model >= 4) modelstr = "pentiummmx";
+ if (model == 4 || model == 8) modelstr = "pentiummmx";
+ else modelstr = "pentium";
break;
case 6:
if (model <= 1) modelstr = "pentiumpro";
@@ -882,6 +909,7 @@
else if (model == 0x5c) cpu_64bit = 1, modelstr = "goldmont"; /* Goldmont */
else if (model == 0x5e) cpu_64bit = 1, cpu_avx=1, modelstr = "skylake"; /* Skylake */
else if (model == 0x5f) cpu_64bit = 1, modelstr = "goldmont"; /* Goldmont */
+ else if (model == 0x7a) cpu_64bit = 1, modelstr = "goldmont"; /* Goldmont Plus */
else if (model == 0x8e) cpu_64bit = 1, cpu_avx=1, modelstr = "kabylake"; /* Kabylake Y/U */
else if (model == 0x9e) cpu_64bit = 1, cpu_avx=1, modelstr = "kabylake"; /* Kabylake desktop */
else cpu_64bit = 1, modelstr = "nehalem"; /* default */
@@ -951,6 +979,20 @@
case 22: /* Jaguar, an improved bobcat */
cpu_64bit = 1, cpu_avx = 1, modelstr = "jaguar";
break;
+ case 23: /* Zen */
+ cpu_64bit = 1, cpu_avx = 1;
+ switch (model)
+ {
+ case 1:
+ case 8:
+ case 17:
+ case 24:
+ modelstr = "zen";
+ break;
+ default:
+ modelstr = "zen2";
+ break;
+ }
}
}
else if (strcmp (vendor_string, "CyrixInstead") == 0)
@@ -983,8 +1025,8 @@
else if (cpu_avx && ! (cpuid_avx && cpuid_osxsave))
/* For CPUs nominally capable of executing AVX, append "noavx" when not
both the AVX and OSXSAVE cpuid bits are set. We tolerate weirdness
- here, as some virtualisers set a broken cpuid state here, while other
- virtualisers allow users to set a broken state. */
+ here, as some virtualisers set a broken cpuid state, while other
+ virtualisers allow guests to set a broken state. */
suffix = "noavx";
printf ("%s%s", modelstr, suffix);
Modified: trunk/Build/source/libs/gmp/gmp-src/configgmp.sub
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/configgmp.sub 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/configgmp.sub 2020-01-19 23:36:31 UTC (rev 53461)
@@ -102,7 +102,7 @@
test_cpu=ia64 ;;
pentium | pentiummmx | pentiumpro | pentium[234m] | k[567] | k6[23] | geode | athlon | viac3*)
test_cpu=i386 ;;
-athlon64 | atom | silvermont | goldmont | core2 | corei* | opteron | k[89] | k10 | bobcat | jaguar* | bulldozer* | piledriver* | steamroller* | excavator* | nano | nehalem* | westmere* | sandybridge* | ivybridge* | haswell* | broadwell* | skylake* | kabylake* | knightslanding)
+athlon64 | atom | silvermont | goldmont | core2 | corei* | opteron | k[89] | k10 | bobcat | jaguar* | bulldozer* | piledriver* | steamroller* | excavator* | zen* | nano | nehalem | westmere | sandybridge* | ivybridge* | haswell* | broadwell* | skylake* | kabylake* | knightslanding)
test_cpu=x86_64 ;;
power[2-9] | power2sc)
test_cpu=power ;;
@@ -129,8 +129,8 @@
armsa1 | armxscale | arm9tdmi | arm9te | \
arm10* | arm11mpcore | armsa1 | arm1136 | arm1156 | arm1176 | \
-armcortexa5 | armcortexa7 | armcortexa8 | armcortexa9 | armcortexa15 | \
-armcortexr4 | armcortexr5 | armcortexm3 | arm*neon | xgene1 | exynosm1 | thunderx)
+armcortex[arm][0-9] | armcortex[arm][0-9][0-9] | \
+arm*neon | armxgene1 | armexynosm1 | armthunderx)
test_cpu="arm";;
*)
Modified: trunk/Build/source/libs/gmp/gmp-src/configure.ac
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/configure.ac 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/configure.ac 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
define(GMP_COPYRIGHT,[[
-Copyright 1996-2016 Free Software Foundation, Inc.
+Copyright 1996-2020 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -47,6 +47,7 @@
m4_pattern_allow(GMP_NUMB_BITS)
m4_pattern_allow(GMP_NONSTD_ABI)
m4_pattern_allow(GMP_CPU_TYPE)
+m4_pattern_allow(GMP_AVX_NOT_REALLY_AVAILABLE)
# If --target is not used then $target_alias is empty, but if say
# "./configure athlon-pc-freebsd3.5" is used, then all three of
@@ -77,7 +78,7 @@
dnl Note that there's a copy of these options in the top-level Makefile.am,
dnl so update there too if changing anything.
dnl
-AM_INIT_AUTOMAKE([1.8 gnu no-dependencies])
+AM_INIT_AUTOMAKE([1.8 gnu no-dependencies subdir-objects])
AC_CONFIG_HEADERS(config.h:config.in)
AM_MAINTAINER_MODE
@@ -321,6 +322,26 @@
#undef HAVE_HOST_CPU_pentiumpro
#undef HAVE_HOST_CPU_pentium2
#undef HAVE_HOST_CPU_pentium3
+#undef HAVE_HOST_CPU_pentium4
+#undef HAVE_HOST_CPU_core2
+#undef HAVE_HOST_CPU_nehalem
+#undef HAVE_HOST_CPU_westmere
+#undef HAVE_HOST_CPU_sandybridge
+#undef HAVE_HOST_CPU_ivybridge
+#undef HAVE_HOST_CPU_haswell
+#undef HAVE_HOST_CPU_broadwell
+#undef HAVE_HOST_CPU_skylake
+#undef HAVE_HOST_CPU_silvermont
+#undef HAVE_HOST_CPU_goldmont
+#undef HAVE_HOST_CPU_k8
+#undef HAVE_HOST_CPU_k10
+#undef HAVE_HOST_CPU_bulldozer
+#undef HAVE_HOST_CPU_piledriver
+#undef HAVE_HOST_CPU_steamroller
+#undef HAVE_HOST_CPU_excavator
+#undef HAVE_HOST_CPU_zen
+#undef HAVE_HOST_CPU_bobcat
+#undef HAVE_HOST_CPU_jaguar
#undef HAVE_HOST_CPU_s390_z900
#undef HAVE_HOST_CPU_s390_z990
#undef HAVE_HOST_CPU_s390_z9
@@ -601,8 +622,8 @@
CALLING_CONVENTIONS_OBJS='arm32call.lo arm32check.lo'
CALLING_CONVENTIONS_OBJS_64=""
cclist_64="gcc cc"
- any_32_testlist="sizeof-long-4"
- any_64_testlist="sizeof-long-8"
+ any_32_testlist="sizeof-void*-4"
+ any_64_testlist="sizeof-void*-8"
# This is needed for clang, which is not content with flags like -mfpu=neon
# alone.
@@ -611,6 +632,8 @@
gcc_cflags_fpmode="-mfloat-abi=softfp" ;;
*-*-*eabihf)
gcc_cflags_fpmode="-mfloat-abi=hard" ;;
+ *-*-mingw*)
+ limb_64=longlong ;;
esac
# FIXME: We make mandatory compiler options optional here. We should
@@ -634,12 +657,12 @@
gcc_cflags_arch="-march=armv6"
;;
armcortexa5 | armv7*)
- path="arm/v6t2 arm/v6 arm/v5 arm"
+ path="arm/v7a/cora5 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a5"
;;
armcortexa5neon)
- path="arm/neon arm/v6t2 arm/v6 arm/v5 arm"
+ path="arm/neon arm/v7a/cora5 arm/v6t2 arm/v6 arm/v5 arm"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_arch="-march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a5"
@@ -646,12 +669,12 @@
;;
armcortexa7)
path="arm/v7a/cora7 arm/v6t2 arm/v6 arm/v5 arm"
- gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a7"
;;
armcortexa7neon)
path="arm/neon arm/v7a/cora7 arm/v6t2 arm/v6 arm/v5 arm"
- gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a7"
;;
@@ -679,15 +702,26 @@
;;
armcortexa15)
path="arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
- gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
;;
armcortexa15neon)
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
- gcc_cflags_arch="-march=armv7-a"
+ gcc_cflags_arch="-march=armv7ve -march=armv7-a"
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
;;
+ armcortexa12 | armcortexa17)
+ path="arm/v7a/cora17 arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv7ve -march=armv7-a"
+ gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
+ ;;
+ armcortexa12neon | armcortexa17neon)
+ path="arm/v7a/cora17/neon arm/v7a/cora15/neon arm/neon arm/v7a/cora17 arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
+ gcc_cflags_arch="-march=armv7ve -march=armv7-a"
+ gcc_cflags_neon="-mfpu=neon"
+ gcc_cflags_tune="-mtune=cortex-a15 -mtune=cortex-a9"
+ ;;
armcortexa53 | armcortexa53neon)
abilist="64 32"
path="arm/neon arm/v7a/cora9 arm/v6t2 arm/v6 arm/v5 arm"
@@ -704,13 +738,13 @@
gcc_cflags_neon="-mfpu=neon"
gcc_cflags_tune="-mtune=cortex-a57"
;;
- armcortexa72 | armcortexa72neon)
+ [armcortexa7[2-9] | armcortexa7[2-9]neon])
abilist="64 32"
path="arm/v7a/cora15/neon arm/neon arm/v7a/cora15 arm/v6t2 arm/v6 arm/v5 arm"
- path_64="arm64/cora72 arm64"
+ path_64="arm64/cora57 arm64"
gcc_cflags_arch="-march=armv8-a"
gcc_cflags_neon="-mfpu=neon"
- gcc_cflags_tune="-mtune=cortex-a72"
+ gcc_cflags_tune="-mtune=cortex-a72 -mtune=cortex-a57"
;;
armexynosm1)
abilist="64 32"
@@ -843,7 +877,6 @@
# systems (GNU/Linux for instance), but lets assume they're ok.
case $host in
[*-*-hpux[1-9] | *-*-hpux[1-9].* | *-*-hpux10 | *-*-hpux10.*]) ;;
- [*-*-linux*]) abilist="1.0" ;; # due to linux permanent kernel bug
*) abilist="2.0w $abilist" ;;
esac
@@ -994,7 +1027,7 @@
GMP_INCLUDE_MPN(mips32/mips-defs.m4)
case $host in
- [mips64*-*-* | mips*-*-irix[6789]*])
+ [mips64*-*-* | mipsisa64*-*-* | mips*-*-irix[6789]*])
abilist="n32 64 o32"
cclist_n32="gcc cc"
@@ -1003,7 +1036,6 @@
gcc_n32_cflags_abi="-mabi=n32 -mn32"
cc_n32_cflags="-O2 -n32" # no -g, it disables all optimizations
limb_n32=longlong
- path_n32="mips64"
cclist_64="gcc cc"
gcc_64_cflags_optlist="abi"
@@ -1012,7 +1044,18 @@
gcc_64_ldflags="-Wc,-mabi=64"
cc_64_cflags="-O2 -64" # no -g, it disables all optimizations
cc_64_ldflags="-Wc,-64"
- path_64="mips64"
+
+ case $host_cpu in
+ [mips64r[6789]* | mipsisa64r[6789]*])
+ path_n32="mips64/r6 mips64"
+ path_64="mips64/r6 mips64"
+ ;;
+ *)
+ path_n32="mips64/hilo mips64"
+ path_64="mips64/hilo mips64"
+ ;;
+ esac
+
;;
esac
;;
@@ -1119,9 +1162,12 @@
power7) gcc_cflags_cpu="-mtune=power7 -mtune=power5"
xlc_cflags_arch="-qarch=pwr7 -qarch=pwr5"
cpu_path="p7 p5 p4 p3-p7" ;;
- [power[89]]) gcc_cflags_cpu="-mtune=power8 -mtune=power7 -mtune=power5"
+ power8) gcc_cflags_cpu="-mtune=power8 -mtune=power7 -mtune=power5"
xlc_cflags_arch="-qarch=pwr8 -qarch=pwr7 -qarch=pwr5"
cpu_path="p8 p7 p5 p4 p3-p7" ;;
+ power9) gcc_cflags_cpu="-mtune=power9 -mtune=power8 -mtune=power7 -mtune=power5"
+ xlc_cflags_arch="-qarch=pwr9 -qarch=pwr8 -qarch=pwr7 -qarch=pwr5"
+ cpu_path="p9 p8 p7 p5 p4 p3-p7" ;;
esac
case $host in
@@ -1186,18 +1232,18 @@
# incompatible with a shared library.
#
abilist="mode64 mode32 $abilist"
- gcc_cflags_opt="-O3 -O2 -O1" # will this become used?
+ gcc_cflags_opt="-O2 -O1" # will this become used?
cclist_mode32="gcc"
gcc_mode32_cflags_maybe="-m32"
gcc_mode32_cflags="-mpowerpc64"
gcc_mode32_cflags_optlist="subtype cpu opt"
gcc_mode32_cflags_subtype="-force_cpusubtype_ALL"
- gcc_mode32_cflags_opt="-O3 -O2 -O1"
+ gcc_mode32_cflags_opt="-O2 -O1"
limb_mode32=longlong
cclist_mode64="gcc"
gcc_mode64_cflags="-m64"
gcc_mode64_cflags_optlist="cpu opt"
- gcc_mode64_cflags_opt="-O3 -O2 -O1"
+ gcc_mode64_cflags_opt="-O2 -O1"
path_mode64=""
path_mode32=""
p=""
@@ -1235,12 +1281,12 @@
gcc_mode32_cflags_maybe="-m32"
gcc_mode32_cflags="-mpowerpc64"
gcc_mode32_cflags_optlist="cpu opt"
- gcc_mode32_cflags_opt="-O3 -O2 -O1"
+ gcc_mode32_cflags_opt="-O2 -O1"
limb_mode32=longlong
cclist_mode64="gcc gcc64"
gcc_mode64_cflags_maybe="-m64"
gcc_mode64_cflags_optlist="cpu opt"
- gcc_mode64_cflags_opt="-O3 -O2 -O1"
+ gcc_mode64_cflags_opt="-O2 -O1"
path_mode64=""
path_mode32=""
p=""
@@ -1295,6 +1341,13 @@
;;
+ # RISC-V
+ [riscv64-*-*])
+ cclist="gcc"
+ path="riscv/64"
+ ;;
+
+
# IBM System/390 and z/Architecture
S390_PATTERN | S390X_PATTERN)
abilist="32"
@@ -1540,8 +1593,10 @@
path_64="sparc64/ultrasparc34 sparc64/ultrasparc1234 sparc64" ;;
[ultrasparct[12]])
path_64="sparc64/ultrasparct1 sparc64" ;;
- [ultrasparct[345]])
+ [ultrasparct3])
path_64="sparc64/ultrasparct3 sparc64" ;;
+ [ultrasparct[45]])
+ path_64="sparc64/ultrasparct45 sparc64/ultrasparct3 sparc64" ;;
*)
path_64="sparc64"
esac
@@ -1646,6 +1701,11 @@
# Availability of rdtsc is checked at run-time.
SPEED_CYCLECOUNTER_OBJ=pentium.lo
+ # Set to "yes" below on a per-cpu basis. We do that in order to allow for
+ # a relevant warning to be output when using a CPU with mulx on a system
+ # which cannot assemble it.
+ x86_have_mulx=no
+
# gcc 2.7.2 only knows i386 and i486, using -m386 or -m486. These
# represent -mcpu= since -m486 doesn't generate 486 specific insns.
# gcc 2.95 adds k6, pentium and pentiumpro, and takes -march= and -mcpu=.
@@ -1788,14 +1848,14 @@
bobcat)
gcc_cflags_cpu="-mtune=btver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=btver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
- path="x86/bobcat x86/k7/mmx x86/k7 x86/mmx x86"
- path_64="x86_64/bobcat x86_64/k10 x86_64/k8 x86_64"
+ path="x86/bt1 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/bt1 x86_64/k10 x86_64/k8 x86_64"
;;
jaguar | jaguarnoavx)
gcc_cflags_cpu="-mtune=btver2 -mtune=btver1 -mtune=amdfam10 -mtune=k8"
gcc_cflags_arch="-march=btver2 -march=btver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
- path="x86/jaguar x86/bobcat x86/k7/mmx x86/k7 x86/mmx x86"
- path_64="x86_64/jaguar x86_64/bobcat x86_64/k10 x86_64/k8 x86_64"
+ path="x86/bt2 x86/bt1 x86/k7/mmx x86/k7 x86/mmx x86"
+ path_64="x86_64/bt2 x86_64/bt1 x86_64/k10 x86_64/k8 x86_64"
;;
bulldozer | bd1 | bulldozernoavx | bd1noavx)
gcc_cflags_cpu="-mtune=bdver1 -mtune=amdfam10 -mtune=k8"
@@ -1820,7 +1880,22 @@
gcc_cflags_arch="-march=bdver4 -march=bdver3 -march=bdver2 -march=bdver1 -march=amdfam10 -march=k8 -march=k8~-mno-sse2"
path="x86/bd4 x86/bd3 x86/bd2 x86/bd1 x86/k7/mmx x86/k7 x86/mmx x86"
path_64="x86_64/bd4 x86_64/bd3 x86_64/bd2 x86_64/bd1 x86_64/k10 x86_64/k8 x86_64"
+ x86_have_mulx=yes
;;
+ zen | zennoavx)
+ gcc_cflags_cpu="-mtune=znver1 -mtune=amdfam10 -mtune=k8"
+ gcc_cflags_arch="-march=znver1 -march=amdfam10 -march=k8"
+ path="x86/k7/mmx x86/k7 x86/mmx x86"
+ x86_have_mulx=yes
+ path_64="x86_64/zen x86_64"
+ ;;
+ zen2 | zen2noavx)
+ gcc_cflags_cpu="-mtune=znver2 -mtune=znver1 -mtune=amdfam10 -mtune=k8"
+ gcc_cflags_arch="-march=znver2 -march=znver1 -march=amdfam10 -march=k8"
+ path="x86/k7/mmx x86/k7 x86/mmx x86"
+ x86_have_mulx=yes
+ path_64="x86_64/zen2 x86_64/zen x86_64"
+ ;;
core2)
gcc_cflags_cpu="-mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
@@ -1828,8 +1903,8 @@
path_64="x86_64/core2 x86_64"
;;
corei | coreinhm | coreiwsm | nehalem | westmere)
- gcc_cflags_cpu="-mtune=corei7 -mtune=core2 -mtune=k8"
- gcc_cflags_arch="-march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
+ gcc_cflags_cpu="-mtune=nehalem -mtune=corei7 -mtune=core2 -mtune=k8"
+ gcc_cflags_arch="-march=nehalem -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
path="x86/coreinhm x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreinhm x86_64/core2 x86_64"
;;
@@ -1843,23 +1918,26 @@
coreihwl | coreihwlnoavx | haswell | haswellnoavx)
gcc_cflags_cpu="-mtune=haswell -mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=haswell -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
- path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ path="x86/coreihwl x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
+ x86_have_mulx=yes
;;
coreibwl | coreibwlnoavx | broadwell | broadwellnoavx)
gcc_cflags_cpu="-mtune=broadwell -mtune=corei7 -mtune=core2 -mtune=k8"
gcc_cflags_arch="-march=broadwell -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
- path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ path="x86/coreihwl x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/coreibwl x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
# extra_functions_64="missing" # enable for bmi2/adx simulation
+ x86_have_mulx=yes
;;
skylake | skylakenoavx | kabylake | kabylakenoavx)
gcc_cflags_cpu="-mtune=skylake -mtune=broadwell -mtune=corei7 -mtune=core2 -mtune=k8"
# Don't pass -march=skylake for now as then some compilers emit AVX512.
gcc_cflags_arch="-march=broadwell -march=corei7 -march=core2 -march=core2~-mno-sse2 -march=k8 -march=k8~-mno-sse2"
- path="x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
+ path="x86/coreihwl x86/coreisbr x86/p6/sse2 x86/p6/p3mmx x86/p6/mmx x86/p6 x86/mmx x86"
path_64="x86_64/skylake x86_64/coreibwl x86_64/coreihwl x86_64/coreisbr x86_64/coreinhm x86_64/core2 x86_64"
# extra_functions_64="missing" # enable for bmi2/adx simulation
+ x86_have_mulx=yes
;;
atom) # in-order pipeline atom
gcc_cflags_cpu="-mtune=atom -mtune=pentium3"
@@ -1867,12 +1945,18 @@
path="x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
path_64="x86_64/atom x86_64"
;;
- silvermont | goldmont) # out-of-order pipeline atom
+ silvermont) # out-of-order pipeline atom
gcc_cflags_cpu="-mtune=slm -mtune=atom -mtune=pentium3"
gcc_cflags_arch="-march=slm -march=atom -march=pentium3"
- path="x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
+ path="x86/silvermont x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
path_64="x86_64/silvermont x86_64/atom x86_64"
;;
+ goldmont) # out-of-order pipeline atom
+ gcc_cflags_cpu="-mtune=slm -mtune=atom -mtune=pentium3"
+ gcc_cflags_arch="-march=slm -march=atom -march=pentium3"
+ path="x86/goldmont x86/atom/sse2 x86/atom/mmx x86/atom x86/mmx x86"
+ path_64="x86_64/goldmont x86_64/silvermont x86_64/atom x86_64"
+ ;;
nano)
gcc_cflags_cpu="-mtune=nano"
gcc_cflags_arch="-march=nano"
@@ -1892,7 +1976,9 @@
# unconditionally for NetBSD where they don't work but OSXSAVE is set
# to claim the contrary.
*noavx-*-* | *-*-netbsd*)
- gcc_cflags_noavx="-mno-avx";;
+ gcc_cflags_noavx="-mno-avx"
+ GMP_DEFINE_RAW(["define(<GMP_AVX_NOT_REALLY_AVAILABLE>,1)"])
+ ;;
esac
case $host in
@@ -2194,7 +2280,7 @@
fat_functions="add_n addmul_1 bdiv_dbm1c com cnd_add_n cnd_sub_n
copyd copyi dive_1 divrem_1
- gcd_1 lshift lshiftc mod_1 mod_1_1 mod_1_1_cps mod_1_2
+ gcd_11 lshift lshiftc mod_1 mod_1_1 mod_1_1_cps mod_1_2
mod_1_2_cps mod_1_4 mod_1_4_cps mod_34lsub1 mode1o mul_1
mul_basecase mullo_basecase pre_divrem_1 pre_mod_1 redc_1
redc_2 rshift sqr_basecase sub_n submul_1"
@@ -2205,7 +2291,7 @@
fat_path="x86 x86/fat x86/i486
x86/k6 x86/k6/mmx x86/k6/k62mmx
x86/k7 x86/k7/mmx
- x86/k8 x86/k10 x86/bobcat
+ x86/k8 x86/k10 x86/bt1
x86/pentium x86/pentium/mmx
x86/p6 x86/p6/mmx x86/p6/p3mmx x86/p6/sse2
x86/pentium4 x86/pentium4/mmx x86/pentium4/sse2
@@ -2218,10 +2304,10 @@
extra_functions_64="$extra_functions_64 fat fat_entry"
path_64="x86_64/fat x86_64"
fat_path="x86_64 x86_64/fat
- x86_64/k8 x86_64/k10 x86_64/bd1 x86_64/bobcat x86_64/pentium4
- x86_64/core2 x86_64/coreinhm x86_64/coreisbr x86_64/coreihwl
- x86_64/coreibwl x86_64/skylake x86_64/atom x86_64/silvermont
- x86_64/nano"
+ x86_64/k8 x86_64/k10 x86_64/bd1 x86_64/bt1 x86_64/bt2 x86_64/zen
+ x86_64/pentium4 x86_64/core2 x86_64/coreinhm x86_64/coreisbr
+ x86_64/coreihwl x86_64/coreibwl x86_64/skylake x86_64/atom
+ x86_64/silvermont x86_64/goldmont x86_64/nano"
fat_functions="$fat_functions addmul_2 addlsh1_n addlsh2_n sublsh1_n"
fi
@@ -2303,12 +2389,12 @@
CC="$cc"
CFLAGS="$cflags"
CPPFLAGS="$cppflags"
- eval GMP_NONSTD_ABI=\"\$GMP_NONSTD_ABI_$ABI\"
# Could easily have this in config.h too, if desired.
ABI_nodots=`echo $ABI | sed 's/\./_/'`
GMP_DEFINE_RAW("define_not_for_expansion(\`HAVE_ABI_$ABI_nodots')", POST)
+ eval GMP_NONSTD_ABI=\"\$GMP_NONSTD_ABI_$ABI_nodots\"
# GMP_LDFLAGS substitution, selected according to ABI.
# These are needed on libgmp.la and libmp.la, but currently not on
@@ -2383,9 +2469,12 @@
# The C compiler and preprocessor, put into ANSI mode if possible.
AC_PROG_CC
-AC_PROG_CC_STDC
+AC_PROG_CC_C99
AC_PROG_CPP
+#if test "$ac_cv_prog_cc_c99" = no; then
+# AC_MSG_ERROR([Cannot find a C99 capable compiler])
+#fi
# The C compiler on the build system, and associated tests.
GMP_PROG_CC_FOR_BUILD
@@ -2511,12 +2600,6 @@
*sse2*) GMP_ASM_X86_SSE2( , [GMP_STRIP_PATH(sse2)]) ;;
esac
fi
- case "$path $fat_path" in
- *mulx*) GMP_ASM_X86_MULX( , [GMP_STRIP_PATH(mulx)]) ;;
- esac
- case "$path $fat_path" in
- *adx*) GMP_ASM_X86_ADX( , [GMP_STRIP_PATH(adx)]) ;;
- esac
;;
esac
@@ -2912,15 +2995,15 @@
mul_1 addmul_1 submul_1 \
add_err1_n add_err2_n add_err3_n sub_err1_n sub_err2_n sub_err3_n \
lshift rshift dive_1 diveby3 divis divrem divrem_1 divrem_2 \
- fib2_ui mod_1 mod_34lsub1 mode1o pre_divrem_1 pre_mod_1 dump \
+ fib2_ui fib2m mod_1 mod_34lsub1 mode1o pre_divrem_1 pre_mod_1 dump \
mod_1_1 mod_1_2 mod_1_3 mod_1_4 lshiftc \
mul mul_fft mul_n sqr mul_basecase sqr_basecase nussbaumer_mul \
mulmid_basecase toom42_mulmid mulmid_n mulmid \
random random2 pow_1 \
- rootrem sqrtrem sizeinbase get_str set_str \
+ rootrem sqrtrem sizeinbase get_str set_str compute_powtab \
scan0 scan1 popcount hamdist cmp zero_p \
- perfsqr perfpow \
- gcd_1 gcd gcdext_1 gcdext gcd_subdiv_step \
+ perfsqr perfpow strongfibo \
+ gcd_11 gcd_22 gcd_1 gcd gcdext_1 gcdext gcd_subdiv_step \
gcdext_lehmer \
div_q tdiv_qr jacbase jacobi_2 jacobi get_d \
matrix22_mul matrix22_mul1_inverse_vector \
@@ -2944,7 +3027,7 @@
dcpi1_div_q dcpi1_div_qr dcpi1_divappr_q \
mu_div_qr mu_divappr_q mu_div_q \
bdiv_q_1 \
- sbpi1_bdiv_q sbpi1_bdiv_qr \
+ sbpi1_bdiv_q sbpi1_bdiv_qr sbpi1_bdiv_r \
dcpi1_bdiv_q dcpi1_bdiv_qr \
mu_bdiv_q mu_bdiv_qr \
bdiv_q bdiv_qr broot brootinv bsqrt bsqrtinv \
@@ -3509,6 +3592,8 @@
#undef HAVE_NATIVE_mpn_divrem_1c
#undef HAVE_NATIVE_mpn_divrem_2
#undef HAVE_NATIVE_mpn_gcd_1
+#undef HAVE_NATIVE_mpn_gcd_11
+#undef HAVE_NATIVE_mpn_gcd_22
#undef HAVE_NATIVE_mpn_hamdist
#undef HAVE_NATIVE_mpn_invert_limb
#undef HAVE_NATIVE_mpn_ior_n
@@ -3551,6 +3636,7 @@
#undef HAVE_NATIVE_mpn_rsh1sub_n
#undef HAVE_NATIVE_mpn_rsh1sub_nc
#undef HAVE_NATIVE_mpn_rshift
+#undef HAVE_NATIVE_mpn_sbpi1_bdiv_r
#undef HAVE_NATIVE_mpn_sqr_basecase
#undef HAVE_NATIVE_mpn_sqr_diagonal
#undef HAVE_NATIVE_mpn_sqr_diag_addlsh1
@@ -3632,6 +3718,13 @@
GMP_ASM_POWERPC_R_REGISTERS
GMP_INCLUDE_MPN(powerpc32/powerpc-defs.m4)
+ # Check for Linux ELFv1 ABI
+ AC_EGREP_CPP(yes,
+[#if _CALL_ELF == 1
+yes
+#endif],
+ [GMP_DEFINE_RAW(["define(<ELFv1_ABI>)"])])
+
# Check for Linux ELFv2 ABI
AC_EGREP_CPP(yes,
[#if _CALL_ELF == 2
@@ -3678,6 +3771,9 @@
;;
X86_PATTERN | X86_64_PATTERN)
GMP_ASM_ALIGN_FILL_0x90
+ if test "$x86_have_mulx" = yes; then
+ GMP_ASM_X86_MULX
+ fi
case $ABI in
32)
GMP_INCLUDE_MPN(x86/x86-defs.m4)
@@ -3752,7 +3848,7 @@
#
if test -z "$fat_path"; then
for i in SQR_TOOM2_THRESHOLD BMOD_1_TO_MOD_1_THRESHOLD SHLD_SLOW SHRD_SLOW; do
- value=`sed -n 's/^#define '$i'[ ]*\([0-9][0-9]*\).*$/\1/p' $gmp_mparam_source`
+ value=`sed -n 's/^#define '$i'[ ]*\([0-9A-Z][0-9A-Z_]*\).*$/\1/p' $gmp_mparam_source`
if test -n "$value"; then
GMP_DEFINE_RAW(["define(<$i>,<$value>)"])
fi
@@ -3891,16 +3987,8 @@
AC_PROG_YACC
AM_PROG_LEX
-# Configs for demos/expr directory
-#
-# Libtool already runs an AC_CHECK_TOOL for ranlib, but we give
-# AC_PROG_RANLIB anyway since automake is supposed to complain if it's not
-# called. (Automake 1.8.4 doesn't, at least not when the only library is in
-# an EXTRA_LIBRARIES.)
-#
-AC_PROG_RANLIB
+LT_INIT
-
# Create config.m4.
GMP_FINISH
@@ -3917,7 +4005,7 @@
tests/cxx/Makefile \
doc/Makefile tune/Makefile \
demos/Makefile demos/calc/Makefile demos/expr/Makefile \
- gmp.h:gmp-h.in)
+ gmp.h:gmp-h.in gmp.pc:gmp.pc.in gmpxx.pc:gmpxx.pc.in)
AC_MSG_NOTICE([summary of build options:
@@ -3929,15 +4017,3 @@
Static libraries: ${enable_static}
Shared libraries: ${enable_shared}
])
-
-if test x$cross_compiling = xyes ; then
- case "$host" in
- *-*-mingw* | *-*-cygwin)
- if test x$ABI = x64 ; then
- AC_MSG_NOTICE([If wine64 is installed, use make check TESTS_ENVIRONMENT=wine64.])
- else
- AC_MSG_NOTICE([If wine is installed, use make check TESTS_ENVIRONMENT=wine.])
- fi
- ;;
- esac
-fi
Modified: trunk/Build/source/libs/gmp/gmp-src/errno.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/errno.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/errno.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,24 +33,26 @@
see https://www.gnu.org/licenses/. */
#include <stdlib.h>
-#include "gmp.h"
+
+#include <signal.h>
+
#include "gmp-impl.h"
int gmp_errno = 0;
-/* The deliberate divide by zero triggers an exception on most systems. On
- those where it doesn't, for example power and powerpc, use abort instead.
-
- Enhancement: Perhaps raise(SIGFPE) (or the same with kill()) would be
- better than abort. Perhaps it'd be possible to get the BSD style
- FPE_INTDIV_TRAP parameter in there too. */
-
+/* Use SIGFPE on systems which have it. Otherwise, deliberate divide
+ by zero, which triggers an exception on most systems. On those
+ where it doesn't, for example power and powerpc, use abort instead. */
void
__gmp_exception (int error_bit)
{
gmp_errno |= error_bit;
+#ifdef SIGFPE
+ raise (SIGFPE);
+#else
__gmp_junk = 10 / __gmp_0;
+#endif
abort ();
}
Modified: trunk/Build/source/libs/gmp/gmp-src/extract-dbl.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/extract-dbl.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/extract-dbl.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#ifdef XDEBUG
Modified: trunk/Build/source/libs/gmp/gmp-src/gen-bases.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gen-bases.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/gen-bases.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,7 @@
/* Generate mp_bases data.
-Copyright 1991, 1993, 1994, 1996, 2000, 2002, 2004, 2011, 2012 Free Software
-Foundation, Inc.
+Copyright 1991, 1993, 1994, 1996, 2000, 2002, 2004, 2011, 2012,
+2015-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -33,9 +33,11 @@
int chars_per_limb;
+int big_base_ctz;
mpz_t big_base;
int normalization_steps;
mpz_t big_base_inverted;
+mpz_t big_base_binverted;
mpz_t t;
@@ -51,6 +53,16 @@
}
void
+binvert (int numb_bits)
+{
+ mpz_t bbo;
+
+ mpz_init_set (bbo, big_base);
+ big_base_ctz = mpz_make_odd (bbo);
+ mpz_invert_2exp (big_base_binverted, bbo, numb_bits);
+}
+
+void
generate (int limb_bits, int nail_bits, int base)
{
int numb_bits = limb_bits - nail_bits;
@@ -57,13 +69,11 @@
mpz_set_ui (t, 1L);
mpz_mul_2exp (t, t, numb_bits);
- mpz_set_ui (big_base, 1L);
+ mpz_set_ui (big_base, (long) base);
chars_per_limb = 0;
- for (;;)
+ while (mpz_cmp (big_base, t) <= 0)
{
mpz_mul_ui (big_base, big_base, (long) base);
- if (mpz_cmp (big_base, t) > 0)
- break;
chars_per_limb++;
}
@@ -74,9 +84,9 @@
mpz_set_ui (t, 1L);
mpz_mul_2exp (t, t, 2*limb_bits - normalization_steps);
mpz_tdiv_q (big_base_inverted, t, big_base);
- mpz_set_ui (t, 1L);
- mpz_mul_2exp (t, t, limb_bits);
- mpz_sub (big_base_inverted, big_base_inverted, t);
+ mpz_clrbit (big_base_inverted, limb_bits);
+
+ binvert (numb_bits);
}
void
@@ -94,6 +104,7 @@
printf ("\n");
printf ("/* mp_bases[10] data, as literal values */\n");
printf ("#define MP_BASES_CHARS_PER_LIMB_10 %d\n", chars_per_limb);
+ printf ("#define MP_BASES_BIG_BASE_CTZ_10 %d\n", big_base_ctz);
printf ("#define MP_BASES_BIG_BASE_10 CNST_LIMB(0x");
mpz_out_str (stdout, 16, big_base);
printf (")\n");
@@ -100,6 +111,9 @@
printf ("#define MP_BASES_BIG_BASE_INVERTED_10 CNST_LIMB(0x");
mpz_out_str (stdout, 16, big_base_inverted);
printf (")\n");
+ printf ("#define MP_BASES_BIG_BASE_BINVERTED_10 CNST_LIMB(0x");
+ mpz_out_str (stdout, 16, big_base_binverted);
+ printf (")\n");
printf ("#define MP_BASES_NORMALIZATION_STEPS_10 %d\n", normalization_steps);
}
@@ -113,13 +127,13 @@
mpz_t t, t2, two, b;
int i;
- mpz_init_set_ui (t, 1);
- mpz_mul_2exp (t, t, prec+EXTRA);
+ mpz_init (t);
+ mpz_setbit (t, prec + EXTRA);
mpz_init (t2);
- mpz_init_set_ui (two, 2);
- mpz_mul_2exp (two, two, prec+EXTRA);
+ mpz_init (two);
+ mpz_setbit (two, prec + EXTRA + 1);
mpz_set_ui (r, 0);
@@ -137,7 +151,7 @@
if (mpz_cmp (t2, two) < 0) /* not too large? */
{
mpz_setbit (r, i); /* set next less significant bit */
- mpz_set (t, t2); /* new value acceptable */
+ mpz_swap (t, t2); /* new value acceptable */
}
}
@@ -161,7 +175,6 @@
printf ("/* This file generated by gen-bases.c - DO NOT EDIT. */\n");
printf ("\n");
- printf ("#include \"gmp.h\"\n");
printf ("#include \"gmp-impl.h\"\n");
printf ("\n");
printf ("#if GMP_NUMB_BITS != %d\n", numb_bits);
@@ -217,6 +230,7 @@
mpz_init (big_base);
mpz_init (big_base_inverted);
+ mpz_init (big_base_binverted);
mpz_init (t);
if (argc != 4)
Modified: trunk/Build/source/libs/gmp/gmp-src/gen-fac.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gen-fac.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/gen-fac.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* Generate data for combinatorics: fac_ui, bin_uiui, ...
-Copyright 2002, 2011-2015 Free Software Foundation, Inc.
+Copyright 2002, 2011-2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -43,7 +43,7 @@
/* returns 0 on success */
int
-gen_consts (int numb, int nail, int limb)
+gen_consts (unsigned numb, unsigned limb)
{
mpz_t x, mask, y, last;
unsigned long a, b;
@@ -50,12 +50,12 @@
unsigned long ofl, ofe;
printf ("/* This file is automatically generated by gen-fac.c */\n\n");
- printf ("#if GMP_NUMB_BITS != %d\n", numb);
- printf ("Error , error this data is for %d GMP_NUMB_BITS only\n", numb);
+ printf ("#if GMP_NUMB_BITS != %u\n", numb);
+ printf ("Error , error this data is for %u GMP_NUMB_BITS only\n", numb);
printf ("#endif\n");
#if 0
- printf ("#if GMP_LIMB_BITS != %d\n", limb);
- printf ("Error , error this data is for %d GMP_LIMB_BITS only\n", limb);
+ printf ("#if GMP_LIMB_BITS != %u\n", limb);
+ printf ("Error , error this data is for %u GMP_LIMB_BITS only\n", limb);
printf ("#endif\n");
#endif
@@ -101,7 +101,7 @@
ofl = b - 1;
printf
("#define ODD_FACTORIAL_TABLE_LIMIT (%lu)\n", ofl);
- mpz_init2 (mask, numb + 1);
+ mpz_init (mask);
mpz_setbit (mask, numb);
mpz_sub_ui (mask, mask, 1);
printf
@@ -280,6 +280,6 @@
nail_bits);
exit (1);
}
- gen_consts (numb_bits, nail_bits, limb_bits);
+ gen_consts (numb_bits, limb_bits);
return 0;
}
Modified: trunk/Build/source/libs/gmp/gmp-src/gen-trialdivtab.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gen-trialdivtab.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/gen-trialdivtab.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
Contributed to the GNU project by Torbjorn Granlund.
-Copyright 2009, 2012, 2013 Free Software Foundation, Inc.
+Copyright 2009, 2012, 2013, 2016, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -59,7 +59,7 @@
int
main (int argc, char *argv[])
{
- unsigned long t, p;
+ int t, p;
mpz_t ppp, acc, inv, gmp_numb_max, tmp, Bhalf;
mpz_t pre[7];
int i;
@@ -91,15 +91,16 @@
for (i = 0; i < 7; i++)
mpz_init (pre[i]);
- mpz_init_set_ui (gmp_numb_max, 1);
- mpz_mul_2exp (gmp_numb_max, gmp_numb_max, limb_bits);
+ mpz_init (B);
+ mpz_setbit (B, limb_bits);
+ mpz_init_set (gmp_numb_max, B);
mpz_sub_ui (gmp_numb_max, gmp_numb_max, 1);
mpz_init (tmp);
mpz_init (inv);
- mpz_init_set_ui (B, 1); mpz_mul_2exp (B, B, limb_bits);
- mpz_init_set_ui (Bhalf, 1); mpz_mul_2exp (Bhalf, Bhalf, limb_bits - 1);
+ mpz_init (Bhalf);
+ mpz_setbit (Bhalf, limb_bits - 1);
start_p = 3;
Modified: trunk/Build/source/libs/gmp/gmp-src/gmp-h.in
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gmp-h.in 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/gmp-h.in 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* Definitions for GNU multiple precision functions. -*- mode: c -*-
-Copyright 1991, 1993-1997, 1999-2016 Free Software Foundation, Inc.
+Copyright 1991, 1993-1997, 1999-2016, 2020 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -341,7 +341,11 @@
__GMP_ATTRIBUTE_PURE. */
#if defined (__cplusplus)
+#if __cplusplus >= 201103L
+#define __GMP_NOTHROW noexcept
+#else
#define __GMP_NOTHROW throw ()
+#endif
#else
#define __GMP_NOTHROW
#endif
@@ -845,13 +849,13 @@
__GMP_DECLSPEC void mpz_import (mpz_ptr, size_t, int, size_t, int, size_t, const void *);
#define mpz_init __gmpz_init
-__GMP_DECLSPEC void mpz_init (mpz_ptr);
+__GMP_DECLSPEC void mpz_init (mpz_ptr) __GMP_NOTHROW;
#define mpz_init2 __gmpz_init2
__GMP_DECLSPEC void mpz_init2 (mpz_ptr, mp_bitcnt_t);
#define mpz_inits __gmpz_inits
-__GMP_DECLSPEC void mpz_inits (mpz_ptr, ...);
+__GMP_DECLSPEC void mpz_inits (mpz_ptr, ...) __GMP_NOTHROW;
#define mpz_init_set __gmpz_init_set
__GMP_DECLSPEC void mpz_init_set (mpz_ptr, mpz_srcptr);
@@ -1512,6 +1516,9 @@
#define mpn_gcd __MPN(gcd)
__GMP_DECLSPEC mp_size_t mpn_gcd (mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t);
+#define mpn_gcd_11 __MPN(gcd_11)
+__GMP_DECLSPEC mp_limb_t mpn_gcd_11 (mp_limb_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
+
#define mpn_gcd_1 __MPN(gcd_1)
__GMP_DECLSPEC mp_limb_t mpn_gcd_1 (mp_srcptr, mp_size_t, mp_limb_t) __GMP_ATTRIBUTE_PURE;
@@ -1840,7 +1847,7 @@
mp_bitcnt_t __gmp_result;
__gmp_usize = __gmp_u->_mp_size;
- __gmp_result = (__gmp_usize < 0 ? ULONG_MAX : 0);
+ __gmp_result = (__gmp_usize < 0 ? ~ __GMP_CAST (mp_bitcnt_t, 0) : __GMP_CAST (mp_bitcnt_t, 0));
if (__GMP_LIKELY (__gmp_usize > 0))
__gmp_result = mpn_popcount (__gmp_u->_mp_d, __gmp_usize);
return __gmp_result;
@@ -2321,8 +2328,8 @@
/* Major version number is the value of __GNU_MP__ too, above. */
#define __GNU_MP_VERSION 6
-#define __GNU_MP_VERSION_MINOR 1
-#define __GNU_MP_VERSION_PATCHLEVEL 2
+#define __GNU_MP_VERSION_MINOR 2
+#define __GNU_MP_VERSION_PATCHLEVEL 0
#define __GNU_MP_RELEASE (__GNU_MP_VERSION * 10000 + __GNU_MP_VERSION_MINOR * 100 + __GNU_MP_VERSION_PATCHLEVEL)
#define __GMP_H__
Modified: trunk/Build/source/libs/gmp/gmp-src/gmp-impl.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gmp-impl.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/gmp-impl.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
THE CONTENTS OF THIS FILE ARE FOR INTERNAL USE AND ARE ALMOST CERTAIN TO
BE SUBJECT TO INCOMPATIBLE CHANGES IN FUTURE GNU MP RELEASES.
-Copyright 1991, 1993-1997, 1999-2015 Free Software Foundation, Inc.
+Copyright 1991-2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -91,8 +91,8 @@
__GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t)
#define DECL_divrem_1(name) \
__GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t)
-#define DECL_gcd_1(name) \
- __GMP_DECLSPEC mp_limb_t name (mp_srcptr, mp_size_t, mp_limb_t)
+#define DECL_gcd_11(name) \
+ __GMP_DECLSPEC mp_limb_t name (mp_limb_t, mp_limb_t)
#define DECL_lshift(name) \
__GMP_DECLSPEC mp_limb_t name (mp_ptr, mp_srcptr, mp_size_t, unsigned)
#define DECL_lshiftc(name) \
@@ -142,6 +142,7 @@
#if ! defined (__GMP_WITHIN_CONFIGURE)
#include "config.h"
+#include "gmp.h"
#include "gmp-mparam.h"
#include "fib_table.h"
#include "fac_table.h"
@@ -340,10 +341,10 @@
TMP_MARK was made, but then no TMP_ALLOCs. */
/* The alignment in bytes, used for TMP_ALLOCed blocks, when alloca or
- __gmp_allocate_func doesn't already determine it. Currently TMP_ALLOC
- isn't used for "double"s, so that's not in the union. */
+ __gmp_allocate_func doesn't already determine it. */
union tmp_align_t {
mp_limb_t l;
+ double d;
char *p;
};
#define __TMP_ALIGN sizeof (union tmp_align_t)
@@ -837,168 +838,255 @@
#define mpn_addmul_2s __MPN(addmul_2s)
__GMP_DECLSPEC mp_limb_t mpn_addmul_2s (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr);
-/* mpn_addlsh1_n(c,a,b,n), when it exists, sets {c,n} to {a,n}+2*{b,n}, and
- returns the carry out (0, 1 or 2). Use _ip1 when a=c. */
-#ifndef mpn_addlsh1_n /* if not done with cpuvec in a fat binary */
+/* Override mpn_addlsh1_n, mpn_addlsh2_n, mpn_sublsh1_n, etc with mpn_addlsh_n,
+ etc when !HAVE_NATIVE the former but HAVE_NATIVE_ the latter. Similarly,
+ override foo_ip1 functions with foo. We then lie and say these macros
+ represent native functions, but leave a trace by using the value 2 rather
+ than 1. */
+
+#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh1_n
+#define mpn_addlsh1_n(a,b,c,d) mpn_addlsh_n(a,b,c,d,1)
+#define HAVE_NATIVE_mpn_addlsh1_n 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh_nc && ! HAVE_NATIVE_mpn_addlsh1_nc
+#define mpn_addlsh1_nc(a,b,c,d,x) mpn_addlsh_nc(a,b,c,d,1,x)
+#define HAVE_NATIVE_mpn_addlsh1_nc 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh1_n && ! HAVE_NATIVE_mpn_addlsh1_n_ip1
+#define mpn_addlsh1_n_ip1(a,b,n) mpn_addlsh1_n(a,a,b,n)
+#define HAVE_NATIVE_mpn_addlsh1_n_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh1_nc && ! HAVE_NATIVE_mpn_addlsh1_nc_ip1
+#define mpn_addlsh1_nc_ip1(a,b,n,c) mpn_addlsh1_nc(a,a,b,n,c)
+#define HAVE_NATIVE_mpn_addlsh1_nc_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh2_n
+#define mpn_addlsh2_n(a,b,c,d) mpn_addlsh_n(a,b,c,d,2)
+#define HAVE_NATIVE_mpn_addlsh2_n 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh_nc && ! HAVE_NATIVE_mpn_addlsh2_nc
+#define mpn_addlsh2_nc(a,b,c,d,x) mpn_addlsh_nc(a,b,c,d,2,x)
+#define HAVE_NATIVE_mpn_addlsh2_nc 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh2_n && ! HAVE_NATIVE_mpn_addlsh2_n_ip1
+#define mpn_addlsh2_n_ip1(a,b,n) mpn_addlsh2_n(a,a,b,n)
+#define HAVE_NATIVE_mpn_addlsh2_n_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_addlsh2_nc && ! HAVE_NATIVE_mpn_addlsh2_nc_ip1
+#define mpn_addlsh2_nc_ip1(a,b,n,c) mpn_addlsh2_nc(a,a,b,n,c)
+#define HAVE_NATIVE_mpn_addlsh2_nc_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh1_n
+#define mpn_sublsh1_n(a,b,c,d) mpn_sublsh_n(a,b,c,d,1)
+#define HAVE_NATIVE_mpn_sublsh1_n 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh_nc && ! HAVE_NATIVE_mpn_sublsh1_nc
+#define mpn_sublsh1_nc(a,b,c,d,x) mpn_sublsh_nc(a,b,c,d,1,x)
+#define HAVE_NATIVE_mpn_sublsh1_nc 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh1_n && ! HAVE_NATIVE_mpn_sublsh1_n_ip1
+#define mpn_sublsh1_n_ip1(a,b,n) mpn_sublsh1_n(a,a,b,n)
+#define HAVE_NATIVE_mpn_sublsh1_n_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh1_nc && ! HAVE_NATIVE_mpn_sublsh1_nc_ip1
+#define mpn_sublsh1_nc_ip1(a,b,n,c) mpn_sublsh1_nc(a,a,b,n,c)
+#define HAVE_NATIVE_mpn_sublsh1_nc_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh2_n
+#define mpn_sublsh2_n(a,b,c,d) mpn_sublsh_n(a,b,c,d,2)
+#define HAVE_NATIVE_mpn_sublsh2_n 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh_nc && ! HAVE_NATIVE_mpn_sublsh2_nc
+#define mpn_sublsh2_nc(a,b,c,d,x) mpn_sublsh_nc(a,b,c,d,2,x)
+#define HAVE_NATIVE_mpn_sublsh2_nc 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh2_n && ! HAVE_NATIVE_mpn_sublsh2_n_ip1
+#define mpn_sublsh2_n_ip1(a,b,n) mpn_sublsh2_n(a,a,b,n)
+#define HAVE_NATIVE_mpn_sublsh2_n_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_sublsh2_nc && ! HAVE_NATIVE_mpn_sublsh2_nc_ip1
+#define mpn_sublsh2_nc_ip1(a,b,n,c) mpn_sublsh2_nc(a,a,b,n,c)
+#define HAVE_NATIVE_mpn_sublsh2_nc_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh_n && ! HAVE_NATIVE_mpn_rsblsh1_n
+#define mpn_rsblsh1_n(a,b,c,d) mpn_rsblsh_n(a,b,c,d,1)
+#define HAVE_NATIVE_mpn_rsblsh1_n 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh_nc && ! HAVE_NATIVE_mpn_rsblsh1_nc
+#define mpn_rsblsh1_nc(a,b,c,d,x) mpn_rsblsh_nc(a,b,c,d,1,x)
+#define HAVE_NATIVE_mpn_rsblsh1_nc 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh1_n && ! HAVE_NATIVE_mpn_rsblsh1_n_ip1
+#define mpn_rsblsh1_n_ip1(a,b,n) mpn_rsblsh1_n(a,a,b,n)
+#define HAVE_NATIVE_mpn_rsblsh1_n_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh1_nc && ! HAVE_NATIVE_mpn_rsblsh1_nc_ip1
+#define mpn_rsblsh1_nc_ip1(a,b,n,c) mpn_rsblsh1_nc(a,a,b,n,c)
+#define HAVE_NATIVE_mpn_rsblsh1_nc_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh_n && ! HAVE_NATIVE_mpn_rsblsh2_n
+#define mpn_rsblsh2_n(a,b,c,d) mpn_rsblsh_n(a,b,c,d,2)
+#define HAVE_NATIVE_mpn_rsblsh2_n 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh_nc && ! HAVE_NATIVE_mpn_rsblsh2_nc
+#define mpn_rsblsh2_nc(a,b,c,d,x) mpn_rsblsh_nc(a,b,c,d,2,x)
+#define HAVE_NATIVE_mpn_rsblsh2_nc 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh2_n && ! HAVE_NATIVE_mpn_rsblsh2_n_ip1
+#define mpn_rsblsh2_n_ip1(a,b,n) mpn_rsblsh2_n(a,a,b,n)
+#define HAVE_NATIVE_mpn_rsblsh2_n_ip1 2
+#endif
+
+#if HAVE_NATIVE_mpn_rsblsh2_nc && ! HAVE_NATIVE_mpn_rsblsh2_nc_ip1
+#define mpn_rsblsh2_nc_ip1(a,b,n,c) mpn_rsblsh2_nc(a,a,b,n,c)
+#define HAVE_NATIVE_mpn_rsblsh2_nc_ip1 2
+#endif
+
+
+#ifndef mpn_addlsh1_n
#define mpn_addlsh1_n __MPN(addlsh1_n)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
+#ifndef mpn_addlsh1_nc
#define mpn_addlsh1_nc __MPN(addlsh1_nc)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-#if HAVE_NATIVE_mpn_addlsh1_n && ! HAVE_NATIVE_mpn_addlsh1_n_ip1
-#define mpn_addlsh1_n_ip1(dst,src,n) mpn_addlsh1_n(dst,dst,src,n)
-#define HAVE_NATIVE_mpn_addlsh1_n_ip1 1
-#else
+#endif
+#ifndef mpn_addlsh1_n_ip1
#define mpn_addlsh1_n_ip1 __MPN(addlsh1_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
-#if HAVE_NATIVE_mpn_addlsh1_nc && ! HAVE_NATIVE_mpn_addlsh1_nc_ip1
-#define mpn_addlsh1_nc_ip1(dst,src,n,c) mpn_addlsh1_nc(dst,dst,src,n,c)
-#define HAVE_NATIVE_mpn_addlsh1_nc_ip1 1
-#else
+#ifndef mpn_addlsh1_nc_ip1
#define mpn_addlsh1_nc_ip1 __MPN(addlsh1_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh1_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
-#ifndef mpn_addlsh2_n /* if not done with cpuvec in a fat binary */
-/* mpn_addlsh2_n(c,a,b,n), when it exists, sets {c,n} to {a,n}+4*{b,n}, and
- returns the carry out (0, ..., 4). Use _ip1 when a=c. */
+#ifndef mpn_addlsh2_n
#define mpn_addlsh2_n __MPN(addlsh2_n)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
+#ifndef mpn_addlsh2_nc
#define mpn_addlsh2_nc __MPN(addlsh2_nc)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-#if HAVE_NATIVE_mpn_addlsh2_n && ! HAVE_NATIVE_mpn_addlsh2_n_ip1
-#define mpn_addlsh2_n_ip1(dst,src,n) mpn_addlsh2_n(dst,dst,src,n)
-#define HAVE_NATIVE_mpn_addlsh2_n_ip1 1
-#else
+#endif
+#ifndef mpn_addlsh2_n_ip1
#define mpn_addlsh2_n_ip1 __MPN(addlsh2_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
-#if HAVE_NATIVE_mpn_addlsh2_nc && ! HAVE_NATIVE_mpn_addlsh2_nc_ip1
-#define mpn_addlsh2_nc_ip1(dst,src,n,c) mpn_addlsh2_nc(dst,dst,src,n,c)
-#define HAVE_NATIVE_mpn_addlsh2_nc_ip1 1
-#else
+#ifndef mpn_addlsh2_nc_ip1
#define mpn_addlsh2_nc_ip1 __MPN(addlsh2_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh2_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
-/* mpn_addlsh_n(c,a,b,n,k), when it exists, sets {c,n} to {a,n}+2^k*{b,n}, and
- returns the carry out (0, ..., 2^k). Use _ip1 when a=c. */
+#ifndef mpn_addlsh_n
#define mpn_addlsh_n __MPN(addlsh_n)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int);
+#endif
+#ifndef mpn_addlsh_nc
#define mpn_addlsh_nc __MPN(addlsh_nc)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
-#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh_n_ip1
-#define mpn_addlsh_n_ip1(dst,src,n,s) mpn_addlsh_n(dst,dst,src,n,s)
-#define HAVE_NATIVE_mpn_addlsh_n_ip1 1
-#else
+#endif
+#ifndef mpn_addlsh_n_ip1
#define mpn_addlsh_n_ip1 __MPN(addlsh_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_n_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
#endif
-#if HAVE_NATIVE_mpn_addlsh_nc && ! HAVE_NATIVE_mpn_addlsh_nc_ip1
-#define mpn_addlsh_nc_ip1(dst,src,n,s,c) mpn_addlsh_nc(dst,dst,src,n,s,c)
-#define HAVE_NATIVE_mpn_addlsh_nc_ip1 1
-#else
+#ifndef mpn_addlsh_nc_ip1
#define mpn_addlsh_nc_ip1 __MPN(addlsh_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_addlsh_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
#endif
-#ifndef mpn_sublsh1_n /* if not done with cpuvec in a fat binary */
-/* mpn_sublsh1_n(c,a,b,n), when it exists, sets {c,n} to {a,n}-2*{b,n}, and
- returns the borrow out (0, 1 or 2). Use _ip1 when a=c. */
+#ifndef mpn_sublsh1_n
#define mpn_sublsh1_n __MPN(sublsh1_n)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#endif
+#ifndef mpn_sublsh1_nc
#define mpn_sublsh1_nc __MPN(sublsh1_nc)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-#if HAVE_NATIVE_mpn_sublsh1_n && ! HAVE_NATIVE_mpn_sublsh1_n_ip1
-#define mpn_sublsh1_n_ip1(dst,src,n) mpn_sublsh1_n(dst,dst,src,n)
-#define HAVE_NATIVE_mpn_sublsh1_n_ip1 1
-#else
+#endif
+#ifndef mpn_sublsh1_n_ip1
#define mpn_sublsh1_n_ip1 __MPN(sublsh1_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
-#if HAVE_NATIVE_mpn_sublsh1_nc && ! HAVE_NATIVE_mpn_sublsh1_nc_ip1
-#define mpn_sublsh1_nc_ip1(dst,src,n,c) mpn_sublsh1_nc(dst,dst,src,n,c)
-#define HAVE_NATIVE_mpn_sublsh1_nc_ip1 1
-#else
+#ifndef mpn_sublsh1_nc_ip1
#define mpn_sublsh1_nc_ip1 __MPN(sublsh1_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh1_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
-/* mpn_rsblsh1_n(c,a,b,n), when it exists, sets {c,n} to 2*{b,n}-{a,n}, and
- returns the carry out (-1, 0, 1). */
-#define mpn_rsblsh1_n __MPN(rsblsh1_n)
-__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
-#define mpn_rsblsh1_nc __MPN(rsblsh1_nc)
-__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-
-/* mpn_sublsh2_n(c,a,b,n), when it exists, sets {c,n} to {a,n}-4*{b,n}, and
- returns the borrow out (0, ..., 4). Use _ip1 when a=c. */
+#ifndef mpn_sublsh2_n
#define mpn_sublsh2_n __MPN(sublsh2_n)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#endif
+#ifndef mpn_sublsh2_nc
#define mpn_sublsh2_nc __MPN(sublsh2_nc)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-#if HAVE_NATIVE_mpn_sublsh2_n && ! HAVE_NATIVE_mpn_sublsh2_n_ip1
-#define mpn_sublsh2_n_ip1(dst,src,n) mpn_sublsh2_n(dst,dst,src,n)
-#define HAVE_NATIVE_mpn_sublsh2_n_ip1 1
-#else
+#endif
+#ifndef mpn_sublsh2_n_ip1
#define mpn_sublsh2_n_ip1 __MPN(sublsh2_n_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_n_ip1 (mp_ptr, mp_srcptr, mp_size_t);
#endif
-#if HAVE_NATIVE_mpn_sublsh2_nc && ! HAVE_NATIVE_mpn_sublsh2_nc_ip1
-#define mpn_sublsh2_nc_ip1(dst,src,n,c) mpn_sublsh2_nc(dst,dst,src,n,c)
-#define HAVE_NATIVE_mpn_sublsh2_nc_ip1 1
-#else
+#ifndef mpn_sublsh2_nc_ip1
#define mpn_sublsh2_nc_ip1 __MPN(sublsh2_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh2_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t);
#endif
-/* mpn_sublsh_n(c,a,b,n,k), when it exists, sets {c,n} to {a,n}-2^k*{b,n}, and
- returns the carry out (0, ..., 2^k). Use _ip1 when a=c. */
+#ifndef mpn_sublsh_n
#define mpn_sublsh_n __MPN(sublsh_n)
__GMP_DECLSPEC mp_limb_t mpn_sublsh_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int);
-#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh_n_ip1
-#define mpn_sublsh_n_ip1(dst,src,n,s) mpn_sublsh_n(dst,dst,src,n,s)
-#define HAVE_NATIVE_mpn_sublsh_n_ip1 1
-#else
+#endif
+#ifndef mpn_sublsh_nc
+#define mpn_sublsh_nc __MPN(sublsh_nc)
+__GMP_DECLSPEC mp_limb_t mpn_sublsh_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
+#endif
+#ifndef mpn_sublsh_n_ip1
#define mpn_sublsh_n_ip1 __MPN(sublsh_n_ip1)
-__GMP_DECLSPEC mp_limb_t mpn_sublsh_n_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
+ __GMP_DECLSPEC mp_limb_t mpn_sublsh_n_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int);
#endif
-#if HAVE_NATIVE_mpn_sublsh_nc && ! HAVE_NATIVE_mpn_sublsh_nc_ip1
-#define mpn_sublsh_nc_ip1(dst,src,n,s,c) mpn_sublsh_nc(dst,dst,src,n,s,c)
-#define HAVE_NATIVE_mpn_sublsh_nc_ip1 1
-#else
+#ifndef mpn_sublsh_nc_ip1
#define mpn_sublsh_nc_ip1 __MPN(sublsh_nc_ip1)
__GMP_DECLSPEC mp_limb_t mpn_sublsh_nc_ip1 (mp_ptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
#endif
-/* mpn_rsblsh2_n(c,a,b,n), when it exists, sets {c,n} to 4*{b,n}-{a,n}, and
- returns the carry out (-1, ..., 3). */
+#define mpn_rsblsh1_n __MPN(rsblsh1_n)
+__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
+#define mpn_rsblsh1_nc __MPN(rsblsh1_nc)
+__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh1_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
+
#define mpn_rsblsh2_n __MPN(rsblsh2_n)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh2_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsblsh2_nc __MPN(rsblsh2_nc)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh2_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-/* mpn_rsblsh_n(c,a,b,n,k), when it exists, sets {c,n} to 2^k*{b,n}-{a,n}, and
- returns the carry out (-1, 0, ..., 2^k-1). */
#define mpn_rsblsh_n __MPN(rsblsh_n)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int);
#define mpn_rsblsh_nc __MPN(rsblsh_nc)
__GMP_DECLSPEC mp_limb_signed_t mpn_rsblsh_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, unsigned int, mp_limb_t);
-/* mpn_rsh1add_n(c,a,b,n), when it exists, sets {c,n} to ({a,n} + {b,n}) >> 1,
- and returns the bit rshifted out (0 or 1). */
#define mpn_rsh1add_n __MPN(rsh1add_n)
__GMP_DECLSPEC mp_limb_t mpn_rsh1add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsh1add_nc __MPN(rsh1add_nc)
__GMP_DECLSPEC mp_limb_t mpn_rsh1add_nc (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t, mp_limb_t);
-/* mpn_rsh1sub_n(c,a,b,n), when it exists, sets {c,n} to ({a,n} - {b,n}) >> 1,
- and returns the bit rshifted out (0 or 1). If there's a borrow from the
- subtract, it's stored as a 1 in the high bit of c[n-1], like a twos
- complement negative. */
#define mpn_rsh1sub_n __MPN(rsh1sub_n)
__GMP_DECLSPEC mp_limb_t mpn_rsh1sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t);
#define mpn_rsh1sub_nc __MPN(rsh1sub_nc)
@@ -1045,6 +1133,12 @@
#define mpn_fib2_ui __MPN(fib2_ui)
__GMP_DECLSPEC mp_size_t mpn_fib2_ui (mp_ptr, mp_ptr, unsigned long);
+#define mpn_fib2m __MPN(fib2m)
+__GMP_DECLSPEC int mpn_fib2m (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t);
+
+#define mpn_strongfibo __MPN(strongfibo)
+__GMP_DECLSPEC int mpn_strongfibo (mp_srcptr, mp_size_t, mp_ptr);
+
/* Remap names of internal mpn functions. */
#define __clz_tab __MPN(clz_tab)
#define mpn_udiv_w_sdiv __MPN(udiv_w_sdiv)
@@ -1446,15 +1540,11 @@
#define mpn_dcpi1_divappr_q __MPN(dcpi1_divappr_q)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_divappr_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, gmp_pi1_t *);
-#define mpn_dcpi1_divappr_q_n __MPN(dcpi1_divappr_q_n)
-__GMP_DECLSPEC mp_limb_t mpn_dcpi1_divappr_q_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, gmp_pi1_t *, mp_ptr);
#define mpn_mu_div_qr __MPN(mu_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_mu_div_qr (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_mu_div_qr_itch __MPN(mu_div_qr_itch)
__GMP_DECLSPEC mp_size_t mpn_mu_div_qr_itch (mp_size_t, mp_size_t, int) ATTRIBUTE_CONST;
-#define mpn_mu_div_qr_choose_in __MPN(mu_div_qr_choose_in)
-__GMP_DECLSPEC mp_size_t mpn_mu_div_qr_choose_in (mp_size_t, mp_size_t, int);
#define mpn_preinv_mu_div_qr __MPN(preinv_mu_div_qr)
__GMP_DECLSPEC mp_limb_t mpn_preinv_mu_div_qr (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
@@ -1465,12 +1555,7 @@
__GMP_DECLSPEC mp_limb_t mpn_mu_divappr_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_mu_divappr_q_itch __MPN(mu_divappr_q_itch)
__GMP_DECLSPEC mp_size_t mpn_mu_divappr_q_itch (mp_size_t, mp_size_t, int) ATTRIBUTE_CONST;
-#define mpn_mu_divappr_q_choose_in __MPN(mu_divappr_q_choose_in)
-__GMP_DECLSPEC mp_size_t mpn_mu_divappr_q_choose_in (mp_size_t, mp_size_t, int);
-#define mpn_preinv_mu_divappr_q __MPN(preinv_mu_divappr_q)
-__GMP_DECLSPEC mp_limb_t mpn_preinv_mu_divappr_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
-
#define mpn_mu_div_q __MPN(mu_div_q)
__GMP_DECLSPEC mp_limb_t mpn_mu_div_q (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_mu_div_q_itch __MPN(mu_div_q_itch)
@@ -1506,6 +1591,9 @@
#define mpn_sbpi1_bdiv_q __MPN(sbpi1_bdiv_q)
__GMP_DECLSPEC void mpn_sbpi1_bdiv_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+#define mpn_sbpi1_bdiv_r __MPN(sbpi1_bdiv_r)
+__GMP_DECLSPEC mp_limb_t mpn_sbpi1_bdiv_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
+
#define mpn_dcpi1_bdiv_qr __MPN(dcpi1_bdiv_qr)
__GMP_DECLSPEC mp_limb_t mpn_dcpi1_bdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
#define mpn_dcpi1_bdiv_qr_n_itch __MPN(dcpi1_bdiv_qr_n_itch)
@@ -1516,11 +1604,6 @@
#define mpn_dcpi1_bdiv_q __MPN(dcpi1_bdiv_q)
__GMP_DECLSPEC void mpn_dcpi1_bdiv_q (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t);
-#define mpn_dcpi1_bdiv_q_n __MPN(dcpi1_bdiv_q_n)
-__GMP_DECLSPEC void mpn_dcpi1_bdiv_q_n (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
-#define mpn_dcpi1_bdiv_q_n_itch __MPN(dcpi1_bdiv_q_n_itch)
-__GMP_DECLSPEC mp_size_t mpn_dcpi1_bdiv_q_n_itch (mp_size_t) ATTRIBUTE_CONST;
-
#define mpn_mu_bdiv_qr __MPN(mu_bdiv_qr)
__GMP_DECLSPEC mp_limb_t mpn_mu_bdiv_qr (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_mu_bdiv_qr_itch __MPN(mu_bdiv_qr_itch)
@@ -1565,48 +1648,6 @@
__GMP_DECLSPEC void mpn_sec_pi1_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr);
-/* Override mpn_addlsh1_n, mpn_addlsh2_n, mpn_sublsh1_n, etc with mpn_addlsh_n,
- etc when !HAVE_NATIVE the former but HAVE_NATIVE_ the latter. We then lie
- and say these macros represent native functions, but leave a trace by using
- the value 2 rather than 1. */
-
-#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh1_n
-#undef mpn_addlsh1_n
-#define mpn_addlsh1_n(a,b,c,d) mpn_addlsh_n(a,b,c,d,1)
-#define HAVE_NATIVE_mpn_addlsh1_n 2
-#endif
-
-#if HAVE_NATIVE_mpn_addlsh_n && ! HAVE_NATIVE_mpn_addlsh2_n
-#undef mpn_addlsh2_n
-#define mpn_addlsh2_n(a,b,c,d) mpn_addlsh_n(a,b,c,d,2)
-#define HAVE_NATIVE_mpn_addlsh2_n 2
-#endif
-
-#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh1_n
-#undef mpn_sublsh1_n
-#define mpn_sublsh1_n(a,b,c,d) mpn_sublsh_n(a,b,c,d,1)
-#define HAVE_NATIVE_mpn_sublsh1_n 2
-#endif
-
-#if HAVE_NATIVE_mpn_sublsh_n && ! HAVE_NATIVE_mpn_sublsh2_n
-#undef mpn_sublsh2_n
-#define mpn_sublsh2_n(a,b,c,d) mpn_sublsh_n(a,b,c,d,2)
-#define HAVE_NATIVE_mpn_sublsh2_n 2
-#endif
-
-#if HAVE_NATIVE_mpn_rsblsh_n && ! HAVE_NATIVE_mpn_rsblsh1_n
-#undef mpn_rsblsh1_n
-#define mpn_rsblsh1_n(a,b,c,d) mpn_rsblsh_n(a,b,c,d,1)
-#define HAVE_NATIVE_mpn_rsblsh1_n 2
-#endif
-
-#if HAVE_NATIVE_mpn_rsblsh_n && ! HAVE_NATIVE_mpn_rsblsh2_n
-#undef mpn_rsblsh2_n
-#define mpn_rsblsh2_n(a,b,c,d) mpn_rsblsh_n(a,b,c,d,2)
-#define HAVE_NATIVE_mpn_rsblsh2_n 2
-#endif
-
-
#ifndef DIVEXACT_BY3_METHOD
#if GMP_NUMB_BITS % 2 == 0 && ! defined (HAVE_NATIVE_mpn_divexact_by3c)
#define DIVEXACT_BY3_METHOD 0 /* default to using mpn_bdiv_dbm1c */
@@ -1666,6 +1707,12 @@
#define mpz_oddfac_1 __gmpz_oddfac_1
__GMP_DECLSPEC void mpz_oddfac_1 (mpz_ptr, mp_limb_t, unsigned);
+#define mpz_stronglucas __gmpz_stronglucas
+__GMP_DECLSPEC int mpz_stronglucas (mpz_srcptr, mpz_ptr, mpz_ptr);
+
+#define mpz_lucas_mod __gmpz_lucas_mod
+__GMP_DECLSPEC int mpz_lucas_mod (mpz_ptr, mpz_ptr, long, mp_bitcnt_t, mpz_srcptr, mpz_ptr, mpz_ptr);
+
#define mpz_inp_str_nowhite __gmpz_inp_str_nowhite
#ifdef _GMP_H_HAVE_FILE
__GMP_DECLSPEC size_t mpz_inp_str_nowhite (mpz_ptr, FILE *, int, int, size_t);
@@ -3662,9 +3709,9 @@
mp_limb_t __x = (input); \
__x -= (__x >> 1) & MP_LIMB_T_MAX/3; \
__x = ((__x >> 2) & MP_LIMB_T_MAX/5) + (__x & MP_LIMB_T_MAX/5); \
- __x = ((__x >> 4) + __x) & MP_LIMB_T_MAX/17; \
- __x = ((__x >> 8) + __x); \
- (result) = __x & 0xff; \
+ __x += (__x >> 4); \
+ __x = ((__x >> 8) & MP_LIMB_T_MAX/4369)+(__x & MP_LIMB_T_MAX/4369); \
+ (result) = __x; \
} while (0)
#endif
@@ -3921,6 +3968,14 @@
#define PP_FIRST_OMITTED 3
#endif
+typedef struct
+{
+ mp_limb_t d0, d1;
+} mp_double_limb_t;
+
+#define mpn_gcd_22 __MPN (gcd_22)
+__GMP_DECLSPEC mp_double_limb_t mpn_gcd_22 (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t);
+
/* BIT1 means a result value in bit 1 (second least significant bit), with a
zero bit representing +1 and a one bit representing -1. Bits other than
bit 1 are garbage. These are meant to be kept in "int"s, and casts are
@@ -4135,8 +4190,6 @@
/* Matrix multiplication */
#define mpn_matrix22_mul __MPN(matrix22_mul)
__GMP_DECLSPEC void mpn_matrix22_mul (mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_srcptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr);
-#define mpn_matrix22_mul_strassen __MPN(matrix22_mul_strassen)
-__GMP_DECLSPEC void mpn_matrix22_mul_strassen (mp_ptr, mp_ptr, mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_srcptr, mp_srcptr, mp_srcptr, mp_size_t, mp_ptr);
#define mpn_matrix22_mul_itch __MPN(matrix22_mul_itch)
__GMP_DECLSPEC mp_size_t mpn_matrix22_mul_itch (mp_size_t, mp_size_t) ATTRIBUTE_CONST;
@@ -4297,17 +4350,16 @@
int base;
};
typedef struct powers powers_t;
-#define mpn_dc_set_str_powtab_alloc(n) ((n) + GMP_LIMB_BITS)
+#define mpn_str_powtab_alloc(n) ((n) + 2 * GMP_LIMB_BITS) /* FIXME: This can perhaps be trimmed */
#define mpn_dc_set_str_itch(n) ((n) + GMP_LIMB_BITS)
-#define mpn_dc_get_str_powtab_alloc(n) ((n) + 2 * GMP_LIMB_BITS)
#define mpn_dc_get_str_itch(n) ((n) + GMP_LIMB_BITS)
+#define mpn_compute_powtab __MPN(compute_powtab)
+__GMP_DECLSPEC size_t mpn_compute_powtab (powers_t *, mp_ptr, mp_size_t, int);
#define mpn_dc_set_str __MPN(dc_set_str)
__GMP_DECLSPEC mp_size_t mpn_dc_set_str (mp_ptr, const unsigned char *, size_t, const powers_t *, mp_ptr);
#define mpn_bc_set_str __MPN(bc_set_str)
__GMP_DECLSPEC mp_size_t mpn_bc_set_str (mp_ptr, const unsigned char *, size_t, int);
-#define mpn_set_str_compute_powtab __MPN(set_str_compute_powtab)
-__GMP_DECLSPEC void mpn_set_str_compute_powtab (powers_t *, mp_ptr, mp_size_t, int);
/* __GMPF_BITS_TO_PREC applies a minimum 53 bits, rounds upwards to a whole
@@ -4615,7 +4667,7 @@
DECL_copyi ((*copyi));
DECL_divexact_1 ((*divexact_1));
DECL_divrem_1 ((*divrem_1));
- DECL_gcd_1 ((*gcd_1));
+ DECL_gcd_11 ((*gcd_11));
DECL_lshift ((*lshift));
DECL_lshiftc ((*lshiftc));
DECL_mod_1 ((*mod_1));
@@ -4897,6 +4949,10 @@
#define MATRIX22_STRASSEN_THRESHOLD matrix22_strassen_threshold
extern mp_size_t matrix22_strassen_threshold;
+typedef int hgcd2_func_t (mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t,
+ struct hgcd_matrix1 *);
+extern hgcd2_func_t *hgcd2_func;
+
#undef HGCD_THRESHOLD
#define HGCD_THRESHOLD hgcd_threshold
extern mp_size_t hgcd_threshold;
Added: trunk/Build/source/libs/gmp/gmp-src/gmp.pc.in
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gmp.pc.in (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/gmp.pc.in 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: @PACKAGE_NAME@
+Description: GNU Multiple Precision Arithmetic Library
+URL: https://gmplib.org
+Version: @PACKAGE_VERSION@
+Cflags: -I${includedir}
+Libs: -L${libdir} -lgmp
Modified: trunk/Build/source/libs/gmp/gmp-src/gmpxx.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gmpxx.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/gmpxx.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,7 @@
/* gmpxx.h -- C++ class wrapper for GMP types. -*- C++ -*-
-Copyright 2001-2003, 2006, 2008, 2011, 2012 Free Software Foundation, Inc.
+Copyright 2001-2003, 2006, 2008, 2011-2015, 2018 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -220,6 +221,11 @@
{
if (q != r) mpq_set(q, r);
}
+ else if (__GMPXX_CONSTANT(l) && l == 1)
+ {
+ mpz_add (mpq_numref(q), mpq_numref(r), mpq_denref(r));
+ if (q != r) mpz_set(mpq_denref(q), mpq_denref(r));
+ }
else
{
if (q == r)
@@ -339,6 +345,11 @@
{
if (q != r) mpq_set(q, r);
}
+ else if (__GMPXX_CONSTANT(l) && l == 1)
+ {
+ mpz_sub (mpq_numref(q), mpq_numref(r), mpq_denref(r));
+ if (q != r) mpz_set(mpq_denref(q), mpq_denref(r));
+ }
else
{
if (q == r)
@@ -689,7 +700,17 @@
}
}
static void eval(mpq_ptr q, unsigned long int l, mpq_srcptr r)
- { __GMPXX_TMPQ_UI; mpq_div (q, temp, r); }
+ {
+ if (__GMPXX_CONSTANT_TRUE(l == 0))
+ mpq_set_ui(q, 0, 1);
+ else if (__GMPXX_CONSTANT_TRUE(l == 1))
+ mpq_inv(q, r);
+ else
+ {
+ __GMPXX_TMPQ_UI;
+ mpq_div (q, temp, r);
+ }
+ }
static void eval(mpq_ptr q, mpq_srcptr r, signed long int l)
{
if (__GMPXX_CONSTANT_TRUE(l >= 0))
@@ -706,7 +727,22 @@
}
}
static void eval(mpq_ptr q, signed long int l, mpq_srcptr r)
- { __GMPXX_TMPQ_SI; mpq_div (q, temp, r); }
+ {
+ if (__GMPXX_CONSTANT_TRUE(l == 0))
+ mpq_set_ui(q, 0, 1);
+ else if (__GMPXX_CONSTANT_TRUE(l == 1))
+ mpq_inv(q, r);
+ else if (__GMPXX_CONSTANT_TRUE(l == -1))
+ {
+ mpq_inv(q, r);
+ mpq_neg(q, q);
+ }
+ else
+ {
+ __GMPXX_TMPQ_SI;
+ mpq_div (q, temp, r);
+ }
+ }
static void eval(mpq_ptr q, mpq_srcptr r, double d)
{ __GMPXX_TMPQ_D; mpq_div (q, r, temp); }
static void eval(mpq_ptr q, double d, mpq_srcptr r)
@@ -946,11 +982,15 @@
{ return mpq_equal(q, r) != 0; }
static bool eval(mpq_srcptr q, unsigned long int l)
- { return mpq_cmp_ui(q, l, 1) == 0; }
+ { return ((__GMPXX_CONSTANT(l) && l == 0) ||
+ mpz_cmp_ui(mpq_denref(q), 1) == 0) &&
+ mpz_cmp_ui(mpq_numref(q), l) == 0; }
static bool eval(unsigned long int l, mpq_srcptr q)
{ return eval(q, l); }
static bool eval(mpq_srcptr q, signed long int l)
- { return mpq_cmp_si(q, l, 1) == 0; }
+ { return ((__GMPXX_CONSTANT(l) && l == 0) ||
+ mpz_cmp_ui(mpq_denref(q), 1) == 0) &&
+ mpz_cmp_si(mpq_numref(q), l) == 0; }
static bool eval(signed long int l, mpq_srcptr q)
{ return eval(q, l); }
static bool eval(mpq_srcptr q, double d)
@@ -958,7 +998,7 @@
static bool eval(double d, mpq_srcptr q)
{ return eval(q, d); }
static bool eval(mpq_srcptr q, mpz_srcptr z)
- { return mpq_cmp_z(q, z) == 0; }
+ { return mpz_cmp_ui(mpq_denref(q), 1) == 0 && mpz_cmp(mpq_numref(q), z) == 0; }
static bool eval(mpz_srcptr z, mpq_srcptr q)
{ return eval(q, z); }
@@ -1194,7 +1234,79 @@
{ mpf_urandomb(f, s, prec); }
};
+struct __gmp_fac_function
+{
+ static void eval(mpz_ptr z, unsigned long l) { mpz_fac_ui(z, l); }
+ static void eval(mpz_ptr z, signed long l)
+ {
+ if (l < 0)
+ throw std::domain_error ("factorial(negative)");
+ eval(z, static_cast<unsigned long>(l));
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w)
+ {
+ if (!mpz_fits_ulong_p(w))
+ {
+ if (mpz_sgn(w) < 0)
+ throw std::domain_error ("factorial(negative)");
+ else
+ throw std::bad_alloc(); // or std::overflow_error ("factorial")?
+ }
+ eval(z, mpz_get_ui(w));
+ }
+ static void eval(mpz_ptr z, double d)
+ { __GMPXX_TMPZ_D; eval (z, temp); }
+};
+struct __gmp_primorial_function
+{
+ static void eval(mpz_ptr z, unsigned long l) { mpz_primorial_ui(z, l); }
+ static void eval(mpz_ptr z, signed long l)
+ {
+ if (l < 0)
+ throw std::domain_error ("primorial(negative)");
+ eval(z, static_cast<unsigned long>(l));
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w)
+ {
+ if (!mpz_fits_ulong_p(w))
+ {
+ if (mpz_sgn(w) < 0)
+ throw std::domain_error ("primorial(negative)");
+ else
+ throw std::bad_alloc(); // or std::overflow_error ("primorial")?
+ }
+ eval(z, mpz_get_ui(w));
+ }
+ static void eval(mpz_ptr z, double d)
+ { __GMPXX_TMPZ_D; eval (z, temp); }
+};
+
+struct __gmp_fib_function
+{
+ static void eval(mpz_ptr z, unsigned long l) { mpz_fib_ui(z, l); }
+ static void eval(mpz_ptr z, signed long l)
+ {
+ if (l < 0)
+ {
+ eval(z, -static_cast<unsigned long>(l));
+ if ((l & 1) == 0)
+ mpz_neg(z, z);
+ }
+ else
+ eval(z, static_cast<unsigned long>(l));
+ }
+ static void eval(mpz_ptr z, mpz_srcptr w)
+ {
+ if (!mpz_fits_slong_p(w))
+ throw std::bad_alloc(); // or std::overflow_error ("fibonacci")?
+ eval(z, mpz_get_si(w));
+ }
+ static void eval(mpz_ptr z, double d)
+ { __GMPXX_TMPZ_D; eval (z, temp); }
+};
+
+
/**************** Auxiliary classes ****************/
/* this is much the same as gmp_allocated_string in gmp-impl.h
@@ -1423,6 +1535,38 @@
__gmp_expr & operator=(float f) { assign_d(f); return *this; } \
__gmp_expr & operator=(double d) { assign_d(d); return *this; }
+#define __GMPP_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+template <class U> \
+static __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr);
+
+#define __GMPNN_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, bigtype) \
+static inline __gmp_expr<T, __gmp_unary_expr<bigtype, eval_fun> > \
+fun(type expr);
+
+#define __GMPNS_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type) \
+__GMPNN_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, signed long)
+#define __GMPNU_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type) \
+__GMPNN_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, unsigned long)
+#define __GMPND_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type) \
+__GMPNN_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, double)
+
+#define __GMPN_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+__GMPNS_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed char) \
+__GMPNU_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned char) \
+__GMPNS_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed int) \
+__GMPNU_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned int) \
+__GMPNS_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed short int) \
+__GMPNU_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned short int) \
+__GMPNS_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed long int) \
+__GMPNU_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned long int) \
+__GMPND_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, float) \
+__GMPND_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, double)
+
+#define __GMP_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+__GMPP_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+__GMPN_DECLARE_UNARY_STATIC_MEMFUN(T, fun, eval_fun)
+
/**************** mpz_class -- wrapper for mpz_t ****************/
template <>
@@ -1485,11 +1629,11 @@
mp_bitcnt_t get_prec() const { return mpf_get_default_prec(); }
// constructors and destructor
- __gmp_expr() { mpz_init(mp); }
+ __gmp_expr() __GMPXX_NOEXCEPT { mpz_init(mp); }
__gmp_expr(const __gmp_expr &z) { mpz_init_set(mp, z.mp); }
#if __GMPXX_USE_CXX11
- __gmp_expr(__gmp_expr &&z)
+ __gmp_expr(__gmp_expr &&z) noexcept
{ *mp = *z.mp; mpz_init(z.mp); }
#endif
template <class T>
@@ -1603,6 +1747,10 @@
__GMP_DECLARE_INCREMENT_OPERATOR(operator++)
__GMP_DECLARE_INCREMENT_OPERATOR(operator--)
+
+ __GMP_DECLARE_UNARY_STATIC_MEMFUN(mpz_t, factorial, __gmp_fac_function)
+ __GMP_DECLARE_UNARY_STATIC_MEMFUN(mpz_t, primorial, __gmp_primorial_function)
+ __GMP_DECLARE_UNARY_STATIC_MEMFUN(mpz_t, fibonacci, __gmp_fib_function)
};
typedef __gmp_expr<mpz_t, mpz_t> mpz_class;
@@ -1980,7 +2128,7 @@
// bool fits_ldouble_p() const { return mpf_fits_ldouble_p(mp); }
#if __GMPXX_USE_CXX11
- explicit operator bool() const { return mp->_mp_size != 0; }
+ explicit operator bool() const { return mpf_sgn(mp) != 0; }
#endif
// compound assignments
@@ -2791,6 +2939,17 @@
return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, eval_fun> >(expr); \
}
+// variant that only works for one of { mpz, mpq, mpf }
+
+#define __GMP_DEFINE_UNARY_FUNCTION_1(T, fun, eval_fun) \
+ \
+template <class U> \
+inline __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr) \
+{ \
+ return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, eval_fun> >(expr); \
+}
+
#define __GMP_DEFINE_UNARY_TYPE_FUNCTION(type, fun, eval_fun) \
\
template <class T, class U> \
@@ -2864,7 +3023,70 @@
__GMPP_DEFINE_BINARY_FUNCTION(fun, eval_fun) \
__GMPN_DEFINE_BINARY_FUNCTION(fun, eval_fun)
+// variant that only works for one of { mpz, mpq, mpf }
+#define __GMPP_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun) \
+ \
+template <class U, class W> \
+inline __gmp_expr<T, \
+__gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<T, W>, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr1, const __gmp_expr<T, W> &expr2) \
+{ \
+ return __gmp_expr<T, \
+ __gmp_binary_expr<__gmp_expr<T, U>, __gmp_expr<T, W>, eval_fun> > \
+ (expr1, expr2); \
+}
+
+#define __GMPNN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type, bigtype) \
+ \
+template <class U> \
+inline __gmp_expr \
+<T, __gmp_binary_expr<__gmp_expr<T, U>, bigtype, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr, type t) \
+{ \
+ return __gmp_expr \
+ <T, __gmp_binary_expr<__gmp_expr<T, U>, bigtype, eval_fun> >(expr, t); \
+} \
+ \
+template <class U> \
+inline __gmp_expr \
+<T, __gmp_binary_expr<bigtype, __gmp_expr<T, U>, eval_fun> > \
+fun(type t, const __gmp_expr<T, U> &expr) \
+{ \
+ return __gmp_expr \
+ <T, __gmp_binary_expr<bigtype, __gmp_expr<T, U>, eval_fun> >(t, expr); \
+}
+
+#define __GMPNS_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type, signed long int)
+
+#define __GMPNU_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type, unsigned long int)
+
+#define __GMPND_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type, double)
+
+#define __GMPNLD_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, type, long double)
+
+#define __GMPN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun) \
+__GMPNS_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, signed char) \
+__GMPNU_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, unsigned char) \
+__GMPNS_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, signed int) \
+__GMPNU_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, unsigned int) \
+__GMPNS_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, signed short int) \
+__GMPNU_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, unsigned short int) \
+__GMPNS_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, signed long int) \
+__GMPNU_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, unsigned long int) \
+__GMPND_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, float) \
+__GMPND_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, double) \
+/* __GMPNLD_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun, long double) */
+
+#define __GMP_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun) \
+__GMPP_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun) \
+__GMPN_DEFINE_BINARY_FUNCTION_1(T, fun, eval_fun)
+
+
#define __GMP_DEFINE_BINARY_FUNCTION_UI(fun, eval_fun) \
\
template <class T, class U> \
@@ -3046,7 +3268,45 @@
__GMP_DEFINE_INCREMENT_OPERATOR(mpf, fun, eval_fun)
+#define __GMPP_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+template <class U> \
+__gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, eval_fun> > \
+fun(const __gmp_expr<T, U> &expr) \
+{ \
+ return __gmp_expr<T, __gmp_unary_expr<__gmp_expr<T, U>, eval_fun> >(expr); \
+}
+#define __GMPNN_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, bigtype) \
+inline __gmp_expr<T, __gmp_unary_expr<bigtype, eval_fun> > \
+fun(type expr) \
+{ \
+ return __gmp_expr<T, __gmp_unary_expr<bigtype, eval_fun> >(expr); \
+}
+
+#define __GMPNS_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, signed long)
+#define __GMPNU_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, unsigned long)
+#define __GMPND_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type) \
+__GMPNN_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, type, double)
+
+#define __GMPN_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+__GMPNS_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed char) \
+__GMPNU_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned char) \
+__GMPNS_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed int) \
+__GMPNU_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned int) \
+__GMPNS_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed short int) \
+__GMPNU_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned short int) \
+__GMPNS_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, signed long int) \
+__GMPNU_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, unsigned long int) \
+__GMPND_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, float) \
+__GMPND_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun, double) \
+
+#define __GMP_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+__GMPP_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+__GMPN_DEFINE_UNARY_STATIC_MEMFUN(T, fun, eval_fun) \
+
+
/**************** Arithmetic operators and functions ****************/
// non-member operators and functions
@@ -3053,16 +3313,16 @@
__GMP_DEFINE_UNARY_FUNCTION(operator+, __gmp_unary_plus)
__GMP_DEFINE_UNARY_FUNCTION(operator-, __gmp_unary_minus)
-__GMP_DEFINE_UNARY_FUNCTION(operator~, __gmp_unary_com)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpz_t, operator~, __gmp_unary_com)
__GMP_DEFINE_BINARY_FUNCTION(operator+, __gmp_binary_plus)
__GMP_DEFINE_BINARY_FUNCTION(operator-, __gmp_binary_minus)
__GMP_DEFINE_BINARY_FUNCTION(operator*, __gmp_binary_multiplies)
__GMP_DEFINE_BINARY_FUNCTION(operator/, __gmp_binary_divides)
-__GMP_DEFINE_BINARY_FUNCTION(operator%, __gmp_binary_modulus)
-__GMP_DEFINE_BINARY_FUNCTION(operator&, __gmp_binary_and)
-__GMP_DEFINE_BINARY_FUNCTION(operator|, __gmp_binary_ior)
-__GMP_DEFINE_BINARY_FUNCTION(operator^, __gmp_binary_xor)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpz_t, operator%, __gmp_binary_modulus)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpz_t, operator&, __gmp_binary_and)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpz_t, operator|, __gmp_binary_ior)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpz_t, operator^, __gmp_binary_xor)
__GMP_DEFINE_BINARY_FUNCTION_UI(operator<<, __gmp_binary_lshift)
__GMP_DEFINE_BINARY_FUNCTION_UI(operator>>, __gmp_binary_rshift)
@@ -3075,13 +3335,17 @@
__GMP_DEFINE_BINARY_TYPE_FUNCTION(bool, operator>=, ! __gmp_binary_less)
__GMP_DEFINE_UNARY_FUNCTION(abs, __gmp_abs_function)
-__GMP_DEFINE_UNARY_FUNCTION(trunc, __gmp_trunc_function)
-__GMP_DEFINE_UNARY_FUNCTION(floor, __gmp_floor_function)
-__GMP_DEFINE_UNARY_FUNCTION(ceil, __gmp_ceil_function)
-__GMP_DEFINE_UNARY_FUNCTION(sqrt, __gmp_sqrt_function)
-__GMP_DEFINE_BINARY_FUNCTION(hypot, __gmp_hypot_function)
-__GMP_DEFINE_BINARY_FUNCTION(gcd, __gmp_gcd_function)
-__GMP_DEFINE_BINARY_FUNCTION(lcm, __gmp_lcm_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpf_t, trunc, __gmp_trunc_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpf_t, floor, __gmp_floor_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpf_t, ceil, __gmp_ceil_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpf_t, sqrt, __gmp_sqrt_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpz_t, sqrt, __gmp_sqrt_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpz_t, factorial, __gmp_fac_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpz_t, primorial, __gmp_primorial_function)
+__GMP_DEFINE_UNARY_FUNCTION_1(mpz_t, fibonacci, __gmp_fib_function)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpf_t, hypot, __gmp_hypot_function)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpz_t, gcd, __gmp_gcd_function)
+__GMP_DEFINE_BINARY_FUNCTION_1(mpz_t, lcm, __gmp_lcm_function)
__GMP_DEFINE_UNARY_TYPE_FUNCTION(int, sgn, __gmp_sgn_function)
__GMP_DEFINE_BINARY_TYPE_FUNCTION(int, cmp, __gmp_cmp_function)
@@ -3108,6 +3372,10 @@
__GMPZ_DEFINE_INCREMENT_OPERATOR(operator++, __gmp_unary_increment)
__GMPZ_DEFINE_INCREMENT_OPERATOR(operator--, __gmp_unary_decrement)
+__GMP_DEFINE_UNARY_STATIC_MEMFUN(mpz_t, mpz_class::factorial, __gmp_fac_function)
+__GMP_DEFINE_UNARY_STATIC_MEMFUN(mpz_t, mpz_class::primorial, __gmp_primorial_function)
+__GMP_DEFINE_UNARY_STATIC_MEMFUN(mpz_t, mpz_class::fibonacci, __gmp_fib_function)
+
// member operators for mpq_class
__GMPQ_DEFINE_COMPOUND_OPERATOR(operator+=, __gmp_binary_plus)
@@ -3381,6 +3649,7 @@
#undef __GMPZQ_DEFINE_EXPR
+#undef __GMP_DEFINE_UNARY_FUNCTION_1
#undef __GMP_DEFINE_UNARY_FUNCTION
#undef __GMP_DEFINE_UNARY_TYPE_FUNCTION
Added: trunk/Build/source/libs/gmp/gmp-src/gmpxx.pc.in
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/gmpxx.pc.in (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/gmpxx.pc.in 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+includedir=@includedir@
+libdir=@libdir@
+
+Name: @PACKAGE_NAME@ C++
+Description: GNU Multiple Precision Arithmetic Library (C++ bindings)
+URL: https://gmplib.org
+Version: @PACKAGE_VERSION@
+Requires: gmp
+Cflags: -I${includedir}
+Libs: -L${libdir} -lgmpxx
Modified: trunk/Build/source/libs/gmp/gmp-src/invalid.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/invalid.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/invalid.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -41,7 +41,6 @@
#include <unistd.h> /* for getpid */
#endif
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/longlong.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/longlong.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/longlong.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
-Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2016 Free Software
+Copyright 1991-1994, 1996, 1997, 1999-2005, 2007-2009, 2011-2020 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -204,7 +204,6 @@
(pl) = __m0 * __m1; \
} while (0)
#endif
-#define UMUL_TIME 18
#else /* ! __GNUC__ */
#include <machine/builtins.h>
#define umul_ppmm(ph, pl, m0, m1) \
@@ -222,7 +221,6 @@
} 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
@@ -285,7 +283,6 @@
#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)))
@@ -329,7 +326,6 @@
__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; \
@@ -372,7 +368,6 @@
#define UDIV_PREINV_ALWAYS 1
#define UDIV_NEEDS_NORMALIZATION 1
#endif
-#define UDIV_TIME 220
#endif
@@ -440,12 +435,50 @@
#if defined (__arm__) && (defined (__thumb2__) || !defined (__thumb__)) \
&& W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
- __asm__ ("adds\t%1, %4, %5\n\tadc\t%0, %2, %3" \
+ do { \
+ if (__builtin_constant_p (bl) && -(USItype)(bl) < 0x100) \
+ __asm__ ("subs\t%1, %4, %5\n\tadc\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" (-(USItype)(bl)) __CLOBBER_CC); \
+ else \
+ __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); \
+ } while (0)
+/* FIXME: Extend the immediate range for the low word by using both ADDS and
+ SUBS, since they set carry in the same way. Note: We need separate
+ definitions for thumb and non-thumb to to th absense of RSC under thumb. */
+#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" \
@@ -468,21 +501,15 @@
: "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) \
@@ -505,7 +532,6 @@
"=&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; \
@@ -513,12 +539,10 @@
(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
@@ -529,12 +553,10 @@
} 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
@@ -541,15 +563,41 @@
/* FIXME: Extend the immediate range for the low word by using both
ADDS and SUBS, since they set carry in the same way. */
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
- __asm__ ("adds\t%1, %x4, %5\n\tadc\t%0, %x2, %x3" \
- : "=r" (sh), "=&r" (sl) \
- : "rZ" ((UDItype)(ah)), "rZ" ((UDItype)(bh)), \
- "%r" ((UDItype)(al)), "rI" ((UDItype)(bl)) __CLOBBER_CC)
+ do { \
+ if (__builtin_constant_p (bl) && -(UDItype)(bl) < 0x1000) \
+ __asm__ ("subs\t%1, %x4, %5\n\tadc\t%0, %x2, %x3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rZ" ((UDItype)(ah)), "rZ" ((UDItype)(bh)), \
+ "%r" ((UDItype)(al)), "rI" (-(UDItype)(bl)) __CLOBBER_CC);\
+ else \
+ __asm__ ("adds\t%1, %x4, %5\n\tadc\t%0, %x2, %x3" \
+ : "=r" (sh), "=&r" (sl) \
+ : "rZ" ((UDItype)(ah)), "rZ" ((UDItype)(bh)), \
+ "%r" ((UDItype)(al)), "rI" ((UDItype)(bl)) __CLOBBER_CC);\
+ } while (0)
#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
- __asm__ ("subs\t%1, %x4, %5\n\tsbc\t%0, %x2, %x3" \
- : "=r,r" (sh), "=&r,&r" (sl) \
- : "rZ,rZ" ((UDItype)(ah)), "rZ,rZ" ((UDItype)(bh)), \
- "r,Z" ((UDItype)(al)), "rI,r" ((UDItype)(bl)) __CLOBBER_CC)
+ do { \
+ if (__builtin_constant_p (bl) && -(UDItype)(bl) < 0x1000) \
+ __asm__ ("adds\t%1, %x4, %5\n\tsbc\t%0, %x2, %x3" \
+ : "=r,r" (sh), "=&r,&r" (sl) \
+ : "rZ,rZ" ((UDItype)(ah)), "rZ,rZ" ((UDItype)(bh)), \
+ "r,Z" ((UDItype)(al)), "rI,r" (-(UDItype)(bl)) __CLOBBER_CC);\
+ else \
+ __asm__ ("subs\t%1, %x4, %5\n\tsbc\t%0, %x2, %x3" \
+ : "=r,r" (sh), "=&r,&r" (sl) \
+ : "rZ,rZ" ((UDItype)(ah)), "rZ,rZ" ((UDItype)(bh)), \
+ "r,Z" ((UDItype)(al)), "rI,r" ((UDItype)(bl)) __CLOBBER_CC);\
+ } while(0);
+#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); \
@@ -556,9 +604,9 @@
__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
@@ -650,11 +698,6 @@
(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 { \
@@ -940,7 +983,6 @@
double d; \
unsigned a[2]; \
} __u; \
- ASSERT ((n) != 0); \
__u.d = (UWtype) (n); \
(c) = 0x3FF + 31 - (__u.a[1] >> 20); \
} while (0)
@@ -997,12 +1039,6 @@
#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
@@ -1016,29 +1052,61 @@
: "=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
@@ -1119,12 +1187,10 @@
__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) \
@@ -1158,8 +1224,6 @@
"=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
@@ -1212,11 +1276,6 @@
__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__ */
@@ -1238,14 +1297,20 @@
__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))); \
__ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
w1 = __ll >> 64; \
@@ -1264,8 +1329,6 @@
: "=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
@@ -1330,33 +1393,41 @@
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))
@@ -1378,7 +1449,6 @@
(pl) = __m0 * __m1; \
} while (0)
#endif
-#define UMUL_TIME 15
#define smul_ppmm(ph, pl, m0, m1) \
do { \
SItype __m0 = (m0), __m1 = (m1); \
@@ -1385,16 +1455,11 @@
__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. */
@@ -1410,17 +1475,20 @@
__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. */
@@ -1431,53 +1499,63 @@
__asm__ ("addic %1,%3,%4\n\tsubfze %0,%2" \
: "=r" (sh), "=&r" (sl) \
: "r" ((UDItype)(bh)), \
- "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl)))); \
+ "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl))) \
+ __CLOBBER_CC); \
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)))); \
+ "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl))) \
+ __CLOBBER_CC); \
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)))); \
+ "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl))) \
+ __CLOBBER_CC); \
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)))); \
+ "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl))) \
+ __CLOBBER_CC); \
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)))); \
+ "rI" ((UDItype)(al)), "*rI" (-((UDItype)(bl))) \
+ __CLOBBER_CC); \
} 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))); \
+ "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))); \
+ "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))); \
+ "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))); \
+ "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))); \
+ "rI" ((UDItype)(al)), "r" ((UDItype)(bl)) \
+ __CLOBBER_CC); \
} \
} while (0)
#endif /* ! _LONG_LONG_LIMB */
@@ -1484,7 +1562,7 @@
#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))); \
@@ -1501,7 +1579,6 @@
(pl) = __m0 * __m1; \
} while (0)
#endif
-#define UMUL_TIME 15
#define smul_ppmm(ph, pl, m0, m1) \
do { \
DItype __m0 = (m0), __m1 = (m1); \
@@ -1508,8 +1585,6 @@
__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
@@ -1570,8 +1645,6 @@
: "=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) \
@@ -1586,11 +1659,19 @@
} 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
@@ -1638,10 +1719,8 @@
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. */
@@ -1653,7 +1732,6 @@
(r) = (n0) - __q * (d); \
(q) = __q; \
} while (0)
-#define UDIV_TIME 25
#endif /* HAVE_HOST_CPU_supersparc */
#else /* ! __sparc_v8__ */
@@ -1662,7 +1740,6 @@
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" \
@@ -1705,7 +1782,6 @@
"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
@@ -1759,7 +1835,6 @@
" 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
@@ -1769,9 +1844,6 @@
(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__ */
@@ -2207,12 +2279,3 @@
#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
Modified: trunk/Build/source/libs/gmp/gmp-src/memory.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/memory.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/memory.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
#include <stdio.h>
#include <stdlib.h> /* for malloc, realloc, free */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/README
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mini-gmp/README 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mini-gmp/README 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,4 +1,4 @@
-Copyright 2011-2013 Free Software Foundation, Inc.
+Copyright 2011-2013, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -27,8 +27,8 @@
see https://www.gnu.org/licenses/.
-This is "mini-gmp", a small implementation of a subset of GMP's mpn
-and mpz interfaces.
+This is "mini-gmp", a small implementation of a subset of GMP's mpn,
+mpz and mpq interfaces.
It is intended for applications which need arithmetic on numbers
larger than a machine word, but which don't need to handle very large
@@ -38,12 +38,11 @@
mini-gmp as a fallback when for some reason GMP is not available, or
not desired as a dependency.
-The supported GMP subset is declared in mini-gmp.h. The implemented
+The supported GMP subset of the mpn and mpz interfaces is declared in
+mini-gmp.h, and implemented in mini-gmp.c. The implemented
functions are fully compatible with the corresponding GMP functions,
as specified in the GMP manual, with a few exceptions:
- mpz_set_str, mpz_init_set_str, mpz_get_str, mpz_out_str and
- mpz_sizeinbase support only |base| <= 36;
mpz_export and mpz_import support only NAILS = 0.
The REALLOC_FUNC and FREE_FUNC registered with
@@ -51,7 +50,7 @@
allocated block in the corresponding argument. mini-gmp always
passes zero for these rarely used arguments.
-The implementation is a single file, mini-gmp.c.
+ When mpz_get_str allocates the block, it can be longer than needed.
The performance target for mini-gmp is to be at most 10 times slower
than the real GMP library, for numbers of size up to a few hundred
@@ -59,19 +58,22 @@
it will be many orders of magnitude slower than GMP for very large
numbers.
+The supported GMP subset of the mpq layer is declared in mini-mpq.h,
+and implemented in mini-mpq.c.
+
You should never "install" mini-gmp. Applications can either just
#include mini-gmp.c (but then, beware that it defines several macros
-and functions outside of the advertised interface). Or compile
-mini-gmp.c as a separate compilation unit, and use the declarations in
-mini-gmp.h.
+and functions outside of the advertised interface), and if needed
+#include mini-mpq.c in a later line (order is important). Or compile
+mini-gmp.c and mini-mpq.c as separate compilation units, and use the
+declarations in mini-gmp.h and mini-mpq.h.
The tests subdirectory contains a testsuite. To use it, you need GMP
and GNU make. Just run make check in the tests directory. If the
hard-coded compiler settings are not right, you have to either edit the
Makefile or pass overriding values on the make command line (e.g.,
-make CC=cc check). Testing is not (yet) as thorough as for the real
-GMP.
+make CC=cc check).
-The current version was put together by Niels Möller
+The initial version of mini-gmp was put together by Niels Möller
<nisse at lysator.liu.se>, with a fair amount of copy-and-paste from the
GMP sources.
Modified: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
Contributed to the GNU project by Niels Möller
-Copyright 1991-1997, 1999-2016 Free Software Foundation, Inc.
+Copyright 1991-1997, 1999-2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -50,11 +50,15 @@
#include "mini-gmp.h"
+#if !defined(MINI_GMP_DONT_USE_FLOAT_H)
+#include <float.h>
+#endif
+
/* Macros */
#define GMP_LIMB_BITS (sizeof(mp_limb_t) * CHAR_BIT)
-#define GMP_LIMB_MAX (~ (mp_limb_t) 0)
+#define GMP_LIMB_MAX ((mp_limb_t) ~ (mp_limb_t) 0)
#define GMP_LIMB_HIGHBIT ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1))
#define GMP_HLIMB_BIT ((mp_limb_t) 1 << (GMP_LIMB_BITS / 2))
@@ -71,6 +75,18 @@
#define GMP_CMP(a,b) (((a) > (b)) - ((a) < (b)))
+#if defined(DBL_MANT_DIG) && FLT_RADIX == 2
+#define GMP_DBL_MANT_BITS DBL_MANT_DIG
+#else
+#define GMP_DBL_MANT_BITS (53)
+#endif
+
+/* Return non-zero if xp,xsize and yp,ysize overlap.
+ If xp+xsize<=yp there's no overlap, or if yp+ysize<=xp there's no
+ overlap. If both these are false, there's an overlap. */
+#define GMP_MPN_OVERLAP_P(xp, xsize, yp, ysize) \
+ ((xp) + (xsize) > (yp) && (yp) + (ysize) > (xp))
+
#define gmp_assert_nocarry(x) do { \
mp_limb_t __cy = (x); \
assert (__cy == 0); \
@@ -78,11 +94,13 @@
#define gmp_clz(count, x) do { \
mp_limb_t __clz_x = (x); \
- unsigned __clz_c; \
- for (__clz_c = 0; \
- (__clz_x & ((mp_limb_t) 0xff << (GMP_LIMB_BITS - 8))) == 0; \
- __clz_c += 8) \
- __clz_x <<= 8; \
+ unsigned __clz_c = 0; \
+ int LOCAL_SHIFT_BITS = 8; \
+ if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS) \
+ for (; \
+ (__clz_x & ((mp_limb_t) 0xff << (GMP_LIMB_BITS - 8))) == 0; \
+ __clz_c += 8) \
+ { __clz_x <<= LOCAL_SHIFT_BITS; } \
for (; (__clz_x & GMP_LIMB_HIGHBIT) == 0; __clz_c++) \
__clz_x <<= 1; \
(count) = __clz_c; \
@@ -113,27 +131,42 @@
#define gmp_umul_ppmm(w1, w0, u, v) \
do { \
- mp_limb_t __x0, __x1, __x2, __x3; \
- unsigned __ul, __vl, __uh, __vh; \
- mp_limb_t __u = (u), __v = (v); \
+ int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS; \
+ if (sizeof(unsigned int) * CHAR_BIT >= 2 * GMP_LIMB_BITS) \
+ { \
+ unsigned int __ww = (unsigned int) (u) * (v); \
+ w0 = (mp_limb_t) __ww; \
+ w1 = (mp_limb_t) (__ww >> LOCAL_GMP_LIMB_BITS); \
+ } \
+ else if (GMP_ULONG_BITS >= 2 * GMP_LIMB_BITS) \
+ { \
+ unsigned long int __ww = (unsigned long int) (u) * (v); \
+ w0 = (mp_limb_t) __ww; \
+ w1 = (mp_limb_t) (__ww >> LOCAL_GMP_LIMB_BITS); \
+ } \
+ else { \
+ mp_limb_t __x0, __x1, __x2, __x3; \
+ unsigned __ul, __vl, __uh, __vh; \
+ mp_limb_t __u = (u), __v = (v); \
\
- __ul = __u & GMP_LLIMB_MASK; \
- __uh = __u >> (GMP_LIMB_BITS / 2); \
- __vl = __v & GMP_LLIMB_MASK; \
- __vh = __v >> (GMP_LIMB_BITS / 2); \
+ __ul = __u & GMP_LLIMB_MASK; \
+ __uh = __u >> (GMP_LIMB_BITS / 2); \
+ __vl = __v & GMP_LLIMB_MASK; \
+ __vh = __v >> (GMP_LIMB_BITS / 2); \
\
- __x0 = (mp_limb_t) __ul * __vl; \
- __x1 = (mp_limb_t) __ul * __vh; \
- __x2 = (mp_limb_t) __uh * __vl; \
- __x3 = (mp_limb_t) __uh * __vh; \
+ __x0 = (mp_limb_t) __ul * __vl; \
+ __x1 = (mp_limb_t) __ul * __vh; \
+ __x2 = (mp_limb_t) __uh * __vl; \
+ __x3 = (mp_limb_t) __uh * __vh; \
\
- __x1 += __x0 >> (GMP_LIMB_BITS / 2);/* this can't give carry */ \
- __x1 += __x2; /* but this indeed can */ \
- if (__x1 < __x2) /* did we get it? */ \
- __x3 += GMP_HLIMB_BIT; /* yes, add it in the proper pos. */ \
+ __x1 += __x0 >> (GMP_LIMB_BITS / 2);/* this can't give carry */ \
+ __x1 += __x2; /* but this indeed can */ \
+ if (__x1 < __x2) /* did we get it? */ \
+ __x3 += GMP_HLIMB_BIT; /* yes, add it in the proper pos. */ \
\
- (w1) = __x3 + (__x1 >> (GMP_LIMB_BITS / 2)); \
- (w0) = (__x1 << (GMP_LIMB_BITS / 2)) + (__x0 & GMP_LLIMB_MASK); \
+ (w1) = __x3 + (__x1 >> (GMP_LIMB_BITS / 2)); \
+ (w0) = (__x1 << (GMP_LIMB_BITS / 2)) + (__x0 & GMP_LLIMB_MASK); \
+ } \
} while (0)
#define gmp_udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
@@ -264,7 +297,7 @@
}
static void *
-gmp_default_realloc (void *old, size_t old_size, size_t new_size)
+gmp_default_realloc (void *old, size_t unused_old_size, size_t new_size)
{
void * p;
@@ -277,7 +310,7 @@
}
static void
-gmp_default_free (void *p, size_t size)
+gmp_default_free (void *p, size_t unused_size)
{
free (p);
}
@@ -576,6 +609,8 @@
{
assert (un >= vn);
assert (vn >= 1);
+ assert (!GMP_MPN_OVERLAP_P(rp, un + vn, up, un));
+ assert (!GMP_MPN_OVERLAP_P(rp, un + vn, vp, vn));
/* We first multiply by the low order limb. This result can be
stored, not added, to rp. We also avoid a loop for zeroing this
@@ -735,81 +770,83 @@
mp_limb_t
mpn_invert_3by2 (mp_limb_t u1, mp_limb_t u0)
{
- mp_limb_t r, p, m, ql;
- unsigned ul, uh, qh;
+ mp_limb_t r, m;
- assert (u1 >= GMP_LIMB_HIGHBIT);
+ {
+ mp_limb_t p, ql;
+ unsigned ul, uh, qh;
- /* For notation, let b denote the half-limb base, so that B = b^2.
- Split u1 = b uh + ul. */
- ul = u1 & GMP_LLIMB_MASK;
- uh = u1 >> (GMP_LIMB_BITS / 2);
+ /* For notation, let b denote the half-limb base, so that B = b^2.
+ Split u1 = b uh + ul. */
+ ul = u1 & GMP_LLIMB_MASK;
+ uh = u1 >> (GMP_LIMB_BITS / 2);
- /* Approximation of the high half of quotient. Differs from the 2/1
- inverse of the half limb uh, since we have already subtracted
- u0. */
- qh = ~u1 / uh;
+ /* Approximation of the high half of quotient. Differs from the 2/1
+ inverse of the half limb uh, since we have already subtracted
+ u0. */
+ qh = (u1 ^ GMP_LIMB_MAX) / uh;
- /* Adjust to get a half-limb 3/2 inverse, i.e., we want
+ /* Adjust to get a half-limb 3/2 inverse, i.e., we want
- qh' = floor( (b^3 - 1) / u) - b = floor ((b^3 - b u - 1) / u
- = floor( (b (~u) + b-1) / u),
+ qh' = floor( (b^3 - 1) / u) - b = floor ((b^3 - b u - 1) / u
+ = floor( (b (~u) + b-1) / u),
+
+ and the remainder
- and the remainder
-
- r = b (~u) + b-1 - qh (b uh + ul)
+ r = b (~u) + b-1 - qh (b uh + ul)
= b (~u - qh uh) + b-1 - qh ul
- Subtraction of qh ul may underflow, which implies adjustments.
- But by normalization, 2 u >= B > qh ul, so we need to adjust by
- at most 2.
- */
+ Subtraction of qh ul may underflow, which implies adjustments.
+ But by normalization, 2 u >= B > qh ul, so we need to adjust by
+ at most 2.
+ */
- r = ((~u1 - (mp_limb_t) qh * uh) << (GMP_LIMB_BITS / 2)) | GMP_LLIMB_MASK;
+ r = ((~u1 - (mp_limb_t) qh * uh) << (GMP_LIMB_BITS / 2)) | GMP_LLIMB_MASK;
- p = (mp_limb_t) qh * ul;
- /* Adjustment steps taken from udiv_qrnnd_c */
- if (r < p)
- {
- qh--;
- r += u1;
- if (r >= u1) /* i.e. we didn't get carry when adding to r */
- if (r < p)
- {
- qh--;
- r += u1;
- }
- }
- r -= p;
+ p = (mp_limb_t) qh * ul;
+ /* Adjustment steps taken from udiv_qrnnd_c */
+ if (r < p)
+ {
+ qh--;
+ r += u1;
+ if (r >= u1) /* i.e. we didn't get carry when adding to r */
+ if (r < p)
+ {
+ qh--;
+ r += u1;
+ }
+ }
+ r -= p;
- /* Low half of the quotient is
+ /* Low half of the quotient is
ql = floor ( (b r + b-1) / u1).
- This is a 3/2 division (on half-limbs), for which qh is a
- suitable inverse. */
+ This is a 3/2 division (on half-limbs), for which qh is a
+ suitable inverse. */
- p = (r >> (GMP_LIMB_BITS / 2)) * qh + r;
- /* Unlike full-limb 3/2, we can add 1 without overflow. For this to
- work, it is essential that ql is a full mp_limb_t. */
- ql = (p >> (GMP_LIMB_BITS / 2)) + 1;
+ p = (r >> (GMP_LIMB_BITS / 2)) * qh + r;
+ /* Unlike full-limb 3/2, we can add 1 without overflow. For this to
+ work, it is essential that ql is a full mp_limb_t. */
+ ql = (p >> (GMP_LIMB_BITS / 2)) + 1;
- /* By the 3/2 trick, we don't need the high half limb. */
- r = (r << (GMP_LIMB_BITS / 2)) + GMP_LLIMB_MASK - ql * u1;
+ /* By the 3/2 trick, we don't need the high half limb. */
+ r = (r << (GMP_LIMB_BITS / 2)) + GMP_LLIMB_MASK - ql * u1;
- if (r >= (p << (GMP_LIMB_BITS / 2)))
- {
- ql--;
- r += u1;
- }
- m = ((mp_limb_t) qh << (GMP_LIMB_BITS / 2)) + ql;
- if (r >= u1)
- {
- m++;
- r -= u1;
- }
+ if (r >= (GMP_LIMB_MAX & (p << (GMP_LIMB_BITS / 2))))
+ {
+ ql--;
+ r += u1;
+ }
+ m = ((mp_limb_t) qh << (GMP_LIMB_BITS / 2)) + ql;
+ if (r >= u1)
+ {
+ m++;
+ r -= u1;
+ }
+ }
- /* Now m is the 2/1 invers of u1. If u0 > 0, adjust it to become a
+ /* Now m is the 2/1 inverse of u1. If u0 > 0, adjust it to become a
3/2 inverse. */
if (u0 > 0)
{
@@ -922,7 +959,8 @@
if (inv->shift > 0)
{
- tp = gmp_xalloc_limbs (nn);
+ /* Shift, reusing qp area if possible. In-place shift if qp == np. */
+ tp = qp ? qp : gmp_xalloc_limbs (nn);
r = mpn_lshift (tp, np, nn, inv->shift);
np = tp;
}
@@ -939,50 +977,19 @@
if (qp)
qp[nn] = q;
}
- if (inv->shift > 0)
+ if ((inv->shift > 0) && (tp != qp))
gmp_free (tp);
return r >> inv->shift;
}
-static mp_limb_t
-mpn_div_qr_1 (mp_ptr qp, mp_srcptr np, mp_size_t nn, mp_limb_t d)
-{
- assert (d > 0);
-
- /* Special case for powers of two. */
- if ((d & (d-1)) == 0)
- {
- mp_limb_t r = np[0] & (d-1);
- if (qp)
- {
- if (d <= 1)
- mpn_copyi (qp, np, nn);
- else
- {
- unsigned shift;
- gmp_ctz (shift, d);
- mpn_rshift (qp, np, nn, shift);
- }
- }
- return r;
- }
- else
- {
- struct gmp_div_inverse inv;
- mpn_div_qr_1_invert (&inv, d);
- return mpn_div_qr_1_preinv (qp, np, nn, &inv);
- }
-}
-
static void
-mpn_div_qr_2_preinv (mp_ptr qp, mp_ptr rp, mp_srcptr np, mp_size_t nn,
+mpn_div_qr_2_preinv (mp_ptr qp, mp_ptr np, mp_size_t nn,
const struct gmp_div_inverse *inv)
{
unsigned shift;
mp_size_t i;
mp_limb_t d1, d0, di, r1, r0;
- mp_ptr tp;
assert (nn >= 2);
shift = inv->shift;
@@ -991,11 +998,7 @@
di = inv->di;
if (shift > 0)
- {
- tp = gmp_xalloc_limbs (nn);
- r1 = mpn_lshift (tp, np, nn, shift);
- np = tp;
- }
+ r1 = mpn_lshift (np, np, nn, shift);
else
r1 = 0;
@@ -1015,31 +1018,16 @@
if (shift > 0)
{
- assert ((r0 << (GMP_LIMB_BITS - shift)) == 0);
+ assert ((r0 & (GMP_LIMB_MAX >> (GMP_LIMB_BITS - shift))) == 0);
r0 = (r0 >> shift) | (r1 << (GMP_LIMB_BITS - shift));
r1 >>= shift;
-
- gmp_free (tp);
}
- rp[1] = r1;
- rp[0] = r0;
+ np[1] = r1;
+ np[0] = r0;
}
-#if 0
static void
-mpn_div_qr_2 (mp_ptr qp, mp_ptr rp, mp_srcptr np, mp_size_t nn,
- mp_limb_t d1, mp_limb_t d0)
-{
- struct gmp_div_inverse inv;
- assert (nn >= 2);
-
- mpn_div_qr_2_invert (&inv, d1, d0);
- mpn_div_qr_2_preinv (qp, rp, np, nn, &inv);
-}
-#endif
-
-static void
mpn_div_qr_pi1 (mp_ptr qp,
mp_ptr np, mp_size_t nn, mp_limb_t n1,
mp_srcptr dp, mp_size_t dn,
@@ -1113,7 +1101,7 @@
if (dn == 1)
np[0] = mpn_div_qr_1_preinv (qp, np, nn, inv);
else if (dn == 2)
- mpn_div_qr_2_preinv (qp, np, np, nn, inv);
+ mpn_div_qr_2_preinv (qp, np, nn, inv);
else
{
mp_limb_t nh;
@@ -1253,7 +1241,7 @@
l = w << binv->shift;
gmp_udiv_qrnnd_preinv (w, r, h, l, binv->d1, binv->di);
- assert ( (r << (GMP_LIMB_BITS - binv->shift)) == 0);
+ assert ((r & (GMP_LIMB_MAX >> (GMP_LIMB_BITS - binv->shift))) == 0);
r >>= binv->shift;
sp[i] = r;
@@ -1421,7 +1409,7 @@
void
mpz_init (mpz_t r)
{
- static const mp_limb_t dummy_limb = 0xc1a0;
+ static const mp_limb_t dummy_limb = GMP_LIMB_MAX & 0xc1a0;
r->_mp_alloc = 0;
r->_mp_size = 0;
@@ -1479,6 +1467,12 @@
if (x >= 0)
mpz_set_ui (r, x);
else /* (x < 0) */
+ if (GMP_LIMB_BITS < GMP_ULONG_BITS)
+ {
+ mpz_set_ui (r, GMP_NEG_CAST (unsigned long int, x));
+ mpz_neg (r, r);
+ }
+ else
{
r->_mp_size = -1;
MPZ_REALLOC (r, 1)[0] = GMP_NEG_CAST (unsigned long int, x);
@@ -1492,6 +1486,15 @@
{
r->_mp_size = 1;
MPZ_REALLOC (r, 1)[0] = x;
+ if (GMP_LIMB_BITS < GMP_ULONG_BITS)
+ {
+ int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;
+ while (x >>= LOCAL_GMP_LIMB_BITS)
+ {
+ ++ r->_mp_size;
+ MPZ_REALLOC (r, r->_mp_size)[r->_mp_size - 1] = x;
+ }
+ }
}
else
r->_mp_size = 0;
@@ -1538,14 +1541,20 @@
int
mpz_fits_slong_p (const mpz_t u)
{
- mp_size_t us = u->_mp_size;
+ return (LONG_MAX + LONG_MIN == 0 || mpz_cmp_ui (u, LONG_MAX) <= 0) &&
+ mpz_cmpabs_ui (u, GMP_NEG_CAST (unsigned long int, LONG_MIN)) <= 0;
+}
- if (us == 1)
- return u->_mp_d[0] < GMP_LIMB_HIGHBIT;
- else if (us == -1)
- return u->_mp_d[0] <= GMP_LIMB_HIGHBIT;
- else
- return (us == 0);
+static int
+mpn_absfits_ulong_p (mp_srcptr up, mp_size_t un)
+{
+ int ulongsize = GMP_ULONG_BITS / GMP_LIMB_BITS;
+ mp_limb_t ulongrem = 0;
+
+ if (GMP_ULONG_BITS % GMP_LIMB_BITS != 0)
+ ulongrem = (mp_limb_t) (ULONG_MAX >> GMP_LIMB_BITS * ulongsize) + 1;
+
+ return un <= ulongsize || (up[ulongsize] < ulongrem && un == ulongsize + 1);
}
int
@@ -1553,22 +1562,36 @@
{
mp_size_t us = u->_mp_size;
- return (us == (us > 0));
+ return us >= 0 && mpn_absfits_ulong_p (u->_mp_d, us);
}
long int
mpz_get_si (const mpz_t u)
{
+ unsigned long r = mpz_get_ui (u);
+ unsigned long c = -LONG_MAX - LONG_MIN;
+
if (u->_mp_size < 0)
- /* This expression is necessary to properly handle 0x80000000 */
- return -1 - (long) ((u->_mp_d[0] - 1) & ~GMP_LIMB_HIGHBIT);
+ /* This expression is necessary to properly handle -LONG_MIN */
+ return -(long) c - (long) ((r - c) & LONG_MAX);
else
- return (long) (mpz_get_ui (u) & ~GMP_LIMB_HIGHBIT);
+ return (long) (r & LONG_MAX);
}
unsigned long int
mpz_get_ui (const mpz_t u)
{
+ if (GMP_LIMB_BITS < GMP_ULONG_BITS)
+ {
+ int LOCAL_GMP_LIMB_BITS = GMP_LIMB_BITS;
+ unsigned long r = 0;
+ mp_size_t n = GMP_ABS (u->_mp_size);
+ n = GMP_MIN (n, 1 + (mp_size_t) (GMP_ULONG_BITS - 1) / GMP_LIMB_BITS);
+ while (--n >= 0)
+ r = (r << LOCAL_GMP_LIMB_BITS) + u->_mp_d[n];
+ return r;
+ }
+
return u->_mp_size == 0 ? 0 : u->_mp_d[0];
}
@@ -1620,11 +1643,19 @@
x->_mp_size = xs < 0 ? -xn : xn;
}
+static mpz_srcptr
+mpz_roinit_normal_n (mpz_t x, mp_srcptr xp, mp_size_t xs)
+{
+ x->_mp_alloc = 0;
+ x->_mp_d = (mp_ptr) xp;
+ x->_mp_size = xs;
+ return x;
+}
+
mpz_srcptr
mpz_roinit_n (mpz_t x, mp_srcptr xp, mp_size_t xs)
{
- x->_mp_alloc = 0;
- x->_mp_d = (mp_ptr) xp;
+ mpz_roinit_normal_n (x, xp, xs);
mpz_limbs_finish (x, xs);
return x;
}
@@ -1658,7 +1689,7 @@
r->_mp_size = 0;
return;
}
- B = 2.0 * (double) GMP_LIMB_HIGHBIT;
+ B = 4.0 * (double) (GMP_LIMB_HIGHBIT >> 1);
Bi = 1.0 / B;
for (rn = 1; x >= B; rn++)
x *= Bi;
@@ -1692,9 +1723,11 @@
double
mpz_get_d (const mpz_t u)
{
+ int m;
+ mp_limb_t l;
mp_size_t un;
double x;
- double B = 2.0 * (double) GMP_LIMB_HIGHBIT;
+ double B = 4.0 * (double) (GMP_LIMB_HIGHBIT >> 1);
un = GMP_ABS (u->_mp_size);
@@ -1701,10 +1734,24 @@
if (un == 0)
return 0.0;
- x = u->_mp_d[--un];
- while (un > 0)
- x = B*x + u->_mp_d[--un];
+ l = u->_mp_d[--un];
+ gmp_clz (m, l);
+ m = m + GMP_DBL_MANT_BITS - GMP_LIMB_BITS;
+ if (m < 0)
+ l &= GMP_LIMB_MAX << -m;
+ for (x = l; --un >= 0;)
+ {
+ x = B*x;
+ if (m > 0) {
+ l = u->_mp_d[un];
+ m -= GMP_LIMB_BITS;
+ if (m < 0)
+ l &= GMP_LIMB_MAX << -m;
+ x += l;
+ }
+ }
+
if (u->_mp_size < 0)
x = -x;
@@ -1725,7 +1772,7 @@
{
xn = GMP_ABS (xn);
- B = 2.0 * (double) GMP_LIMB_HIGHBIT;
+ B = 4.0 * (double) (GMP_LIMB_HIGHBIT >> 1);
Bi = 1.0 / B;
/* Scale d so it can be compared with the top limb. */
@@ -1784,14 +1831,12 @@
{
mp_size_t usize = u->_mp_size;
- if (usize < -1)
- return -1;
- else if (v >= 0)
+ if (v >= 0)
return mpz_cmp_ui (u, v);
else if (usize >= 0)
return 1;
- else /* usize == -1 */
- return GMP_CMP (GMP_NEG_CAST (mp_limb_t, v), u->_mp_d[0]);
+ else
+ return - mpz_cmpabs_ui (u, GMP_NEG_CAST (unsigned long int, v));
}
int
@@ -1799,12 +1844,10 @@
{
mp_size_t usize = u->_mp_size;
- if (usize > 1)
- return 1;
- else if (usize < 0)
+ if (usize < 0)
return -1;
else
- return GMP_CMP (mpz_get_ui (u), v);
+ return mpz_cmpabs_ui (u, v);
}
int
@@ -1824,10 +1867,15 @@
int
mpz_cmpabs_ui (const mpz_t u, unsigned long v)
{
- if (GMP_ABS (u->_mp_size) > 1)
+ mp_size_t un = GMP_ABS (u->_mp_size);
+
+ if (! mpn_absfits_ulong_p (u->_mp_d, un))
return 1;
else
- return GMP_CMP (mpz_get_ui (u), v);
+ {
+ unsigned long uu = mpz_get_ui (u);
+ return GMP_CMP(uu, v);
+ }
}
int
@@ -1862,81 +1910,28 @@
/* MPZ addition and subtraction */
-/* Adds to the absolute value. Returns new size, but doesn't store it. */
-static mp_size_t
-mpz_abs_add_ui (mpz_t r, const mpz_t a, unsigned long b)
-{
- mp_size_t an;
- mp_ptr rp;
- mp_limb_t cy;
- an = GMP_ABS (a->_mp_size);
- if (an == 0)
- {
- MPZ_REALLOC (r, 1)[0] = b;
- return b > 0;
- }
-
- rp = MPZ_REALLOC (r, an + 1);
-
- cy = mpn_add_1 (rp, a->_mp_d, an, b);
- rp[an] = cy;
- an += cy;
-
- return an;
-}
-
-/* Subtract from the absolute value. Returns new size, (or -1 on underflow),
- but doesn't store it. */
-static mp_size_t
-mpz_abs_sub_ui (mpz_t r, const mpz_t a, unsigned long b)
-{
- mp_size_t an = GMP_ABS (a->_mp_size);
- mp_ptr rp;
-
- if (an == 0)
- {
- MPZ_REALLOC (r, 1)[0] = b;
- return -(b > 0);
- }
- rp = MPZ_REALLOC (r, an);
- if (an == 1 && a->_mp_d[0] < b)
- {
- rp[0] = b - a->_mp_d[0];
- return -1;
- }
- else
- {
- gmp_assert_nocarry (mpn_sub_1 (rp, a->_mp_d, an, b));
- return mpn_normalized_size (rp, an);
- }
-}
-
void
mpz_add_ui (mpz_t r, const mpz_t a, unsigned long b)
{
- if (a->_mp_size >= 0)
- r->_mp_size = mpz_abs_add_ui (r, a, b);
- else
- r->_mp_size = -mpz_abs_sub_ui (r, a, b);
+ mpz_t bb;
+ mpz_init_set_ui (bb, b);
+ mpz_add (r, a, bb);
+ mpz_clear (bb);
}
void
mpz_sub_ui (mpz_t r, const mpz_t a, unsigned long b)
{
- if (a->_mp_size < 0)
- r->_mp_size = -mpz_abs_add_ui (r, a, b);
- else
- r->_mp_size = mpz_abs_sub_ui (r, a, b);
+ mpz_ui_sub (r, b, a);
+ mpz_neg (r, r);
}
void
mpz_ui_sub (mpz_t r, unsigned long a, const mpz_t b)
{
- if (b->_mp_size < 0)
- r->_mp_size = mpz_abs_add_ui (r, b, a);
- else
- r->_mp_size = -mpz_abs_sub_ui (r, b, a);
+ mpz_neg (r, b);
+ mpz_add_ui (r, r, a);
}
static mp_size_t
@@ -2023,32 +2018,17 @@
mpz_neg (r, r);
}
else
- mpz_mul_ui (r, u, (unsigned long int) v);
+ mpz_mul_ui (r, u, v);
}
void
mpz_mul_ui (mpz_t r, const mpz_t u, unsigned long int v)
{
- mp_size_t un, us;
- mp_ptr tp;
- mp_limb_t cy;
-
- us = u->_mp_size;
-
- if (us == 0 || v == 0)
- {
- r->_mp_size = 0;
- return;
- }
-
- un = GMP_ABS (us);
-
- tp = MPZ_REALLOC (r, un + 1);
- cy = mpn_mul_1 (tp, u->_mp_d, un, v);
- tp[un] = cy;
-
- un += (cy > 0);
- r->_mp_size = (us < 0) ? - un : un;
+ mpz_t vv;
+ mpz_init_set_ui (vv, v);
+ mpz_mul (r, u, vv);
+ mpz_clear (vv);
+ return;
}
void
@@ -2127,8 +2107,8 @@
mpz_addmul_ui (mpz_t r, const mpz_t u, unsigned long int v)
{
mpz_t t;
- mpz_init (t);
- mpz_mul_ui (t, u, v);
+ mpz_init_set_ui (t, v);
+ mpz_mul (t, u, t);
mpz_add (r, r, t);
mpz_clear (t);
}
@@ -2137,8 +2117,8 @@
mpz_submul_ui (mpz_t r, const mpz_t u, unsigned long int v)
{
mpz_t t;
- mpz_init (t);
- mpz_mul_ui (t, u, v);
+ mpz_init_set_ui (t, v);
+ mpz_mul (t, u, t);
mpz_sub (r, r, t);
mpz_clear (t);
}
@@ -2534,56 +2514,20 @@
mpz_div_qr_ui (mpz_t q, mpz_t r,
const mpz_t n, unsigned long d, enum mpz_div_round_mode mode)
{
- mp_size_t ns, qn;
- mp_ptr qp;
- mp_limb_t rl;
- mp_size_t rs;
+ unsigned long ret;
+ mpz_t rr, dd;
- ns = n->_mp_size;
- if (ns == 0)
- {
- if (q)
- q->_mp_size = 0;
- if (r)
- r->_mp_size = 0;
- return 0;
- }
+ mpz_init (rr);
+ mpz_init_set_ui (dd, d);
+ mpz_div_qr (q, rr, n, dd, mode);
+ mpz_clear (dd);
+ ret = mpz_get_ui (rr);
- qn = GMP_ABS (ns);
- if (q)
- qp = MPZ_REALLOC (q, qn);
- else
- qp = NULL;
-
- rl = mpn_div_qr_1 (qp, n->_mp_d, qn, d);
- assert (rl < d);
-
- rs = rl > 0;
- rs = (ns < 0) ? -rs : rs;
-
- if (rl > 0 && ( (mode == GMP_DIV_FLOOR && ns < 0)
- || (mode == GMP_DIV_CEIL && ns >= 0)))
- {
- if (q)
- gmp_assert_nocarry (mpn_add_1 (qp, qp, qn, 1));
- rl = d - rl;
- rs = -rs;
- }
-
if (r)
- {
- MPZ_REALLOC (r, 1)[0] = rl;
- r->_mp_size = rs;
- }
- if (q)
- {
- qn -= (qp[qn-1] == 0);
- assert (qn == 0 || qp[qn-1] > 0);
+ mpz_swap (r, rr);
+ mpz_clear (rr);
- q->_mp_size = (ns < 0) ? - qn : qn;
- }
-
- return rl;
+ return ret;
}
unsigned long
@@ -2722,22 +2666,16 @@
unsigned long
mpz_gcd_ui (mpz_t g, const mpz_t u, unsigned long v)
{
- mp_size_t un;
+ mpz_t t;
+ mpz_init_set_ui(t, v);
+ mpz_gcd (t, u, t);
+ if (v > 0)
+ v = mpz_get_ui (t);
- if (v == 0)
- {
- if (g)
- mpz_abs (g, u);
- }
- else
- {
- un = GMP_ABS (u->_mp_size);
- if (un != 0)
- v = mpn_gcd_11 (mpn_div_qr_1 (NULL, u->_mp_d, un, v), v);
+ if (g)
+ mpz_swap (t, g);
- if (g)
- mpz_set_ui (g, v);
- }
+ mpz_clear (t);
return v;
}
@@ -2831,7 +2769,7 @@
signed long sign = mpz_sgn (v);
mpz_abs (g, v);
if (s)
- mpz_set_ui (s, 0);
+ s->_mp_size = 0;
if (t)
mpz_set_si (t, sign);
return;
@@ -2845,7 +2783,7 @@
if (s)
mpz_set_si (s, sign);
if (t)
- mpz_set_ui (t, 0);
+ t->_mp_size = 0;
return;
}
@@ -2970,8 +2908,9 @@
mpz_sub (s0, s0, s1);
mpz_add (t0, t0, t1);
}
- mpz_divexact_ui (s0, s0, 2);
- mpz_divexact_ui (t0, t0, 2);
+ assert (mpz_even_p (t0) && mpz_even_p (s0));
+ mpz_tdiv_q_2exp (s0, s0, 1);
+ mpz_tdiv_q_2exp (t0, t0, 1);
}
/* Arrange so that |s| < |u| / 2g */
@@ -3096,7 +3035,10 @@
mpz_ui_pow_ui (mpz_t r, unsigned long blimb, unsigned long e)
{
mpz_t b;
- mpz_pow_ui (r, mpz_roinit_n (b, &blimb, 1), e);
+
+ mpz_init_set_ui (b, blimb);
+ mpz_pow_ui (r, b, e);
+ mpz_clear (b);
}
void
@@ -3208,7 +3150,10 @@
mpz_powm_ui (mpz_t r, const mpz_t b, unsigned long elimb, const mpz_t m)
{
mpz_t e;
- mpz_powm (r, b, mpz_roinit_n (e, &elimb, 1), m);
+
+ mpz_init_set_ui (e, elimb);
+ mpz_powm (r, b, e, m);
+ mpz_clear (e);
}
/* x=trunc(y^(1/z)), r=y-x^z */
@@ -3315,7 +3260,7 @@
assert (n > 0);
assert (p [n-1] != 0);
- return mpz_root (NULL, mpz_roinit_n (t, p, n), 2);
+ return mpz_root (NULL, mpz_roinit_normal_n (t, p, n), 2);
}
mp_size_t
@@ -3329,7 +3274,7 @@
mpz_init (r);
mpz_init (s);
- mpz_rootrem (s, r, mpz_roinit_n (u, p, n), 2);
+ mpz_rootrem (s, r, mpz_roinit_normal_n (u, p, n), 2);
assert (s->_mp_size == (n+1)/2);
mpn_copyd (sp, s->_mp_d, s->_mp_size);
@@ -3344,14 +3289,27 @@
/* Combinatorics */
void
-mpz_fac_ui (mpz_t x, unsigned long n)
+mpz_mfac_uiui (mpz_t x, unsigned long n, unsigned long m)
{
mpz_set_ui (x, n + (n == 0));
- while (n > 2)
- mpz_mul_ui (x, x, --n);
+ if (m + 1 < 2) return;
+ while (n > m + 1)
+ mpz_mul_ui (x, x, n -= m);
}
void
+mpz_2fac_ui (mpz_t x, unsigned long n)
+{
+ mpz_mfac_uiui (x, n, 2);
+}
+
+void
+mpz_fac_ui (mpz_t x, unsigned long n)
+{
+ mpz_mfac_uiui (x, n, 1);
+}
+
+void
mpz_bin_uiui (mpz_t r, unsigned long n, unsigned long k)
{
mpz_t t;
@@ -3364,8 +3322,8 @@
mpz_init (t);
mpz_fac_ui (t, k);
- for (; k > 0; k--)
- mpz_mul_ui (r, r, n--);
+ for (; k > 0; --k)
+ mpz_mul_ui (r, r, n--);
mpz_divexact (r, r, t);
mpz_clear (t);
@@ -3373,7 +3331,178 @@
/* Primality testing */
+
+/* Computes Kronecker (a/b) with odd b, a!=0 and GCD(a,b) = 1 */
+/* Adapted from JACOBI_BASE_METHOD==4 in mpn/generic/jacbase.c */
static int
+gmp_jacobi_coprime (mp_limb_t a, mp_limb_t b)
+{
+ int c, bit = 0;
+
+ assert (b & 1);
+ assert (a != 0);
+ /* assert (mpn_gcd_11 (a, b) == 1); */
+
+ /* Below, we represent a and b shifted right so that the least
+ significant one bit is implicit. */
+ b >>= 1;
+
+ gmp_ctz(c, a);
+ a >>= 1;
+
+ do
+ {
+ a >>= c;
+ /* (2/b) = -1 if b = 3 or 5 mod 8 */
+ bit ^= c & (b ^ (b >> 1));
+ if (a < b)
+ {
+ bit ^= a & b;
+ a = b - a;
+ b -= a;
+ }
+ else
+ {
+ a -= b;
+ assert (a != 0);
+ }
+
+ gmp_ctz(c, a);
+ ++c;
+ }
+ while (b > 0);
+
+ return bit & 1 ? -1 : 1;
+}
+
+static void
+gmp_lucas_step_k_2k (mpz_t V, mpz_t Qk, const mpz_t n)
+{
+ mpz_mod (Qk, Qk, n);
+ /* V_{2k} <- V_k ^ 2 - 2Q^k */
+ mpz_mul (V, V, V);
+ mpz_submul_ui (V, Qk, 2);
+ mpz_tdiv_r (V, V, n);
+ /* Q^{2k} = (Q^k)^2 */
+ mpz_mul (Qk, Qk, Qk);
+}
+
+/* Computes V_k, Q^k (mod n) for the Lucas' sequence */
+/* with P=1, Q=Q; k = (n>>b0)|1. */
+/* Requires an odd n > 4; b0 > 0; -2*Q must not overflow a long */
+/* Returns (U_k == 0) and sets V=V_k and Qk=Q^k. */
+static int
+gmp_lucas_mod (mpz_t V, mpz_t Qk, long Q,
+ mp_bitcnt_t b0, const mpz_t n)
+{
+ mp_bitcnt_t bs;
+ mpz_t U;
+ int res;
+
+ assert (b0 > 0);
+ assert (Q <= - (LONG_MIN / 2));
+ assert (Q >= - (LONG_MAX / 2));
+ assert (mpz_cmp_ui (n, 4) > 0);
+ assert (mpz_odd_p (n));
+
+ mpz_init_set_ui (U, 1); /* U1 = 1 */
+ mpz_set_ui (V, 1); /* V1 = 1 */
+ mpz_set_si (Qk, Q);
+
+ for (bs = mpz_sizeinbase (n, 2) - 1; --bs >= b0;)
+ {
+ /* U_{2k} <- U_k * V_k */
+ mpz_mul (U, U, V);
+ /* V_{2k} <- V_k ^ 2 - 2Q^k */
+ /* Q^{2k} = (Q^k)^2 */
+ gmp_lucas_step_k_2k (V, Qk, n);
+
+ /* A step k->k+1 is performed if the bit in $n$ is 1 */
+ /* mpz_tstbit(n,bs) or the the bit is 0 in $n$ but */
+ /* should be 1 in $n+1$ (bs == b0) */
+ if (b0 == bs || mpz_tstbit (n, bs))
+ {
+ /* Q^{k+1} <- Q^k * Q */
+ mpz_mul_si (Qk, Qk, Q);
+ /* U_{k+1} <- (U_k + V_k) / 2 */
+ mpz_swap (U, V); /* Keep in V the old value of U_k */
+ mpz_add (U, U, V);
+ /* We have to compute U/2, so we need an even value, */
+ /* equivalent (mod n) */
+ if (mpz_odd_p (U))
+ mpz_add (U, U, n);
+ mpz_tdiv_q_2exp (U, U, 1);
+ /* V_{k+1} <-(D*U_k + V_k) / 2 =
+ U_{k+1} + (D-1)/2*U_k = U_{k+1} - 2Q*U_k */
+ mpz_mul_si (V, V, -2*Q);
+ mpz_add (V, U, V);
+ mpz_tdiv_r (V, V, n);
+ }
+ mpz_tdiv_r (U, U, n);
+ }
+
+ res = U->_mp_size == 0;
+ mpz_clear (U);
+ return res;
+}
+
+/* Performs strong Lucas' test on x, with parameters suggested */
+/* for the BPSW test. Qk is only passed to recycle a variable. */
+/* Requires GCD (x,6) = 1.*/
+static int
+gmp_stronglucas (const mpz_t x, mpz_t Qk)
+{
+ mp_bitcnt_t b0;
+ mpz_t V, n;
+ mp_limb_t maxD, D; /* The absolute value is stored. */
+ long Q;
+ mp_limb_t tl;
+
+ /* Test on the absolute value. */
+ mpz_roinit_normal_n (n, x->_mp_d, GMP_ABS (x->_mp_size));
+
+ assert (mpz_odd_p (n));
+ /* assert (mpz_gcd_ui (NULL, n, 6) == 1); */
+ if (mpz_root (Qk, n, 2))
+ return 0; /* A square is composite. */
+
+ /* Check Ds up to square root (in case, n is prime)
+ or avoid overflows */
+ maxD = (Qk->_mp_size == 1) ? Qk->_mp_d [0] - 1 : GMP_LIMB_MAX;
+
+ D = 3;
+ /* Search a D such that (D/n) = -1 in the sequence 5,-7,9,-11,.. */
+ /* For those Ds we have (D/n) = (n/|D|) */
+ do
+ {
+ if (D >= maxD)
+ return 1 + (D != GMP_LIMB_MAX); /* (1 + ! ~ D) */
+ D += 2;
+ tl = mpz_tdiv_ui (n, D);
+ if (tl == 0)
+ return 0;
+ }
+ while (gmp_jacobi_coprime (tl, D) == 1);
+
+ mpz_init (V);
+
+ /* n-(D/n) = n+1 = d*2^{b0}, with d = (n>>b0) | 1 */
+ b0 = mpz_scan0 (n, 0);
+
+ /* D= P^2 - 4Q; P = 1; Q = (1-D)/4 */
+ Q = (D & 2) ? (long) (D >> 2) + 1 : -(long) (D >> 2);
+
+ if (! gmp_lucas_mod (V, Qk, Q, b0, n)) /* If Ud != 0 */
+ while (V->_mp_size != 0 && --b0 != 0) /* while Vk != 0 */
+ /* V <- V ^ 2 - 2Q^k */
+ /* Q^{2k} = (Q^k)^2 */
+ gmp_lucas_step_k_2k (V, Qk, n);
+
+ mpz_clear (V);
+ return (b0 != 0);
+}
+
+static int
gmp_millerrabin (const mpz_t n, const mpz_t nm1, mpz_t y,
const mpz_t q, mp_bitcnt_t k)
{
@@ -3434,21 +3563,26 @@
if (mpz_cmpabs_ui (n, 31*31) < 0)
return 2;
- /* Use Miller-Rabin, with a deterministic sequence of bases, a[j] =
- j^2 + j + 41 using Euler's polynomial. We potentially stop early,
- if a[j] >= n - 1. Since n >= 31*31, this can happen only if reps >
- 30 (a[30] == 971 > 31*31 == 961). */
-
mpz_init (nm1);
mpz_init (q);
- mpz_init (y);
/* Find q and k, where q is odd and n = 1 + 2**k * q. */
- nm1->_mp_size = mpz_abs_sub_ui (nm1, n, 1);
+ mpz_abs (nm1, n);
+ nm1->_mp_d[0] -= 1;
k = mpz_scan1 (nm1, 0);
mpz_tdiv_q_2exp (q, nm1, k);
- for (j = 0, is_prime = 1; is_prime & (j < reps); j++)
+ /* BPSW test */
+ mpz_init_set_ui (y, 2);
+ is_prime = gmp_millerrabin (n, nm1, y, q, k) && gmp_stronglucas (n, y);
+ reps -= 24; /* skip the first 24 repetitions */
+
+ /* Use Miller-Rabin, with a deterministic sequence of bases, a[j] =
+ j^2 + j + 41 using Euler's polynomial. We potentially stop early,
+ if a[j] >= n - 1. Since n >= 31*31, this can happen only if reps >
+ 30 (a[30] == 971 > 31*31 == 961). */
+
+ for (j = 0; is_prime & (j < reps); j++)
{
mpz_set_ui (y, (unsigned long) j*j+j+41);
if (mpz_cmp (y, nm1) >= 0)
@@ -3516,7 +3650,7 @@
{
/* d < 0. Check if any of the bits below is set: If so, our bit
must be complemented. */
- if (shift > 0 && (w << (GMP_LIMB_BITS - shift)) > 0)
+ if (shift > 0 && (mp_limb_t) (w << (GMP_LIMB_BITS - shift)) > 0)
return bit ^ 1;
while (--limb_index >= 0)
if (d->_mp_d[limb_index] > 0)
@@ -3623,8 +3757,8 @@
void
mpz_com (mpz_t r, const mpz_t u)
{
- mpz_neg (r, u);
- mpz_sub_ui (r, r, 1);
+ mpz_add_ui (r, u, 1);
+ mpz_neg (r, r);
}
void
@@ -3847,13 +3981,18 @@
unsigned c;
/* Do 16 bits at a time, to avoid limb-sized constants. */
- for (c = 0; x > 0; x >>= 16)
+ int LOCAL_SHIFT_BITS = 16;
+ for (c = 0; x > 0;)
{
- unsigned w = ((x >> 1) & 0x5555) + (x & 0x5555);
+ unsigned w = x - ((x >> 1) & 0x5555);
w = ((w >> 2) & 0x3333) + (w & 0x3333);
- w = ((w >> 4) & 0x0f0f) + (w & 0x0f0f);
- w = (w >> 8) + (w & 0x00ff);
+ w = (w >> 4) + w;
+ w = ((w >> 8) & 0x000f) + (w & 0x000f);
c += w;
+ if (GMP_LIMB_BITS > LOCAL_SHIFT_BITS)
+ x >>= LOCAL_SHIFT_BITS;
+ else
+ x = 0;
}
return c;
}
@@ -3964,7 +4103,7 @@
}
/* Mask to 0 all bits before starting_bit, thus ignoring them. */
- limb &= (GMP_LIMB_MAX << (starting_bit % GMP_LIMB_BITS));
+ limb &= GMP_LIMB_MAX << (starting_bit % GMP_LIMB_BITS);
}
return mpn_common_scan (limb, i, up, un, ux);
@@ -3994,7 +4133,7 @@
limb -= mpn_zero_p (up, i); /* limb = ~(~limb + zero_p) */
/* Mask all bits before starting_bit, thus ignoring them. */
- limb &= (GMP_LIMB_MAX << (starting_bit % GMP_LIMB_BITS));
+ limb &= GMP_LIMB_MAX << (starting_bit % GMP_LIMB_BITS);
return mpn_common_scan (limb, i, up, un, ux);
}
@@ -4013,7 +4152,7 @@
size_t ndigits;
assert (base >= 2);
- assert (base <= 36);
+ assert (base <= 62);
un = GMP_ABS (u->_mp_size);
if (un == 0)
@@ -4063,19 +4202,22 @@
mp_size_t un;
size_t i, sn;
- if (base >= 0)
+ digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ if (base > 1)
{
- digits = "0123456789abcdefghijklmnopqrstuvwxyz";
+ if (base <= 36)
+ digits = "0123456789abcdefghijklmnopqrstuvwxyz";
+ else if (base > 62)
+ return NULL;
}
+ else if (base >= -1)
+ base = 10;
else
{
base = -base;
- digits = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ if (base > 36)
+ return NULL;
}
- if (base <= 1)
- base = 10;
- if (base > 36)
- return NULL;
sn = 1 + mpz_sizeinbase (u, base);
if (!sp)
@@ -4123,7 +4265,7 @@
int
mpz_set_str (mpz_t r, const char *sp, int base)
{
- unsigned bits;
+ unsigned bits, value_of_a;
mp_size_t rn, alloc;
mp_ptr rp;
size_t dn;
@@ -4130,7 +4272,7 @@
int sign;
unsigned char *dp;
- assert (base == 0 || (base >= 2 && base <= 36));
+ assert (base == 0 || (base >= 2 && base <= 62));
while (isspace( (unsigned char) *sp))
sp++;
@@ -4166,6 +4308,7 @@
}
dp = (unsigned char *) gmp_xalloc (strlen (sp));
+ value_of_a = (base > 36) ? 36 : 10;
for (dn = 0; *sp; sp++)
{
unsigned digit;
@@ -4175,7 +4318,7 @@
else if (*sp >= '0' && *sp <= '9')
digit = *sp - '0';
else if (*sp >= 'a' && *sp <= 'z')
- digit = *sp - 'a' + 10;
+ digit = *sp - 'a' + value_of_a;
else if (*sp >= 'A' && *sp <= 'Z')
digit = *sp - 'A' + 10;
else
@@ -4356,10 +4499,15 @@
limb = u->_mp_d[un-1];
assert (limb != 0);
- k = 0;
- do {
- k++; limb >>= CHAR_BIT;
- } while (limb != 0);
+ k = (GMP_LIMB_BITS <= CHAR_BIT);
+ if (!k)
+ {
+ do {
+ int LOCAL_CHAR_BIT = CHAR_BIT;
+ k++; limb >>= LOCAL_CHAR_BIT;
+ } while (limb != 0);
+ }
+ /* else limb = 0; */
count = (k + (un-1) * sizeof (mp_limb_t) + size - 1) / size;
@@ -4388,17 +4536,28 @@
for (bytes = 0, i = 0, k = 0; k < count; k++, p += word_step)
{
size_t j;
- for (j = 0; j < size; j++, p -= (ptrdiff_t) endian)
+ for (j = 0; j < size; ++j, p -= (ptrdiff_t) endian)
{
- if (bytes == 0)
+ if (sizeof (mp_limb_t) == 1)
{
if (i < un)
- limb = u->_mp_d[i++];
- bytes = sizeof (mp_limb_t);
+ *p = u->_mp_d[i++];
+ else
+ *p = 0;
}
- *p = limb;
- limb >>= CHAR_BIT;
- bytes--;
+ else
+ {
+ int LOCAL_CHAR_BIT = CHAR_BIT;
+ if (bytes == 0)
+ {
+ if (i < un)
+ limb = u->_mp_d[i++];
+ bytes = sizeof (mp_limb_t);
+ }
+ *p = limb;
+ limb >>= LOCAL_CHAR_BIT;
+ bytes--;
+ }
}
}
assert (i == un);
Modified: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-gmp.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mini-gmp, a minimalistic implementation of a GNU GMP subset.
-Copyright 2011-2015 Free Software Foundation, Inc.
+Copyright 2011-2015, 2017, 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -53,7 +53,11 @@
void *(**) (void *, size_t, size_t),
void (**) (void *, size_t));
-typedef unsigned long mp_limb_t;
+#ifndef MINI_GMP_LIMB_TYPE
+#define MINI_GMP_LIMB_TYPE long
+#endif
+
+typedef unsigned MINI_GMP_LIMB_TYPE mp_limb_t;
typedef long mp_size_t;
typedef unsigned long mp_bitcnt_t;
@@ -217,6 +221,8 @@
int mpz_root (mpz_t, const mpz_t, unsigned long);
void mpz_fac_ui (mpz_t, unsigned long);
+void mpz_2fac_ui (mpz_t, unsigned long);
+void mpz_mfac_uiui (mpz_t, unsigned long, unsigned long);
void mpz_bin_uiui (mpz_t, unsigned long, unsigned long);
int mpz_probab_prime_p (const mpz_t, int);
Added: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,554 @@
+/* mini-mpq, a minimalistic implementation of a GNU GMP subset.
+
+ Contributed to the GNU project by Marco Bodrato
+
+ Acknowledgment: special thanks to Bradley Lucier for his comments
+ to the preliminary version of this code.
+
+Copyright 2018, 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include <assert.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "mini-mpq.h"
+
+#ifndef GMP_LIMB_HIGHBIT
+/* Define macros and static functions already defined by mini-gmp.c */
+#define GMP_LIMB_BITS (sizeof(mp_limb_t) * CHAR_BIT)
+#define GMP_LIMB_HIGHBIT ((mp_limb_t) 1 << (GMP_LIMB_BITS - 1))
+#define GMP_NEG_CAST(T,x) (-((T)((x) + 1) - 1))
+#define GMP_MIN(a, b) ((a) < (b) ? (a) : (b))
+
+static mpz_srcptr
+mpz_roinit_normal_n (mpz_t x, mp_srcptr xp, mp_size_t xs)
+{
+ x->_mp_alloc = 0;
+ x->_mp_d = (mp_ptr) xp;
+ x->_mp_size = xs;
+ return x;
+}
+
+static void
+gmp_die (const char *msg)
+{
+ fprintf (stderr, "%s\n", msg);
+ abort();
+}
+#endif
+
+
+/* MPQ helper functions */
+static mpq_srcptr
+mpq_roinit_normal_nn (mpq_t x, mp_srcptr np, mp_size_t ns,
+ mp_srcptr dp, mp_size_t ds)
+{
+ mpz_roinit_normal_n (mpq_numref(x), np, ns);
+ mpz_roinit_normal_n (mpq_denref(x), dp, ds);
+ return x;
+}
+
+static mpq_srcptr
+mpq_roinit_zz (mpq_t x, mpz_srcptr n, mpz_srcptr d)
+{
+ return mpq_roinit_normal_nn (x, n->_mp_d, n->_mp_size,
+ d->_mp_d, d->_mp_size);
+}
+
+static void
+mpq_nan_init (mpq_t x)
+{
+ mpz_init (mpq_numref (x));
+ mpz_init (mpq_denref (x));
+}
+
+void
+mpq_init (mpq_t x)
+{
+ mpz_init (mpq_numref (x));
+ mpz_init_set_ui (mpq_denref (x), 1);
+}
+
+void
+mpq_clear (mpq_t x)
+{
+ mpz_clear (mpq_numref (x));
+ mpz_clear (mpq_denref (x));
+}
+
+static void
+mpq_canonical_sign (mpq_t r)
+{
+ int cmp = mpq_denref (r)->_mp_size;
+ if (cmp <= 0)
+ {
+ if (cmp == 0)
+ gmp_die("mpq: Fraction with zero denominator.");
+ mpz_neg (mpq_denref (r), mpq_denref (r));
+ mpz_neg (mpq_numref (r), mpq_numref (r));
+ }
+}
+
+static void
+mpq_helper_canonicalize (mpq_t r, const mpz_t num, const mpz_t den, mpz_t g)
+{
+ if (num->_mp_size == 0)
+ mpq_set_ui (r, 0, 1);
+ else
+ {
+ mpz_gcd (g, num, den);
+ mpz_tdiv_q (mpq_numref (r), num, g);
+ mpz_tdiv_q (mpq_denref (r), den, g);
+ mpq_canonical_sign (r);
+ }
+}
+
+void
+mpq_canonicalize (mpq_t r)
+{
+ mpz_t t;
+
+ mpz_init (t);
+ mpq_helper_canonicalize (r, mpq_numref (r), mpq_denref (r), t);
+ mpz_clear (t);
+}
+
+void
+mpq_swap (mpq_t a, mpq_t b)
+{
+ mpz_swap (mpq_numref (a), mpq_numref (b));
+ mpz_swap (mpq_denref (a), mpq_denref (b));
+}
+
+
+/* MPQ assignment and conversions. */
+void
+mpz_set_q (mpz_t r, const mpq_t q)
+{
+ mpz_tdiv_q (r, mpq_numref (q), mpq_denref (q));
+}
+
+void
+mpq_set (mpq_t r, const mpq_t q)
+{
+ mpz_set (mpq_numref (r), mpq_numref (q));
+ mpz_set (mpq_denref (r), mpq_denref (q));
+}
+
+void
+mpq_set_ui (mpq_t r, unsigned long n, unsigned long d)
+{
+ mpz_set_ui (mpq_numref (r), n);
+ mpz_set_ui (mpq_denref (r), d);
+}
+
+void
+mpq_set_si (mpq_t r, signed long n, unsigned long d)
+{
+ mpz_set_si (mpq_numref (r), n);
+ mpz_set_ui (mpq_denref (r), d);
+}
+
+void
+mpq_set_z (mpq_t r, const mpz_t n)
+{
+ mpz_set_ui (mpq_denref (r), 1);
+ mpz_set (mpq_numref (r), n);
+}
+
+void
+mpq_set_num (mpq_t r, const mpz_t z)
+{
+ mpz_set (mpq_numref (r), z);
+}
+
+void
+mpq_set_den (mpq_t r, const mpz_t z)
+{
+ mpz_set (mpq_denref (r), z);
+}
+
+void
+mpq_get_num (mpz_t r, const mpq_t q)
+{
+ mpz_set (r, mpq_numref (q));
+}
+
+void
+mpq_get_den (mpz_t r, const mpq_t q)
+{
+ mpz_set (r, mpq_denref (q));
+}
+
+
+/* MPQ comparisons and the like. */
+int
+mpq_cmp (const mpq_t a, const mpq_t b)
+{
+ mpz_t t1, t2;
+ int res;
+
+ mpz_init (t1);
+ mpz_init (t2);
+ mpz_mul (t1, mpq_numref (a), mpq_denref (b));
+ mpz_mul (t2, mpq_numref (b), mpq_denref (a));
+ res = mpz_cmp (t1, t2);
+ mpz_clear (t1);
+ mpz_clear (t2);
+
+ return res;
+}
+
+int
+mpq_cmp_z (const mpq_t a, const mpz_t b)
+{
+ mpz_t t;
+ int res;
+
+ mpz_init (t);
+ mpz_mul (t, b, mpq_denref (a));
+ res = mpz_cmp (mpq_numref (a), t);
+ mpz_clear (t);
+
+ return res;
+}
+
+int
+mpq_equal (const mpq_t a, const mpq_t b)
+{
+ return (mpz_cmp (mpq_numref (a), mpq_numref (b)) == 0) &&
+ (mpz_cmp (mpq_denref (a), mpq_denref (b)) == 0);
+}
+
+int
+mpq_cmp_ui (const mpq_t q, unsigned long n, unsigned long d)
+{
+ mpq_t t;
+ assert (d != 0);
+ if (ULONG_MAX <= GMP_LIMB_MAX) {
+ mp_limb_t nl = n, dl = d;
+ return mpq_cmp (q, mpq_roinit_normal_nn (t, &nl, n != 0, &dl, 1));
+ } else {
+ int ret;
+
+ mpq_init (t);
+ mpq_set_ui (t, n, d);
+ ret = mpq_cmp (q, t);
+ mpq_clear (t);
+
+ return ret;
+ }
+}
+
+int
+mpq_cmp_si (const mpq_t q, signed long n, unsigned long d)
+{
+ assert (d != 0);
+
+ if (n >= 0)
+ return mpq_cmp_ui (q, n, d);
+ else
+ {
+ mpq_t t;
+
+ if (ULONG_MAX <= GMP_LIMB_MAX)
+ {
+ mp_limb_t nl = GMP_NEG_CAST (unsigned long, n), dl = d;
+ return mpq_cmp (q, mpq_roinit_normal_nn (t, &nl, -1, &dl, 1));
+ }
+ else
+ {
+ unsigned long l_n = GMP_NEG_CAST (unsigned long, n);
+
+ mpq_roinit_normal_nn (t, mpq_numref (q)->_mp_d, - mpq_numref (q)->_mp_size,
+ mpq_denref (q)->_mp_d, mpq_denref (q)->_mp_size);
+ return - mpq_cmp_ui (t, l_n, d);
+ }
+ }
+}
+
+int
+mpq_sgn (const mpq_t a)
+{
+ return mpz_sgn (mpq_numref (a));
+}
+
+
+/* MPQ arithmetic. */
+void
+mpq_abs (mpq_t r, const mpq_t q)
+{
+ mpz_abs (mpq_numref (r), mpq_numref (q));
+ mpz_set (mpq_denref (r), mpq_denref (q));
+}
+
+void
+mpq_neg (mpq_t r, const mpq_t q)
+{
+ mpz_neg (mpq_numref (r), mpq_numref (q));
+ mpz_set (mpq_denref (r), mpq_denref (q));
+}
+
+void
+mpq_add (mpq_t r, const mpq_t a, const mpq_t b)
+{
+ mpz_t t;
+
+ mpz_init (t);
+ mpz_gcd (t, mpq_denref (a), mpq_denref (b));
+ if (mpz_cmp_ui (t, 1) == 0)
+ {
+ mpz_mul (t, mpq_numref (a), mpq_denref (b));
+ mpz_addmul (t, mpq_numref (b), mpq_denref (a));
+ mpz_mul (mpq_denref (r), mpq_denref (a), mpq_denref (b));
+ mpz_swap (mpq_numref (r), t);
+ }
+ else
+ {
+ mpz_t x, y;
+ mpz_init (x);
+ mpz_init (y);
+
+ mpz_tdiv_q (x, mpq_denref (b), t);
+ mpz_tdiv_q (y, mpq_denref (a), t);
+ mpz_mul (x, mpq_numref (a), x);
+ mpz_addmul (x, mpq_numref (b), y);
+
+ mpz_gcd (t, x, t);
+ mpz_tdiv_q (mpq_numref (r), x, t);
+ mpz_tdiv_q (x, mpq_denref (b), t);
+ mpz_mul (mpq_denref (r), x, y);
+
+ mpz_clear (x);
+ mpz_clear (y);
+ }
+ mpz_clear (t);
+}
+
+void
+mpq_sub (mpq_t r, const mpq_t a, const mpq_t b)
+{
+ mpq_t t;
+
+ mpq_roinit_normal_nn (t, mpq_numref (b)->_mp_d, - mpq_numref (b)->_mp_size,
+ mpq_denref (b)->_mp_d, mpq_denref (b)->_mp_size);
+ mpq_add (r, a, t);
+}
+
+void
+mpq_div (mpq_t r, const mpq_t a, const mpq_t b)
+{
+ mpq_t t;
+ mpq_mul (r, a, mpq_roinit_zz (t, mpq_denref (b), mpq_numref (b)));
+}
+
+void
+mpq_mul (mpq_t r, const mpq_t a, const mpq_t b)
+{
+ mpq_t t;
+ mpq_nan_init (t);
+
+ if (a != b) {
+ mpz_t g;
+
+ mpz_init (g);
+ mpq_helper_canonicalize (t, mpq_numref (a), mpq_denref (b), g);
+ mpq_helper_canonicalize (r, mpq_numref (b), mpq_denref (a), g);
+ mpz_clear (g);
+
+ a = r;
+ b = t;
+ }
+
+ mpz_mul (mpq_numref (r), mpq_numref (a), mpq_numref (b));
+ mpz_mul (mpq_denref (r), mpq_denref (a), mpq_denref (b));
+ mpq_clear (t);
+}
+
+void
+mpq_div_2exp (mpq_t r, const mpq_t q, mp_bitcnt_t e)
+{
+ mp_bitcnt_t z = mpz_scan1 (mpq_numref (q), 0);
+ z = GMP_MIN (z, e);
+ mpz_mul_2exp (mpq_denref (r), mpq_denref (q), e - z);
+ mpz_tdiv_q_2exp (mpq_numref (r), mpq_numref (q), z);
+}
+
+void
+mpq_mul_2exp (mpq_t r, const mpq_t q, mp_bitcnt_t e)
+{
+ mp_bitcnt_t z = mpz_scan1 (mpq_denref (q), 0);
+ z = GMP_MIN (z, e);
+ mpz_mul_2exp (mpq_numref (r), mpq_numref (q), e - z);
+ mpz_tdiv_q_2exp (mpq_denref (r), mpq_denref (q), z);
+}
+
+void
+mpq_inv (mpq_t r, const mpq_t q)
+{
+ mpq_set (r, q);
+ mpz_swap (mpq_denref (r), mpq_numref (r));
+ mpq_canonical_sign (r);
+}
+
+
+/* MPQ to/from double. */
+void
+mpq_set_d (mpq_t r, double x)
+{
+ mpz_set_ui (mpq_denref (r), 1);
+
+ /* x != x is true when x is a NaN, and x == x * 0.5 is true when x is
+ zero or infinity. */
+ if (x == x * 0.5 || x != x)
+ mpq_numref (r)->_mp_size = 0;
+ else
+ {
+ double B;
+ mp_bitcnt_t e;
+
+ B = 4.0 * (double) (GMP_LIMB_HIGHBIT >> 1);
+ for (e = 0; x != x + 0.5; e += GMP_LIMB_BITS)
+ x *= B;
+
+ mpz_set_d (mpq_numref (r), x);
+ mpq_div_2exp (r, r, e);
+ }
+}
+
+double
+mpq_get_d (const mpq_t u)
+{
+ mp_bitcnt_t ne, de, ee;
+ mpz_t z;
+ double B, ret;
+
+ ne = mpz_sizeinbase (mpq_numref (u), 2);
+ de = mpz_sizeinbase (mpq_denref (u), 2);
+
+ ee = CHAR_BIT * sizeof (double);
+ if (de == 1 || ne > de + ee)
+ ee = 0;
+ else
+ ee = (ee + de - ne) / GMP_LIMB_BITS + 1;
+
+ mpz_init (z);
+ mpz_mul_2exp (z, mpq_numref (u), ee * GMP_LIMB_BITS);
+ mpz_tdiv_q (z, z, mpq_denref (u));
+ ret = mpz_get_d (z);
+ mpz_clear (z);
+
+ B = 4.0 * (double) (GMP_LIMB_HIGHBIT >> 1);
+ for (B = 1 / B; ee != 0; --ee)
+ ret *= B;
+
+ return ret;
+}
+
+
+/* MPQ and strings/streams. */
+char *
+mpq_get_str (char *sp, int base, const mpq_t q)
+{
+ char *res;
+ char *rden;
+ size_t len;
+
+ res = mpz_get_str (sp, base, mpq_numref (q));
+ if (res == NULL || mpz_cmp_ui (mpq_denref (q), 1) == 0)
+ return res;
+
+ len = strlen (res) + 1;
+ rden = sp ? sp + len : NULL;
+ rden = mpz_get_str (rden, base, mpq_denref (q));
+ assert (rden != NULL);
+
+ if (sp == NULL) {
+ void * (*gmp_reallocate_func) (void *, size_t, size_t);
+ void (*gmp_free_func) (void *, size_t);
+ size_t lden;
+
+ mp_get_memory_functions (NULL, &gmp_reallocate_func, &gmp_free_func);
+ lden = strlen (rden) + 1;
+ res = (char *) gmp_reallocate_func (res, 0, (lden + len) * sizeof (char));
+ memcpy (res + len, rden, lden);
+ gmp_free_func (rden, 0);
+ }
+
+ res [len - 1] = '/';
+ return res;
+}
+
+size_t
+mpq_out_str (FILE *stream, int base, const mpq_t x)
+{
+ char * str;
+ size_t len;
+ void (*gmp_free_func) (void *, size_t);
+
+ str = mpq_get_str (NULL, base, x);
+ len = strlen (str);
+ len = fwrite (str, 1, len, stream);
+ mp_get_memory_functions (NULL, NULL, &gmp_free_func);
+ gmp_free_func (str, 0);
+ return len;
+}
+
+int
+mpq_set_str (mpq_t r, const char *sp, int base)
+{
+ const char *slash;
+
+ slash = strchr (sp, '/');
+ if (slash == NULL) {
+ mpz_set_ui (mpq_denref(r), 1);
+ return mpz_set_str (mpq_numref(r), sp, base);
+ } else {
+ char *num;
+ size_t numlen;
+ int ret;
+ void * (*gmp_allocate_func) (size_t);
+ void (*gmp_free_func) (void *, size_t);
+
+ mp_get_memory_functions (&gmp_allocate_func, NULL, &gmp_free_func);
+ numlen = slash - sp;
+ num = (char *) gmp_allocate_func ((numlen + 1) * sizeof (char));
+ memcpy (num, sp, numlen);
+ num[numlen] = '\0';
+ ret = mpz_set_str (mpq_numref(r), num, base);
+ gmp_free_func (num, 0);
+
+ if (ret != 0)
+ return ret;
+
+ return mpz_set_str (mpq_denref(r), slash + 1, base);
+ }
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,114 @@
+/* mini-mpq, a minimalistic implementation of a GNU GMP subset.
+
+Copyright 2018, 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+/* Header */
+
+#ifndef __MINI_MPQ_H__
+#define __MINI_MPQ_H__
+
+#include "mini-gmp.h"
+
+#if defined (__cplusplus)
+extern "C" {
+#endif
+
+typedef struct
+{
+ __mpz_struct _mp_num;
+ __mpz_struct _mp_den;
+} __mpq_struct;
+
+typedef __mpq_struct mpq_t[1];
+
+typedef const __mpq_struct *mpq_srcptr;
+typedef __mpq_struct *mpq_ptr;
+
+#define mpq_numref(Q) (&((Q)->_mp_num))
+#define mpq_denref(Q) (&((Q)->_mp_den))
+
+void mpq_abs (mpq_t, const mpq_t);
+void mpq_add (mpq_t, const mpq_t, const mpq_t);
+void mpq_canonicalize (mpq_t);
+void mpq_clear (mpq_t);
+int mpq_cmp (const mpq_t, const mpq_t);
+int mpq_cmp_si (const mpq_t, signed long, unsigned long);
+int mpq_cmp_ui (const mpq_t, unsigned long, unsigned long);
+int mpq_cmp_z (const mpq_t, const mpz_t);
+void mpq_div (mpq_t, const mpq_t, const mpq_t);
+void mpq_div_2exp (mpq_t, const mpq_t, mp_bitcnt_t);
+int mpq_equal (const mpq_t, const mpq_t);
+double mpq_get_d (const mpq_t);
+void mpq_get_den (mpz_t, const mpq_t);
+void mpq_get_num (mpz_t, const mpq_t);
+char * mpq_get_str (char *, int, const mpq_t q);
+void mpq_init (mpq_t);
+void mpq_inv (mpq_t, const mpq_t);
+void mpq_mul (mpq_t, const mpq_t, const mpq_t);
+void mpq_mul_2exp (mpq_t, const mpq_t, mp_bitcnt_t);
+void mpq_neg (mpq_t, const mpq_t);
+void mpq_set (mpq_t, const mpq_t);
+void mpq_set_d (mpq_t, double);
+void mpq_set_den (mpq_t, const mpz_t);
+void mpq_set_num (mpq_t, const mpz_t);
+void mpq_set_si (mpq_t, signed long, unsigned long);
+int mpq_set_str (mpq_t, const char *, int);
+void mpq_set_ui (mpq_t, unsigned long, unsigned long);
+void mpq_set_z (mpq_t, const mpz_t);
+int mpq_sgn (const mpq_t);
+void mpq_sub (mpq_t, const mpq_t, const mpq_t);
+void mpq_swap (mpq_t, mpq_t);
+
+/* This long list taken from gmp.h. */
+/* For reference, "defined(EOF)" cannot be used here. In g++ 2.95.4,
+ <iostream> defines EOF but not FILE. */
+#if defined (FILE) \
+ || defined (H_STDIO) \
+ || defined (_H_STDIO) /* AIX */ \
+ || defined (_STDIO_H) /* glibc, Sun, SCO */ \
+ || defined (_STDIO_H_) /* BSD, OSF */ \
+ || defined (__STDIO_H) /* Borland */ \
+ || defined (__STDIO_H__) /* IRIX */ \
+ || defined (_STDIO_INCLUDED) /* HPUX */ \
+ || defined (__dj_include_stdio_h_) /* DJGPP */ \
+ || defined (_FILE_DEFINED) /* Microsoft */ \
+ || defined (__STDIO__) /* Apple MPW MrC */ \
+ || defined (_MSL_STDIO_H) /* Metrowerks */ \
+ || defined (_STDIO_H_INCLUDED) /* QNX4 */ \
+ || defined (_ISO_STDIO_ISO_H) /* Sun C++ */ \
+ || defined (__STDIO_LOADED) /* VMS */
+size_t mpq_out_str (FILE *, int, const mpq_t);
+#endif
+
+void mpz_set_q (mpz_t, const mpq_t);
+
+#if defined (__cplusplus)
+}
+#endif
+#endif /* __MINI_MPQ_H__ */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mini-gmp/mini-mpq.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mp_bpl.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mp_bpl.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mp_bpl.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -27,7 +27,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
const int mp_bits_per_limb = GMP_LIMB_BITS;
Modified: trunk/Build/source/libs/gmp/gmp-src/mp_clz_tab.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mp_clz_tab.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mp_clz_tab.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mp_dv_tab.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mp_dv_tab.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mp_dv_tab.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Table to be indexed by character, to get its numerical value. Assumes ASCII
Modified: trunk/Build/source/libs/gmp/gmp-src/mp_get_fns.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mp_get_fns.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mp_get_fns.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mp_minv_tab.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mp_minv_tab.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mp_minv_tab.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mp_set_fns.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mp_set_fns.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mp_set_fns.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/abs.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/abs.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/abs.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/add.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/add.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/add.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/add_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/add_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/add_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/ceilfloor.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/ceilfloor.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/ceilfloor.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/clear.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/clear.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/clear.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/clears.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/clears.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/clears.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <stdarg.h>
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -39,11 +38,12 @@
va_start (ap, x);
- while (x != NULL)
+ do
{
__GMP_FREE_FUNC_LIMBS (PTR(x), PREC(x) + 1);
x = va_arg (ap, mpf_ptr);
}
+ while (x != NULL);
va_end (ap);
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/cmp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/cmp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/cmp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_d.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_d.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_d.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
#include <float.h> /* for DBL_MAX */
#endif
-#include "gmp.h"
#include "gmp-impl.h"
int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_si.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_si.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_si.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_z.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_z.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/cmp_z.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
@@ -39,7 +38,7 @@
SIZ (vf) = size = SIZ (v);
EXP (vf) = size = ABS (size);
- /* PREC (vf) = size; */
+ /* PREC (vf) = size; */
PTR (vf) = PTR (v);
return mpf_cmp (u, vf);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/div.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/div.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/div.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/div_2exp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/div_2exp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/div_2exp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/div_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/div_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/div_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/dump.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/dump.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/dump.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
#include <stdio.h>
#include <string.h> /* for strlen */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/eq.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/eq.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/eq.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/fits_s.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/fits_s.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/fits_s.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -68,5 +67,5 @@
else
return 0;
- return fl <= (fs >= 0 ? (mp_limb_t) MAXIMUM : - (mp_limb_t) MINIMUM);
+ return fl <= (fs >= 0 ? (mp_limb_t) MAXIMUM : NEG_CAST (mp_limb_t, MINIMUM));
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/fits_u.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/fits_u.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/fits_u.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_d.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_d.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_d.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
double
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_d_2exp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_d_2exp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_d_2exp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* double mpf_get_d_2exp (signed long int *exp, mpf_t src).
-Copyright 2001-2004 Free Software Foundation, Inc.
+Copyright 2001-2004, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,23 +28,21 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
double
-mpf_get_d_2exp (signed long int *exp2, mpf_srcptr src)
+mpf_get_d_2exp (signed long int *expptr, mpf_srcptr src)
{
mp_size_t size, abs_size;
mp_srcptr ptr;
int cnt;
- long exp;
size = SIZ(src);
if (UNLIKELY (size == 0))
{
- *exp2 = 0;
+ *expptr = 0;
return 0.0;
}
@@ -53,9 +51,6 @@
count_leading_zeros (cnt, ptr[abs_size - 1]);
cnt -= GMP_NAIL_BITS;
- exp = EXP(src) * GMP_NUMB_BITS - cnt;
- *exp2 = exp;
-
- return mpn_get_d (ptr, abs_size, (mp_size_t) 0,
- (long) - (abs_size * GMP_NUMB_BITS - cnt));
+ *expptr = EXP(src) * GMP_NUMB_BITS - cnt;
+ return mpn_get_d (ptr, abs_size, size, -(abs_size * GMP_NUMB_BITS - cnt));
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_dfl_prec.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_dfl_prec.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_dfl_prec.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_prc.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_prc.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_prc.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_bitcnt_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_si.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_si.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_si.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,8 +4,8 @@
example, the number 3.1416 would be returned as "31416" in DIGIT_PTR and
1 in EXP.
-Copyright 1993-1997, 2000-2003, 2005, 2006, 2011, 2015 Free Software
-Foundation, Inc.
+Copyright 1993-1997, 2000-2003, 2005, 2006, 2011, 2015, 2017 Free
+Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +34,6 @@
see https://www.gnu.org/licenses/. */
#include <stdlib.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h" /* for count_leading_zeros */
@@ -139,26 +138,23 @@
un = ABSIZ(u);
ue = EXP(u);
- if (base >= 0)
+ num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
+ if (base > 1)
{
- num_to_text = "0123456789abcdefghijklmnopqrstuvwxyz";
- if (base <= 1)
- base = 10;
- else if (base > 36)
- {
- num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
- if (base > 62)
+ if (base <= 36)
+ num_to_text = "0123456789abcdefghijklmnopqrstuvwxyz";
+ else if (UNLIKELY (base > 62))
return NULL;
- }
}
+ else if (base > -2)
+ {
+ base = 10;
+ }
else
{
base = -base;
- if (base <= 1)
- base = 10;
- else if (base > 36)
+ if (UNLIKELY (base > 36))
return NULL;
- num_to_text = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
}
MPF_SIGNIFICANT_DIGITS (max_digits, base, PREC(u));
@@ -170,7 +166,7 @@
/* We didn't get a string from the user. Allocate one (and return
a pointer to it) with space for `-' and terminating null. */
alloc_size = n_digits + 2;
- dbuf = (char *) (*__gmp_allocate_func) (n_digits + 2);
+ dbuf = __GMP_ALLOCATE_FUNC_TYPE (n_digits + 2, char);
}
if (un == 0)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/get_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/get_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/get_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/init.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/init.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/init.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/init2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/init2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/init2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/inits.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/inits.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/inits.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <stdarg.h>
-#include "gmp.h"
#include "gmp-impl.h"
void
@@ -39,11 +38,12 @@
va_start (ap, x);
- while (x != NULL)
+ do
{
mpf_init (x);
x = va_arg (ap, mpf_ptr);
}
+ while (x != NULL);
va_end (ap);
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/inp_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/inp_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/inp_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
#include <stdio.h>
#include <ctype.h>
-#include "gmp.h"
#include "gmp-impl.h"
size_t
@@ -47,7 +46,7 @@
stream = stdin;
alloc_size = 100;
- str = (char *) (*__gmp_allocate_func) (alloc_size);
+ str = __GMP_ALLOCATE_FUNC_TYPE (alloc_size, char);
str_size = 0;
nread = 0;
@@ -65,7 +64,7 @@
{
size_t old_alloc_size = alloc_size;
alloc_size = alloc_size * 3 / 2;
- str = (char *) (*__gmp_reallocate_func) (str, old_alloc_size, alloc_size);
+ str = __GMP_REALLOCATE_FUNC_TYPE (str, old_alloc_size, alloc_size, char);
}
if (c == EOF || isspace (c))
break;
@@ -79,7 +78,7 @@
{
size_t old_alloc_size = alloc_size;
alloc_size = alloc_size * 3 / 2;
- str = (char *) (*__gmp_reallocate_func) (str, old_alloc_size, alloc_size);
+ str = __GMP_REALLOCATE_FUNC_TYPE (str, old_alloc_size, alloc_size, char);
}
str[str_size] = 0;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/int_p.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/int_p.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/int_p.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/iset.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/iset.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/iset.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/iset_d.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/iset_d.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/iset_d.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/iset_si.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/iset_si.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/iset_si.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/iset_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/iset_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/iset_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/iset_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/iset_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/iset_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpf_mul -- Multiply two floats.
-Copyright 1993, 1994, 1996, 2001, 2005 Free Software Foundation, Inc.
+Copyright 1993, 1994, 1996, 2001, 2005, 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,70 +28,107 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
mpf_mul (mpf_ptr r, mpf_srcptr u, mpf_srcptr v)
{
- mp_srcptr up, vp;
- mp_size_t usize, vsize;
mp_size_t sign_product;
mp_size_t prec = r->_mp_prec;
+ mp_size_t rsize;
+ mp_limb_t cy_limb;
+ mp_ptr rp, tp;
+ mp_size_t adj;
+ TMP_DECL;
- usize = u->_mp_size;
- vsize = v->_mp_size;
- sign_product = usize ^ vsize;
+ if (u == v)
+ {
+ mp_srcptr up;
+ mp_size_t usize;
- usize = ABS (usize);
- vsize = ABS (vsize);
+ usize = u->_mp_size;
+ sign_product = 0;
- up = u->_mp_d;
- vp = v->_mp_d;
- if (usize > prec)
- {
- up += usize - prec;
- usize = prec;
- }
- if (vsize > prec)
- {
- vp += vsize - prec;
- vsize = prec;
- }
+ usize = ABS (usize);
- if (usize == 0 || vsize == 0)
- {
- r->_mp_size = 0;
- r->_mp_exp = 0; /* ??? */
+ up = u->_mp_d;
+ if (usize > prec)
+ {
+ up += usize - prec;
+ usize = prec;
+ }
+
+ if (usize == 0)
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0; /* ??? */
+ return;
+ }
+ else
+ {
+ TMP_MARK;
+ rsize = 2 * usize;
+ tp = TMP_ALLOC_LIMBS (rsize);
+
+ mpn_sqr (tp, up, usize);
+ cy_limb = tp[rsize - 1];
+ }
}
else
{
- mp_size_t rsize;
- mp_limb_t cy_limb;
- mp_ptr rp, tp;
- mp_size_t adj;
- TMP_DECL;
+ mp_srcptr up, vp;
+ mp_size_t usize, vsize;
- TMP_MARK;
- rsize = usize + vsize;
- tp = TMP_ALLOC_LIMBS (rsize);
- cy_limb = (usize >= vsize
- ? mpn_mul (tp, up, usize, vp, vsize)
- : mpn_mul (tp, vp, vsize, up, usize));
+ usize = u->_mp_size;
+ vsize = v->_mp_size;
+ sign_product = usize ^ vsize;
- adj = cy_limb == 0;
- rsize -= adj;
- prec++;
- if (rsize > prec)
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ up = u->_mp_d;
+ vp = v->_mp_d;
+ if (usize > prec)
{
- tp += rsize - prec;
- rsize = prec;
+ up += usize - prec;
+ usize = prec;
}
- rp = r->_mp_d;
- MPN_COPY (rp, tp, rsize);
- r->_mp_exp = u->_mp_exp + v->_mp_exp - adj;
- r->_mp_size = sign_product >= 0 ? rsize : -rsize;
+ if (vsize > prec)
+ {
+ vp += vsize - prec;
+ vsize = prec;
+ }
- TMP_FREE;
+ if (usize == 0 || vsize == 0)
+ {
+ r->_mp_size = 0;
+ r->_mp_exp = 0;
+ return;
+ }
+ else
+ {
+ TMP_MARK;
+ rsize = usize + vsize;
+ tp = TMP_ALLOC_LIMBS (rsize);
+ cy_limb = (usize >= vsize
+ ? mpn_mul (tp, up, usize, vp, vsize)
+ : mpn_mul (tp, vp, vsize, up, usize));
+
+ }
}
+
+ adj = cy_limb == 0;
+ rsize -= adj;
+ prec++;
+ if (rsize > prec)
+ {
+ tp += rsize - prec;
+ rsize = prec;
+ }
+ rp = r->_mp_d;
+ MPN_COPY (rp, tp, rsize);
+ r->_mp_exp = u->_mp_exp + v->_mp_exp - adj;
+ r->_mp_size = sign_product >= 0 ? rsize : -rsize;
+
+ TMP_FREE;
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/mul_2exp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/mul_2exp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/mul_2exp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/mul_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/mul_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/mul_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/neg.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/neg.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/neg.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/out_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/out_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/out_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -45,7 +45,6 @@
#include <locale.h> /* for localeconv */
#endif
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/pow_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/pow_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/pow_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/random2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/random2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/random2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/reldiff.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/reldiff.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/reldiff.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_d.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_d.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_d.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
#include <float.h> /* for DBL_MAX */
#endif
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_dfl_prec.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_dfl_prec.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_dfl_prec.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_size_t __gmp_default_fp_limb_precision = __GMPF_BITS_TO_PREC (53);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc_raw.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc_raw.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_prc_raw.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpf_set_q (mpf_t rop, mpq_t op) -- Convert the rational op to the float rop.
-Copyright 1996, 1999, 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
+Copyright 1996, 1999, 2001, 2002, 2004, 2005, 2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,48 +28,28 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
-/* As usual the aim is to produce PREC(r) limbs, with the high non-zero.
- The basic mpn_tdiv_qr produces a quotient of nsize-dsize+1 limbs, with
- either the high or second highest limb non-zero. We arrange for
- nsize-dsize+1 to equal prec+1, hence giving either prec or prec+1 result
- limbs at PTR(r).
+/* As usual the aim is to produce PREC(r) limbs, with the high non-zero. The
+ basic mpn_div_q produces a quotient of nsize-dsize+1 limbs, with either the
+ high or second highest limb non-zero. We arrange for nsize-dsize+1 to equal
+ prec+1, hence giving either prec or prec+1 result limbs at PTR(r).
- nsize-dsize+1 == prec+1 is achieved by adjusting num(q), either dropping
- low limbs if it's too big, or padding with low zeros if it's too small.
- The full given den(q) is always used.
+ nsize-dsize+1 == prec+1 is achieved by adjusting num(q), either dropping low
+ limbs if it's too big, or padding with low zeros if it's too small. The
+ full given den(q) is always used.
- We cannot truncate den(q), because even when it's much bigger than prec
- the last limbs can still influence the final quotient. Often they don't,
- but we leave optimization of that to a prospective quotient-only mpn
- division.
+ We cannot truncate den(q), because even when it's much bigger than prec the
+ last limbs can still influence the final quotient. Often they don't, but we
+ leave optimization of that to mpn_div_q.
- Not done:
-
- If den(q) is a power of 2 then we may end up with low zero limbs on the
- result. But nothing is done about this, since it should be unlikely on
- random data, and can be left to an application to call mpf_div_2exp if it
- might occur with any frequency.
-
Enhancements:
- The high quotient limb is non-zero when high{np,dsize} >= {dp,dsize}. We
+ The high quotient limb is non-zero when high{np,dsize} > {dp,dsize}. We
could make that comparison and use qsize==prec instead of qsize==prec+1,
- to save one limb in the division.
+ to save one limb in the division. */
- Future:
-
- If/when mpn_tdiv_qr supports its qxn parameter we can use that instead of
- padding n with zeros in temporary space.
-
- If/when a quotient-only division exists it can be used here immediately.
- remp is only to satisfy mpn_tdiv_qr, the remainder is not used. */
-
void
mpf_set_q (mpf_t r, mpq_srcptr q)
{
@@ -76,7 +56,7 @@
mp_srcptr np, dp;
mp_size_t prec, nsize, dsize, qsize, prospective_qsize, tsize, zeros;
mp_size_t sign_quotient, high_zero;
- mp_ptr qp, tp, remp;
+ mp_ptr qp, tp;
mp_exp_t exp;
TMP_DECL;
@@ -106,42 +86,25 @@
exp = prospective_qsize; /* ie. number of integer limbs */
qsize = prec + 1; /* desired q */
- zeros = qsize - prospective_qsize; /* n zeros to get desired qsize */
- tsize = nsize + zeros; /* possible copy of n */
+ zeros = qsize - prospective_qsize; /* n zeros to get desired qsize */
+ tsize = nsize + zeros; /* size of intermediate numerator */
+ tp = TMP_ALLOC_LIMBS (tsize + 1); /* +1 for mpn_div_q's scratch */
- if (WANT_TMP_DEBUG)
- {
- /* separate alloc blocks, for malloc debugging */
- remp = TMP_ALLOC_LIMBS (dsize);
- tp = NULL;
- if (zeros > 0)
- tp = TMP_ALLOC_LIMBS (tsize);
- }
- else
- {
- /* one alloc with a conditionalized size, for efficiency */
- mp_size_t size = dsize + (zeros > 0 ? tsize : 0);
- remp = TMP_ALLOC_LIMBS (size);
- tp = remp + dsize;
- }
-
if (zeros > 0)
{
/* pad n with zeros into temporary space */
MPN_ZERO (tp, zeros);
MPN_COPY (tp+zeros, np, nsize);
- np = tp;
- nsize = tsize;
+ np = tp; /* mpn_div_q allows this overlap */
}
else
{
/* shorten n to get desired qsize */
- nsize += zeros;
np -= zeros;
}
- ASSERT (nsize-dsize+1 == qsize);
- mpn_tdiv_qr (qp, remp, (mp_size_t) 0, np, nsize, dp, dsize);
+ ASSERT (tsize-dsize+1 == qsize);
+ mpn_div_q (qp, np, tsize, dp, dsize, tp);
/* strip possible zero high limb */
high_zero = (qp[qsize-1] == 0);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_si.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_si.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_si.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,8 +2,8 @@
in base BASE to a float in dest. If BASE is zero, the leading characters
of STRING is used to figure out the base.
-Copyright 1993-1997, 2000-2003, 2005, 2007, 2008, 2011, 2013 Free Software
-Foundation, Inc.
+Copyright 1993-1997, 2000-2003, 2005, 2007, 2008, 2011, 2013, 2019 Free
+Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -54,7 +54,6 @@
#include <locale.h> /* for localeconv */
#endif
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -127,12 +126,15 @@
size_t i, j;
int c;
int negative;
- char *dotpos = 0;
+ char *dotpos;
const char *expptr;
int exp_base;
const char *point = GMP_DECIMAL_POINT;
size_t pointlen = strlen (point);
const unsigned char *digit_value;
+ int incr;
+ size_t n_zeros_skipped;
+
TMP_DECL;
c = (unsigned char) *str;
@@ -199,6 +201,10 @@
TMP_MARK;
s = begs = (char *) TMP_ALLOC (str_size + 1);
+ incr = 0;
+ n_zeros_skipped = 0;
+ dotpos = NULL;
+
/* Loop through mantissa, converting it from ASCII to raw byte values. */
for (i = 0; i < str_size; i++)
{
@@ -231,7 +237,13 @@
TMP_FREE;
return -1;
}
- *s++ = dig;
+ *s = dig;
+ incr |= dig != 0;
+ s += incr; /* Increment after first non-0 digit seen. */
+ if (dotpos != NULL)
+ /* Count skipped zeros between radix point and first non-0
+ digit. */
+ n_zeros_skipped += 1 - incr;
}
}
c = (unsigned char) *++str;
@@ -252,8 +264,7 @@
#if 0
size_t n_chars_needed;
- /* This breaks things like 0.000...0001. To safely ignore superfluous
- digits, we need to skip over leading zeros. */
+ /* This needs careful testing. Leave disabled for now. */
/* Just consider the relevant leading digits of the mantissa. */
LIMBS_PER_DIGIT_IN_BASE (n_chars_needed, prec, base);
if (str_size > n_chars_needed)
@@ -260,11 +271,7 @@
str_size = n_chars_needed;
#endif
- LIMBS_PER_DIGIT_IN_BASE (ma, str_size, base);
- mp = TMP_ALLOC_LIMBS (ma);
- mn = mpn_set_str (mp, (unsigned char *) begs, str_size, base);
-
- if (mn == 0)
+ if (str_size == 0)
{
SIZ(x) = 0;
EXP(x) = 0;
@@ -272,6 +279,10 @@
return 0;
}
+ LIMBS_PER_DIGIT_IN_BASE (ma, str_size, base);
+ mp = TMP_ALLOC_LIMBS (ma);
+ mn = mpn_set_str (mp, (unsigned char *) begs, str_size, base);
+
madj = 0;
/* Ignore excess limbs in MP,MSIZE. */
if (mn > prec)
@@ -311,7 +322,7 @@
else
exp_in_base = 0;
if (dotpos != 0)
- exp_in_base -= s - dotpos;
+ exp_in_base -= s - dotpos + n_zeros_skipped;
divflag = exp_in_base < 0;
exp_in_base = ABS (exp_in_base);
@@ -325,8 +336,7 @@
}
ra = 2 * (prec + 1);
- rp = TMP_ALLOC_LIMBS (ra);
- tp = TMP_ALLOC_LIMBS (ra);
+ TMP_ALLOC_LIMBS_2 (rp, ra, tp, ra);
rn = mpn_pow_1_highpart (rp, &radj, (mp_limb_t) base, exp_in_base, prec, tp);
if (divflag)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/set_z.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/set_z.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/set_z.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/size.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/size.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/size.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
size_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/sqrt_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/sub.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/sub.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/sub.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/sub_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/sub_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/sub_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/swap.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/swap.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/swap.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/trunc.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/trunc.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/trunc.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/ui_div.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/ui_div.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/ui_div.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/ui_sub.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/ui_sub.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/ui_sub.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpf/urandomb.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpf/urandomb.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpf/urandomb.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/Makefile.am
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/Makefile.am 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/Makefile.am 2020-01-19 23:36:31 UTC (rev 53461)
@@ -41,7 +41,7 @@
TARG_DIST = alpha arm arm64 cray generic ia64 lisp m68k m88k \
minithres mips32 mips64 pa32 pa64 power powerpc32 powerpc64 \
- s390_32 s390_64 sh sparc32 sparc64 thumb vax x86 x86_64
+ riscv s390_32 s390_64 sh sparc32 sparc64 thumb vax x86 x86_64
EXTRA_DIST = asm-defs.m4 cpp-ccas m4-ccas $(TARG_DIST)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/dive_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/dive_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/dive_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev5/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev5/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev5/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* Alpha EV5 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2002, 2004, 2005, 2008-2010, 2014 Free
-Software Foundation, Inc.
+Copyright 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +33,7 @@
/* 600 MHz 21164A */
/* FFT tuning limit = 5000000 */
-/* Generated by tuneup.c, 2014-03-12, gcc 4.5 */
+/* Generated by tuneup.c, 2017-02-02, gcc 4.9 */
#define DIVREM_1_NORM_THRESHOLD 0 /* preinv always */
#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
@@ -41,11 +40,11 @@
#define MOD_1_1P_METHOD 2
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 10
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
#define MOD_1_1_TO_MOD_1_2_THRESHOLD 22
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 15
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 20
#define USE_PREINV_DIVREM_1 1 /* preinv always */
#define DIV_QR_1N_PI1_METHOD 1
#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
@@ -52,26 +51,28 @@
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always */
-#define BMOD_1_TO_MOD_1_THRESHOLD 76
+#define BMOD_1_TO_MOD_1_THRESHOLD 69
-#define MUL_TOOM22_THRESHOLD 14
+#define DIV_1_VS_MUL_1_PERCENT 181
+
+#define MUL_TOOM22_THRESHOLD 16
#define MUL_TOOM33_THRESHOLD 50
#define MUL_TOOM44_THRESHOLD 118
-#define MUL_TOOM6H_THRESHOLD 157
+#define MUL_TOOM6H_THRESHOLD 173
#define MUL_TOOM8H_THRESHOLD 236
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 77
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 49
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 84
#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 53
#define MUL_TOOM43_TO_TOOM54_THRESHOLD 70
#define SQR_BASECASE_THRESHOLD 0 /* always */
#define SQR_TOOM2_THRESHOLD 22
-#define SQR_TOOM3_THRESHOLD 73
+#define SQR_TOOM3_THRESHOLD 69
#define SQR_TOOM4_THRESHOLD 178
-#define SQR_TOOM6_THRESHOLD 0 /* always */
-#define SQR_TOOM8_THRESHOLD 260
+#define SQR_TOOM6_THRESHOLD 189
+#define SQR_TOOM8_THRESHOLD 357
#define MULMID_TOOM42_THRESHOLD 18
@@ -147,41 +148,44 @@
#define SQR_FFT_THRESHOLD 3968
#define MULLO_BASECASE_THRESHOLD 0 /* always */
-#define MULLO_DC_THRESHOLD 45
-#define MULLO_MUL_N_THRESHOLD 8397
+#define MULLO_DC_THRESHOLD 50
+#define MULLO_MUL_N_THRESHOLD 5558
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 78
+#define SQRLO_SQR_THRESHOLD 3597
#define DC_DIV_QR_THRESHOLD 47
-#define DC_DIVAPPR_Q_THRESHOLD 168
+#define DC_DIVAPPR_Q_THRESHOLD 167
#define DC_BDIV_QR_THRESHOLD 47
#define DC_BDIV_Q_THRESHOLD 110
-#define INV_MULMOD_BNM1_THRESHOLD 26
-#define INV_NEWTON_THRESHOLD 189
-#define INV_APPR_THRESHOLD 181
+#define INV_MULMOD_BNM1_THRESHOLD 30
+#define INV_NEWTON_THRESHOLD 181
+#define INV_APPR_THRESHOLD 173
-#define BINV_NEWTON_THRESHOLD 196
-#define REDC_1_TO_REDC_N_THRESHOLD 51
+#define BINV_NEWTON_THRESHOLD 182
+#define REDC_1_TO_REDC_N_THRESHOLD 47
-#define MU_DIV_QR_THRESHOLD 1558
-#define MU_DIVAPPR_Q_THRESHOLD 1558
+#define MU_DIV_QR_THRESHOLD 979
+#define MU_DIVAPPR_Q_THRESHOLD 1142
#define MUPI_DIV_QR_THRESHOLD 90
-#define MU_BDIV_QR_THRESHOLD 855
-#define MU_BDIV_Q_THRESHOLD 1078
+#define MU_BDIV_QR_THRESHOLD 748
+#define MU_BDIV_Q_THRESHOLD 979
-#define POWM_SEC_TABLE 1,16,90,452,1221
+#define POWM_SEC_TABLE 1,16,90,386,2177
-#define MATRIX22_STRASSEN_THRESHOLD 11
-#define HGCD_THRESHOLD 99
-#define HGCD_APPR_THRESHOLD 103
-#define HGCD_REDUCE_THRESHOLD 2899
-#define GCD_DC_THRESHOLD 283
-#define GCDEXT_DC_THRESHOLD 201
-#define JACOBI_BASE_METHOD 3
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 26
+#define SET_STR_DC_THRESHOLD 363
+#define SET_STR_PRECOMPUTE_THRESHOLD 1201
-#define GET_STR_DC_THRESHOLD 13
-#define GET_STR_PRECOMPUTE_THRESHOLD 28
-#define SET_STR_DC_THRESHOLD 426
-#define SET_STR_PRECOMPUTE_THRESHOLD 1505
+#define FAC_DSC_THRESHOLD 342
+#define FAC_ODD_THRESHOLD 0 /* always */
-#define FAC_DSC_THRESHOLD 1404
-#define FAC_ODD_THRESHOLD 0 /* always */
+#define MATRIX22_STRASSEN_THRESHOLD 13
+#define HGCD_THRESHOLD 105
+#define HGCD_APPR_THRESHOLD 108
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 238
+#define GCDEXT_DC_THRESHOLD 199
+#define JACOBI_BASE_METHOD 2
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,145 +0,0 @@
-dnl Alpha ev67 mpn_gcd_1 -- Nx1 greatest common divisor.
-
-dnl Copyright 2003, 2004 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-
-C ev67: 3.4 cycles/bitpair for 1x1 part
-
-
-C mp_limb_t mpn_gcd_1 (mp_srcptr xp, mp_size_t xsize, mp_limb_t y);
-C
-C In the 1x1 part, the algorithm is to change x,y to abs(x-y),min(x,y) and
-C strip trailing zeros from abs(x-y) to maintain x and y both odd.
-C
-C The trailing zeros are calculated from just x-y, since in twos-complement
-C there's the same number of trailing zeros on d or -d. This means the cttz
-C runs in parallel with abs(x-y).
-C
-C The loop takes 5 cycles, and at 0.68 iterations per bit for two N-bit
-C operands with this algorithm gives the measured 3.4 c/l.
-C
-C The slottings shown are for SVR4 style systems, Unicos differs in the
-C initial gp setup and the LEA.
-C
-C Enhancement:
-C
-C On the jsr, !lituse_jsr! (when available) would allow the linker to relax
-C it to a bsr, but probably only in a static binary. Plain "jsr foo" gives
-C the right object code for relaxation, and ought to be available
-C everywhere, but we prefer to schedule the GOT ldq (LEA) back earlier, for
-C the usual case of running in a shared library.
-C
-C bsr could perhaps be used explicitly anyway. We should be able to assume
-C modexact is in the same module as us (ie. shared library or mainline).
-C Would there be any worries about the size of the displacement? Could
-C always put modexact and gcd_1 in the same .o to be certain.
-
-ASM_START()
-PROLOGUE(mpn_gcd_1, gp)
-
- C r16 xp
- C r17 size
- C r18 y
-
- C ldah C l
- C lda C u
-
- ldq r0, 0(r16) C L x = xp[0]
- lda r30, -32(r30) C u alloc stack
-
- LEA( r27, mpn_modexact_1c_odd) C L modexact addr, ldq (gp)
- stq r10, 16(r30) C L save r10
- cttz r18, r10 C U0 y twos
- cmpeq r17, 1, r5 C u test size==1
-
- stq r9, 8(r30) C L save r9
- clr r19 C u zero c for modexact
- unop
- unop
-
- cttz r0, r6 C U0 x twos
- stq r26, 0(r30) C L save ra
-
- srl r18, r10, r18 C U y odd
-
- mov r18, r9 C l hold y across call
-
- cmpult r6, r10, r2 C u test x_twos < y_twos
-
- cmovne r2, r6, r10 C l common_twos = min(x_twos,y_twos)
- bne r5, L(one) C U no modexact if size==1
- jsr r26, (r27), mpn_modexact_1c_odd C L0
-
- LDGP( r29, 0(r26)) C u,l ldah,lda
- cttz r0, r6 C U0 new x twos
- ldq r26, 0(r30) C L restore ra
-
-L(one):
- mov r9, r1 C u y
- ldq r9, 8(r30) C L restore r9
- mov r10, r2 C u common twos
- ldq r10, 16(r30) C L restore r10
-
- lda r30, 32(r30) C l free stack
- beq r0, L(done) C U return y if x%y==0
-
- srl r0, r6, r0 C U x odd
- unop
-
- ALIGN(16)
-L(top):
- C r0 x
- C r1 y
- C r2 common twos, for use at end
-
- subq r0, r1, r7 C l0 d = x - y
- cmpult r0, r1, r16 C u0 test x >= y
-
- subq r1, r0, r4 C l0 new_x = y - x
- cttz r7, r8 C U0 d twos
-
- cmoveq r16, r7, r4 C l0 new_x = d if x>=y
- cmovne r16, r0, r1 C u0 y = x if x<y
- unop C l \ force cmoveq into l0
- unop C u /
-
- C C cmoveq2 L0, cmovne2 U0
-
- srl r4, r8, r0 C U0 x = new_x >> twos
- bne r7, L(top) C U1 stop when d==0
-
-
-L(done):
- sll r1, r2, r0 C U0 return y << common_twos
- ret r31, (r26), 1 C L0
-
-EPILOGUE()
-ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/alpha/ev67/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,79 @@
+dnl Alpha ev67 mpn_gcd_11 -- Nx1 greatest common divisor.
+
+dnl Copyright 2003, 2004 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+
+C ev67: 3.4 cycles/bitpair for 1x1 part
+
+
+C mp_limb_t mpn_gcd_1 (mp_srcptr xp, mp_size_t xsize, mp_limb_t y);
+C
+C In the 1x1 part, the algorithm is to change x,y to abs(x-y),min(x,y) and
+C strip trailing zeros from abs(x-y) to maintain x and y both odd.
+C
+C The trailing zeros are calculated from just x-y, since in twos-complement
+C there's the same number of trailing zeros on d or -d. This means the cttz
+C runs in parallel with abs(x-y).
+C
+C The loop takes 5 cycles, and at 0.68 iterations per bit for two N-bit
+C operands with this algorithm gives the measured 3.4 c/l.
+C
+C The slottings shown are for SVR4 style systems, Unicos differs in the
+C initial gp setup and the LEA.
+
+
+ASM_START()
+PROLOGUE(mpn_gcd_11)
+ mov r16, r0
+ mov r17, r1
+
+ ALIGN(16)
+L(top): subq r0, r1, r7 C l0 d = x - y
+ cmpult r0, r1, r16 C u0 test x >= y
+
+ subq r1, r0, r4 C l0 new_x = y - x
+ cttz r7, r8 C U0 d twos
+
+ cmoveq r16, r7, r4 C l0 new_x = d if x>=y
+ cmovne r16, r0, r1 C u0 y = x if x<y
+ unop C l \ force cmoveq into l0
+ unop C u /
+
+ C C cmoveq2 L0, cmovne2 U0
+
+ srl r4, r8, r0 C U0 x = new_x >> twos
+ bne r7, L(top) C U1 stop when d==0
+
+
+L(end): mov r1, r0 C U0 return y << common_twos
+ ret r31, (r26), 1 C L0
+EPILOGUE()
+ASM_END()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/aorslsh1_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/aorslsh1_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/aorslsh1_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -163,5 +163,5 @@
REVCY(r12)
L(rt0): RETVAL( r14)
pop {r4-r10r11, r14}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/arm-defs.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/arm-defs.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/arm-defs.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
dnl m4 macros for ARM assembler.
-dnl Copyright 2001, 2012, 2013 Free Software Foundation, Inc.
+dnl Copyright 2001, 2012-2016, 2018-2019 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -36,6 +36,11 @@
changecom(@&*$)
+define(`ASM_START',
+m4_assert_numargs_range(0,1)
+`ifelse($1,`neon',`.fpu neon',
+ $1,,`',
+ 1,1,`m4_error(`$0 got invalid argument $1')')')
dnl APCS register names.
@@ -43,18 +48,18 @@
deflit(a2,r1)
deflit(a3,r2)
deflit(a4,r3)
-deflit(v1,r4)
-deflit(v2,r5)
-deflit(v3,r6)
-deflit(v4,r7)
-deflit(v5,r8)
-deflit(v6,r9)
+dnl deflit(v1,r4)
+dnl deflit(v2,r5)
+dnl deflit(v3,r6)
+dnl deflit(v4,r7)
+dnl deflit(v5,r8)
+dnl deflit(v6,r9)
deflit(sb,r9)
-deflit(v7,r10)
+dnl deflit(v7,r10)
deflit(sl,r10)
deflit(fp,r11)
deflit(ip,r12)
-deflit(sp,r13)
+dnl deflit(sp,r13)
deflit(lr,r14)
deflit(pc,r15)
@@ -84,11 +89,12 @@
')dnl
')
-define(`ret',`ifdef(`NOTHUMB',`mov pc, ',`bx')')
+define(`return',`ifdef(`NOTHUMB',`mov pc, ',`bx')')
define(`EPILOGUE_cpu',
`lea_list
- SIZE(`$1',.-`$1')')
+ SIZE(`$1',.-`$1')'
+`define(`lea_list', `')')
divert
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_dbm1c.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_dbm1c.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_dbm1c.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -109,5 +109,5 @@
str r5, [qp]
sbc r0, r5, r12
pop {r4, r5, r6, r7, r8}
- ret lr
+ return lr
EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,162 @@
+dnl ARM v4 mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb divisor.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C norm unorm
+C 1176 13 18
+C Cortex-A5 8 12
+C Cortex-A7 10.5 18
+C Cortex-A8 14 15
+C Cortex-A9 10 12 not measured since latest edits
+C Cortex-A15 9 9
+C Cortex-A53 14 20
+
+C Architecture requirements:
+C v5 -
+C v5t -
+C v5te -
+C v6 -
+C v6t2 -
+C v7a -
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`d', `r3')
+define(`di_arg', `sp[0]') C just mpn_pi1_bdiv_q_1
+define(`cnt_arg', `sp[4]') C just mpn_pi1_bdiv_q_1
+
+define(`cy', `r7')
+define(`cnt', `r6')
+define(`tnc', `r8')
+
+ASM_START()
+PROLOGUE(mpn_bdiv_q_1)
+ tst d, #1
+ push {r6-r11}
+ mov cnt, #0
+ bne L(inv)
+
+C count trailing zeros
+ movs r10, d, lsl #16
+ moveq d, d, lsr #16
+ moveq cnt, #16
+ tst d, #0xff
+ moveq d, d, lsr #8
+ addeq cnt, cnt, #8
+ LEA( r10, ctz_tab)
+ and r11, d, #0xff
+ ldrb r10, [r10, r11]
+ mov d, d, lsr r10
+ add cnt, cnt, r10
+
+C binvert limb
+L(inv): LEA( r10, binvert_limb_table)
+ and r12, d, #254
+ ldrb r10, [r10, r12, lsr #1]
+ mul r12, r10, r10
+ mul r12, d, r12
+ rsb r12, r12, r10, lsl #1
+ mul r10, r12, r12
+ mul r10, d, r10
+ rsb r10, r10, r12, lsl #1 C r10 = inverse
+ b L(pi1)
+EPILOGUE()
+
+PROLOGUE(mpn_pi1_bdiv_q_1)
+ push {r6-r11}
+
+ ldr cnt, [sp, #28]
+ ldr r10, [sp, #24]
+
+L(pi1): ldr r11, [up], #4 C up[0]
+ cmp cnt, #0
+ mov cy, #0
+ bne L(unorm)
+
+L(norm):
+ subs n, n, #1 C set carry as side-effect
+ beq L(edn)
+
+ ALIGN(16)
+L(tpn): sbcs cy, r11, cy
+ ldr r11, [up], #4
+ sub n, n, #1
+ mul r9, r10, cy
+ tst n, n
+ umull r12, cy, d, r9
+ str r9, [rp], #4
+ bne L(tpn)
+
+L(edn): sbc cy, r11, cy
+ mul r9, r10, cy
+ str r9, [rp]
+ pop {r6-r11}
+ return r14
+
+L(unorm):
+ rsb tnc, cnt, #32
+ mov r11, r11, lsr cnt
+ subs n, n, #1 C set carry as side-effect
+ beq L(edu)
+
+ ALIGN(16)
+L(tpu): ldr r12, [up], #4
+ orr r9, r11, r12, lsl tnc
+ mov r11, r12, lsr cnt
+ sbcs cy, r9, cy C critical path ->cy->cy->
+ sub n, n, #1
+ mul r9, r10, cy C critical path ->cy->r9->
+ tst n, n
+ umull r12, cy, d, r9 C critical path ->r9->cy->
+ str r9, [rp], #4
+ bne L(tpu)
+
+L(edu): sbc cy, r11, cy
+ mul r9, r10, cy
+ str r9, [rp]
+ pop {r6-r11}
+ return r14
+EPILOGUE()
+
+ RODATA
+ctz_tab:
+ .byte 8,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 7,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 6,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
+ .byte 5,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0,4,0,1,0,2,0,1,0,3,0,1,0,2,0,1,0
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/cnd_aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/cnd_aors_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/cnd_aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -130,5 +130,5 @@
L(end): RETVAL
pop {r4-r11}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/com.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/com.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/com.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -71,5 +71,5 @@
bne L(top)
ldmfd sp!, { r7, r8, r9 } C restore regs from stack
-L(rtn): ret lr
+L(rtn): return lr
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyd.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyd.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyd.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -80,5 +80,5 @@
L(end): stmda rp, { r3,r4,r5,r12 }
pop { r4-r5 }
-L(rtn): ret lr
+L(rtn): return lr
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyi.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyi.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/copyi.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -75,5 +75,5 @@
L(end): stm rp, { r3,r4,r5,r12 }
pop { r4-r5 }
-L(rtn): ret lr
+L(rtn): return lr
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/dive_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/dive_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/dive_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,4 +1,4 @@
-dnl ARM v4 mpn_modexact_1c_odd
+dnl ARM v4 mpn_divexact_1.
dnl Contributed to the GNU project by Torbjorn Granlund.
@@ -96,10 +96,10 @@
L(norm):
subs n, n, #1 C set carry as side-effect
- beq L(end)
+ beq L(edn)
ALIGN(16)
-L(top): sbcs cy, r5, cy
+L(tpn): sbcs cy, r5, cy
ldr r5, [up], #4
sub n, n, #1
mul r9, r4, cy
@@ -106,13 +106,13 @@
tst n, n
umull r12, cy, d, r9
str r9, [rp], #4
- bne L(top)
+ bne L(tpn)
-L(end): sbc cy, r5, cy
+L(edn): sbc cy, r5, cy
mul r9, r4, cy
str r9, [rp]
pop {r4-r9}
- ret r14
+ return r14
L(unnorm):
rsb tnc, cnt, #32
@@ -136,7 +136,7 @@
mul r9, r4, cy
str r9, [rp]
pop {r4-r9}
- ret r14
+ return r14
EPILOGUE()
RODATA
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/invert_limb.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/invert_limb.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/invert_limb.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -52,7 +52,7 @@
adds r1, r12, r0
adc r3, r3, r0
rsb r0, r3, r2
- ret lr
+ return lr
EPILOGUE()
RODATA
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/logops_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/logops_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/logops_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -135,5 +135,5 @@
pop { r4, r5, r6, r7 } C popping r8-r10 here strangely fails
L(rtn): pop { r8, r9, r10 }
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshift.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshift.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshift.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -84,5 +84,5 @@
L(1): str r7, [rp, #-4]
mov r0, r4, lsr tnc
pop {r4, r6, r7, r8}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshiftc.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshiftc.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/lshiftc.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -91,5 +91,5 @@
str r7, [rp, #-4]
mov r0, r4, lsr tnc
pop {r4, r6, r7, r8}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mod_34lsub1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mod_34lsub1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mod_34lsub1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,10 +33,13 @@
C cycles/limb
C StrongARM ?
C XScale ?
-C Cortex-A7 ?
-C Cortex-A8 ?
+C Cortex-A5 2.67
+C Cortex-A7 2.35
+C Cortex-A8 2.0
C Cortex-A9 1.33
C Cortex-A15 1.33
+C Cortex-A17 3.34
+C Cortex-A53 2.0
define(`ap', r0)
define(`n', r1)
@@ -106,7 +109,7 @@
add r0, r0, r12, lsr #8
pop { r4, r5, r6, r7 }
- ret lr
+ return lr
L(le2): cmn n, #1
bne L(1)
@@ -117,5 +120,5 @@
bic r0, r2, #0xff000000
add r0, r0, r2, lsr #24
pop { r4, r5, r6, r7 }
- ret lr
+ return lr
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mode1o.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mode1o.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/mode1o.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -88,5 +88,5 @@
addcc r0, r0, #1
ldmfd sp!, {r4, r5}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lorrshift.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lorrshift.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lorrshift.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -56,8 +56,8 @@
C * Try using 128-bit operations. Note that Neon lacks pure 128-bit shifts,
C which might make it tricky.
C * Clean up and simplify.
-C * Consider sharing most of the code for lshift and rshift, since the feed-in code,
-C the loop, and most of the wind-down code are identical.
+C * Consider sharing most of the code for lshift and rshift, since the feed-in
+C code, the loop, and most of the wind-down code are identical.
C * Replace the basecase code with code using 'extension' registers.
C * Optimise. It is not clear that this loop insn permutation is optimal for
C either A9 or A15.
@@ -85,7 +85,7 @@
MULFUNC_PROLOGUE(mpn_lshift mpn_rshift)
-ASM_START()
+ASM_START(neon)
TEXT
ALIGN(64)
PROLOGUE(func)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lshiftc.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lshiftc.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/neon/lshiftc.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -68,37 +68,23 @@
define(`n', `r2')
define(`cnt', `r3')
- define(`IFLSH', `$1')
- define(`IFRSH', `')
- define(`X',`0')
- define(`Y',`1')
- define(`func',`mpn_lshiftc')
-define(`OPERATION_lshiftc',1)
-
-ASM_START()
+ASM_START(neon)
TEXT
ALIGN(64)
PROLOGUE(mpn_lshiftc)
-IFLSH(` mov r12, n, lsl #2 ')
-IFLSH(` add rp, rp, r12 ')
-IFLSH(` add ap, ap, r12 ')
+ mov r12, n, lsl #2
+ add rp, rp, r12
+ add ap, ap, r12
cmp n, #4 C SIMD code n limit
ble L(base)
-ifdef(`OPERATION_lshiftc',`
vdup.32 d6, r3 C left shift count is positive
sub r3, r3, #64 C right shift count is negative
vdup.32 d7, r3
- mov r12, #-8') C lshift pointer update offset
-ifdef(`OPERATION_rshift',`
- rsb r3, r3, #0 C right shift count is negative
- vdup.32 d6, r3
- add r3, r3, #64 C left shift count is positive
- vdup.32 d7, r3
- mov r12, #8') C rshift pointer update offset
+ mov r12, #-8 C lshift pointer update offset
-IFLSH(` sub ap, ap, #8 ')
+ sub ap, ap, #8
vld1.32 {d19}, [ap], r12 C load initial 2 limbs
vshl.u64 d18, d19, d7 C retval
@@ -105,16 +91,15 @@
tst rp, #4 C is rp 64-bit aligned already?
beq L(rp_aligned) C yes, skip
vmvn d19, d19
-IFLSH(` add ap, ap, #4 ') C move back ap pointer
-IFRSH(` sub ap, ap, #4 ') C move back ap pointer
+ add ap, ap, #4 C move back ap pointer
vshl.u64 d4, d19, d6
sub n, n, #1 C first limb handled
-IFLSH(` sub rp, rp, #4 ')
- vst1.32 {d4[Y]}, [rp]IFRSH(!) C store first limb, rp gets aligned
+ sub rp, rp, #4
+ vst1.32 {d4[1]}, [rp] C store first limb, rp gets aligned
vld1.32 {d19}, [ap], r12 C load ap[1] and ap[2]
L(rp_aligned):
-IFLSH(` sub rp, rp, #8 ')
+ sub rp, rp, #8
subs n, n, #6
vmvn d19, d19
blt L(two_or_three_more)
@@ -180,9 +165,9 @@
L(l3): vshl.u64 d5, d19, d6
vld1.32 {d17}, [ap], r12
L(cj1): vmov.u8 d16, #0
-IFLSH(` add ap, ap, #4 ')
+ add ap, ap, #4
vmvn d17, d17
- vld1.32 {d16[Y]}, [ap], r12
+ vld1.32 {d16[1]}, [ap], r12
vshl.u64 d0, d17, d7
vshl.u64 d4, d17, d6
vmvn d16, d16
@@ -192,9 +177,9 @@
vst1.32 {d3}, [rp:64], r12
vorr d2, d4, d1
vst1.32 {d2}, [rp:64], r12
-IFLSH(` add rp, rp, #4 ')
- vst1.32 {d5[Y]}, [rp]
- vmov.32 r0, d18[X]
+ add rp, rp, #4
+ vst1.32 {d5[1]}, [rp]
+ vmov.32 r0, d18[0]
bx lr
L(l2): vld1.32 {d16}, [ap], r12
@@ -208,7 +193,7 @@
vorr d3, d5, d0
L(cj2): vst1.32 {d2}, [rp:64], r12
vst1.32 {d3}, [rp]
- vmov.32 r0, d18[X]
+ vmov.32 r0, d18[0]
bx lr
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rsh1aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rsh1aors_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rsh1aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -120,5 +120,5 @@
str r4, [rp, #0]
mov r0, r11
pop {r4-r11}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rshift.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rshift.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/rshift.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -82,5 +82,5 @@
L(1): str r7, [rp]
mov r0, r4, lsl tnc
pop {r4, r6, r7, r8}
- ret r14
+ return r14
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/sec_tabselect.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/sec_tabselect.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/sec_tabselect.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -109,7 +109,7 @@
bge L(tp2)
stmia rp, {r8,r9}
pop {r4-r11, r14}
- ret lr
+ return lr
L(n2): cmp j, #-2
bne L(n1)
@@ -127,5 +127,5 @@
bge L(tp1)
str r8, [rp]
L(n1): pop {r4-r11, r14}
- ret lr
+ return lr
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/udiv.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/udiv.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/udiv.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -61,7 +61,7 @@
str n1, [rem_ptr] C store remainder
adc r0, n0, n0 C quotient: add last carry from divstep
- ret lr
+ return lr
L(_large_divisor):
stmfd sp!, { r8, lr }
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,120 +0,0 @@
-dnl ARM v5 mpn_gcd_1.
-
-dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for ARM by Torbjörn
-dnl Granlund.
-
-dnl Copyright 2000-2002, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C cycles/bit (approx)
-C StrongARM -
-C XScale ?
-C Cortex-A7 ?
-C Cortex-A8 ?
-C Cortex-A9 5.9
-C Cortex-A15 ?
-C Numbers measured with: speed -CD -s8-32 -t24 mpn_gcd_1
-
-C TODO
-C * Optimise inner-loop better.
-
-C Threshold of when to call bmod when U is one limb. Should be about
-C (time_in_cycles(bmod_1,1) + call_overhead) / (cycles/bit).
-define(`BMOD_THRES_LOG2', 6)
-
-C INPUT PARAMETERS
-define(`up', `r0')
-define(`n', `r1')
-define(`v0', `r2')
-
-ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
- `define(`BMOD_1_TO_MOD_1_THRESHOLD',0xffffffff)')
-
-ASM_START()
- TEXT
- ALIGN(16)
-PROLOGUE(mpn_gcd_1)
- push {r4, r7, lr}
- ldr r3, [up] C U low limb
-
- orr r3, r3, v0
- rsb r4, r3, #0
- and r4, r4, r3
- clz r4, r4 C min(ctz(u0),ctz(v0))
- rsb r4, r4, #31
-
- rsb r12, v0, #0
- and r12, r12, v0
- clz r12, r12
- rsb r12, r12, #31
- mov v0, v0, lsr r12
-
- mov r7, v0
-
- cmp n, #1
- bne L(nby1)
-
-C Both U and V are single limbs, reduce with bmod if u0 >> v0.
- ldr r3, [up]
- cmp v0, r3, lsr #BMOD_THRES_LOG2
- bhi L(red1)
-
-L(bmod):mov r3, #0 C carry argument
- bl mpn_modexact_1c_odd
- b L(red0)
-
-L(nby1):cmp n, #BMOD_1_TO_MOD_1_THRESHOLD
- blo L(bmod)
-
- bl mpn_mod_1
-
-L(red0):mov r3, r0
-L(red1):rsbs r12, r3, #0
- and r12, r12, r3
- clz r12, r12
- rsb r12, r12, #31
- bne L(mid)
- b L(end)
-
- ALIGN(8)
-L(top): rsb r12, r12, #31
- movcc r3, r1 C if x-y < 0
- movcc r7, r0 C use x,y-x
-L(mid): mov r3, r3, lsr r12 C
- mov r0, r3 C
- sub r1, r7, r3 C
- rsbs r3, r7, r3 C
- and r12, r1, r3 C
- clz r12, r12 C
- bne L(top) C
-
-L(end): mov r0, r7, lsl r4
- pop {r4, r7, pc}
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v5/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,70 @@
+dnl ARM v5 mpn_gcd_11.
+
+dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for ARM by Torbjörn
+dnl Granlund.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C StrongARM -
+C XScale ?
+C Cortex-A5 6.45 obsolete
+C Cortex-A7 6.41 obsolete
+C Cortex-A8 5.0 obsolete
+C Cortex-A9 5.9 obsolete
+C Cortex-A15 4.40 obsolete
+C Cortex-A17 5.68 obsolete
+C Cortex-A53 4.37 obsolete
+C Numbers measured with: speed -CD -s8-32 -t24 mpn_gcd_1
+
+define(`u0', `r0')
+define(`v0', `r1')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_gcd_11)
+ subs r3, u0, v0 C 0
+ beq L(end) C
+
+ ALIGN(16)
+L(top): sub r2, v0, u0 C 0,5
+ and r12, r2, r3 C 1
+ clz r12, r12 C 2
+ rsb r12, r12, #31 C 3
+ rsbcc r3, r3, #0 C v = abs(u-v), even 1
+ movcs u0, v0 C u = min(u,v) 1
+ lsr v0, r3, r12 C 4
+ subs r3, u0, v0 C 5
+ bne L(top) C
+
+L(end): bx lr
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_2.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_2.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_2.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,10 +36,13 @@
C StrongARM: -
C XScale -
C ARM11 4.68
-C Cortex-A7 3.625
-C Cortex-A8 4
+C Cortex-A5 3.63
+C Cortex-A7 3.65
+C Cortex-A8 4.0
C Cortex-A9 2.25
C Cortex-A15 2.5
+C Cortex-A17 2.13
+C Cortex-A53 3.5
define(`rp',`r0')
define(`up',`r1')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_3.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_3.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/addmul_3.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,10 +36,13 @@
C StrongARM: -
C XScale -
C ARM11 4.33
-C Cortex-A7 3.23
-C Cortex-A8 3.19
+C Cortex-A5 3.28
+C Cortex-A7 3.25
+C Cortex-A8 3.17
C Cortex-A9 2.125
C Cortex-A15 2
+C Cortex-A17 2.11
+C Cortex-A53 4.18
C TODO
C * Use a fast path for n <= KARATSUBA_MUL_THRESHOLD using a jump table,
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012, 2015 Free Software
-Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -33,98 +32,97 @@
#define GMP_LIMB_BYTES 4
/* 700 MHz ARM11 (raspberry pi) */
-/* FFT tuning limit = 10 M */
-/* Generated by tuneup.c, 2015-10-05, gcc 4.6 */
+/* FFT tuning limit = 8,088,775 */
+/* Generated by tuneup.c, 2019-10-23, gcc 8.3 */
#define DIVREM_1_NORM_THRESHOLD 0 /* preinv always */
#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
#define MOD_1_2_TO_MOD_1_4_THRESHOLD MP_SIZE_T_MAX
#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 19
#define USE_PREINV_DIVREM_1 1 /* preinv always */
-#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 71.61% faster than 2 */
#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 39
+#define BMOD_1_TO_MOD_1_THRESHOLD 38
-#define MUL_TOOM22_THRESHOLD 44
-#define MUL_TOOM33_THRESHOLD 138
-#define MUL_TOOM44_THRESHOLD 517
+#define DIV_1_VS_MUL_1_PERCENT 251
+
+#define MUL_TOOM22_THRESHOLD 38
+#define MUL_TOOM33_THRESHOLD 134
+#define MUL_TOOM44_THRESHOLD 512
#define MUL_TOOM6H_THRESHOLD 0 /* always */
-#define MUL_TOOM8H_THRESHOLD 692
+#define MUL_TOOM8H_THRESHOLD 620
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 141
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 407
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 132
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 209
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 625
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 209
#define MUL_TOOM42_TO_TOOM63_THRESHOLD 211
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 225
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 300
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
-#define SQR_TOOM2_THRESHOLD 56
-#define SQR_TOOM3_THRESHOLD 173
-#define SQR_TOOM4_THRESHOLD 711
-#define SQR_TOOM6_THRESHOLD 0 /* always */
-#define SQR_TOOM8_THRESHOLD 915
+#define SQR_TOOM2_THRESHOLD 55
+#define SQR_TOOM3_THRESHOLD 200
+#define SQR_TOOM4_THRESHOLD 470
+#define SQR_TOOM6_THRESHOLD 614
+#define SQR_TOOM8_THRESHOLD 882
-#define MULMID_TOOM42_THRESHOLD 70
+#define MULMID_TOOM42_THRESHOLD 62
-#define MULMOD_BNM1_THRESHOLD 24
-#define SQRMOD_BNM1_THRESHOLD 28
+#define MULMOD_BNM1_THRESHOLD 23
+#define SQRMOD_BNM1_THRESHOLD 26
-#define MUL_FFT_MODF_THRESHOLD 560 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 565 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 560, 5}, { 27, 6}, { 15, 5}, { 31, 6}, \
- { 28, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
- { 36, 7}, { 19, 6}, { 39, 7}, { 23, 6}, \
- { 47, 7}, { 25, 6}, { 51, 7}, { 27, 6}, \
- { 55, 7}, { 29, 8}, { 15, 7}, { 37, 8}, \
+ { { 565, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 15, 5}, { 31, 6}, { 28, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 21, 6}, { 43, 7}, { 23, 6}, \
+ { 47, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
{ 19, 7}, { 43, 8}, { 23, 7}, { 51, 8}, \
{ 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
- { 35, 7}, { 71, 8}, { 43, 9}, { 23, 8}, \
- { 55, 9}, { 31, 8}, { 71, 9}, { 39, 8}, \
- { 83, 9}, { 47, 8}, { 99, 9}, { 55,10}, \
- { 31, 9}, { 79,10}, { 47, 9}, { 103,11}, \
- { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
- { 159,10}, { 95, 9}, { 191,10}, { 111,11}, \
- { 63,10}, { 159,11}, { 95,10}, { 207,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
- { 271,11}, { 159,10}, { 335,11}, { 191,10}, \
- { 399,11}, { 223,12}, { 127,11}, { 255,10}, \
- { 511,11}, { 287,10}, { 575,11}, { 319,10}, \
- { 639,11}, { 351,12}, { 191,11}, { 383,10}, \
- { 767,11}, { 415,13}, { 127,12}, { 255,11}, \
- { 575,12}, { 319,11}, { 703,12}, { 383,11}, \
+ { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 71, 9}, { 39, 8}, { 83, 9}, { 47, 8}, \
+ { 99, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 103,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
+ { 191,10}, { 111,11}, { 63,10}, { 159,11}, \
+ { 95,10}, { 207,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 159,10}, \
+ { 351,11}, { 191,10}, { 399,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 639,11}, { 351,12}, \
+ { 191,11}, { 415,13}, { 127,12}, { 255,11}, \
+ { 575,12}, { 319,11}, { 671,12}, { 383,11}, \
{ 799,12}, { 447,13}, { 255,12}, { 511,11}, \
- { 1023,12}, { 575,11}, { 1151,12}, { 703,13}, \
- { 383,12}, { 831,14}, { 255,13}, { 511,12}, \
- { 1151,13}, { 639,12}, { 1343,13}, { 767,12}, \
- { 1599,13}, { 895,14}, { 511,13}, { 1023,12}, \
- { 2111,13}, { 1151,12}, { 2367,13}, { 8192,14}, \
+ { 1023,12}, { 703,13}, { 383,12}, { 895,14}, \
+ { 255,13}, { 511,12}, { 1151,13}, { 639,12}, \
+ { 1343,13}, { 767,12}, { 1599,13}, { 895,14}, \
{ 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 110
+#define MUL_FFT_TABLE3_SIZE 98
#define MUL_FFT_THRESHOLD 5760
-#define SQR_FFT_MODF_THRESHOLD 505 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 530 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 505, 5}, { 27, 6}, { 15, 5}, { 31, 6}, \
- { 29, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
- { 35, 7}, { 19, 6}, { 40, 7}, { 23, 6}, \
- { 47, 7}, { 29, 8}, { 15, 7}, { 37, 8}, \
- { 19, 7}, { 43, 8}, { 23, 7}, { 49, 8}, \
- { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
- { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
- { 71, 9}, { 39, 8}, { 83, 9}, { 47, 8}, \
- { 99, 9}, { 55,10}, { 31, 9}, { 79,10}, \
- { 47, 9}, { 103,11}, { 31,10}, { 63, 9}, \
- { 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
- { 191,10}, { 111,11}, { 63,10}, { 127, 9}, \
- { 255,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { { 530, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 28, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
+ { 35, 7}, { 19, 6}, { 39, 7}, { 21, 6}, \
+ { 43, 7}, { 23, 6}, { 47, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 43, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 7}, { 55, 8}, \
+ { 31, 7}, { 63, 8}, { 43, 9}, { 23, 8}, \
+ { 55, 9}, { 31, 8}, { 71, 9}, { 39, 8}, \
+ { 83, 9}, { 47, 8}, { 95, 9}, { 55,10}, \
+ { 31, 9}, { 79,10}, { 47, 9}, { 103,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 167,10}, { 95, 9}, { 191,10}, { 111,11}, \
+ { 63,10}, { 143, 9}, { 287,10}, { 159,11}, \
{ 95,10}, { 191, 9}, { 383,12}, { 63,11}, \
{ 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
{ 543,10}, { 287,11}, { 159,10}, { 351,11}, \
@@ -133,56 +131,57 @@
{ 319,10}, { 639,11}, { 351,12}, { 191,11}, \
{ 383,10}, { 767,11}, { 415,13}, { 127,12}, \
{ 255,11}, { 607,12}, { 319,11}, { 703,12}, \
- { 383,11}, { 831,12}, { 447,13}, { 255,12}, \
- { 511,11}, { 1023,12}, { 703,13}, { 383,12}, \
- { 831,14}, { 255,13}, { 511,12}, { 1087,13}, \
- { 639,12}, { 1343,13}, { 767,12}, { 1599,13}, \
- { 895,14}, { 511,13}, { 1023,12}, { 2111,13}, \
- { 1151,12}, { 2431,13}, { 8192,14}, { 16384,15}, \
- { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 109
-#define SQR_FFT_THRESHOLD 4672
+ { 383,11}, { 799,12}, { 447,11}, { 895,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 703,13}, \
+ { 383,12}, { 895,14}, { 255,13}, { 511,12}, \
+ { 1151,13}, { 639,12}, { 1343,13}, { 767,12}, \
+ { 1599,13}, { 895,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 104
+#define SQR_FFT_THRESHOLD 4416
#define MULLO_BASECASE_THRESHOLD 0 /* always */
-#define MULLO_DC_THRESHOLD 55
+#define MULLO_DC_THRESHOLD 51
#define MULLO_MUL_N_THRESHOLD 11278
-#define SQRLO_BASECASE_THRESHOLD 8
-#define SQRLO_DC_THRESHOLD 51
-#define SQRLO_SQR_THRESHOLD 8907
+#define SQRLO_BASECASE_THRESHOLD 10
+#define SQRLO_DC_THRESHOLD 55
+#define SQRLO_SQR_THRESHOLD 8648
-#define DC_DIV_QR_THRESHOLD 46
-#define DC_DIVAPPR_Q_THRESHOLD 148
-#define DC_BDIV_QR_THRESHOLD 57
+#define DC_DIV_QR_THRESHOLD 36
+#define DC_DIVAPPR_Q_THRESHOLD 146
+#define DC_BDIV_QR_THRESHOLD 46
#define DC_BDIV_Q_THRESHOLD 160
-#define INV_MULMOD_BNM1_THRESHOLD 86
-#define INV_NEWTON_THRESHOLD 138
-#define INV_APPR_THRESHOLD 139
+#define INV_MULMOD_BNM1_THRESHOLD 74
+#define INV_NEWTON_THRESHOLD 145
+#define INV_APPR_THRESHOLD 147
-#define BINV_NEWTON_THRESHOLD 216
+#define BINV_NEWTON_THRESHOLD 372
#define REDC_1_TO_REDC_2_THRESHOLD 6
-#define REDC_2_TO_REDC_N_THRESHOLD 124
+#define REDC_2_TO_REDC_N_THRESHOLD 140
-#define MU_DIV_QR_THRESHOLD 2642
-#define MU_DIVAPPR_Q_THRESHOLD 2492
-#define MUPI_DIV_QR_THRESHOLD 74
-#define MU_BDIV_QR_THRESHOLD 2130
-#define MU_BDIV_Q_THRESHOLD 2541
+#define MU_DIV_QR_THRESHOLD 2801
+#define MU_DIVAPPR_Q_THRESHOLD 2801
+#define MUPI_DIV_QR_THRESHOLD 79
+#define MU_BDIV_QR_THRESHOLD 2541
+#define MU_BDIV_Q_THRESHOLD 2764
-#define POWM_SEC_TABLE 5,26,143,446
+#define POWM_SEC_TABLE 3,20,139,734
-#define GET_STR_DC_THRESHOLD 20
-#define GET_STR_PRECOMPUTE_THRESHOLD 39
-#define SET_STR_DC_THRESHOLD 527
-#define SET_STR_PRECOMPUTE_THRESHOLD 1069
+#define GET_STR_DC_THRESHOLD 27
+#define GET_STR_PRECOMPUTE_THRESHOLD 45
+#define SET_STR_DC_THRESHOLD 342
+#define SET_STR_PRECOMPUTE_THRESHOLD 1290
-#define FAC_DSC_THRESHOLD 430
-#define FAC_ODD_THRESHOLD 55
+#define FAC_DSC_THRESHOLD 390
+#define FAC_ODD_THRESHOLD 438
-#define MATRIX22_STRASSEN_THRESHOLD 23
-#define HGCD_THRESHOLD 79
-#define HGCD_APPR_THRESHOLD 71
-#define HGCD_REDUCE_THRESHOLD 3810
-#define GCD_DC_THRESHOLD 283
-#define GCDEXT_DC_THRESHOLD 253
-#define JACOBI_BASE_METHOD 1
+#define MATRIX22_STRASSEN_THRESHOLD 25
+#define HGCD2_DIV1_METHOD 5 /* 1.32% faster than 3 */
+#define HGCD_THRESHOLD 82
+#define HGCD_APPR_THRESHOLD 81
+#define HGCD_REDUCE_THRESHOLD 4633
+#define GCD_DC_THRESHOLD 345
+#define GCDEXT_DC_THRESHOLD 268
+#define JACOBI_BASE_METHOD 1 /* 3.30% faster than 2 */
+
+/* Tuneup completed successfully, took 45018 seconds */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/mul_2.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/mul_2.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6/mul_2.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,10 +36,13 @@
C StrongARM: -
C XScale -
C ARM11 5.25
-C Cortex-A7 3.13
-C Cortex-A8 5
+C Cortex-A5 3.63
+C Cortex-A7 3.15
+C Cortex-A8 5.0
C Cortex-A9 2.25
C Cortex-A15 2.5
+C Cortex-A17 2.13
+C Cortex-A53 3.5
C TODO
C * This is a trivial edit of the addmul_2 code. Check for simplifications,
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,115 +0,0 @@
-dnl ARM v6t2 mpn_gcd_1.
-
-dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for ARM by Torbjörn
-dnl Granlund.
-
-dnl Copyright 2000-2002, 2005, 2009, 2011, 2012 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C cycles/bit (approx)
-C StrongARM -
-C XScale -
-C Cortex-A7 ?
-C Cortex-A8 ?
-C Cortex-A9 5.3
-C Cortex-A15 3.5
-C Numbers measured with: speed -CD -s8-32 -t24 mpn_gcd_1
-
-C TODO
-C * Optimise inner-loop better.
-C * Push saving/restoring of callee-user regs into call code
-
-C Threshold of when to call bmod when U is one limb. Should be about
-C (time_in_cycles(bmod_1,1) + call_overhead) / (cycles/bit).
-define(`BMOD_THRES_LOG2', 7)
-
-C INPUT PARAMETERS
-define(`up', `r0')
-define(`n', `r1')
-define(`v0', `r2')
-
-ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
- `define(`BMOD_1_TO_MOD_1_THRESHOLD',0xffffffff)')
-
-ASM_START()
- TEXT
- ALIGN(16)
-PROLOGUE(mpn_gcd_1)
- push {r4, r7, lr}
- ldr r3, [up] C U low limb
-
- orr r3, r3, v0
- rbit r4, r3
- clz r4, r4 C min(ctz(u0),ctz(v0))
-
- rbit r12, v0
- clz r12, r12
- mov v0, v0, lsr r12
-
- mov r7, v0
-
- cmp n, #1
- bne L(nby1)
-
-C Both U and V are single limbs, reduce with bmod if u0 >> v0.
- ldr r3, [up]
- cmp v0, r3, lsr #BMOD_THRES_LOG2
- bhi L(red1)
-
-L(bmod):mov r3, #0 C carry argument
- bl mpn_modexact_1c_odd
- b L(red0)
-
-L(nby1):cmp n, #BMOD_1_TO_MOD_1_THRESHOLD
- blo L(bmod)
-
- bl mpn_mod_1
-
-L(red0):mov r3, r0
-L(red1):cmp r3, #0
- rbit r12, r3
- clz r12, r12
- bne L(mid)
- b L(end)
-
- ALIGN(8)
-L(top): movcs r3, r1 C if x-y < 0
- movcs r7, r0 C use x,y-x
-L(mid): mov r3, r3, lsr r12 C
- mov r0, r3 C
- subs r1, r7, r3 C
- rsb r3, r7, r3 C
- rbit r12, r1
- clz r12, r12 C
- bne L(top) C
-
-L(end): mov r0, r7, lsl r4
- pop {r4, r7, pc}
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,65 @@
+dnl ARM v6t2 mpn_gcd_11.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011, 2012, 2019 Free Software Foundation,
+dnl Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C StrongARM -
+C XScale -
+C Cortex-A5 5.2
+C Cortex-A7 5.04
+C Cortex-A8 3.59
+C Cortex-A9 9.5
+C Cortex-A15 3.2
+C Cortex-A17 5.25
+C Cortex-A53 3.57
+
+define(`u0', `r0')
+define(`v0', `r1')
+
+ASM_START()
+ TEXT
+ ALIGN(64)
+PROLOGUE(mpn_gcd_11)
+ subs r3, u0, v0 C 0
+ beq L(end) C
+
+ ALIGN(16)
+L(top): rbit r12, r3 C 1,5
+ clz r12, r12 C 2
+ rsbcc r3, r3, #0 C v = abs(u-v), even 1
+ movcs u0, v0 C u = min(u,v) 1
+ lsr v0, r3, r12 C 3
+ subs r3, u0, v0 C 4
+ bne L(top) C
+
+L(end): bx lr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_22.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_22.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v6t2/gcd_22.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,113 @@
+dnl ARM v6t2 mpn_gcd_22.
+
+dnl Copyright 2019 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+
+C cycles/bit (approx)
+C StrongARM -
+C XScale -
+C Cortex-A5 10.1
+C Cortex-A7 9.1
+C Cortex-A8 6.3
+C Cortex-A9 ?
+C Cortex-A12 7.7
+C Cortex-A15 5.7
+C Cortex-A17 ?
+C Cortex-A53 7.0
+
+
+define(`gp', `r0')
+
+define(`u1', `r1')
+define(`u0', `r2')
+define(`v1', `r3')
+define(`v0', `r4')
+
+define(`t0', `r5')
+define(`t1', `r6')
+define(`cnt', `r7')
+
+ASM_START()
+PROLOGUE(mpn_gcd_22)
+ push { r4-r7 }
+
+ ldr v0, [sp,#16] C
+
+L(top): subs t0, u0, v0 C 0 7
+ beq L(lowz)
+ sbcs t1, u1, v1 C 1 8
+
+ rbit cnt, t0 C 1
+
+ negcc t0, t0
+ mvncc t1, t1
+L(bck): movcc v0, u0
+ movcc v1, u1
+
+ clz cnt, cnt C 2
+ rsb r12, cnt, #32 C 3
+
+ lsr u0, t0, cnt C 3
+ lsl r12, t1, r12 C 4
+ lsr u1, t1, cnt C 3
+ orr u0, u0, r12 C 5
+
+ orrs r12, u1, v1
+ bne L(top)
+
+
+ str r12, [gp,#4] C high result limb <= 0
+
+ mov r6, gp
+ mov r0, u0 C pass 1st argument
+ mov r1, v0 C pass 2nd argument
+ mov r7, r14 C preserve link register
+ bl mpn_gcd_11
+ str r0, [r6,#0]
+ mov r14, r7
+ pop { r4-r7 }
+ bx r14
+
+L(lowz):C We come here when v0 - u0 = 0
+ C 1. If v1 - u1 = 0, then gcd is u = v.
+ C 2. Else compute gcd_21({v1,v0}, |u1-v1|)
+ subs t0, u1, v1
+ beq L(end)
+ mov t1, #0
+ rbit cnt, t0 C 1
+ negcc t0, t0
+ b L(bck)
+
+L(end): str v0, [gp,#0]
+ str v1, [gp,#4]
+ pop { r4-r7 }
+ bx r14
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,36 @@
+dnl ARM mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb divisor.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 2013, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_bdiv_q_1 mpn_pi1_bdiv_q_1)
+include_mpn(`arm/v7a/cora8/bdiv_q_1.asm')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012-2015 Free Software
-Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,29 +31,31 @@
#define GMP_LIMB_BITS 32
#define GMP_LIMB_BYTES 4
-/* 1700 MHz Cortex-A15 with Neon (in spite of file position) */
-/* FFT tuning limit = 25 M */
-/* Generated by tuneup.c, 2015-10-06, gcc 4.8 */
+/* 2000 MHz Cortex-A15 with Neon (in spite of file position) */
+/* FFT tuning limit = 50,736,668 */
+/* Generated by tuneup.c, 2019-10-22, gcc 5.4 */
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
#define MOD_1U_TO_MOD_1_1_THRESHOLD 2
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
-#define MOD_1_2_TO_MOD_1_4_THRESHOLD 102
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 9
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD MP_SIZE_T_MAX
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 8
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 49.14% faster than 2 */
#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 15
+#define BMOD_1_TO_MOD_1_THRESHOLD 17
+#define DIV_1_VS_MUL_1_PERCENT 267
+
#define MUL_TOOM22_THRESHOLD 28
-#define MUL_TOOM33_THRESHOLD 116
-#define MUL_TOOM44_THRESHOLD 169
-#define MUL_TOOM6H_THRESHOLD 399
+#define MUL_TOOM33_THRESHOLD 114
+#define MUL_TOOM44_THRESHOLD 178
+#define MUL_TOOM6H_THRESHOLD 238
#define MUL_TOOM8H_THRESHOLD 597
#define MUL_TOOM32_TO_TOOM43_THRESHOLD 113
@@ -61,133 +62,151 @@
#define MUL_TOOM32_TO_TOOM53_THRESHOLD 115
#define MUL_TOOM42_TO_TOOM53_THRESHOLD 115
#define MUL_TOOM42_TO_TOOM63_THRESHOLD 115
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 160
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 154
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_TOOM2_THRESHOLD 38
#define SQR_TOOM3_THRESHOLD 126
-#define SQR_TOOM4_THRESHOLD 345
-#define SQR_TOOM6_THRESHOLD 470
-#define SQR_TOOM8_THRESHOLD 644
+#define SQR_TOOM4_THRESHOLD 336
+#define SQR_TOOM6_THRESHOLD 446
+#define SQR_TOOM8_THRESHOLD 650
#define MULMID_TOOM42_THRESHOLD 52
-#define MULMOD_BNM1_THRESHOLD 17
-#define SQRMOD_BNM1_THRESHOLD 19
+#define MULMOD_BNM1_THRESHOLD 23
+#define SQRMOD_BNM1_THRESHOLD 17
-#define MUL_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 575 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 500, 5}, { 26, 6}, { 27, 7}, { 15, 6}, \
- { 31, 7}, { 19, 6}, { 39, 7}, { 25, 6}, \
- { 51, 7}, { 27, 8}, { 15, 7}, { 33, 8}, \
- { 19, 7}, { 41, 8}, { 23, 7}, { 51, 8}, \
- { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
- { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
- { 31, 8}, { 67, 9}, { 47, 8}, { 99, 9}, \
- { 55,10}, { 31, 9}, { 79,10}, { 47, 9}, \
- { 95,11}, { 31,10}, { 63, 9}, { 135,10}, \
- { 79, 9}, { 159,10}, { 95, 9}, { 191,10}, \
- { 111,11}, { 63,10}, { 127, 9}, { 255,10}, \
- { 143, 9}, { 287,10}, { 159,11}, { 95,10}, \
- { 191, 9}, { 383, 8}, { 767,12}, { 63,11}, \
+ { { 575, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 27, 7}, { 15, 6}, { 31, 7}, { 19, 6}, \
+ { 39, 7}, { 25, 6}, { 51, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 51, 8}, { 27, 9}, { 15, 8}, \
+ { 31, 7}, { 63, 8}, { 39, 9}, { 23, 8}, \
+ { 55,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
+ { 39, 8}, { 79, 9}, { 47, 8}, { 95, 9}, \
+ { 55,10}, { 31, 9}, { 71, 8}, { 143, 9}, \
+ { 87,10}, { 47, 9}, { 111,11}, { 31,10}, \
+ { 63, 9}, { 143,10}, { 79, 9}, { 159,10}, \
+ { 95,11}, { 63,10}, { 143, 9}, { 287,10}, \
+ { 159,11}, { 95,10}, { 191,12}, { 63,11}, \
{ 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,10}, { 287,11}, { 159,10}, { 335, 9}, \
+ { 671,10}, { 367, 9}, { 735,11}, { 191,10}, \
+ { 383, 9}, { 799,10}, { 415,11}, { 223,12}, \
+ { 127,10}, { 543,11}, { 287,10}, { 575,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,10}, \
+ { 831,11}, { 447,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1087,11}, { 575,12}, { 319,11}, \
+ { 671,10}, { 1343,11}, { 735,12}, { 383,11}, \
+ { 831,12}, { 447,11}, { 959,13}, { 255,12}, \
+ { 511,11}, { 1087,12}, { 575,11}, { 1151,12}, \
+ { 639,11}, { 1343,12}, { 703,13}, { 383,12}, \
+ { 767,11}, { 1599,12}, { 895,14}, { 255,13}, \
+ { 511,12}, { 1087,13}, { 639,12}, { 1407,13}, \
+ { 767,12}, { 1599,13}, { 895,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2431,13}, \
+ { 1279,12}, { 2559,13}, { 1407,14}, { 767,13}, \
+ { 1535,12}, { 3135,13}, { 1663,15}, { 511,14}, \
+ { 1023,13}, { 2303,14}, { 1279,13}, { 2559,12}, \
+ { 5119,13}, { 2687,14}, { 1535,13}, { 3071,12}, \
+ { 6143,13}, { 3199,12}, { 6399,14}, { 1791,15}, \
+ { 1023,14}, { 2047,13}, { 4095,14}, { 2303,13}, \
+ { 4607,12}, { 9215,13}, { 4863,12}, { 9727,14}, \
+ { 2559,13}, { 5119,15}, { 1535,14}, { 3071,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 155
+#define MUL_FFT_THRESHOLD 5760
+
+#define SQR_FFT_MODF_THRESHOLD 525 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 525, 5}, { 25, 6}, { 27, 7}, { 15, 6}, \
+ { 31, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 25, 6}, { 51, 7}, { 27, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 51, 8}, { 27, 7}, { 55, 9}, \
+ { 15, 8}, { 31, 7}, { 63, 8}, { 39, 9}, \
+ { 23, 8}, { 51,10}, { 15, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 99, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 95,11}, { 63,10}, { 143, 9}, \
+ { 287, 8}, { 575, 9}, { 303,10}, { 159,11}, \
+ { 95,10}, { 191, 9}, { 383,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
{ 543,10}, { 287,11}, { 159,10}, { 319, 9}, \
{ 639,10}, { 335, 9}, { 671,10}, { 351,11}, \
- { 191,10}, { 383, 9}, { 767,10}, { 415,11}, \
- { 223,12}, { 127,11}, { 255,10}, { 543,11}, \
- { 287,10}, { 575,11}, { 319,10}, { 639,11}, \
- { 351,12}, { 191,11}, { 383,10}, { 767,11}, \
- { 447,13}, { 127,12}, { 255,11}, { 607,12}, \
- { 319,11}, { 735,12}, { 383,11}, { 831,12}, \
- { 447,11}, { 895,13}, { 255,12}, { 511,11}, \
- { 1023,12}, { 703,13}, { 383,12}, { 895,14}, \
- { 255,13}, { 511,12}, { 1151,13}, { 639,12}, \
- { 1471,13}, { 767,12}, { 1663,13}, { 895,14}, \
+ { 191,10}, { 399, 9}, { 799,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 447,12}, { 127,10}, \
+ { 543,11}, { 287,10}, { 575,11}, { 319,10}, \
+ { 639,11}, { 351,10}, { 703,12}, { 191,11}, \
+ { 383,10}, { 799,11}, { 415,10}, { 831,11}, \
+ { 447,13}, { 127,11}, { 543,10}, { 1087,11}, \
+ { 607,12}, { 319,11}, { 735,12}, { 383,11}, \
+ { 831,12}, { 447,11}, { 959,12}, { 511,11}, \
+ { 1023,12}, { 575,11}, { 1151,12}, { 639,11}, \
+ { 1279,12}, { 703,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 831,11}, { 1663,12}, { 895,14}, \
+ { 255,13}, { 511,12}, { 1087,13}, { 639,12}, \
+ { 1343,13}, { 767,12}, { 1599,13}, { 895,14}, \
{ 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
- { 2431,13}, { 1279,14}, { 767,13}, { 1535,12}, \
- { 3135,15}, { 511,14}, { 1023,13}, { 2303,14}, \
- { 1279,13}, { 2559,12}, { 5119,13}, { 2815,14}, \
+ { 2303,13}, { 1279,14}, { 767,13}, { 1535,12}, \
+ { 3135,13}, { 1663,15}, { 511,14}, { 1023,13}, \
+ { 2047,12}, { 4095,13}, { 2303,14}, { 1279,13}, \
+ { 2559,12}, { 5119,14}, { 1535,13}, { 3071,12}, \
+ { 6143,13}, { 3199,12}, { 6399,14}, { 1791,15}, \
+ { 1023,14}, { 2047,13}, { 4095,14}, { 2303,13}, \
+ { 4607,12}, { 9215,13}, { 4863,12}, { 9727,14}, \
+ { 2559,15}, { 1535,14}, { 3071,13}, { 8192,14}, \
{ 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 122
-#define MUL_FFT_THRESHOLD 5312
+#define SQR_FFT_TABLE3_SIZE 154
+#define SQR_FFT_THRESHOLD 5312
-#define SQR_FFT_MODF_THRESHOLD 468 /* k = 5 */
-#define SQR_FFT_TABLE3 \
- { { 468, 5}, { 25, 6}, { 27, 7}, { 15, 6}, \
- { 31, 7}, { 19, 6}, { 39, 7}, { 25, 6}, \
- { 51, 7}, { 27, 8}, { 15, 7}, { 33, 8}, \
- { 19, 7}, { 41, 8}, { 23, 7}, { 51, 8}, \
- { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
- { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
- { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
- { 47, 8}, { 95, 9}, { 55,10}, { 31, 9}, \
- { 79,10}, { 47, 9}, { 103,11}, { 31,10}, \
- { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
- { 95, 9}, { 191,10}, { 111,11}, { 63,10}, \
- { 127, 9}, { 255,10}, { 143, 9}, { 287,10}, \
- { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
- { 383, 8}, { 767,12}, { 63,11}, { 127,10}, \
- { 255, 9}, { 511,10}, { 271, 9}, { 543,10}, \
- { 287,11}, { 159,10}, { 319, 9}, { 639,10}, \
- { 335, 9}, { 671,10}, { 351, 9}, { 703,11}, \
- { 191,10}, { 383, 9}, { 767,10}, { 415,11}, \
- { 223,12}, { 127,11}, { 255,10}, { 511,11}, \
- { 287,10}, { 575,11}, { 319,10}, { 639,11}, \
- { 351,12}, { 191,11}, { 383,10}, { 767,11}, \
- { 447,13}, { 127,12}, { 255,11}, { 607,12}, \
- { 319,11}, { 735,12}, { 383,11}, { 831,12}, \
- { 447,13}, { 255,12}, { 511,11}, { 1023,12}, \
- { 575,11}, { 1151,12}, { 639,11}, { 1279,12}, \
- { 703,13}, { 383,12}, { 895,14}, { 255,13}, \
- { 511,12}, { 1151,13}, { 639,12}, { 1407,13}, \
- { 767,12}, { 1663,13}, { 895,14}, { 511,13}, \
- { 1023,12}, { 2047,13}, { 1151,12}, { 2431,13}, \
- { 1279,14}, { 767,13}, { 1535,12}, { 3135,15}, \
- { 511,14}, { 1023,13}, { 2175,14}, { 1279,13}, \
- { 2687,14}, { 16384,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 127
-#define SQR_FFT_THRESHOLD 4736
-
#define MULLO_BASECASE_THRESHOLD 0 /* always */
#define MULLO_DC_THRESHOLD 38
-#define MULLO_MUL_N_THRESHOLD 8907
+#define MULLO_MUL_N_THRESHOLD 10950
#define SQRLO_BASECASE_THRESHOLD 10
#define SQRLO_DC_THRESHOLD 35
-#define SQRLO_SQR_THRESHOLD 8907
+#define SQRLO_SQR_THRESHOLD 10323
-#define DC_DIV_QR_THRESHOLD 54
-#define DC_DIVAPPR_Q_THRESHOLD 266
+#define DC_DIV_QR_THRESHOLD 57
+#define DC_DIVAPPR_Q_THRESHOLD 254
#define DC_BDIV_QR_THRESHOLD 48
-#define DC_BDIV_Q_THRESHOLD 296
+#define DC_BDIV_Q_THRESHOLD 286
-#define INV_MULMOD_BNM1_THRESHOLD 54
-#define INV_NEWTON_THRESHOLD 274
-#define INV_APPR_THRESHOLD 276
+#define INV_MULMOD_BNM1_THRESHOLD 55
+#define INV_NEWTON_THRESHOLD 252
+#define INV_APPR_THRESHOLD 252
-#define BINV_NEWTON_THRESHOLD 348
-#define REDC_1_TO_REDC_2_THRESHOLD 59
+#define BINV_NEWTON_THRESHOLD 372
+#define REDC_1_TO_REDC_2_THRESHOLD 61
#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
-#define MU_DIV_QR_THRESHOLD 1787
+#define MU_DIV_QR_THRESHOLD 1858
#define MU_DIVAPPR_Q_THRESHOLD 1787
#define MUPI_DIV_QR_THRESHOLD 122
#define MU_BDIV_QR_THRESHOLD 1528
-#define MU_BDIV_Q_THRESHOLD 1752
+#define MU_BDIV_Q_THRESHOLD 1836
-#define POWM_SEC_TABLE 1,32,224,398,2211
+#define POWM_SEC_TABLE 1,14,200,480,1532
#define GET_STR_DC_THRESHOLD 16
-#define GET_STR_PRECOMPUTE_THRESHOLD 30
-#define SET_STR_DC_THRESHOLD 100
-#define SET_STR_PRECOMPUTE_THRESHOLD 807
+#define GET_STR_PRECOMPUTE_THRESHOLD 33
+#define SET_STR_DC_THRESHOLD 104
+#define SET_STR_PRECOMPUTE_THRESHOLD 1120
-#define FAC_DSC_THRESHOLD 309
-#define FAC_ODD_THRESHOLD 28
+#define FAC_DSC_THRESHOLD 164
+#define FAC_ODD_THRESHOLD 27
-#define MATRIX22_STRASSEN_THRESHOLD 25
-#define HGCD_THRESHOLD 153
-#define HGCD_APPR_THRESHOLD 176
-#define HGCD_REDUCE_THRESHOLD 3014
-#define GCD_DC_THRESHOLD 667
-#define GCDEXT_DC_THRESHOLD 483
-#define JACOBI_BASE_METHOD 4
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD2_DIV1_METHOD 1 /* 3.70% faster than 3 */
+#define HGCD_THRESHOLD 137
+#define HGCD_APPR_THRESHOLD 157
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 610
+#define GCDEXT_DC_THRESHOLD 443
+#define JACOBI_BASE_METHOD 4 /* 12.66% faster than 1 */
+
+/* Tuneup completed successfully, took 69757 seconds */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora15/neon/aorsorrlshC_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -59,7 +59,7 @@
define(`CLRCY', `cmp r13, #0')
define(`RETVAL', `sbc $2, $2, $2
cmn $2, #1
- adc r0, $1, #0')
+ adc r0, $1, #0')
define(`func', mpn_sublsh`'LSH`'_n)')
ifdef(`DO_rsb', `
define(`ADCSBCS', `sbcs $1, $3, $2')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/addmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/addmul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/addmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,34 @@
+dnl ARM mpn_addmul_1
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_addmul_1)
+include_mpn(`arm/v6/addmul_1.asm')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,233 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+/* 1800 MHz Cortex-A17 with Neon (in spite of file position) */
+/* FFT tuning limit = 51243975 */
+/* Generated by tuneup.c, 2019-10-29, gcc 6.3 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 8
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD MP_SIZE_T_MAX
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 12
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1 /* 54.08% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 45
+
+#define DIV_1_VS_MUL_1_PERCENT 248
+
+#define MUL_TOOM22_THRESHOLD 38
+#define MUL_TOOM33_THRESHOLD 132
+#define MUL_TOOM44_THRESHOLD 200
+#define MUL_TOOM6H_THRESHOLD 303
+#define MUL_TOOM8H_THRESHOLD 478
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 137
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 179
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 132
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 145
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 191
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 62
+#define SQR_TOOM3_THRESHOLD 189
+#define SQR_TOOM4_THRESHOLD 354
+#define SQR_TOOM6_THRESHOLD 426
+#define SQR_TOOM8_THRESHOLD 608
+
+#define MULMID_TOOM42_THRESHOLD 62
+
+#define MULMOD_BNM1_THRESHOLD 21
+#define SQRMOD_BNM1_THRESHOLD 29
+
+#define MUL_FFT_MODF_THRESHOLD 595 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 595, 5}, { 29, 6}, { 15, 5}, { 31, 6}, \
+ { 16, 5}, { 33, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 7}, { 55, 9}, { 15, 8}, { 31, 7}, \
+ { 63, 8}, { 43, 9}, { 23, 8}, { 55, 9}, \
+ { 31, 8}, { 63, 9}, { 39, 8}, { 83, 9}, \
+ { 47, 8}, { 95, 9}, { 55,10}, { 31, 9}, \
+ { 79,10}, { 47, 9}, { 103,11}, { 31,10}, \
+ { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
+ { 95, 9}, { 191,10}, { 111,11}, { 63,10}, \
+ { 143, 8}, { 575,10}, { 159,11}, { 95,10}, \
+ { 191, 9}, { 383, 8}, { 767, 9}, { 399, 8}, \
+ { 799,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511, 8}, { 1023, 9}, { 543, 8}, { 1087, 9}, \
+ { 575,10}, { 303,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 335, 9}, { 671,10}, { 351, 9}, \
+ { 703,10}, { 367, 9}, { 735,11}, { 191,10}, \
+ { 383, 9}, { 767,10}, { 399, 9}, { 799,10}, \
+ { 415, 9}, { 831,10}, { 431, 9}, { 863,11}, \
+ { 223,10}, { 447,12}, { 127,10}, { 511, 9}, \
+ { 1023,10}, { 543, 9}, { 1087,10}, { 607, 9}, \
+ { 1215,11}, { 319,10}, { 671, 9}, { 1343,11}, \
+ { 351,10}, { 735,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,10}, { 863,11}, { 447,10}, \
+ { 895,13}, { 127,11}, { 511,10}, { 1023,11}, \
+ { 543,10}, { 1087,11}, { 607,10}, { 1215,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 735,10}, \
+ { 1471,12}, { 383,11}, { 799,10}, { 1599,11}, \
+ { 863,10}, { 1727,12}, { 447,11}, { 991,10}, \
+ { 1983,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1215,10}, { 2431,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,12}, { 959,11}, \
+ { 1983,13}, { 511,12}, { 1087,11}, { 2239,12}, \
+ { 1215,11}, { 2431,13}, { 639,12}, { 1471,11}, \
+ { 2943,13}, { 767,12}, { 1727,13}, { 895,12}, \
+ { 1983,14}, { 511,13}, { 1023,12}, { 2239,13}, \
+ { 1151,12}, { 2495,13}, { 1279,12}, { 2623,13}, \
+ { 1407,12}, { 2943,14}, { 767,13}, { 1535,12}, \
+ { 3135,13}, { 1663,12}, { 3455,13}, { 1919,12}, \
+ { 3839,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4479,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
+ { 3967,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
+ { 2303,13}, { 4991,12}, { 9983,14}, { 2559,13}, \
+ { 5247,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 194
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 500, 5}, { 29, 6}, { 15, 5}, { 31, 6}, \
+ { 16, 5}, { 33, 6}, { 29, 7}, { 15, 6}, \
+ { 32, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
+ { 43, 9}, { 23, 8}, { 55,10}, { 15, 9}, \
+ { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
+ { 47, 8}, { 95, 9}, { 55,10}, { 31, 9}, \
+ { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
+ { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
+ { 95, 9}, { 191,10}, { 111,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287,10}, \
+ { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
+ { 383, 8}, { 767, 9}, { 399,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
+ { 671,10}, { 351, 9}, { 703,10}, { 367, 9}, \
+ { 735,11}, { 191,10}, { 383, 9}, { 767,10}, \
+ { 399, 9}, { 799,10}, { 415, 9}, { 831,10}, \
+ { 431, 9}, { 863,10}, { 447,12}, { 127,11}, \
+ { 255,10}, { 511, 9}, { 1023,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 607, 9}, { 1215,11}, \
+ { 319,10}, { 671,11}, { 351,10}, { 735,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 863,11}, { 447,10}, { 895,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 543,10}, \
+ { 1087,11}, { 607,10}, { 1215,12}, { 319,11}, \
+ { 671,10}, { 1343,11}, { 735,10}, { 1471,12}, \
+ { 383,11}, { 799,10}, { 1599,11}, { 863,12}, \
+ { 447,11}, { 959,10}, { 1919,11}, { 991,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1215,10}, { 2431,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,12}, { 959,11}, \
+ { 1919,14}, { 255,13}, { 511,12}, { 1087,11}, \
+ { 2239,12}, { 1215,11}, { 2431,13}, { 639,12}, \
+ { 1471,11}, { 2943,13}, { 767,12}, { 1727,13}, \
+ { 895,12}, { 1983,14}, { 511,13}, { 1023,12}, \
+ { 2239,13}, { 1151,12}, { 2495,13}, { 1279,12}, \
+ { 2623,13}, { 1407,12}, { 2943,14}, { 767,13}, \
+ { 1535,12}, { 3071,13}, { 1663,12}, { 3455,13}, \
+ { 1919,12}, { 3839,15}, { 511,14}, { 1023,13}, \
+ { 2175,12}, { 4479,13}, { 2431,14}, { 1279,13}, \
+ { 2943,12}, { 5887,14}, { 1535,13}, { 3455,14}, \
+ { 1791,13}, { 3967,15}, { 1023,14}, { 2047,13}, \
+ { 4479,14}, { 2303,13}, { 4991,12}, { 9983,14}, \
+ { 2559,13}, { 5119,14}, { 2815,13}, { 5887,15}, \
+ { 1535,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 199
+#define SQR_FFT_THRESHOLD 4736
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 27
+#define MULLO_MUL_N_THRESHOLD 13463
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 26
+#define SQRLO_SQR_THRESHOLD 8907
+
+#define DC_DIV_QR_THRESHOLD 38
+#define DC_DIVAPPR_Q_THRESHOLD 103
+#define DC_BDIV_QR_THRESHOLD 44
+#define DC_BDIV_Q_THRESHOLD 98
+
+#define INV_MULMOD_BNM1_THRESHOLD 78
+#define INV_NEWTON_THRESHOLD 165
+#define INV_APPR_THRESHOLD 115
+
+#define BINV_NEWTON_THRESHOLD 296
+#define REDC_1_TO_REDC_2_THRESHOLD 2
+#define REDC_2_TO_REDC_N_THRESHOLD 147
+
+#define MU_DIV_QR_THRESHOLD 2089
+#define MU_DIVAPPR_Q_THRESHOLD 2089
+#define MUPI_DIV_QR_THRESHOLD 70
+#define MU_BDIV_QR_THRESHOLD 1718
+#define MU_BDIV_Q_THRESHOLD 2089
+
+#define POWM_SEC_TABLE 7,19,107,480,1486
+
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 29
+#define SET_STR_DC_THRESHOLD 126
+#define SET_STR_PRECOMPUTE_THRESHOLD 541
+
+#define FAC_DSC_THRESHOLD 132
+#define FAC_ODD_THRESHOLD 29
+
+#define MATRIX22_STRASSEN_THRESHOLD 30
+#define HGCD2_DIV1_METHOD 1 /* 6.55% faster than 3 */
+#define HGCD_THRESHOLD 54
+#define HGCD_APPR_THRESHOLD 52
+#define HGCD_REDUCE_THRESHOLD 3524
+#define GCD_DC_THRESHOLD 303
+#define GCDEXT_DC_THRESHOLD 225
+#define JACOBI_BASE_METHOD 4 /* 9.73% faster than 1 */
+
+/* Tuneup completed successfully, took 111418 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mod_34lsub1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mod_34lsub1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mod_34lsub1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,121 @@
+dnl ARM mpn_mod_34lsub1 -- remainder modulo 2^24-1.
+
+dnl Copyright 2012, 2013, 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C StrongARM ?
+C XScale ?
+C Cortex-A5 2.67
+C Cortex-A7 2.37
+C Cortex-A8 2.34
+C Cortex-A9 ?
+C Cortex-A15 1.39
+C Cortex-A17 1.60
+C Cortex-A53 2.51
+
+define(`ap', r0)
+define(`n', r1)
+
+C mp_limb_t mpn_mod_34lsub1 (mp_srcptr up, mp_size_t n)
+
+C TODO
+C * Write cleverer summation code.
+C * Consider loading 6 64-bit aligned registers at a time, to approach 1 c/l.
+
+ASM_START()
+ TEXT
+ ALIGN(32)
+PROLOGUE(mpn_mod_34lsub1)
+ push { r4, r5, r6, r7 }
+
+ subs n, n, #3
+ mov r7, #0
+ blt L(le2) C n <= 2
+
+ ldmia ap!, { r2, r3, r12 }
+ subs n, n, #3
+ blt L(sum) C n <= 5
+ mov r7, #0
+ b L(mid)
+
+L(top): adds r2, r2, r4
+ adcs r3, r3, r5
+ adcs r12, r12, r6
+ adc r7, r7, #0
+L(mid): ldmia ap!, { r4, r5, r6 }
+ subs n, n, #3
+ bpl L(top)
+
+ adds r2, r2, r4
+ adcs r3, r3, r5
+ adcs r12, r12, r6
+ adc r7, r7, #0 C r7 <= 1
+
+L(sum): cmn n, #2
+ movlo r4, #0
+ ldrhs r4, [ap], #4
+ movls r5, #0
+ ldrhi r5, [ap], #4
+
+ adds r2, r2, r4
+ adcs r3, r3, r5
+ adcs r12, r12, #0
+ adc r7, r7, #0 C r7 <= 2
+
+L(sum2):
+ bic r0, r2, #0xff000000
+ add r0, r0, r2, lsr #24
+ add r0, r0, r7
+
+ mov r7, r3, lsl #8
+ bic r2, r7, #0xff000000
+ add r0, r0, r2
+ add r0, r0, r3, lsr #16
+
+ mov r2, r12, lsl #16
+ bic r1, r2, #0xff000000
+ add r0, r0, r1
+ add r0, r0, r12, lsr #8
+
+ pop { r4, r5, r6, r7 }
+ return lr
+
+L(le2): cmn n, #1
+ bne L(1)
+ ldmia ap!, { r2, r3 }
+ mov r12, #0
+ b L(sum2)
+L(1): ldr r2, [ap]
+ bic r0, r2, #0xff000000
+ add r0, r0, r2, lsr #24
+ pop { r4, r5, r6, r7 }
+ return lr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/mul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,34 @@
+dnl ARM mpn_mul_1
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_mul_1)
+include_mpn(`arm/v6/mul_1.asm')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/submul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/submul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora17/submul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,34 @@
+dnl ARM mpn_submul_1
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_submul_1)
+include_mpn(`arm/v6/submul_1.asm')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora5/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora5/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora5/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,205 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+/* 1500 MHz Cortex-A5 (odroid c1) */
+/* FFT tuning limit = 18,235,562 */
+/* Generated by tuneup.c, 2019-10-22, gcc 4.9 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 8
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD MP_SIZE_T_MAX
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 23
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1 /* 132.79% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 52
+
+#define DIV_1_VS_MUL_1_PERCENT 213
+
+#define MUL_TOOM22_THRESHOLD 48
+#define MUL_TOOM33_THRESHOLD 143
+#define MUL_TOOM44_THRESHOLD 262
+#define MUL_TOOM6H_THRESHOLD 414
+#define MUL_TOOM8H_THRESHOLD 527
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 153
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 168
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 152
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 180
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 226
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 66
+#define SQR_TOOM3_THRESHOLD 149
+#define SQR_TOOM4_THRESHOLD 348
+#define SQR_TOOM6_THRESHOLD 517
+#define SQR_TOOM8_THRESHOLD 608
+
+#define MULMID_TOOM42_THRESHOLD 70
+
+#define MULMOD_BNM1_THRESHOLD 26
+#define SQRMOD_BNM1_THRESHOLD 28
+
+#define MUL_FFT_MODF_THRESHOLD 660 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 660, 5}, { 29, 6}, { 15, 5}, { 33, 6}, \
+ { 17, 5}, { 35, 6}, { 29, 7}, { 15, 6}, \
+ { 37, 7}, { 19, 6}, { 40, 7}, { 21, 6}, \
+ { 43, 7}, { 37, 8}, { 19, 7}, { 43, 8}, \
+ { 23, 7}, { 51, 8}, { 27, 7}, { 55, 8}, \
+ { 31, 7}, { 63, 8}, { 43, 9}, { 23, 8}, \
+ { 55, 9}, { 31, 8}, { 71, 9}, { 39, 8}, \
+ { 83, 9}, { 47, 8}, { 99, 9}, { 55,10}, \
+ { 31, 9}, { 63, 8}, { 127, 9}, { 79,10}, \
+ { 47, 9}, { 103,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 167,10}, { 95, 9}, \
+ { 191,10}, { 111,11}, { 63,10}, { 159,11}, \
+ { 95,10}, { 191, 9}, { 383,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271,11}, \
+ { 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
+ { 671,11}, { 191,10}, { 383, 9}, { 767,10}, \
+ { 399, 9}, { 799,10}, { 415,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 511, 9}, { 1023,10}, \
+ { 543,11}, { 287,10}, { 607,11}, { 319,10}, \
+ { 671,11}, { 351,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,10}, { 831,13}, { 127,12}, \
+ { 255,11}, { 511,10}, { 1023,11}, { 543,10}, \
+ { 1087,11}, { 575,10}, { 1151,11}, { 607,12}, \
+ { 319,11}, { 703,12}, { 383,11}, { 831,12}, \
+ { 447,11}, { 895,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1183,12}, { 639,11}, \
+ { 1279,12}, { 703,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 895,14}, { 255,13}, { 511,12}, \
+ { 1151,13}, { 639,12}, { 1407,13}, { 767,12}, \
+ { 1599,13}, { 895,12}, { 1791,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2367,13}, \
+ { 1279,12}, { 2559,13}, { 1407,14}, { 767,13}, \
+ { 1535,12}, { 3071,13}, { 1663,12}, { 3327,13}, \
+ { 1791,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4351,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 140
+#define MUL_FFT_THRESHOLD 7552
+
+#define SQR_FFT_MODF_THRESHOLD 590 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 590, 5}, { 33, 6}, { 17, 5}, { 35, 6}, \
+ { 36, 7}, { 19, 6}, { 40, 7}, { 21, 6}, \
+ { 43, 7}, { 23, 6}, { 47, 7}, { 37, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
+ { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 83, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 103,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 167,10}, { 95, 9}, \
+ { 191,10}, { 111,11}, { 63,10}, { 159,11}, \
+ { 95,10}, { 191, 9}, { 383,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 335, 9}, { 671,10}, { 351,11}, { 191,10}, \
+ { 383, 9}, { 767,10}, { 415,12}, { 127,11}, \
+ { 255,10}, { 511, 9}, { 1023,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 575, 9}, { 1151,10}, \
+ { 607,11}, { 319,10}, { 671,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 831,13}, { 127,12}, { 255,11}, { 511,10}, \
+ { 1023,11}, { 543,10}, { 1087,11}, { 575,10}, \
+ { 1151,11}, { 607,12}, { 319,11}, { 735,12}, \
+ { 383,11}, { 831,12}, { 447,11}, { 927,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1151,12}, { 639,11}, { 1279,12}, { 703,13}, \
+ { 383,12}, { 767,11}, { 1535,12}, { 831,11}, \
+ { 1663,12}, { 895,11}, { 1791,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1023,11}, { 2047,12}, \
+ { 1151,13}, { 639,12}, { 1407,13}, { 767,12}, \
+ { 1599,13}, { 895,12}, { 1791,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2367,13}, \
+ { 1279,12}, { 2559,13}, { 1407,14}, { 767,13}, \
+ { 1535,12}, { 3071,13}, { 1663,12}, { 3327,13}, \
+ { 1791,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4351,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 144
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 39
+#define MULLO_MUL_N_THRESHOLD 14709
+#define SQRLO_BASECASE_THRESHOLD 8
+#define SQRLO_DC_THRESHOLD 33
+#define SQRLO_SQR_THRESHOLD 11278
+
+#define DC_DIV_QR_THRESHOLD 36
+#define DC_DIVAPPR_Q_THRESHOLD 116
+#define DC_BDIV_QR_THRESHOLD 48
+#define DC_BDIV_Q_THRESHOLD 140
+
+#define INV_MULMOD_BNM1_THRESHOLD 95
+#define INV_NEWTON_THRESHOLD 181
+#define INV_APPR_THRESHOLD 125
+
+#define BINV_NEWTON_THRESHOLD 327
+#define REDC_1_TO_REDC_2_THRESHOLD 0 /* always */
+#define REDC_2_TO_REDC_N_THRESHOLD 152
+
+#define MU_DIV_QR_THRESHOLD 2350
+#define MU_DIVAPPR_Q_THRESHOLD 2130
+#define MUPI_DIV_QR_THRESHOLD 98
+#define MU_BDIV_QR_THRESHOLD 1970
+#define MU_BDIV_Q_THRESHOLD 2172
+
+#define POWM_SEC_TABLE 6,37,108,624,2351
+
+#define GET_STR_DC_THRESHOLD 28
+#define GET_STR_PRECOMPUTE_THRESHOLD 44
+#define SET_STR_DC_THRESHOLD 309
+#define SET_STR_PRECOMPUTE_THRESHOLD 762
+
+#define FAC_DSC_THRESHOLD 236
+#define FAC_ODD_THRESHOLD 29
+
+#define MATRIX22_STRASSEN_THRESHOLD 25
+#define HGCD2_DIV1_METHOD 5 /* 2.92% faster than 3 */
+#define HGCD_THRESHOLD 70
+#define HGCD_APPR_THRESHOLD 59
+#define HGCD_REDUCE_THRESHOLD 4120
+#define GCD_DC_THRESHOLD 229
+#define GCDEXT_DC_THRESHOLD 233
+#define JACOBI_BASE_METHOD 1 /* 17.07% faster than 4 */
+
+/* Tuneup completed successfully, took 47845 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora5/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora7/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora7/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora7/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012, 2015 Free Software
-Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -33,47 +32,49 @@
#define GMP_LIMB_BYTES 4
/* 900 MHz Cortex-A7 (raspberry pi2) */
-/* FFT tuning limit = 25 M */
-/* Generated by tuneup.c, 2015-05-15, gcc 4.6 */
+/* FFT tuning limit = 21,559,921 */
+/* Generated by tuneup.c, 2019-10-22, gcc 8.3 */
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 7
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
#define MOD_1_2_TO_MOD_1_4_THRESHOLD MP_SIZE_T_MAX
#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 18
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 16
-#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 64.16% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 47
+#define BMOD_1_TO_MOD_1_THRESHOLD 48
+#define DIV_1_VS_MUL_1_PERCENT 216
+
#define MUL_TOOM22_THRESHOLD 39
#define MUL_TOOM33_THRESHOLD 129
-#define MUL_TOOM44_THRESHOLD 195
-#define MUL_TOOM6H_THRESHOLD 414
+#define MUL_TOOM44_THRESHOLD 196
+#define MUL_TOOM6H_THRESHOLD 327
#define MUL_TOOM8H_THRESHOLD 478
#define MUL_TOOM32_TO_TOOM43_THRESHOLD 129
#define MUL_TOOM32_TO_TOOM53_THRESHOLD 183
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 129
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 145
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 191
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 132
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 144
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 190
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_TOOM2_THRESHOLD 52
#define SQR_TOOM3_THRESHOLD 162
-#define SQR_TOOM4_THRESHOLD 280
+#define SQR_TOOM4_THRESHOLD 268
#define SQR_TOOM6_THRESHOLD 399
-#define SQR_TOOM8_THRESHOLD 567
+#define SQR_TOOM8_THRESHOLD 547
-#define MULMID_TOOM42_THRESHOLD 58
+#define MULMID_TOOM42_THRESHOLD 50
-#define MULMOD_BNM1_THRESHOLD 22
-#define SQRMOD_BNM1_THRESHOLD 27
+#define MULMOD_BNM1_THRESHOLD 21
+#define SQRMOD_BNM1_THRESHOLD 25
#define MUL_FFT_MODF_THRESHOLD 636 /* k = 5 */
#define MUL_FFT_TABLE3 \
@@ -91,104 +92,111 @@
{ 63,10}, { 159,11}, { 95,10}, { 191,12}, \
{ 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
{ 271, 9}, { 543,11}, { 159,10}, { 319, 9}, \
- { 639,10}, { 335, 9}, { 671,11}, { 191,10}, \
- { 383, 9}, { 767,10}, { 399, 9}, { 799,11}, \
- { 223,12}, { 127,11}, { 255,10}, { 543,11}, \
+ { 639,10}, { 335, 9}, { 671,10}, { 351,11}, \
+ { 191,10}, { 383, 9}, { 767,10}, { 399, 9}, \
+ { 799,10}, { 415,11}, { 223,12}, { 127,11}, \
+ { 255,10}, { 511, 9}, { 1023,10}, { 543,11}, \
{ 287,10}, { 607,11}, { 319,10}, { 671,11}, \
{ 351,12}, { 191,11}, { 383,10}, { 799,11}, \
- { 415,13}, { 127,12}, { 255,11}, { 543,10}, \
- { 1087,11}, { 607,12}, { 319,11}, { 735,12}, \
- { 383,11}, { 863,12}, { 447,11}, { 959,13}, \
- { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
- { 1215,12}, { 703,13}, { 383,12}, { 767,11}, \
- { 1535,12}, { 959,14}, { 255,13}, { 511,12}, \
- { 1215,13}, { 639,12}, { 1471,13}, { 767,12}, \
- { 1663,13}, { 895,12}, { 1855,14}, { 511,13}, \
- { 1023,12}, { 2111,13}, { 1151,12}, { 2431,13}, \
- { 1407,14}, { 767,13}, { 1663,12}, { 3327,13}, \
- { 1791,15}, { 511,14}, { 1023,13}, { 2431,14}, \
- { 1279,13}, { 2815,14}, { 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 124
-#define MUL_FFT_THRESHOLD 5760
+ { 415,10}, { 831,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,11}, { 543,10}, { 1087,11}, \
+ { 607,12}, { 319,11}, { 735,12}, { 383,11}, \
+ { 863,12}, { 447,11}, { 959,13}, { 255,12}, \
+ { 511,11}, { 1087,12}, { 575,11}, { 1215,12}, \
+ { 639,11}, { 1279,12}, { 703,13}, { 383,12}, \
+ { 767,11}, { 1599,12}, { 959,14}, { 255,13}, \
+ { 511,12}, { 1215,13}, { 639,12}, { 1471,13}, \
+ { 767,12}, { 1663,13}, { 895,12}, { 1855,14}, \
+ { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
+ { 2431,13}, { 1407,14}, { 767,13}, { 1663,12}, \
+ { 3327,13}, { 1791,15}, { 511,14}, { 1023,13}, \
+ { 2431,14}, { 1279,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 133
+#define MUL_FFT_THRESHOLD 6784
-#define SQR_FFT_MODF_THRESHOLD 555 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 535 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 555, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
- { 29, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
- { 36, 7}, { 19, 6}, { 39, 7}, { 29, 8}, \
- { 15, 7}, { 35, 8}, { 19, 7}, { 43, 8}, \
- { 23, 7}, { 49, 8}, { 31, 7}, { 63, 8}, \
+ { { 535, 5}, { 25, 6}, { 13, 5}, { 28, 6}, \
+ { 15, 5}, { 31, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 29, 8}, { 15, 7}, { 37, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
{ 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
{ 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
{ 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
- { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 47, 9}, { 103,11}, { 31,10}, { 63, 9}, \
{ 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
{ 191,10}, { 111,11}, { 63,10}, { 143, 9}, \
{ 287,10}, { 159,11}, { 95,10}, { 191,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511, 8}, \
- { 1023, 9}, { 543,10}, { 287,11}, { 159,10}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
+ { 271, 9}, { 543,10}, { 287,11}, { 159,10}, \
{ 319, 9}, { 639,10}, { 335, 9}, { 671,10}, \
{ 351,11}, { 191,10}, { 383, 9}, { 767,10}, \
- { 399, 9}, { 799,10}, { 415,12}, { 127,11}, \
- { 255,10}, { 511, 9}, { 1023,10}, { 543,11}, \
- { 287,10}, { 607,11}, { 319,10}, { 671,11}, \
- { 351,12}, { 191,11}, { 383,10}, { 799,11}, \
- { 415,10}, { 831,13}, { 127,12}, { 255,11}, \
- { 511,10}, { 1023,11}, { 543,10}, { 1087,11}, \
- { 607,12}, { 319,11}, { 735,12}, { 383,11}, \
- { 863,12}, { 447,11}, { 991,12}, { 511,11}, \
- { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
- { 1279,12}, { 703,13}, { 383,12}, { 959,13}, \
- { 511,12}, { 1215,13}, { 639,12}, { 1471,13}, \
- { 767,12}, { 1663,13}, { 895,12}, { 1855,14}, \
- { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
- { 2431,13}, { 1407,14}, { 767,13}, { 1663,12}, \
- { 3327,13}, { 1791,15}, { 511,14}, { 1023,13}, \
- { 2431,14}, { 1279,13}, { 2815,14}, { 16384,15}, \
- { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 129
+ { 399, 9}, { 799,10}, { 415, 9}, { 831,11}, \
+ { 223,12}, { 127,10}, { 543,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 671,11}, { 351,10}, \
+ { 703,12}, { 191,11}, { 383,10}, { 799,11}, \
+ { 415,10}, { 831,13}, { 127,11}, { 511,10}, \
+ { 1023,11}, { 543,10}, { 1087,11}, { 607,12}, \
+ { 319,11}, { 735,12}, { 383,11}, { 863,12}, \
+ { 447,11}, { 991,12}, { 511,11}, { 1087,12}, \
+ { 575,11}, { 1215,12}, { 639,11}, { 1279,12}, \
+ { 703,13}, { 383,12}, { 767,11}, { 1535,12}, \
+ { 831,11}, { 1663,12}, { 959,13}, { 511,12}, \
+ { 1215,13}, { 639,12}, { 1471,13}, { 767,12}, \
+ { 1663,13}, { 895,12}, { 1855,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2431,13}, \
+ { 1407,14}, { 767,13}, { 1791,15}, { 511,14}, \
+ { 1023,13}, { 2431,14}, { 1279,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 134
#define SQR_FFT_THRESHOLD 4736
#define MULLO_BASECASE_THRESHOLD 0 /* always */
#define MULLO_DC_THRESHOLD 27
-#define MULLO_MUL_N_THRESHOLD 11278
+#define MULLO_MUL_N_THRESHOLD 13463
#define SQRLO_BASECASE_THRESHOLD 5
-#define SQRLO_DC_THRESHOLD 30
-#define SQRLO_SQR_THRESHOLD 8907
+#define SQRLO_DC_THRESHOLD 31
+#define SQRLO_SQR_THRESHOLD 9449
-#define DC_DIV_QR_THRESHOLD 32
-#define DC_DIVAPPR_Q_THRESHOLD 89
-#define DC_BDIV_QR_THRESHOLD 39
-#define DC_BDIV_Q_THRESHOLD 112
+#define DC_DIV_QR_THRESHOLD 28
+#define DC_DIVAPPR_Q_THRESHOLD 90
+#define DC_BDIV_QR_THRESHOLD 32
+#define DC_BDIV_Q_THRESHOLD 110
-#define INV_MULMOD_BNM1_THRESHOLD 76
-#define INV_NEWTON_THRESHOLD 110
+#define INV_MULMOD_BNM1_THRESHOLD 78
+#define INV_NEWTON_THRESHOLD 134
#define INV_APPR_THRESHOLD 98
-#define BINV_NEWTON_THRESHOLD 214
+#define BINV_NEWTON_THRESHOLD 278
#define REDC_1_TO_REDC_2_THRESHOLD 4
-#define REDC_2_TO_REDC_N_THRESHOLD 122
+#define REDC_2_TO_REDC_N_THRESHOLD 123
#define MU_DIV_QR_THRESHOLD 1718
#define MU_DIVAPPR_Q_THRESHOLD 1685
-#define MUPI_DIV_QR_THRESHOLD 54
-#define MU_BDIV_QR_THRESHOLD 1470
-#define MU_BDIV_Q_THRESHOLD 1685
+#define MUPI_DIV_QR_THRESHOLD 62
+#define MU_BDIV_QR_THRESHOLD 1528
+#define MU_BDIV_Q_THRESHOLD 1718
-#define POWM_SEC_TABLE 1,16,102,615,2016
+#define POWM_SEC_TABLE 1,22,95,563,1955
-#define GET_STR_DC_THRESHOLD 29
-#define GET_STR_PRECOMPUTE_THRESHOLD 57
-#define SET_STR_DC_THRESHOLD 272
-#define SET_STR_PRECOMPUTE_THRESHOLD 788
+#define GET_STR_DC_THRESHOLD 28
+#define GET_STR_PRECOMPUTE_THRESHOLD 51
+#define SET_STR_DC_THRESHOLD 182
+#define SET_STR_PRECOMPUTE_THRESHOLD 638
-#define FAC_DSC_THRESHOLD 360
-#define FAC_ODD_THRESHOLD 55
+#define FAC_DSC_THRESHOLD 153
+#define FAC_ODD_THRESHOLD 56
-#define MATRIX22_STRASSEN_THRESHOLD 27
+#define MATRIX22_STRASSEN_THRESHOLD 25
+#define HGCD2_DIV1_METHOD 1 /* 5.04% faster than 3 */
#define HGCD_THRESHOLD 55
-#define HGCD_APPR_THRESHOLD 51
+#define HGCD_APPR_THRESHOLD 50
#define HGCD_REDUCE_THRESHOLD 3389
-#define GCD_DC_THRESHOLD 168
-#define GCDEXT_DC_THRESHOLD 189
-#define JACOBI_BASE_METHOD 1
+#define GCD_DC_THRESHOLD 153
+#define GCDEXT_DC_THRESHOLD 180
+#define JACOBI_BASE_METHOD 1 /* 30.60% faster than 4 */
+
+/* Tuneup completed successfully, took 75202 seconds */
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,158 @@
+dnl ARM v6 mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb divisor.
+dnl This is v6 code but it runs well on just the v7a Cortex-A8, A9, and A15.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 2013, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C norm unorm
+C 1176 - -
+C Cortex-A5 9 13
+C Cortex-A7 12 18
+C Cortex-A8 13 14
+C Cortex-A9 9 10 not measured since latest edits
+C Cortex-A15 7 7
+C Cortex-A53 16 24
+
+C Architecture requirements:
+C v5 -
+C v5t clz
+C v5te -
+C v6 umaal
+C v6t2 -
+C v7a -
+
+define(`rp', `r0')
+define(`up', `r1')
+define(`n', `r2')
+define(`d', `r3')
+define(`di_arg', `sp[0]') C just mpn_pi1_bdiv_q_1
+define(`cnt_arg', `sp[4]') C just mpn_pi1_bdiv_q_1
+
+define(`cy', `r7')
+define(`cnt', `r6')
+define(`tnc', `r4')
+
+ASM_START()
+PROLOGUE(mpn_bdiv_q_1)
+ push {r6-r11}
+
+ rsb r10, d, #0
+ and r10, r10, d
+ clz r10, r10
+ rsbs cnt, r10, #31 C count_trailing_zeros
+ mov d, d, lsr cnt
+
+C binvert limb
+ LEA( r10, binvert_limb_table)
+ and r12, d, #254
+ ldrb r10, [r10, r12, lsr #1]
+ mul r12, r10, r10
+ mul r12, d, r12
+ rsb r12, r12, r10, lsl #1
+ mul r10, r12, r12
+ mul r10, d, r10
+ rsb r10, r10, r12, lsl #1 C r10 = inverse
+ b L(pi1)
+EPILOGUE()
+
+PROLOGUE(mpn_pi1_bdiv_q_1)
+ push {r6-r11}
+
+ ldr cnt, [sp, #28]
+ ldr r10, [sp, #24]
+ cmp cnt, #0
+
+L(pi1): ldr r11, [up], #4 C up[0]
+ mov cy, #0
+ rsb r8, r10, #0 C r8 = -inverse
+ bne L(unorm)
+
+L(norm):
+ subs n, n, #1
+ mul r11, r11, r10
+ beq L(edn)
+
+ ALIGN(16)
+L(tpn): ldr r9, [up], #4
+ mov r12, #0
+ str r11, [rp], #4
+ umaal r12, cy, r11, d
+ mul r11, r9, r10
+ mla r11, cy, r8, r11
+ subs n, n, #1
+ bne L(tpn)
+
+L(edn): str r11, [rp]
+ pop {r6-r11}
+ bx r14
+
+L(unorm):
+ push {r4-r5}
+ rsb tnc, cnt, #32
+ mov r5, r11, lsr cnt
+ subs n, n, #1
+ beq L(ed1)
+
+ ldr r12, [up], #4
+ orr r9, r5, r12, lsl tnc
+ mov r5, r12, lsr cnt
+ mul r11, r9, r10
+ subs n, n, #1
+ beq L(edu)
+
+ ALIGN(16)
+L(tpu): ldr r12, [up], #4
+ orr r9, r5, r12, lsl tnc
+ mov r5, r12, lsr cnt
+ mov r12, #0
+ str r11, [rp], #4
+ umaal r12, cy, r11, d
+ mul r11, r9, r10
+ mla r11, cy, r8, r11
+ subs n, n, #1
+ bne L(tpu)
+
+L(edu): str r11, [rp], #4
+ mov r12, #0
+ umaal r12, cy, r11, d
+ mul r11, r5, r10
+ mla r11, cy, r8, r11
+ str r11, [rp]
+ pop {r4-r11}
+ bx r14
+
+L(ed1): mul r11, r5, r10
+ str r11, [rp]
+ pop {r4-r11}
+ bx r14
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora8/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2003, 2009, 2010, 2012, 2015 Free Software
-Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -33,62 +32,63 @@
#define GMP_LIMB_BYTES 4
/* 1000 MHz Cortex-A8 (beaglebone black) */
-/* FFT tuning limit = 10 M */
-/* Generated by tuneup.c, 2015-10-05, gcc 4.6 */
+/* FFT tuning limit = 9,464,348 */
+/* Generated by tuneup.c, 2019-10-23, gcc 6.3 */
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 5
#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
#define MOD_1_1_TO_MOD_1_2_THRESHOLD MP_SIZE_T_MAX
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 12
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 50.65% faster than 2 */
#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 28
+#define BMOD_1_TO_MOD_1_THRESHOLD 31
+#define DIV_1_VS_MUL_1_PERCENT 192
+
#define MUL_TOOM22_THRESHOLD 39
#define MUL_TOOM33_THRESHOLD 129
-#define MUL_TOOM44_THRESHOLD 220
+#define MUL_TOOM44_THRESHOLD 226
#define MUL_TOOM6H_THRESHOLD 366
#define MUL_TOOM8H_THRESHOLD 620
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 129
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 179
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 139
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 149
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 141
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 183
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 154
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 160
#define MUL_TOOM43_TO_TOOM54_THRESHOLD 193
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
-#define SQR_TOOM2_THRESHOLD 44
+#define SQR_TOOM2_THRESHOLD 46
#define SQR_TOOM3_THRESHOLD 145
-#define SQR_TOOM4_THRESHOLD 384
-#define SQR_TOOM6_THRESHOLD 414
+#define SQR_TOOM4_THRESHOLD 375
+#define SQR_TOOM6_THRESHOLD 0 /* always */
#define SQR_TOOM8_THRESHOLD 547
-#define MULMID_TOOM42_THRESHOLD 40
+#define MULMID_TOOM42_THRESHOLD 38
#define MULMOD_BNM1_THRESHOLD 22
-#define SQRMOD_BNM1_THRESHOLD 25
+#define SQRMOD_BNM1_THRESHOLD 23
#define MUL_FFT_MODF_THRESHOLD 476 /* k = 5 */
#define MUL_FFT_TABLE3 \
{ { 476, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
- { 28, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
- { 35, 7}, { 19, 6}, { 39, 7}, { 27, 8}, \
- { 15, 7}, { 35, 8}, { 19, 7}, { 43, 8}, \
- { 23, 7}, { 49, 8}, { 27, 7}, { 55, 8}, \
- { 31, 7}, { 63, 8}, { 43, 9}, { 23, 8}, \
- { 55, 9}, { 31, 8}, { 71, 9}, { 39, 8}, \
- { 83, 9}, { 47, 8}, { 99, 9}, { 55,10}, \
- { 31, 9}, { 63, 8}, { 127, 9}, { 87,10}, \
+ { 28, 7}, { 15, 6}, { 33, 7}, { 19, 6}, \
+ { 39, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 51, 8}, \
+ { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
+ { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 71, 9}, { 39, 8}, { 83, 9}, { 47, 8}, \
+ { 99, 9}, { 55,10}, { 31, 9}, { 87,10}, \
{ 47, 9}, { 103,11}, { 31,10}, { 63, 9}, \
- { 143,10}, { 79, 9}, { 167,10}, { 95, 9}, \
- { 191,10}, { 111,11}, { 63,10}, { 127, 9}, \
+ { 135,10}, { 79, 9}, { 167,10}, { 95, 9}, \
+ { 199,10}, { 111,11}, { 63,10}, { 127, 9}, \
{ 255,10}, { 143, 9}, { 287, 8}, { 575,10}, \
{ 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
{ 383, 8}, { 767, 9}, { 399,10}, { 207,12}, \
@@ -95,113 +95,113 @@
{ 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
{ 271, 9}, { 543,10}, { 287, 9}, { 575,11}, \
{ 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
- { 671,10}, { 351, 9}, { 703,11}, { 191,10}, \
- { 383, 9}, { 767,10}, { 399, 9}, { 799,10}, \
- { 415, 9}, { 831,11}, { 223,12}, { 127,11}, \
- { 255,10}, { 511, 9}, { 1023,10}, { 543,11}, \
+ { 671,10}, { 351, 9}, { 703,10}, { 367,11}, \
+ { 191,10}, { 399, 9}, { 799,10}, { 415,11}, \
+ { 223,12}, { 127,11}, { 255,10}, { 543,11}, \
{ 287,10}, { 607, 9}, { 1215,11}, { 319,10}, \
{ 671,11}, { 351,10}, { 703,12}, { 191,11}, \
{ 383,10}, { 799,11}, { 415,10}, { 863,11}, \
- { 447,13}, { 127,12}, { 255,11}, { 511,10}, \
- { 1023,11}, { 543,10}, { 1087,11}, { 607,12}, \
- { 319,11}, { 671,10}, { 1343,11}, { 735,12}, \
- { 383,11}, { 799,10}, { 1599,11}, { 863,12}, \
- { 447,11}, { 959,13}, { 255,12}, { 511,11}, \
- { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
- { 1343,12}, { 703,11}, { 1407,13}, { 383,12}, \
- { 767,11}, { 1599,12}, { 831,11}, { 1663,12}, \
- { 959,14}, { 255,13}, { 511,12}, { 1215,13}, \
- { 639,12}, { 1471,13}, { 767,12}, { 1663,13}, \
- { 895,12}, { 1791,14}, { 511,13}, { 1023,12}, \
- { 2111,13}, { 1151,12}, { 2431,13}, { 8192,14}, \
- { 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 150
-#define MUL_FFT_THRESHOLD 7552
-
-#define SQR_FFT_MODF_THRESHOLD 428 /* k = 5 */
-#define SQR_FFT_TABLE3 \
- { { 428, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
- { 25, 7}, { 13, 6}, { 28, 7}, { 15, 6}, \
- { 32, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
- { 39, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
- { 19, 7}, { 41, 8}, { 23, 7}, { 49, 8}, \
- { 27, 9}, { 15, 8}, { 39, 9}, { 23, 8}, \
- { 55,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
- { 39, 8}, { 83, 9}, { 47, 8}, { 95, 9}, \
- { 55,10}, { 31, 9}, { 79,10}, { 47, 9}, \
- { 103,11}, { 31,10}, { 63, 9}, { 135,10}, \
- { 79, 9}, { 159, 8}, { 319, 9}, { 167,10}, \
- { 95, 9}, { 191,10}, { 111,11}, { 63,10}, \
- { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
- { 143, 9}, { 287, 8}, { 575, 9}, { 303,10}, \
- { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
- { 383, 8}, { 767, 9}, { 399,12}, { 63,11}, \
- { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
- { 543,10}, { 287, 9}, { 575,10}, { 303,11}, \
- { 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
- { 671,10}, { 351, 9}, { 703,10}, { 367,11}, \
- { 191,10}, { 383, 9}, { 767,10}, { 399, 9}, \
- { 799,10}, { 415, 9}, { 831,11}, { 223,10}, \
- { 447,12}, { 127,11}, { 255,10}, { 511, 9}, \
- { 1023,10}, { 543,11}, { 287,10}, { 607,11}, \
- { 319,10}, { 671,11}, { 351,10}, { 735,12}, \
- { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
- { 863,11}, { 447,10}, { 895,13}, { 127,12}, \
- { 255,11}, { 511,10}, { 1023,11}, { 543,10}, \
+ { 447,13}, { 127,12}, { 255,11}, { 543,10}, \
{ 1087,11}, { 607,12}, { 319,11}, { 671,10}, \
{ 1343,11}, { 735,12}, { 383,11}, { 799,10}, \
{ 1599,11}, { 863,12}, { 447,11}, { 959,13}, \
{ 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1215,12}, { 639,11}, { 1343,12}, { 703,13}, \
+ { 383,12}, { 767,11}, { 1599,12}, { 831,11}, \
+ { 1663,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1215,13}, { 639,12}, { 1407,13}, { 767,12}, \
+ { 1663,13}, { 895,12}, { 1791,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 4096,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 139
+#define MUL_FFT_THRESHOLD 6784
+
+#define SQR_FFT_MODF_THRESHOLD 436 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 436, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 28, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
+ { 35, 7}, { 19, 6}, { 39, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 9}, { 15, 8}, \
+ { 43, 9}, { 23, 8}, { 55,10}, { 15, 9}, \
+ { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
+ { 47, 8}, { 95, 9}, { 55,10}, { 31, 9}, \
+ { 79,10}, { 47, 9}, { 103,11}, { 31,10}, \
+ { 63, 9}, { 135,10}, { 79, 9}, { 159, 8}, \
+ { 319, 9}, { 167,10}, { 95, 9}, { 191,10}, \
+ { 111,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511, 9}, { 271,10}, { 143, 9}, { 287, 8}, \
+ { 575, 9}, { 303,10}, { 159, 9}, { 319,11}, \
+ { 95,10}, { 191, 9}, { 383, 8}, { 767, 9}, \
+ { 399,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287, 9}, \
+ { 575,10}, { 303,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 335, 9}, { 671,10}, { 351, 9}, \
+ { 703,10}, { 367,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 399, 9}, { 799,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 447,12}, { 127,11}, \
+ { 255,10}, { 511, 9}, { 1023,10}, { 543,11}, \
+ { 287,10}, { 607,11}, { 319,10}, { 671,11}, \
+ { 351,10}, { 735,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,10}, { 863,11}, { 447,10}, \
+ { 895,13}, { 127,12}, { 255,11}, { 511,10}, \
+ { 1023,11}, { 543,10}, { 1087,11}, { 607,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 735,12}, \
+ { 383,11}, { 863,12}, { 447,11}, { 959,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
{ 1215,12}, { 639,11}, { 1343,12}, { 703,11}, \
{ 1407,13}, { 383,12}, { 767,11}, { 1599,12}, \
{ 831,11}, { 1663,12}, { 959,14}, { 255,13}, \
{ 511,12}, { 1215,13}, { 639,12}, { 1471,13}, \
- { 767,12}, { 1663,13}, { 895,12}, { 1919,14}, \
+ { 767,12}, { 1663,13}, { 895,12}, { 1855,14}, \
{ 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
- { 2431,13}, { 8192,14}, { 16384,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 156
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 152
#define SQR_FFT_THRESHOLD 3712
-#define MULLO_BASECASE_THRESHOLD 19
+#define MULLO_BASECASE_THRESHOLD 21
#define MULLO_DC_THRESHOLD 0 /* never mpn_mullo_basecase */
-#define MULLO_MUL_N_THRESHOLD 22
-#define SQRLO_BASECASE_THRESHOLD 13
-#define SQRLO_DC_THRESHOLD 14
+#define MULLO_MUL_N_THRESHOLD 13463
+#define SQRLO_BASECASE_THRESHOLD 9
+#define SQRLO_DC_THRESHOLD 17
#define SQRLO_SQR_THRESHOLD 7246
-#define DC_DIV_QR_THRESHOLD 23
-#define DC_DIVAPPR_Q_THRESHOLD 64
-#define DC_BDIV_QR_THRESHOLD 25
-#define DC_BDIV_Q_THRESHOLD 56
+#define DC_DIV_QR_THRESHOLD 27
+#define DC_DIVAPPR_Q_THRESHOLD 74
+#define DC_BDIV_QR_THRESHOLD 21
+#define DC_BDIV_Q_THRESHOLD 64
-#define INV_MULMOD_BNM1_THRESHOLD 77
+#define INV_MULMOD_BNM1_THRESHOLD 78
#define INV_NEWTON_THRESHOLD 31
#define INV_APPR_THRESHOLD 37
-#define BINV_NEWTON_THRESHOLD 166
-#define REDC_1_TO_REDC_2_THRESHOLD 0 /* always */
+#define BINV_NEWTON_THRESHOLD 167
+#define REDC_1_TO_REDC_2_THRESHOLD 4
#define REDC_2_TO_REDC_N_THRESHOLD 198
-#define MU_DIV_QR_THRESHOLD 1787
-#define MU_DIVAPPR_Q_THRESHOLD 1558
-#define MUPI_DIV_QR_THRESHOLD 45
-#define MU_BDIV_QR_THRESHOLD 1718
+#define MU_DIV_QR_THRESHOLD 1858
+#define MU_DIVAPPR_Q_THRESHOLD 1685
+#define MUPI_DIV_QR_THRESHOLD 43
+#define MU_BDIV_QR_THRESHOLD 1589
#define MU_BDIV_Q_THRESHOLD 1685
-#define POWM_SEC_TABLE 1,19,101,371,1486
+#define POWM_SEC_TABLE 1,13,96,487,1378
-#define GET_STR_DC_THRESHOLD 21
-#define GET_STR_PRECOMPUTE_THRESHOLD 38
-#define SET_STR_DC_THRESHOLD 146
-#define SET_STR_PRECOMPUTE_THRESHOLD 531
+#define GET_STR_DC_THRESHOLD 18
+#define GET_STR_PRECOMPUTE_THRESHOLD 36
+#define SET_STR_DC_THRESHOLD 145
+#define SET_STR_PRECOMPUTE_THRESHOLD 505
-#define FAC_DSC_THRESHOLD 155
-#define FAC_ODD_THRESHOLD 24
+#define FAC_DSC_THRESHOLD 137
+#define FAC_ODD_THRESHOLD 29
#define MATRIX22_STRASSEN_THRESHOLD 24
-#define HGCD_THRESHOLD 42
+#define HGCD2_DIV1_METHOD 5 /* 4.29% faster than 4 */
+#define HGCD_THRESHOLD 39
#define HGCD_APPR_THRESHOLD 50
-#define HGCD_REDUCE_THRESHOLD 3664
-#define GCD_DC_THRESHOLD 156
-#define GCDEXT_DC_THRESHOLD 116
-#define JACOBI_BASE_METHOD 4
+#define HGCD_REDUCE_THRESHOLD 3524
+#define GCD_DC_THRESHOLD 116
+#define GCDEXT_DC_THRESHOLD 124
+#define JACOBI_BASE_METHOD 4 /* 5.89% faster than 1 */
+
+/* Tuneup completed successfully, took 48230 seconds */
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,36 @@
+dnl ARM mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb divisor.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 2013, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+MULFUNC_PROLOGUE(mpn_bdiv_q_1 mpn_pi1_bdiv_q_1)
+include_mpn(`arm/v7a/cora8/bdiv_q_1.asm')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm/v7a/cora9/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -51,6 +51,8 @@
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
#define BMOD_1_TO_MOD_1_THRESHOLD 20
+#define DIV_1_VS_MUL_1_PERCENT 190
+
#define MUL_TOOM22_THRESHOLD 45
#define MUL_TOOM33_THRESHOLD 129
#define MUL_TOOM44_THRESHOLD 387
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aors_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
dnl Contributed to the GNU project by Torbjörn Granlund.
-dnl Copyright 2013 Free Software Foundation, Inc.
+dnl Copyright 2013, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -33,10 +33,11 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 2.75-3.25
+C Cortex-A57 1.5
+C X-Gene 2.0
-changecom(@&*$)
+changecom(blah)
define(`rp', `x0')
define(`up', `x1')
@@ -47,16 +48,15 @@
define(`ADDSUBC', adcs)
define(`CLRCY', `cmn xzr, xzr')
define(`SETCY', `cmp $1, #1')
- define(`RETVAL', `adc x0, xzr, xzr')
- define(`func', mpn_add_n)
+ define(`RETVAL', `cset x0, cs')
+ define(`func_n', mpn_add_n)
define(`func_nc', mpn_add_nc)')
ifdef(`OPERATION_sub_n', `
define(`ADDSUBC', sbcs)
define(`CLRCY', `cmp xzr, xzr')
- define(`SETCY', `subs $1, xzr, $1')
- define(`RETVAL', `sbc x0, xzr, xzr
- and x0, x0, #1')
- define(`func', mpn_sub_n)
+ define(`SETCY', `cmp xzr, $1')
+ define(`RETVAL', `cset x0, cc')
+ define(`func_n', mpn_sub_n)
define(`func_nc', mpn_sub_nc)')
MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
@@ -66,33 +66,60 @@
SETCY( x4)
b L(ent)
EPILOGUE()
-PROLOGUE(func)
+PROLOGUE(func_n)
CLRCY
-L(ent): tbz n, #0, L(b0)
+L(ent): lsr x18, n, #2
+ tbz n, #0, L(bx0)
- ldr x4, [up],#8
- ldr x6, [vp],#8
- sub n, n, #1
- ADDSUBC x8, x4, x6
- str x8, [rp],#8
- cbz n, L(rt)
+L(bx1): ldr x7, [up]
+ ldr x11, [vp]
+ ADDSUBC x13, x7, x11
+ str x13, [rp],#8
+ tbnz n, #1, L(b11)
-L(b0): ldp x4, x5, [up],#16
- ldp x6, x7, [vp],#16
- sub n, n, #2
- ADDSUBC x8, x4, x6
- ADDSUBC x9, x5, x7
- cbz n, L(end)
+L(b01): cbz x18, L(ret)
+ ldp x4, x5, [up,#8]
+ ldp x8, x9, [vp,#8]
+ sub up, up, #8
+ sub vp, vp, #8
+ b L(mid)
-L(top): ldp x4, x5, [up],#16
- ldp x6, x7, [vp],#16
- sub n, n, #2
- stp x8, x9, [rp],#16
- ADDSUBC x8, x4, x6
- ADDSUBC x9, x5, x7
- cbnz n, L(top)
+L(b11): ldp x6, x7, [up,#8]
+ ldp x10, x11, [vp,#8]
+ add up, up, #8
+ add vp, vp, #8
+ cbz x18, L(end)
+ b L(top)
-L(end): stp x8, x9, [rp]
-L(rt): RETVAL
+L(bx0): tbnz n, #1, L(b10)
+
+L(b00): ldp x4, x5, [up]
+ ldp x8, x9, [vp]
+ sub up, up, #16
+ sub vp, vp, #16
+ b L(mid)
+
+L(b10): ldp x6, x7, [up]
+ ldp x10, x11, [vp]
+ cbz x18, L(end)
+
+ ALIGN(16)
+L(top): ldp x4, x5, [up,#16]
+ ldp x8, x9, [vp,#16]
+ ADDSUBC x12, x6, x10
+ ADDSUBC x13, x7, x11
+ stp x12, x13, [rp],#16
+L(mid): ldp x6, x7, [up,#32]!
+ ldp x10, x11, [vp,#32]!
+ ADDSUBC x12, x4, x8
+ ADDSUBC x13, x5, x9
+ stp x12, x13, [rp],#16
+ sub x18, x18, #1
+ cbnz x18, L(top)
+
+L(end): ADDSUBC x12, x6, x10
+ ADDSUBC x13, x7, x11
+ stp x12, x13, [rp]
+L(ret): RETVAL
ret
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsmul_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,8 +1,8 @@
-dnl ARM64 mpn_submul_1
+dnl ARM64 mpn_addmul_1 and mpn_submul_1
dnl Contributed to the GNU project by Torbjörn Granlund.
-dnl Copyright 2013 Free Software Foundation, Inc.
+dnl Copyright 2013, 2015, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -33,11 +33,19 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 9.3-9.8
+C Cortex-A57 7.0
+C X-Gene 5.0
-changecom(@&*$)
+C NOTES
+C * It is possible to keep the carry chain alive between the addition blocks
+C and thus avoid csinc, but only for addmul_1. Since that saves no time
+C on the tested pipelines, we keep addmul_1 and submul_1 similar.
+C * We could separate feed-in into 4 blocks, one for each residue (mod 4).
+C That is likely to save a few cycles.
+changecom(blah)
+
define(`rp', `x0')
define(`up', `x1')
define(`n', `x2')
@@ -57,7 +65,7 @@
MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
PROLOGUE(func)
- mov x15, #0
+ adds x15, xzr, xzr
tbz n, #0, L(1)
@@ -64,8 +72,7 @@
ldr x4, [up],#8
mul x8, x4, v0
umulh x12, x4, v0
- adds x8, x8, x15
- ldr x4, [rp,#0]
+ ldr x4, [rp]
ADDSUB x8, x4, x8
csinc x15, x12, x12, COND
str x8, [rp],#8
@@ -79,9 +86,8 @@
umulh x13, x5, v0
adds x8, x8, x15
adcs x9, x9, x12
- ldp x4, x5, [rp,#0]
+ ldp x4, x5, [rp]
adc x15, x13, xzr
- sub n, n, #1
ADDSUB x8, x4, x8
ADDSUBC x9, x5, x9
csinc x15, x15, x15, COND
@@ -88,10 +94,24 @@
stp x8, x9, [rp],#16
L(2): lsr n, n, #2
- cbz n, L(end)
+ cbz n, L(le3)
+ ldp x4, x5, [up],#32
+ ldp x6, x7, [up,#-16]
+ b L(mid)
+L(le3): mov x0, x15
+ ret
-L(top): ldp x4, x5, [up],#16
- ldp x6, x7, [up],#16
+ ALIGN(16)
+L(top): ldp x4, x5, [up],#32
+ ldp x6, x7, [up,#-16]
+ ADDSUB x8, x16, x8
+ ADDSUBC x9, x17, x9
+ stp x8, x9, [rp],#32
+ ADDSUBC x10, x12, x10
+ ADDSUBC x11, x13, x11
+ stp x10, x11, [rp,#-16]
+ csinc x15, x15, x15, COND
+L(mid): sub n, n, #1
mul x8, x4, v0
umulh x12, x4, v0
mul x9, x5, v0
@@ -103,20 +123,18 @@
mul x11, x7, v0
umulh x15, x7, v0
adcs x10, x10, x13
- ldp x4, x5, [rp,#0]
+ ldp x16, x17, [rp]
adcs x11, x11, x14
- ldp x6, x7, [rp,#16]
+ ldp x12, x13, [rp,#16]
adc x15, x15, xzr
- sub n, n, #1
- ADDSUB x8, x4, x8
- ADDSUBC x9, x5, x9
- ADDSUBC x10, x6, x10
- ADDSUBC x11, x7, x11
- stp x8, x9, [rp],#16
- csinc x15, x15, x15, COND
- stp x10, x11, [rp],#16
cbnz n, L(top)
-L(end): mov x0, x15
+ ADDSUB x8, x16, x8
+ ADDSUBC x9, x17, x9
+ ADDSUBC x10, x12, x10
+ ADDSUBC x11, x13, x11
+ stp x8, x9, [rp]
+ stp x10, x11, [rp,#16]
+ csinc x0, x15, x15, COND
ret
EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh1_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh1_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh1_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,43 @@
+dnl ARM64 mpn_addlsh1_n, mpn_sublsh1_n, mpn_rsblsh1_n.
+
+dnl Copyright 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+
+define(LSH, 1)
+define(RSH, 63)
+
+ifdef(`OPERATION_addlsh1_n',`define(`DO_add')')
+ifdef(`OPERATION_sublsh1_n',`define(`DO_sub')')
+ifdef(`OPERATION_rsblsh1_n',`define(`DO_rsb')')
+
+MULFUNC_PROLOGUE(mpn_addlsh1_n mpn_sublsh1_n mpn_rsblsh1_n)
+
+include_mpn(`arm64/aorsorrlshC_n.asm')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh2_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh2_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlsh2_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,43 @@
+dnl ARM64 mpn_addlsh2_n, mpn_sublsh2_n, mpn_rsblsh2_n.
+
+dnl Copyright 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+
+define(LSH, 2)
+define(RSH, 62)
+
+ifdef(`OPERATION_addlsh2_n',`define(`DO_add')')
+ifdef(`OPERATION_sublsh2_n',`define(`DO_sub')')
+ifdef(`OPERATION_rsblsh2_n',`define(`DO_rsb')')
+
+MULFUNC_PROLOGUE(mpn_addlsh2_n mpn_sublsh2_n mpn_rsblsh2_n)
+
+include_mpn(`arm64/aorsorrlshC_n.asm')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlshC_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlshC_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/aorsorrlshC_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,139 @@
+dnl ARM64 mpn_addlshC_n, mpn_sublshC_n, mpn_rsblshC_n.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C Cortex-A53 3.25-3.75
+C Cortex-A57 2.18
+C X-Gene 2.5
+
+changecom(blah)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`vp', `x2')
+define(`n', `x3')
+
+ifdef(`DO_add', `
+ define(`ADDSUB', `adds $1, $2, $3')
+ define(`ADDSUBC', `adcs $1, $2, $3')
+ define(`CLRRCY', `adds $1, xzr, xzr')
+ define(`RETVAL', `adc x0, $1, xzr')
+ define(`func_n', mpn_addlsh`'LSH`'_n)')
+ifdef(`DO_sub', `
+ define(`ADDSUB', `subs $1, $3, $2')
+ define(`ADDSUBC', `sbcs $1, $3, $2')
+ define(`CLRRCY', `subs $1, xzr, xzr')
+ define(`RETVAL', `cinc x0, $1, cc')
+ define(`func_n', mpn_sublsh`'LSH`'_n)')
+ifdef(`DO_rsb', `
+ define(`ADDSUB', `subs $1, $2, $3')
+ define(`ADDSUBC', `sbcs $1, $2, $3')
+ define(`CLRRCY', `subs $1, xzr, xzr')
+ define(`RETVAL', `sbc x0, $1, xzr')
+ define(`func_n', mpn_rsblsh`'LSH`'_n)')
+
+ASM_START()
+PROLOGUE(func_n)
+ lsr x18, n, #2
+ tbz n, #0, L(bx0)
+
+L(bx1): ldr x5, [up]
+ tbnz n, #1, L(b11)
+
+L(b01): ldr x11, [vp]
+ cbz x18, L(1)
+ ldp x8, x9, [vp,#8]
+ lsl x13, x11, #LSH
+ ADDSUB( x15, x13, x5)
+ str x15, [rp],#8
+ sub up, up, #24
+ sub vp, vp, #8
+ b L(mid)
+
+L(1): lsl x13, x11, #LSH
+ ADDSUB( x15, x13, x5)
+ str x15, [rp]
+ lsr x0, x11, RSH
+ RETVAL( x0, x1)
+ ret
+
+L(b11): ldr x9, [vp]
+ ldp x10, x11, [vp,#8]!
+ lsl x13, x9, #LSH
+ ADDSUB( x17, x13, x5)
+ str x17, [rp],#8
+ sub up, up, #8
+ cbz x18, L(end)
+ b L(top)
+
+L(bx0): tbnz n, #1, L(b10)
+
+L(b00): CLRRCY( x11)
+ ldp x8, x9, [vp],#-16
+ sub up, up, #32
+ b L(mid)
+
+L(b10): CLRRCY( x9)
+ ldp x10, x11, [vp]
+ sub up, up, #16
+ cbz x18, L(end)
+
+ ALIGN(16)
+L(top): ldp x4, x5, [up,#16]
+ extr x12, x10, x9, #RSH
+ ldp x8, x9, [vp,#16]
+ extr x13, x11, x10, #RSH
+ ADDSUBC(x14, x12, x4)
+ ADDSUBC(x15, x13, x5)
+ stp x14, x15, [rp],#16
+L(mid): ldp x4, x5, [up,#32]!
+ extr x12, x8, x11, #RSH
+ ldp x10, x11, [vp,#32]!
+ extr x13, x9, x8, #RSH
+ ADDSUBC(x16, x12, x4)
+ ADDSUBC(x17, x13, x5)
+ stp x16, x17, [rp],#16
+ sub x18, x18, #1
+ cbnz x18, L(top)
+
+L(end): ldp x4, x5, [up,#16]
+ extr x12, x10, x9, #RSH
+ extr x13, x11, x10, #RSH
+ ADDSUBC(x14, x12, x4)
+ ADDSUBC(x15, x13, x5)
+ stp x14, x15, [rp]
+ lsr x0, x11, RSH
+ RETVAL( x0, x1)
+ ret
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_dbm1c.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,8 +31,9 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 8
+C Cortex-A57 7
+C X-Gene 4.25
define(`qp', `x0')
define(`up', `x1')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,128 @@
+dnl ARM64 mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb divisor.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C norm unorm
+C Cortex-A53 12 15
+C Cortex-A57 12 12
+C Cortex-A72
+C Cortex-A73
+C X-Gene 11 11
+
+C TODO
+C * Scheduling of umulh later in the unorm loop brings A53 time to 12 c/l.
+C Unfortunately, that requires software pipelining.
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`n', `x2')
+define(`d', `x3')
+define(`di', `x4') C just mpn_pi1_bdiv_q_1
+define(`cnt', `x5') C just mpn_pi1_bdiv_q_1
+
+define(`cy', `r7')
+define(`tnc', `x8')
+
+ASM_START()
+PROLOGUE(mpn_bdiv_q_1)
+
+ rbit x6, d
+ clz cnt, x6
+ lsr d, d, cnt
+
+ifdef(`PIC',`
+ adrp x7, :got:__gmp_binvert_limb_table
+ ubfx x6, d, 1, 7
+ ldr x7, [x7, #:got_lo12:__gmp_binvert_limb_table]
+',`
+ adrp x7, __gmp_binvert_limb_table
+ ubfx x6, d, 1, 7
+ add x7, x7, :lo12:__gmp_binvert_limb_table
+')
+ ldrb w6, [x7, x6]
+ ubfiz x7, x6, 1, 8
+ umull x6, w6, w6
+ msub x6, x6, d, x7
+ lsl x7, x6, 1
+ mul x6, x6, x6
+ msub x6, x6, d, x7
+ lsl x7, x6, 1
+ mul x6, x6, x6
+ msub di, x6, d, x7
+
+ b mpn_pi1_bdiv_q_1
+EPILOGUE()
+
+PROLOGUE(mpn_pi1_bdiv_q_1)
+ sub n, n, #1
+ subs x6, x6, x6 C clear r6 and C flag
+ ldr x9, [up],#8
+ cbz cnt, L(norm)
+
+L(unorm):
+ lsr x12, x9, cnt
+ cbz n, L(eu1)
+ sub tnc, xzr, cnt
+
+L(tpu): ldr x9, [up],#8
+ lsl x7, x9, tnc
+ orr x7, x7, x12
+ sbcs x6, x7, x6
+ mul x7, x6, di
+ str x7, [rp],#8
+ lsr x12, x9, cnt
+ umulh x6, x7, d
+ sub n, n, #1
+ cbnz n, L(tpu)
+
+L(eu1): sbcs x6, x12, x6
+ mul x6, x6, di
+ str x6, [rp]
+ ret
+
+L(norm):
+ mul x5, x9, di
+ str x5, [rp],#8
+ cbz n, L(en1)
+
+L(tpn): ldr x9, [up],#8
+ umulh x5, x5, d
+ sbcs x5, x9, x5
+ mul x5, x5, di
+ str x5, [rp],#8
+ sub n, n, #1
+ cbnz n, L(tpn)
+
+L(en1): ret
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cnd_aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cnd_aors_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cnd_aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
dnl Contributed to the GNU project by Torbjörn Granlund.
-dnl Copyright 2012, 2013 Free Software Foundation, Inc.
+dnl Copyright 2012, 2013, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -33,10 +33,11 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 3.87-4.37
+C Cortex-A57 1.75
+C X-Gene 2.0
-changecom(@&*$)
+changecom(blah)
define(`cnd', `x0')
define(`rp', `x1')
@@ -45,16 +46,15 @@
define(`n', `x4')
ifdef(`OPERATION_cnd_add_n', `
- define(`ADDSUBC', adcs)
+ define(`ADDSUBC', adcs)
define(`CLRCY', `cmn xzr, xzr')
- define(`RETVAL', `adc x0, xzr, xzr')
- define(func, mpn_cnd_add_n)')
+ define(`RETVAL', `cset x0, cs')
+ define(`func', mpn_cnd_add_n)')
ifdef(`OPERATION_cnd_sub_n', `
- define(`ADDSUBC', sbcs)
+ define(`ADDSUBC', sbcs)
define(`CLRCY', `cmp xzr, xzr')
- define(`RETVAL', `sbc x0, xzr, xzr
- and x0, x0, #1')
- define(func, mpn_cnd_sub_n)')
+ define(`RETVAL', `cset x0, cc')
+ define(`func', mpn_cnd_sub_n)')
MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
@@ -63,37 +63,67 @@
cmp cnd, #1
sbc cnd, cnd, cnd
- CLRCY C really only needed for n = 0 (mod 4)
+ CLRCY
- tbz n, #0, L(1)
- ldr x10, [up], #8
- ldr x12, [vp], #8
- bic x6, x12, cnd
- ADDSUBC x8, x10, x6
- sub n, n, #1
- str x8, [rp], #8
- cbz n, L(rt)
+ lsr x18, n, #2
+ tbz n, #0, L(bx0)
-L(1): ldp x10, x11, [up], #16
- ldp x12, x13, [vp], #16
- sub n, n, #2
- cbz n, L(end)
+L(bx1): ldr x13, [vp]
+ ldr x11, [up]
+ bic x7, x13, cnd
+ ADDSUBC x9, x11, x7
+ str x9, [rp]
+ tbnz n, #1, L(b11)
+L(b01): cbz x18, L(rt)
+ ldp x12, x13, [vp,#8]
+ ldp x10, x11, [up,#8]
+ sub up, up, #8
+ sub vp, vp, #8
+ sub rp, rp, #24
+ b L(mid)
+
+L(b11): ldp x12, x13, [vp,#8]!
+ ldp x10, x11, [up,#8]!
+ sub rp, rp, #8
+ cbz x18, L(end)
+ b L(top)
+
+L(bx0): ldp x12, x13, [vp]
+ ldp x10, x11, [up]
+ tbnz n, #1, L(b10)
+
+L(b00): sub up, up, #16
+ sub vp, vp, #16
+ sub rp, rp, #32
+ b L(mid)
+
+L(b10): sub rp, rp, #16
+ cbz x18, L(end)
+
+ ALIGN(16)
L(top): bic x6, x12, cnd
bic x7, x13, cnd
- ldp x12, x13, [vp], #16
+ ldp x12, x13, [vp,#16]
ADDSUBC x8, x10, x6
ADDSUBC x9, x11, x7
- ldp x10, x11, [up], #16
- sub n, n, #2
- stp x8, x9, [rp], #16
- cbnz n, L(top)
+ ldp x10, x11, [up,#16]
+ stp x8, x9, [rp,#16]
+L(mid): bic x6, x12, cnd
+ bic x7, x13, cnd
+ ldp x12, x13, [vp,#32]!
+ ADDSUBC x8, x10, x6
+ ADDSUBC x9, x11, x7
+ ldp x10, x11, [up,#32]!
+ stp x8, x9, [rp,#32]!
+ sub x18, x18, #1
+ cbnz x18, L(top)
L(end): bic x6, x12, cnd
bic x7, x13, cnd
ADDSUBC x8, x10, x6
ADDSUBC x9, x11, x7
- stp x8, x9, [rp]
+ stp x8, x9, [rp,#16]
L(rt): RETVAL
ret
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/com.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/com.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/com.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,10 +31,11 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 2.25
+C Cortex-A57 1.25
+C X-Gene 1.75
-changecom(@&*$)
+changecom(blah)
define(`rp', `x0')
define(`up', `x1')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyd.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyd.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyd.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,7 @@
C Cortex-A53 ?
C Cortex-A57 ?
-changecom(@&*$)
+changecom(blah)
define(`rp', `x0')
define(`up', `x1')
@@ -58,9 +58,9 @@
L(al2): sub up, up, #16
ld1 {v26.2d}, [up]
- subs n, n, #6
+ sub n, n, #6
sub rp, rp, #16 C offset rp for loop
- b.lt L(end)
+ tbnz n, #63, L(end)
sub up, up, #16 C offset up for loop
mov x12, #-16
@@ -70,8 +70,8 @@
st1 {v26.2d}, [rp], x12
ld1 {v26.2d}, [up], x12
st1 {v22.2d}, [rp], x12
- subs n, n, #4
- b.ge L(top)
+ sub n, n, #4
+ tbz n, #63, L(top)
add up, up, #16 C undo up offset
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyi.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyi.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/copyi.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,10 +31,11 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 2
+C Cortex-A57 1
+C X-Gene 1.25
-changecom(@&*$)
+changecom(blah)
define(`rp', `x0')
define(`up', `x1')
@@ -52,8 +53,8 @@
st1 {v22.1d}, [rp], #8
L(al2): ld1 {v26.2d}, [up], #16
- subs n, n, #6
- b.lt L(end)
+ sub n, n, #6
+ tbnz n, #63, L(end)
ALIGN(16)
L(top): ld1 {v22.2d}, [up], #16
@@ -60,8 +61,8 @@
st1 {v26.2d}, [rp], #16
ld1 {v26.2d}, [up], #16
st1 {v22.2d}, [rp], #16
- subs n, n, #4
- b.ge L(top)
+ sub n, n, #4
+ tbz n, #63, L(top)
L(end): st1 {v26.2d}, [rp], #16
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/cnd_aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/cnd_aors_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/cnd_aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,99 @@
+dnl ARM64 mpn_cnd_add_n, mpn_cnd_sub_n
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2012, 2013, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C Cortex-A53 3.5-4
+C Cortex-A57 2.25
+C X-Gene 3.5
+
+changecom(blah)
+
+define(`cnd', `x0')
+define(`rp', `x1')
+define(`up', `x2')
+define(`vp', `x3')
+define(`n', `x4')
+
+ifdef(`OPERATION_cnd_add_n', `
+ define(`ADDSUBC', adcs)
+ define(`CLRCY', `cmn xzr, xzr')
+ define(`RETVAL', `cset x0, cs')
+ define(`func', mpn_cnd_add_n)')
+ifdef(`OPERATION_cnd_sub_n', `
+ define(`ADDSUBC', sbcs)
+ define(`CLRCY', `cmp xzr, xzr')
+ define(`RETVAL', `cset x0, cc')
+ define(`func', mpn_cnd_sub_n)')
+
+MULFUNC_PROLOGUE(mpn_cnd_add_n mpn_cnd_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ cmp cnd, #1
+ sbc cnd, cnd, cnd
+
+ CLRCY C really only needed for n = 0 (mod 4)
+
+ tbz n, #0, L(1)
+ ldr x10, [up], #8
+ ldr x12, [vp], #8
+ bic x6, x12, cnd
+ ADDSUBC x8, x10, x6
+ sub n, n, #1
+ str x8, [rp], #8
+ cbz n, L(rt)
+
+L(1): ldp x10, x11, [up], #16
+ ldp x12, x13, [vp], #16
+ sub n, n, #2
+ cbz n, L(end)
+
+L(top): bic x6, x12, cnd
+ bic x7, x13, cnd
+ ldp x12, x13, [vp], #16
+ ADDSUBC x8, x10, x6
+ ADDSUBC x9, x11, x7
+ ldp x10, x11, [up], #16
+ sub n, n, #2
+ stp x8, x9, [rp], #16
+ cbnz n, L(top)
+
+L(end): bic x6, x12, cnd
+ bic x7, x13, cnd
+ ADDSUBC x8, x10, x6
+ ADDSUBC x9, x11, x7
+ stp x8, x9, [rp]
+L(rt): RETVAL
+ ret
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,242 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file for a53.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 1536 MHz Cortex-A53 */
+/* FFT tuning limit = 21,583,800 */
+/* Generated by tuneup.c, 2019-10-22, gcc 5.4 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#define MOD_1_1P_METHOD 2 /* 4.84% faster than 1 */
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 12
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 18
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 22
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 39.05% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 21
+#define DIV_QR_1_UNNORM_THRESHOLD 21
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 38
+
+#define DIV_1_VS_MUL_1_PERCENT 161
+
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 49
+#define MUL_TOOM44_THRESHOLD 73
+#define MUL_TOOM6H_THRESHOLD 173
+#define MUL_TOOM8H_THRESHOLD 236
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 77
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 88
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 65
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 68
+#define SQR_TOOM4_THRESHOLD 183
+#define SQR_TOOM6_THRESHOLD 230
+#define SQR_TOOM8_THRESHOLD 357
+
+#define MULMID_TOOM42_THRESHOLD 23
+
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 11
+
+#define MUL_FFT_MODF_THRESHOLD 316 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 316, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 8, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 23, 8}, \
+ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
+ { 41, 9}, { 23, 8}, { 49, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 51,11}, \
+ { 15,10}, { 31, 9}, { 71,10}, { 39, 9}, \
+ { 83,10}, { 47, 9}, { 99,10}, { 55,11}, \
+ { 31,10}, { 63, 8}, { 255,10}, { 71, 8}, \
+ { 287,10}, { 79, 9}, { 159, 8}, { 319,10}, \
+ { 87,11}, { 47,10}, { 95, 9}, { 191, 8}, \
+ { 383,10}, { 103, 9}, { 207, 8}, { 415,10}, \
+ { 111, 9}, { 223,12}, { 31,11}, { 63, 9}, \
+ { 255, 8}, { 511,10}, { 135, 9}, { 287, 8}, \
+ { 575,11}, { 79,10}, { 159, 9}, { 319, 8}, \
+ { 639,10}, { 175, 9}, { 351, 8}, { 703,11}, \
+ { 95,10}, { 191, 9}, { 383, 8}, { 767,10}, \
+ { 207, 9}, { 415, 8}, { 831,10}, { 223, 9}, \
+ { 447,12}, { 63,10}, { 255, 9}, { 511, 8}, \
+ { 1023, 9}, { 543,10}, { 287, 9}, { 575, 8}, \
+ { 1151,11}, { 159,10}, { 319, 9}, { 639,11}, \
+ { 175,10}, { 351, 9}, { 703, 8}, { 1407,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447,13}, { 63,11}, { 255,10}, { 543,11}, \
+ { 287,10}, { 575, 9}, { 1151,12}, { 159,11}, \
+ { 319,10}, { 639,11}, { 351,10}, { 703, 9}, \
+ { 1407, 8}, { 2815,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 415,10}, { 831,12}, { 223,11}, \
+ { 447,10}, { 895,11}, { 479,10}, { 959, 9}, \
+ { 1919,12}, { 255,11}, { 511,10}, { 1023,11}, \
+ { 543,10}, { 1087,12}, { 287,11}, { 575,10}, \
+ { 1151,12}, { 319,11}, { 639,12}, { 351,11}, \
+ { 703,10}, { 1407, 9}, { 2815,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 415,11}, { 831,10}, \
+ { 1663,12}, { 447,11}, { 895,10}, { 1791,12}, \
+ { 479,11}, { 959,13}, { 255,12}, { 511,11}, \
+ { 1023,12}, { 543,11}, { 1087,12}, { 575,11}, \
+ { 1151,13}, { 319,12}, { 703,11}, { 1407,10}, \
+ { 2815,13}, { 383,12}, { 831,11}, { 1663,13}, \
+ { 447,12}, { 895,11}, { 1791,12}, { 959,11}, \
+ { 1919,14}, { 255,13}, { 511,12}, { 1087,13}, \
+ { 575,12}, { 1151,13}, { 703,12}, { 1407,11}, \
+ { 2815,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 895,12}, { 1791,13}, { 959,12}, { 1919,15}, \
+ { 255,14}, { 511,13}, { 1087,12}, { 2175,13}, \
+ { 1215,14}, { 639,13}, { 1407,12}, { 2815,14}, \
+ { 767,13}, { 1663,14}, { 895,13}, { 1919,12}, \
+ { 3839,15}, { 511,14}, { 1023,13}, { 2175,14}, \
+ { 1151,13}, { 2431,12}, { 4863,14}, { 16384,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 217
+#define MUL_FFT_THRESHOLD 3200
+
+#define SQR_FFT_MODF_THRESHOLD 276 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 276, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 17, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 15, 7}, { 31, 8}, { 19, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
+ { 39, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
+ { 79,10}, { 47, 9}, { 95, 8}, { 191,10}, \
+ { 55,11}, { 31,10}, { 63, 8}, { 255,10}, \
+ { 71, 9}, { 143, 8}, { 287,10}, { 79, 9}, \
+ { 159,11}, { 47,10}, { 95, 9}, { 191, 8}, \
+ { 383, 7}, { 767,10}, { 103,12}, { 31,11}, \
+ { 63, 9}, { 255, 8}, { 511, 7}, { 1023,10}, \
+ { 143, 9}, { 287,11}, { 79,10}, { 159, 9}, \
+ { 319, 8}, { 639,10}, { 175, 9}, { 351, 8}, \
+ { 703,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,10}, { 207, 9}, { 415, 8}, { 831,10}, \
+ { 223, 9}, { 447,12}, { 63,10}, { 255, 9}, \
+ { 511, 8}, { 1023,11}, { 143,10}, { 287, 9}, \
+ { 575, 8}, { 1151,11}, { 159,10}, { 319, 9}, \
+ { 639,11}, { 175,10}, { 351, 9}, { 703,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447,13}, { 63,11}, { 255,10}, { 511, 9}, \
+ { 1023,11}, { 287,10}, { 575, 9}, { 1151,12}, \
+ { 159,11}, { 319,10}, { 639,11}, { 351,10}, \
+ { 703, 9}, { 1407,12}, { 191,11}, { 383,10}, \
+ { 767,11}, { 415,10}, { 831,12}, { 223,11}, \
+ { 447,10}, { 895,11}, { 479,10}, { 959,12}, \
+ { 255,11}, { 511,10}, { 1023,12}, { 287,11}, \
+ { 575,10}, { 1151,12}, { 319,11}, { 639,12}, \
+ { 351,11}, { 703,10}, { 1407,13}, { 191,12}, \
+ { 383,11}, { 767,12}, { 415,11}, { 831,10}, \
+ { 1663,12}, { 447,11}, { 895,12}, { 479,11}, \
+ { 959,10}, { 1919,13}, { 255,12}, { 511,11}, \
+ { 1023,12}, { 543,11}, { 1087,12}, { 575,11}, \
+ { 1151,13}, { 319,12}, { 703,11}, { 1407,10}, \
+ { 2815,13}, { 383,12}, { 831,11}, { 1663,13}, \
+ { 447,12}, { 895,11}, { 1791,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1087,13}, { 575,12}, \
+ { 1151,13}, { 703,12}, { 1407,11}, { 2815,14}, \
+ { 383,13}, { 831,12}, { 1663,13}, { 895,12}, \
+ { 1791,13}, { 959,12}, { 1919,15}, { 255,14}, \
+ { 511,13}, { 1087,12}, { 2175,13}, { 1151,14}, \
+ { 639,13}, { 1407,12}, { 2815,14}, { 767,13}, \
+ { 1663,14}, { 895,13}, { 1919,12}, { 3839,15}, \
+ { 511,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
+ { 2431,12}, { 4863,14}, { 16384,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 204
+#define SQR_FFT_THRESHOLD 2688
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 38
+#define MULLO_MUL_N_THRESHOLD 6253
+#define SQRLO_BASECASE_THRESHOLD 4
+#define SQRLO_DC_THRESHOLD 67
+#define SQRLO_SQR_THRESHOLD 5240
+
+#define DC_DIV_QR_THRESHOLD 43
+#define DC_DIVAPPR_Q_THRESHOLD 155
+#define DC_BDIV_QR_THRESHOLD 39
+#define DC_BDIV_Q_THRESHOLD 89
+
+#define INV_MULMOD_BNM1_THRESHOLD 34
+#define INV_NEWTON_THRESHOLD 163
+#define INV_APPR_THRESHOLD 161
+
+#define BINV_NEWTON_THRESHOLD 196
+#define REDC_1_TO_REDC_N_THRESHOLD 43
+
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 998
+#define MUPI_DIV_QR_THRESHOLD 91
+#define MU_BDIV_QR_THRESHOLD 807
+#define MU_BDIV_Q_THRESHOLD 924
+
+#define POWM_SEC_TABLE 6,30,125,579,1730
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 30
+#define SET_STR_DC_THRESHOLD 802
+#define SET_STR_PRECOMPUTE_THRESHOLD 1815
+
+#define FAC_DSC_THRESHOLD 258
+#define FAC_ODD_THRESHOLD 24
+
+#define MATRIX22_STRASSEN_THRESHOLD 10
+#define HGCD2_DIV1_METHOD 1 /* 7.05% faster than 3 */
+#define HGCD_THRESHOLD 107
+#define HGCD_APPR_THRESHOLD 112
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 324
+#define GCDEXT_DC_THRESHOLD 242
+#define JACOBI_BASE_METHOD 4 /* 22.41% faster than 1 */
+
+/* Tuneup completed successfully, took 66624 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora53/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora57/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora57/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora57/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,187 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file for a57, a72-a75.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 1800 MHz Cortex-A72 */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2019-10-02, gcc 7.4 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#define MOD_1_1P_METHOD 1 /* 2.21% faster than 2 */
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 8
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 42
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 15
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 34.95% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 5
+#define DIV_QR_1_UNNORM_THRESHOLD 5
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 33
+
+#define DIV_1_VS_MUL_1_PERCENT 168
+
+#define MUL_TOOM22_THRESHOLD 10
+#define MUL_TOOM33_THRESHOLD 41
+#define MUL_TOOM44_THRESHOLD 99
+#define MUL_TOOM6H_THRESHOLD 142
+#define MUL_TOOM8H_THRESHOLD 199
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 69
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 63
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 66
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 55
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 65
+#define SQR_TOOM4_THRESHOLD 166
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 309
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 7
+#define SQRMOD_BNM1_THRESHOLD 12
+
+#define MUL_FFT_MODF_THRESHOLD 276 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 276, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 8, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 13, 8}, \
+ { 7, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 21, 9}, { 11, 8}, { 25,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
+ { 23, 8}, { 49, 9}, { 27,10}, { 15, 9}, \
+ { 39,10}, { 23, 9}, { 51,11}, { 15,10}, \
+ { 31, 9}, { 67,10}, { 39, 9}, { 79,10}, \
+ { 47, 9}, { 99,10}, { 55,11}, { 31,10}, \
+ { 63, 8}, { 255,10}, { 71, 9}, { 143, 8}, \
+ { 287,10}, { 79, 9}, { 159, 8}, { 319,11}, \
+ { 47,10}, { 95, 9}, { 191,10}, { 103,12}, \
+ { 31,11}, { 63, 9}, { 255, 8}, { 511,10}, \
+ { 143, 8}, { 575,11}, { 79,10}, { 159, 9}, \
+ { 319,10}, { 175, 9}, { 351, 8}, { 703,11}, \
+ { 95,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415,10}, { 223, 9}, { 447, 8}, { 895,12}, \
+ { 63,10}, { 255, 9}, { 511, 8}, { 1023, 9}, \
+ { 543,11}, { 143,10}, { 287, 9}, { 575, 8}, \
+ { 1151,10}, { 319, 9}, { 639,11}, { 175,10}, \
+ { 351, 9}, { 703,12}, { 95,10}, { 383, 9}, \
+ { 767,11}, { 207, 9}, { 831,11}, { 223,10}, \
+ { 447, 9}, { 895,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 109
+#define MUL_FFT_THRESHOLD 3200
+
+#define SQR_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 244, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 8, 5}, { 17, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 25,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
+ { 27,10}, { 15, 9}, { 39,10}, { 23, 9}, \
+ { 47,11}, { 15,10}, { 31, 9}, { 67,10}, \
+ { 39, 9}, { 79,10}, { 47, 9}, { 99,10}, \
+ { 55,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255,10}, { 71, 8}, { 287, 7}, { 575, 9}, \
+ { 159, 8}, { 319,11}, { 47,10}, { 95, 9}, \
+ { 191, 8}, { 383,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287, 8}, \
+ { 575,11}, { 79,10}, { 159, 9}, { 319, 8}, \
+ { 639, 9}, { 351,10}, { 191, 9}, { 383,10}, \
+ { 207, 9}, { 415,10}, { 239,12}, { 63,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 143,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 351, 9}, { 703,11}, { 191,10}, \
+ { 383, 9}, { 767,11}, { 207,10}, { 415, 9}, \
+ { 831,11}, { 223,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 97
+#define SQR_FFT_THRESHOLD 2496
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 39
+#define MULLO_MUL_N_THRESHOLD 6253
+#define SQRLO_BASECASE_THRESHOLD 4
+#define SQRLO_DC_THRESHOLD 56
+#define SQRLO_SQR_THRESHOLD 4940
+
+#define DC_DIV_QR_THRESHOLD 41
+#define DC_DIVAPPR_Q_THRESHOLD 136
+#define DC_BDIV_QR_THRESHOLD 39
+#define DC_BDIV_Q_THRESHOLD 89
+
+#define INV_MULMOD_BNM1_THRESHOLD 22
+#define INV_NEWTON_THRESHOLD 154
+#define INV_APPR_THRESHOLD 141
+
+#define BINV_NEWTON_THRESHOLD 182
+#define REDC_1_TO_REDC_N_THRESHOLD 39
+
+#define MU_DIV_QR_THRESHOLD 979
+#define MU_DIVAPPR_Q_THRESHOLD 1078
+#define MUPI_DIV_QR_THRESHOLD 75
+#define MU_BDIV_QR_THRESHOLD 872
+#define MU_BDIV_Q_THRESHOLD 942
+
+#define POWM_SEC_TABLE 1,19,117,539,1730
+
+#define GET_STR_DC_THRESHOLD 10
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 572
+#define SET_STR_PRECOMPUTE_THRESHOLD 1036
+
+#define FAC_DSC_THRESHOLD 142
+#define FAC_ODD_THRESHOLD 23
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD2_DIV1_METHOD 1 /* 8.83% faster than 3 */
+#define HGCD_THRESHOLD 80
+#define HGCD_APPR_THRESHOLD 70
+#define HGCD_REDUCE_THRESHOLD 1962
+#define GCD_DC_THRESHOLD 273
+#define GCDEXT_DC_THRESHOLD 198
+#define JACOBI_BASE_METHOD 1 /* 7.49% faster than 4 */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora57/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora72/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora72/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora72/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,242 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file for a72.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 1800 MHz Cortex-A72 */
+/* FFT tuning limit = 50,811,960 */
+/* Generated by tuneup.c, 2019-10-22, gcc 7.3 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 3
+#define MOD_1_1P_METHOD 2 /* 12.09% faster than 1 */
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 3
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 26
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 15
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 13.42% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 4
+#define DIV_QR_1_UNNORM_THRESHOLD 4
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 38
+
+#define DIV_1_VS_MUL_1_PERCENT 168
+
+#define MUL_TOOM22_THRESHOLD 8
+#define MUL_TOOM33_THRESHOLD 57
+#define MUL_TOOM44_THRESHOLD 153
+#define MUL_TOOM6H_THRESHOLD 222
+#define MUL_TOOM8H_THRESHOLD 333
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 57
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 108
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 104
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 82
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 16
+#define SQR_TOOM3_THRESHOLD 73
+#define SQR_TOOM4_THRESHOLD 154
+#define SQR_TOOM6_THRESHOLD 206
+#define SQR_TOOM8_THRESHOLD 333
+
+#define MULMID_TOOM42_THRESHOLD 18
+
+#define MULMOD_BNM1_THRESHOLD 8
+#define SQRMOD_BNM1_THRESHOLD 10
+
+#define MUL_FFT_MODF_THRESHOLD 268 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 268, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 15, 7}, { 13, 8}, { 7, 7}, { 16, 8}, \
+ { 9, 7}, { 19, 8}, { 11, 7}, { 23, 8}, \
+ { 13, 9}, { 7, 8}, { 15, 7}, { 31, 8}, \
+ { 19, 9}, { 11, 8}, { 27,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
+ { 27,10}, { 15, 9}, { 39,10}, { 23, 9}, \
+ { 51,11}, { 15,10}, { 31, 9}, { 71,10}, \
+ { 39, 9}, { 79, 8}, { 159, 7}, { 319, 9}, \
+ { 83,10}, { 47, 9}, { 95, 7}, { 383, 9}, \
+ { 99,10}, { 55,11}, { 31,10}, { 63, 8}, \
+ { 255, 7}, { 511, 9}, { 131,10}, { 71, 9}, \
+ { 143, 8}, { 287, 7}, { 575, 6}, { 1151,10}, \
+ { 79, 8}, { 319, 7}, { 639,10}, { 87, 8}, \
+ { 351,11}, { 47,10}, { 95, 8}, { 383, 7}, \
+ { 767,10}, { 103, 8}, { 415, 7}, { 831, 6}, \
+ { 1663, 9}, { 223, 8}, { 447,12}, { 31,11}, \
+ { 63, 9}, { 255, 8}, { 511, 7}, { 1023, 9}, \
+ { 287, 8}, { 575, 7}, { 1151, 6}, { 2303, 7}, \
+ { 1215,11}, { 79, 9}, { 319, 8}, { 639, 7}, \
+ { 1279, 9}, { 351, 8}, { 703, 7}, { 1407, 6}, \
+ { 2815, 9}, { 383, 8}, { 831, 7}, { 1663, 9}, \
+ { 447, 8}, { 895, 7}, { 1791, 6}, { 3583, 8}, \
+ { 959, 6}, { 3839, 5}, { 7679, 9}, { 511, 8}, \
+ { 1023, 7}, { 2175, 9}, { 575, 8}, { 1151, 7}, \
+ { 2303, 8}, { 1215,10}, { 351, 9}, { 703, 7}, \
+ { 3071, 8}, { 1663, 9}, { 895, 8}, { 1791, 7}, \
+ { 3583, 8}, { 1919, 6}, { 7679, 7}, { 3967, 9}, \
+ { 1023,10}, { 575, 9}, { 1151, 8}, { 2559,10}, \
+ { 703, 8}, { 2815, 9}, { 1471, 7}, { 5887,10}, \
+ { 767,11}, { 415, 9}, { 1791, 8}, { 3583,11}, \
+ { 479,10}, { 959, 8}, { 3967,11}, { 511, 9}, \
+ { 2175,10}, { 1151, 8}, { 4607, 9}, { 2815,10}, \
+ { 1471, 9}, { 2943,11}, { 767,10}, { 1535,11}, \
+ { 831,10}, { 1791,11}, { 959,10}, { 1919, 9}, \
+ { 3839, 8}, { 7679,10}, { 1983,12}, { 511,10}, \
+ { 2047,11}, { 1215,12}, { 639,11}, { 1407,10}, \
+ { 2815,11}, { 1471,12}, { 767,11}, { 1663,12}, \
+ { 895,11}, { 1791,12}, { 959,11}, { 1919,10}, \
+ { 3839,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2047,12}, { 1215,13}, { 639,12}, { 1279,13}, \
+ { 703,12}, { 1407,11}, { 2815,13}, { 767,12}, \
+ { 1535,13}, { 831,12}, { 1663,13}, { 895,12}, \
+ { 1791,11}, { 3583,13}, { 959,12}, { 1919,11}, \
+ { 3839,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1215,12}, { 2431,14}, { 639,13}, { 1407,12}, \
+ { 2815,13}, { 1471,12}, { 2943,14}, { 767,13}, \
+ { 1535,12}, { 3071,13}, { 1791,12}, { 3583,13}, \
+ { 1919,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
+ { 2431,14}, { 1279,13}, { 2559,15}, { 767,14}, \
+ { 1791,13}, { 3839,15}, { 1023,14}, { 2431,13}, \
+ { 4863,15}, { 1279,14}, { 2943,15}, { 1535,14}, \
+ { 16384,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 218
+#define MUL_FFT_THRESHOLD 2688
+
+#define SQR_FFT_MODF_THRESHOLD 236 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 236, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 15, 7}, { 8, 6}, { 17, 7}, { 13, 8}, \
+ { 7, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 25,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
+ { 27,10}, { 15, 9}, { 39,10}, { 23, 9}, \
+ { 47,11}, { 15,10}, { 31, 9}, { 67,10}, \
+ { 39, 9}, { 79, 8}, { 159,10}, { 47, 9}, \
+ { 95, 8}, { 191, 7}, { 383,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255, 7}, \
+ { 511,10}, { 71, 9}, { 143, 8}, { 287, 7}, \
+ { 575,10}, { 79, 8}, { 319, 7}, { 639,11}, \
+ { 47,10}, { 95, 8}, { 383, 7}, { 767, 8}, \
+ { 415,12}, { 31,11}, { 63,10}, { 127, 9}, \
+ { 255, 8}, { 543, 9}, { 287, 8}, { 575, 7}, \
+ { 1151, 9}, { 319, 8}, { 639, 9}, { 351, 8}, \
+ { 703, 7}, { 1407, 6}, { 2815,10}, { 191, 9}, \
+ { 383, 8}, { 767, 9}, { 415, 8}, { 831, 7}, \
+ { 1663,10}, { 223, 9}, { 447, 8}, { 895, 7}, \
+ { 1791, 9}, { 479, 8}, { 959,12}, { 63,11}, \
+ { 127, 9}, { 543, 8}, { 1087,10}, { 287, 9}, \
+ { 575, 8}, { 1151,10}, { 319, 9}, { 639,10}, \
+ { 351, 9}, { 703, 8}, { 1407, 7}, { 2815, 8}, \
+ { 1471, 5}, { 11775, 9}, { 767, 8}, { 1535,10}, \
+ { 415, 9}, { 895, 8}, { 1919, 6}, { 7679, 7}, \
+ { 3967,11}, { 255,10}, { 543, 9}, { 1087, 8}, \
+ { 2175,10}, { 575, 9}, { 1151, 8}, { 2431,10}, \
+ { 639, 9}, { 1279,10}, { 703, 9}, { 1407, 8}, \
+ { 2943,11}, { 383,10}, { 767,11}, { 447,10}, \
+ { 895,11}, { 479,10}, { 959, 9}, { 1919, 8}, \
+ { 3839,10}, { 1023, 9}, { 2175,10}, { 1215, 9}, \
+ { 2431,11}, { 703, 9}, { 2815,10}, { 1471,11}, \
+ { 767,10}, { 1663,11}, { 895,10}, { 1791,11}, \
+ { 959, 9}, { 3839,12}, { 511,11}, { 1087,10}, \
+ { 2175,11}, { 1215,10}, { 2431,12}, { 639,11}, \
+ { 1279,12}, { 703,11}, { 1471,12}, { 767,11}, \
+ { 1663,12}, { 895,11}, { 1919,10}, { 3839,13}, \
+ { 511,12}, { 1087,11}, { 2175,12}, { 1215,11}, \
+ { 2431,13}, { 639,12}, { 1279,13}, { 703,12}, \
+ { 1407,13}, { 767,12}, { 1535,13}, { 831,12}, \
+ { 1791,13}, { 1151,12}, { 2303,13}, { 1215,14}, \
+ { 639,12}, { 2559,13}, { 1407,14}, { 767,12}, \
+ { 3071,14}, { 895,13}, { 1919,12}, { 3839,14}, \
+ { 1023,13}, { 2175,14}, { 1151,12}, { 4607,14}, \
+ { 1279,13}, { 2559,14}, { 1407,13}, { 2943,15}, \
+ { 767,14}, { 1663,13}, { 3583,14}, { 1919,15}, \
+ { 1023,14}, { 2047,13}, { 4095,14}, { 2943,15}, \
+ { 1535,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 203
+#define SQR_FFT_THRESHOLD 2176
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 5240
+#define SQRLO_BASECASE_THRESHOLD 6
+#define SQRLO_DC_THRESHOLD 45
+#define SQRLO_SQR_THRESHOLD 4265
+
+#define DC_DIV_QR_THRESHOLD 38
+#define DC_DIVAPPR_Q_THRESHOLD 108
+#define DC_BDIV_QR_THRESHOLD 36
+#define DC_BDIV_Q_THRESHOLD 71
+
+#define INV_MULMOD_BNM1_THRESHOLD 14
+#define INV_NEWTON_THRESHOLD 132
+#define INV_APPR_THRESHOLD 124
+
+#define BINV_NEWTON_THRESHOLD 199
+#define REDC_1_TO_REDC_N_THRESHOLD 34
+
+#define MU_DIV_QR_THRESHOLD 979
+#define MU_DIVAPPR_Q_THRESHOLD 979
+#define MUPI_DIV_QR_THRESHOLD 61
+#define MU_BDIV_QR_THRESHOLD 734
+#define MU_BDIV_Q_THRESHOLD 942
+
+#define POWM_SEC_TABLE 6,30,110,579,1730
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 19
+#define SET_STR_DC_THRESHOLD 458
+#define SET_STR_PRECOMPUTE_THRESHOLD 875
+
+#define FAC_DSC_THRESHOLD 153
+#define FAC_ODD_THRESHOLD 24
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD2_DIV1_METHOD 1 /* 8.41% faster than 3 */
+#define HGCD_THRESHOLD 81
+#define HGCD_APPR_THRESHOLD 80
+#define HGCD_REDUCE_THRESHOLD 1494
+#define GCD_DC_THRESHOLD 268
+#define GCDEXT_DC_THRESHOLD 189
+#define JACOBI_BASE_METHOD 1 /* 10.80% faster than 4 */
+
+/* Tuneup completed successfully, took 96906 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora72/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora73/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora73/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora73/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,225 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file for a73.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 1800 MHz Cortex-A72 */
+/* FFT tuning limit = 48,820,337 */
+/* Generated by tuneup.c, 2019-10-22, gcc 7.4 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 3
+#define MOD_1_1P_METHOD 1 /* 2.28% faster than 2 */
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 8
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 44
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 16
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 35.13% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 5
+#define DIV_QR_1_UNNORM_THRESHOLD 5
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 33
+
+#define DIV_1_VS_MUL_1_PERCENT 168
+
+#define MUL_TOOM22_THRESHOLD 10
+#define MUL_TOOM33_THRESHOLD 57
+#define MUL_TOOM44_THRESHOLD 89
+#define MUL_TOOM6H_THRESHOLD 141
+#define MUL_TOOM8H_THRESHOLD 199
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 61
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 69
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 65
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 66
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 58
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 62
+#define SQR_TOOM4_THRESHOLD 166
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 309
+
+#define MULMID_TOOM42_THRESHOLD 22
+
+#define MULMOD_BNM1_THRESHOLD 8
+#define SQRMOD_BNM1_THRESHOLD 11
+
+#define MUL_FFT_MODF_THRESHOLD 276 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 276, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 15, 7}, { 8, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 13, 8}, { 7, 7}, { 17, 8}, \
+ { 9, 7}, { 19, 8}, { 11, 7}, { 23, 8}, \
+ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
+ { 27,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
+ { 19, 8}, { 39, 9}, { 23, 8}, { 47, 9}, \
+ { 27,10}, { 15, 9}, { 43,10}, { 23, 9}, \
+ { 51,11}, { 15,10}, { 31, 9}, { 67,10}, \
+ { 39, 9}, { 83,10}, { 47, 9}, { 99,10}, \
+ { 55,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 9}, { 131,10}, { 71, 9}, { 143, 8}, \
+ { 287,10}, { 79, 9}, { 159, 8}, { 319,11}, \
+ { 47, 9}, { 191, 8}, { 383, 7}, { 767, 8}, \
+ { 415,12}, { 31,11}, { 63, 9}, { 255, 8}, \
+ { 511,10}, { 143, 9}, { 287, 8}, { 575,11}, \
+ { 79,10}, { 159, 9}, { 319,10}, { 175, 9}, \
+ { 351, 8}, { 703,11}, { 95,10}, { 191, 9}, \
+ { 383, 8}, { 767,10}, { 207, 9}, { 415,10}, \
+ { 223, 9}, { 447,12}, { 63,10}, { 255, 9}, \
+ { 511, 8}, { 1023, 9}, { 543,11}, { 143, 9}, \
+ { 575,10}, { 319, 9}, { 639,10}, { 351, 9}, \
+ { 703,12}, { 95,11}, { 191,10}, { 383,11}, \
+ { 207,10}, { 415,11}, { 223,10}, { 447, 9}, \
+ { 895,13}, { 63,11}, { 255,10}, { 511,11}, \
+ { 287,10}, { 575,12}, { 159,11}, { 319,10}, \
+ { 639,11}, { 351,10}, { 703, 9}, { 1407,12}, \
+ { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
+ { 223,11}, { 447,10}, { 895,11}, { 479,10}, \
+ { 959,12}, { 255,11}, { 543,10}, { 1087,11}, \
+ { 575,12}, { 319,11}, { 639,12}, { 351,11}, \
+ { 703,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,12}, { 447,11}, { 895,12}, \
+ { 479,13}, { 255,12}, { 511,11}, { 1023,12}, \
+ { 575,13}, { 319,12}, { 703,13}, { 383,12}, \
+ { 831,13}, { 447,12}, { 959,14}, { 255,13}, \
+ { 511,12}, { 1023,13}, { 575,12}, { 1151,13}, \
+ { 703,12}, { 1407,14}, { 383,13}, { 831,12}, \
+ { 1663,13}, { 959,15}, { 255,14}, { 511,13}, \
+ { 1151,14}, { 639,13}, { 1407,14}, { 767,13}, \
+ { 1663,14}, { 895,13}, { 1791,15}, { 511,14}, \
+ { 1023,13}, { 2047,14}, { 1151,13}, { 2431,14}, \
+ { 1407,15}, { 767,14}, { 1791,16}, { 511,15}, \
+ { 1023,14}, { 2431,15}, { 1279,14}, { 2815,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 185
+#define MUL_FFT_THRESHOLD 3200
+
+#define SQR_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 244, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 23, 8}, \
+ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
+ { 25,10}, { 7, 9}, { 15, 8}, { 31, 9}, \
+ { 19, 8}, { 39, 9}, { 23, 8}, { 47,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 63,10}, { 39, 9}, \
+ { 79,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 63, 8}, { 255,10}, { 71, 9}, \
+ { 143, 8}, { 287,10}, { 79, 9}, { 159, 8}, \
+ { 319,11}, { 47,10}, { 95, 9}, { 191, 8}, \
+ { 383,12}, { 31,11}, { 63,10}, { 127, 9}, \
+ { 287, 8}, { 575,11}, { 79,10}, { 159, 9}, \
+ { 319, 8}, { 639,10}, { 175, 9}, { 351, 8}, \
+ { 703,11}, { 95, 9}, { 383, 8}, { 767,10}, \
+ { 207, 9}, { 415,10}, { 223, 8}, { 895,10}, \
+ { 239,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 319, 9}, { 639,11}, { 175,10}, { 351, 9}, \
+ { 703,11}, { 191,10}, { 383,11}, { 207,10}, \
+ { 415,11}, { 223,10}, { 479,11}, { 255,10}, \
+ { 511,11}, { 287,10}, { 575,12}, { 159,11}, \
+ { 351,12}, { 191,11}, { 383,10}, { 767,12}, \
+ { 223,11}, { 447,10}, { 895,11}, { 479,13}, \
+ { 127,12}, { 255,11}, { 511,12}, { 287,10}, \
+ { 1151,12}, { 319,11}, { 639,12}, { 351,11}, \
+ { 703,13}, { 191,12}, { 383,11}, { 767,12}, \
+ { 415,11}, { 831,12}, { 447,11}, { 895,12}, \
+ { 479,11}, { 959,12}, { 511,11}, { 1023,12}, \
+ { 575,11}, { 1151,13}, { 319,12}, { 639,11}, \
+ { 1279,13}, { 383,12}, { 831,13}, { 447,12}, \
+ { 895,14}, { 255,13}, { 511,12}, { 1023,13}, \
+ { 703,14}, { 383,13}, { 831,12}, { 1663,13}, \
+ { 895,15}, { 255,14}, { 511,13}, { 1151,14}, \
+ { 639,13}, { 1407,14}, { 767,13}, { 1535,14}, \
+ { 895,15}, { 511,14}, { 1151,13}, { 2431,14}, \
+ { 1407,15}, { 767,14}, { 1791,16}, { 511,15}, \
+ { 1023,14}, { 2431,15}, { 1279,14}, { 2815,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 165
+#define SQR_FFT_THRESHOLD 2496
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 39
+#define MULLO_MUL_N_THRESHOLD 6253
+#define SQRLO_BASECASE_THRESHOLD 4
+#define SQRLO_DC_THRESHOLD 56
+#define SQRLO_SQR_THRESHOLD 4940
+
+#define DC_DIV_QR_THRESHOLD 36
+#define DC_DIVAPPR_Q_THRESHOLD 136
+#define DC_BDIV_QR_THRESHOLD 35
+#define DC_BDIV_Q_THRESHOLD 88
+
+#define INV_MULMOD_BNM1_THRESHOLD 30
+#define INV_NEWTON_THRESHOLD 149
+#define INV_APPR_THRESHOLD 139
+
+#define BINV_NEWTON_THRESHOLD 166
+#define REDC_1_TO_REDC_N_THRESHOLD 38
+
+#define MU_DIV_QR_THRESHOLD 1120
+#define MU_DIVAPPR_Q_THRESHOLD 1078
+#define MUPI_DIV_QR_THRESHOLD 68
+#define MU_BDIV_QR_THRESHOLD 889
+#define MU_BDIV_Q_THRESHOLD 942
+
+#define POWM_SEC_TABLE 4,22,102,473,1730
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 22
+#define SET_STR_DC_THRESHOLD 381
+#define SET_STR_PRECOMPUTE_THRESHOLD 1042
+
+#define FAC_DSC_THRESHOLD 140
+#define FAC_ODD_THRESHOLD 23
+
+#define MATRIX22_STRASSEN_THRESHOLD 11
+#define HGCD2_DIV1_METHOD 1 /* 7.84% faster than 3 */
+#define HGCD_THRESHOLD 80
+#define HGCD_APPR_THRESHOLD 80
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 273
+#define GCDEXT_DC_THRESHOLD 201
+#define JACOBI_BASE_METHOD 1 /* 1.03% faster than 4 */
+
+/* Tuneup completed successfully, took 64972 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/cora73/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,125 +0,0 @@
-dnl ARM v6t2 mpn_gcd_1.
-
-dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for ARM by Torbjorn
-dnl Granlund.
-
-dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-changecom(@&*$)
-
-C cycles/bit (approx)
-C Cortex-A53 ?
-C Cortex-A57 ?
-
-C TODO
-C * Optimise inner-loop better.
-C * Push saving/restoring of callee-user regs into call code
-
-C Threshold of when to call bmod when U is one limb. Should be about
-C (time_in_cycles(bmod_1,1) + call_overhead) / (cycles/bit).
-define(`BMOD_THRES_LOG2', 7)
-
-C INPUT PARAMETERS
-define(`up', `x0')
-define(`n', `x1')
-define(`v0', `x2')
-
-ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
- `define(`BMOD_1_TO_MOD_1_THRESHOLD',30)')
-
-ASM_START()
- TEXT
- ALIGN(16)
-PROLOGUE(mpn_gcd_1)
- stp x29, x30, [sp,#-32]!
- ldr x3, [up] C U low limb
- stp x19, x20, [sp,#16]
-
- orr x3, x3, v0
- rbit x4, x3
- clz x20, x4 C min(ctz(u0),ctz(v0))
-
- rbit x12, v0
- clz x12, x12
- lsr v0, v0, x12
-
- mov x19, v0
-
- cmp n, #1
- b.ne L(nby1)
-
-C Both U and V are single limbs, reduce with bmod if u0 >> v0.
- ldr x3, [up]
- cmp v0, x3, lsr #BMOD_THRES_LOG2
- b.hi L(red1)
-
-L(bmod):mov x3, #0 C carry argument
- bl mpn_modexact_1c_odd
- b L(red0)
-
-L(nby1):cmp n, #BMOD_1_TO_MOD_1_THRESHOLD
- b.lo L(bmod)
-
- bl mpn_mod_1
-
-L(red0):mov x3, x0
-L(red1):cmp x3, #0
- rbit x12, x3
- clz x12, x12
- b.ne L(mid)
- b L(end)
-
- ALIGN(8)
-L(top):
-ifelse(1,1,`
-C This shorter variant makes full use of armv8 insns
- csneg x3, x1, x1, cs C if x-y < 0
- csel x19, x4, x19, cs C use x,y-x
-L(mid): lsr x4, x3, x12 C
- subs x1, x19, x4 C
-',`
-C This variant is akin to the 32-bit v6t2 code
- csel x3, x1, x3, cs C if x-y < 0
- csel x19, x0, x19, cs C use x,y-x
-L(mid): lsr x3, x3, x12 C
- mov x0, x3 C
- subs x1, x19, x3 C
- sub x3, x3, x19 C
-')
- rbit x12, x1
- clz x12, x12 C
- b.ne L(top) C
-
-L(end): lsl x0, x19, x20
- ldp x19, x20, [sp,#16]
- ldp x29, x30, [sp],#32
- ret
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,70 @@
+dnl ARM v8a mpn_gcd_11.
+
+dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for ARM by Torbjorn
+dnl Granlund.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+changecom(blah)
+
+C cycles/bit (approx)
+C Cortex-A35 ?
+C Cortex-A53 ?
+C Cortex-A55 ?
+C Cortex-A57 ?
+C Cortex-A72 ?
+C Cortex-A73 ?
+C Cortex-A75 ?
+C Cortex-A76 ?
+C Cortex-A77 ?
+C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
+
+define(`u0', `x0')
+define(`v0', `x1')
+
+ASM_START()
+ TEXT
+ ALIGN(16)
+PROLOGUE(mpn_gcd_11)
+ subs x3, u0, v0 C 0
+ b.eq L(end) C
+
+ ALIGN(16)
+L(top): rbit x12, x3 C 1,5
+ clz x12, x12 C 2
+ csneg x3, x3, x3, cs C v = abs(u-v), even 1
+ csel u0, v0, u0, cs C u = min(u,v) 1
+ lsr v0, x3, x12 C 3
+ subs x3, u0, v0 C 4
+ b.ne L(top) C
+
+L(end): ret
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_22.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_22.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gcd_22.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,112 @@
+dnl ARM v8a mpn_gcd_22.
+
+dnl Copyright 2019 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+changecom(blah)
+
+C cycles/bit (approx)
+C Cortex-A35 ?
+C Cortex-A53 7.26
+C Cortex-A55 ?
+C Cortex-A57 ?
+C Cortex-A72 5.72
+C Cortex-A73 6.43
+C Cortex-A75 ?
+C Cortex-A76 ?
+C Cortex-A77 ?
+
+
+define(`u1', `x0')
+define(`u0', `x1')
+define(`v1', `x2')
+define(`v0', `x3')
+
+define(`t0', `x5')
+define(`t1', `x6')
+define(`cnt', `x7')
+define(`tnc', `x8')
+
+ASM_START()
+PROLOGUE(mpn_gcd_22)
+
+ ALIGN(16)
+L(top): subs t0, u0, v0 C 0 6
+ cbz t0, L(lowz)
+ sbcs t1, u1, v1 C 1 7
+
+ rbit cnt, t0 C 1
+
+ cneg t0, t0, cc C 2
+ cinv t1, t1, cc C 2 u = |u - v|
+L(bck): csel v0, v0, u0, cs C 2
+ csel v1, v1, u1, cs C 2 v = min(u,v)
+
+ clz cnt, cnt C 2
+ sub tnc, xzr, cnt C 3
+
+ lsr u0, t0, cnt C 3
+ lsl x14, t1, tnc C 4
+ lsr u1, t1, cnt C 3
+ orr u0, u0, x14 C 5
+
+ orr x11, u1, v1
+ cbnz x11, L(top)
+
+
+ subs x4, u0, v0 C 0
+ b.eq L(end1) C
+
+ ALIGN(16)
+L(top1):rbit x12, x4 C 1,5
+ clz x12, x12 C 2
+ csneg x4, x4, x4, cs C v = abs(u-v), even 1
+ csel u0, v0, u0, cs C u = min(u,v) 1
+ lsr v0, x4, x12 C 3
+ subs x4, u0, v0 C 4
+ b.ne L(top1) C
+L(end1):mov x0, u0
+ mov x1, #0
+ ret
+
+L(lowz):C We come here when v0 - u0 = 0
+ C 1. If v1 - u1 = 0, then gcd is u = v.
+ C 2. Else compute gcd_21({v1,v0}, |u1-v1|)
+ subs t0, u1, v1
+ b.eq L(end)
+ mov t1, #0
+ rbit cnt, t0 C 1
+ cneg t0, t0, cc C 2
+ b L(bck) C FIXME: make conditional
+
+L(end): mov x0, v0
+ mov x1, v1
+ ret
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2015 Free Software Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -31,211 +31,162 @@
#define GMP_LIMB_BITS 64
#define GMP_LIMB_BYTES 8
-/* 2400 MHz AppliedMicro X-Gene */
-/* FFT tuning limit = 100 M */
-/* Generated by tuneup.c, 2015-10-18, gcc 4.8 */
+/* 1536 MHz Cortex-A53 */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2019-09-29, gcc 5.4 */
-#define DIVREM_1_NORM_THRESHOLD 0 /* always */
-#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1_1P_METHOD 1
-#define MOD_1_NORM_THRESHOLD 0 /* always */
-#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 4
+#define MOD_1_1P_METHOD 2 /* 2.08% faster than 1 */
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
-#define MOD_1_2_TO_MOD_1_4_THRESHOLD 28
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 20
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 21
#define USE_PREINV_DIVREM_1 1
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 1
-#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 38.26% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 13
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always */
-#define BMOD_1_TO_MOD_1_THRESHOLD 30
+#define BMOD_1_TO_MOD_1_THRESHOLD 40
+#define DIV_1_VS_MUL_1_PERCENT 159
+
#define MUL_TOOM22_THRESHOLD 14
-#define MUL_TOOM33_THRESHOLD 57
-#define MUL_TOOM44_THRESHOLD 154
-#define MUL_TOOM6H_THRESHOLD 206
-#define MUL_TOOM8H_THRESHOLD 309
+#define MUL_TOOM33_THRESHOLD 49
+#define MUL_TOOM44_THRESHOLD 82
+#define MUL_TOOM6H_THRESHOLD 173
+#define MUL_TOOM8H_THRESHOLD 236
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 102
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 89
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 104
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 130
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 76
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 80
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 74
-#define SQR_BASECASE_THRESHOLD 6
-#define SQR_TOOM2_THRESHOLD 28
-#define SQR_TOOM3_THRESHOLD 93
-#define SQR_TOOM4_THRESHOLD 160
-#define SQR_TOOM6_THRESHOLD 197
-#define SQR_TOOM8_THRESHOLD 284
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 67
+#define SQR_TOOM4_THRESHOLD 166
+#define SQR_TOOM6_THRESHOLD 222
+#define SQR_TOOM8_THRESHOLD 333
-#define MULMID_TOOM42_THRESHOLD 34
+#define MULMID_TOOM42_THRESHOLD 20
-#define MULMOD_BNM1_THRESHOLD 12
-#define SQRMOD_BNM1_THRESHOLD 13
+#define MULMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 11
-#define MUL_FFT_MODF_THRESHOLD 308 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 316 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 308, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
- { 8, 5}, { 17, 6}, { 13, 7}, { 7, 6}, \
- { 15, 7}, { 8, 6}, { 17, 7}, { 17, 8}, \
- { 9, 7}, { 20, 8}, { 11, 7}, { 24, 8}, \
- { 13, 7}, { 27, 9}, { 7, 8}, { 15, 7}, \
- { 31, 8}, { 21, 9}, { 11, 8}, { 27, 9}, \
- { 15, 8}, { 35, 9}, { 19, 8}, { 39, 9}, \
- { 23, 8}, { 47, 9}, { 27,10}, { 15, 9}, \
- { 31, 8}, { 63, 9}, { 39,10}, { 23, 9}, \
- { 55,11}, { 15,10}, { 31, 9}, { 71,10}, \
- { 39, 9}, { 83,10}, { 47, 9}, { 99,10}, \
- { 55,11}, { 31,10}, { 63, 9}, { 127,10}, \
- { 79, 9}, { 159,11}, { 47,10}, { 95, 9}, \
- { 191, 8}, { 383,10}, { 103,12}, { 31,11}, \
- { 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
- { 135, 9}, { 271,10}, { 143,11}, { 79,10}, \
+ { { 316, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 8, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 23, 8}, \
+ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
+ { 41, 9}, { 23, 8}, { 49, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 51,11}, \
+ { 15,10}, { 31, 9}, { 71,10}, { 39, 9}, \
+ { 83,10}, { 47, 9}, { 99,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255, 9}, \
+ { 131,10}, { 71, 8}, { 287,10}, { 79, 9}, \
+ { 159, 8}, { 319,10}, { 87,11}, { 47,10}, \
+ { 95, 9}, { 191, 8}, { 383,10}, { 103, 9}, \
+ { 207, 8}, { 415,10}, { 111, 9}, { 223,12}, \
+ { 31,11}, { 63, 9}, { 255, 8}, { 511,10}, \
+ { 135, 9}, { 287, 8}, { 575,11}, { 79,10}, \
{ 159, 9}, { 319, 8}, { 639,10}, { 175, 9}, \
{ 351, 8}, { 703,11}, { 95,10}, { 191, 9}, \
- { 383, 8}, { 767,10}, { 207, 9}, { 415, 8}, \
- { 831,11}, { 111,10}, { 223,12}, { 63,11}, \
- { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
- { 543,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 383, 8}, { 767,10}, { 207, 9}, { 415,11}, \
+ { 111,10}, { 223, 9}, { 447,12}, { 63,10}, \
+ { 255, 9}, { 511, 8}, { 1023, 9}, { 543,10}, \
+ { 287, 9}, { 575, 8}, { 1151,11}, { 159,10}, \
{ 319, 9}, { 639,11}, { 175,10}, { 351, 9}, \
- { 703,12}, { 95,11}, { 191,10}, { 383, 9}, \
- { 767,11}, { 207,10}, { 415, 9}, { 831,11}, \
- { 223,10}, { 447,13}, { 63,12}, { 127,11}, \
- { 255,10}, { 511,11}, { 271,10}, { 543,11}, \
- { 287,10}, { 575,12}, { 159,11}, { 319,10}, \
- { 639,11}, { 351,10}, { 703,11}, { 383,10}, \
- { 767,11}, { 415,10}, { 831,12}, { 223,11}, \
- { 447,10}, { 895,11}, { 479,10}, { 959,13}, \
- { 127,11}, { 543,12}, { 287,11}, { 575,10}, \
- { 1151,12}, { 319,11}, { 639,12}, { 351,11}, \
- { 703,10}, { 1407, 9}, { 2815,12}, { 383,11}, \
- { 767,12}, { 415,11}, { 831,10}, { 1663,12}, \
- { 447,11}, { 895,10}, { 1791,12}, { 479,11}, \
- { 959,10}, { 1919,14}, { 127,13}, { 255,12}, \
- { 511,11}, { 1023,12}, { 543,11}, { 1087,12}, \
- { 575,11}, { 1151,13}, { 319,12}, { 639,11}, \
- { 1279,12}, { 703,11}, { 1407,13}, { 383,12}, \
- { 767,11}, { 1535,12}, { 831,11}, { 1663,13}, \
- { 447,12}, { 959,11}, { 1919,14}, { 255,13}, \
- { 511,12}, { 1087,13}, { 575,12}, { 1215,13}, \
- { 639,12}, { 1279,13}, { 703,12}, { 1407,14}, \
- { 383,13}, { 767,12}, { 1535,13}, { 831,12}, \
- { 1663,13}, { 895,12}, { 1791,13}, { 959,12}, \
- { 1919,15}, { 255,14}, { 511,13}, { 1087,12}, \
- { 2175,13}, { 1151,14}, { 639,13}, { 1407,12}, \
- { 2815,14}, { 767,13}, { 1663,14}, { 895,13}, \
- { 1919,15}, { 511,14}, { 1023,13}, { 2175,14}, \
- { 1151,13}, { 2431,14}, { 1407,13}, { 2815,15}, \
- { 767,14}, { 1919,16}, { 511,15}, { 1023,14}, \
- { 2431,15}, { 1279,14}, { 2943,15}, { 32768,16}, \
- { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
- {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 220
-#define MUL_FFT_THRESHOLD 3520
+ { 703, 8}, { 1407,12}, { 95,11}, { 191,10}, \
+ { 383, 9}, { 767,11}, { 207,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 447,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 118
+#define MUL_FFT_THRESHOLD 3200
#define SQR_FFT_MODF_THRESHOLD 272 /* k = 5 */
#define SQR_FFT_TABLE3 \
{ { 272, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
- { 17, 7}, { 9, 6}, { 19, 7}, { 17, 8}, \
- { 9, 7}, { 20, 8}, { 11, 7}, { 24, 8}, \
+ { 8, 5}, { 17, 6}, { 17, 7}, { 17, 8}, \
+ { 9, 7}, { 19, 8}, { 11, 7}, { 23, 8}, \
{ 13, 9}, { 7, 8}, { 15, 7}, { 31, 8}, \
- { 21, 9}, { 11, 8}, { 27,10}, { 7, 9}, \
- { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
- { 23, 8}, { 47, 9}, { 27,10}, { 15, 9}, \
- { 39,10}, { 23, 9}, { 51,11}, { 15,10}, \
- { 31, 9}, { 67,10}, { 39, 9}, { 79,10}, \
- { 47, 9}, { 95,10}, { 55,11}, { 31,10}, \
+ { 19, 9}, { 11, 8}, { 27, 9}, { 15, 8}, \
+ { 33, 9}, { 19, 8}, { 39, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 39,10}, \
+ { 23, 9}, { 47,11}, { 15,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 79,10}, { 47, 9}, \
+ { 95, 8}, { 191,10}, { 55,11}, { 31,10}, \
{ 63, 8}, { 255,10}, { 71, 9}, { 143, 8}, \
- { 287,10}, { 79,11}, { 47,10}, { 95, 9}, \
- { 191,12}, { 31,11}, { 63, 9}, { 255, 8}, \
- { 511,10}, { 143, 9}, { 287,11}, { 79,10}, \
- { 159, 9}, { 319, 8}, { 639,10}, { 175, 9}, \
- { 351, 8}, { 703,11}, { 95,10}, { 191, 9}, \
- { 383, 8}, { 767,10}, { 207, 9}, { 415,12}, \
- { 63,10}, { 255, 9}, { 511,11}, { 143,10}, \
- { 287, 9}, { 575,11}, { 159,10}, { 319, 9}, \
+ { 287,10}, { 79, 9}, { 159,11}, { 47,10}, \
+ { 95, 9}, { 191, 8}, { 383, 7}, { 767,10}, \
+ { 103, 9}, { 207,12}, { 31,11}, { 63, 9}, \
+ { 255, 8}, { 511, 7}, { 1023, 9}, { 271,10}, \
+ { 143, 9}, { 287,11}, { 79,10}, { 159, 9}, \
+ { 319, 8}, { 639,10}, { 175, 9}, { 351, 8}, \
+ { 703,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,10}, { 207, 9}, { 415, 8}, { 831,10}, \
+ { 223,12}, { 63,10}, { 255, 9}, { 511, 8}, \
+ { 1023,10}, { 271,11}, { 143,10}, { 287, 9}, \
+ { 575, 8}, { 1151,11}, { 159,10}, { 319, 9}, \
{ 639,11}, { 175,10}, { 351, 9}, { 703,12}, \
{ 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
- { 207,10}, { 415, 9}, { 831,11}, { 223,13}, \
- { 63,11}, { 255,10}, { 511, 9}, { 1023,11}, \
- { 287,10}, { 575, 9}, { 1151,12}, { 159,11}, \
- { 319,10}, { 639,11}, { 351,10}, { 703, 9}, \
- { 1407,12}, { 191,11}, { 383,10}, { 767,11}, \
- { 415,10}, { 831,12}, { 223,11}, { 447,10}, \
- { 895,11}, { 479,10}, { 959,12}, { 255,11}, \
- { 511,10}, { 1023,12}, { 287,11}, { 575,10}, \
- { 1151,12}, { 319,11}, { 639,12}, { 351,11}, \
- { 703,10}, { 1407,12}, { 383,11}, { 767,12}, \
- { 415,11}, { 831,10}, { 1663,12}, { 447,11}, \
- { 895,12}, { 479,11}, { 959,10}, { 1919,13}, \
- { 255,12}, { 511,11}, { 1023,12}, { 543,11}, \
- { 1087,12}, { 575,11}, { 1151,13}, { 319,12}, \
- { 639,11}, { 1279,12}, { 703,11}, { 1407,10}, \
- { 2815,13}, { 383,12}, { 831,11}, { 1663,13}, \
- { 447,12}, { 895,11}, { 1791,12}, { 959,11}, \
- { 1919,14}, { 255,13}, { 511,12}, { 1087,13}, \
- { 575,12}, { 1215,13}, { 639,12}, { 1279,13}, \
- { 703,12}, { 1407,11}, { 2815,14}, { 383,13}, \
- { 831,12}, { 1663,13}, { 895,12}, { 1791,13}, \
- { 959,12}, { 1919,15}, { 255,14}, { 511,13}, \
- { 1087,12}, { 2175,13}, { 1215,14}, { 639,13}, \
- { 1407,12}, { 2815,14}, { 767,13}, { 1663,14}, \
- { 895,13}, { 1919,12}, { 3839,15}, { 511,14}, \
- { 1023,13}, { 2175,14}, { 1151,13}, { 2431,12}, \
- { 4863,14}, { 1407,13}, { 2815,15}, { 767,14}, \
- { 1919,13}, { 3839,16}, { 511,15}, { 1023,14}, \
- { 2431,13}, { 4863,15}, { 1279,14}, { 2943,13}, \
- { 5887,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
- { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
- {4194304,23}, {8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 210
-#define SQR_FFT_THRESHOLD 2496
+ { 207,10}, { 415, 9}, { 831,11}, { 223,10}, \
+ { 447,13}, { 8192,14}, { 16384,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 112
+#define SQR_FFT_THRESHOLD 2688
#define MULLO_BASECASE_THRESHOLD 0 /* always */
-#define MULLO_DC_THRESHOLD 45
-#define MULLO_MUL_N_THRESHOLD 7035
+#define MULLO_DC_THRESHOLD 38
+#define MULLO_MUL_N_THRESHOLD 6253
#define SQRLO_BASECASE_THRESHOLD 4
-#define SQRLO_DC_THRESHOLD 108
-#define SQRLO_SQR_THRESHOLD 4955
+#define SQRLO_DC_THRESHOLD 67
+#define SQRLO_SQR_THRESHOLD 5240
-#define DC_DIV_QR_THRESHOLD 51
-#define DC_DIVAPPR_Q_THRESHOLD 184
-#define DC_BDIV_QR_THRESHOLD 47
-#define DC_BDIV_Q_THRESHOLD 50
+#define DC_DIV_QR_THRESHOLD 42
+#define DC_DIVAPPR_Q_THRESHOLD 152
+#define DC_BDIV_QR_THRESHOLD 39
+#define DC_BDIV_Q_THRESHOLD 93
-#define INV_MULMOD_BNM1_THRESHOLD 26
-#define INV_NEWTON_THRESHOLD 228
-#define INV_APPR_THRESHOLD 204
+#define INV_MULMOD_BNM1_THRESHOLD 37
+#define INV_NEWTON_THRESHOLD 163
+#define INV_APPR_THRESHOLD 162
-#define BINV_NEWTON_THRESHOLD 248
-#define REDC_1_TO_REDC_N_THRESHOLD 60
+#define BINV_NEWTON_THRESHOLD 194
+#define REDC_1_TO_REDC_N_THRESHOLD 43
-#define MU_DIV_QR_THRESHOLD 1210
-#define MU_DIVAPPR_Q_THRESHOLD 1234
-#define MUPI_DIV_QR_THRESHOLD 116
-#define MU_BDIV_QR_THRESHOLD 889
-#define MU_BDIV_Q_THRESHOLD 1210
+#define MU_DIV_QR_THRESHOLD 998
+#define MU_DIVAPPR_Q_THRESHOLD 998
+#define MUPI_DIV_QR_THRESHOLD 98
+#define MU_BDIV_QR_THRESHOLD 807
+#define MU_BDIV_Q_THRESHOLD 924
-#define POWM_SEC_TABLE 1,23,194,712,2177
+#define POWM_SEC_TABLE 6,30,194,579,1730
-#define GET_STR_DC_THRESHOLD 10
-#define GET_STR_PRECOMPUTE_THRESHOLD 22
-#define SET_STR_DC_THRESHOLD 1105
-#define SET_STR_PRECOMPUTE_THRESHOLD 3109
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 29
+#define SET_STR_DC_THRESHOLD 788
+#define SET_STR_PRECOMPUTE_THRESHOLD 1816
-#define FAC_DSC_THRESHOLD 298
-#define FAC_ODD_THRESHOLD 27
+#define FAC_DSC_THRESHOLD 236
+#define FAC_ODD_THRESHOLD 24
-#define MATRIX22_STRASSEN_THRESHOLD 15
-#define HGCD_THRESHOLD 134
-#define HGCD_APPR_THRESHOLD 166
-#define HGCD_REDUCE_THRESHOLD 2121
-#define GCD_DC_THRESHOLD 531
-#define GCDEXT_DC_THRESHOLD 386
-#define JACOBI_BASE_METHOD 4
-
-/* Tuneup completed successfully, took 65068 seconds */
+#define MATRIX22_STRASSEN_THRESHOLD 10
+#define HGCD2_DIV1_METHOD 1 /* 7.05% faster than 3 */
+#define HGCD_THRESHOLD 101
+#define HGCD_APPR_THRESHOLD 104
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 330
+#define GCDEXT_DC_THRESHOLD 242
+#define JACOBI_BASE_METHOD 4 /* 20.00% faster than 1 */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/hamdist.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/hamdist.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/hamdist.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,8 +31,9 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 4.5
+C Cortex-A57 1.9
+C X-Gene 4.36
C TODO
C * Consider greater unrolling.
@@ -42,7 +43,7 @@
C * Explore if explicit align directives, e.g., "[ptr:128]" help.
C * See rth's gmp-devel 2013-02/03 messages about final summation tricks.
-changecom(@&*$)
+changecom(blah)
C INPUT PARAMETERS
define(`ap', x0)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/logops_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/logops_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/logops_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,11 +32,13 @@
include(`../config.m4')
-C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C cycles/limb cycles/limb
+C nand,nior all other
+C Cortex-A53 3.25-3.5 2.75-3
+C Cortex-A57 2.0 1.5
+C X-Gene 2.14 2.0
-changecom(@&*$)
+changecom(blah)
define(`rp', `x0')
define(`up', `x1')
@@ -76,31 +78,62 @@
ASM_START()
PROLOGUE(func)
- tbz n, #0, L(b0)
+ lsr x18, n, #2
+ tbz n, #0, L(bx0)
- ldr x4, [up],#8
- ldr x6, [vp],#8
- sub n, n, #1
- LOGOP( x8, x4, x6)
- POSTOP( x8)
- str x8, [rp],#8
- cbz n, L(rtn)
+L(bx1): ldr x7, [up]
+ ldr x11, [vp]
+ LOGOP( x15, x7, x11)
+ POSTOP( x15)
+ str x15, [rp],#8
+ tbnz n, #1, L(b11)
-L(b0): ldp x4, x5, [up],#16
- ldp x6, x7, [vp],#16
- sub n, n, #2
+L(b01): cbz x18, L(ret)
+ ldp x4, x5, [up,#8]
+ ldp x8, x9, [vp,#8]
+ sub up, up, #8
+ sub vp, vp, #8
b L(mid)
-L(top): ldp x4, x5, [up],#16
- ldp x6, x7, [vp],#16
- sub n, n, #2
- stp x8, x9, [rp],#16
-L(mid): LOGOP( x8, x4, x6)
- LOGOP( x9, x5, x7)
- POSTOP( x8)
- POSTOP( x9)
- cbnz n, L(top)
+L(b11): ldp x6, x7, [up,#8]
+ ldp x10, x11, [vp,#8]
+ add up, up, #8
+ add vp, vp, #8
+ cbz x18, L(end)
+ b L(top)
- stp x8, x9, [rp],#16
-L(rtn): ret
+L(bx0): tbnz n, #1, L(b10)
+
+L(b00): ldp x4, x5, [up],#-16
+ ldp x8, x9, [vp],#-16
+ b L(mid)
+
+L(b10): ldp x6, x7, [up]
+ ldp x10, x11, [vp]
+ cbz x18, L(end)
+
+ ALIGN(16)
+L(top): ldp x4, x5, [up,#16]
+ ldp x8, x9, [vp,#16]
+ LOGOP( x12, x6, x10)
+ LOGOP( x13, x7, x11)
+ POSTOP( x12)
+ POSTOP( x13)
+ stp x12, x13, [rp],#16
+L(mid): ldp x6, x7, [up,#32]!
+ ldp x10, x11, [vp,#32]!
+ LOGOP( x12, x4, x8)
+ LOGOP( x13, x5, x9)
+ POSTOP( x12)
+ POSTOP( x13)
+ stp x12, x13, [rp],#16
+ sub x18, x18, #1
+ cbnz x18, L(top)
+
+L(end): LOGOP( x12, x6, x10)
+ LOGOP( x13, x7, x11)
+ POSTOP( x12)
+ POSTOP( x13)
+ stp x12, x13, [rp]
+L(ret): ret
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshift.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshift.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshift.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
dnl ARM64 mpn_lshift.
-dnl Copyright 2013, 2014 Free Software Foundation, Inc.
+dnl Copyright 2013, 2014, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
@@ -19,12 +19,20 @@
include(`../config.m4')
-C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C cycles/limb assumed optimal c/l
+C Cortex-A53 3.5-4.0 3.25
+C Cortex-A57 2.0 2.0
+C X-Gene 2.67 2.5
-changecom(@&*$)
+C TODO
+C * The feed-in code used 1 ldr for odd sized and 2 ldr for even sizes. These
+C numbers should be 1 and 0, respectively. The str in wind-down should also
+C go.
+C * Using extr and with 63 separate loops we might reach 1.25 c/l on A57.
+C * A53's speed depends on alignment, tune/speed -w1 gives 3.5, -w0 gives 4.0.
+changecom(blah)
+
define(`rp_arg', `x0')
define(`up', `x1')
define(`n', `x2')
@@ -34,21 +42,24 @@
define(`tnc',`x8')
+define(`PSHIFT', lsl)
+define(`NSHIFT', lsr)
+
ASM_START()
PROLOGUE(mpn_lshift)
add rp, rp_arg, n, lsl #3
add up, up, n, lsl #3
sub tnc, xzr, cnt
+ lsr x18, n, #2
tbz n, #0, L(bx0)
L(bx1): ldr x4, [up,#-8]
tbnz n, #1, L(b11)
-L(b01): lsr x0, x4, tnc
- lsl x18, x4, cnt
- sub n, n, #1
- cbnz n, L(gt1)
- str x18, [rp,#-8]
+L(b01): NSHIFT x0, x4, tnc
+ PSHIFT x2, x4, cnt
+ cbnz x18, L(gt1)
+ str x2, [rp,#-8]
ret
L(gt1): ldp x4, x5, [up,#-24]
sub up, up, #8
@@ -55,25 +66,21 @@
add rp, rp, #16
b L(lo2)
-L(b11): lsr x0, x4, tnc
- lsl x9, x4, cnt
- ldp x6, x7, [up,#-24]
- add n, n, #1
- add up, up, #8
- add rp, rp, #32
- b L(lo0)
+L(b11): NSHIFT x0, x4, tnc
+ PSHIFT x2, x4, cnt
+ ldp x6, x7, [up,#-24]!
+ b L(lo3)
L(bx0): ldp x4, x5, [up,#-16]
tbz n, #1, L(b00)
-L(b10): lsr x0, x5, tnc
- lsl x13, x5, cnt
- lsr x10, x4, tnc
- lsl x18, x4, cnt
- sub n, n, #2
- cbnz n, L(gt2)
+L(b10): NSHIFT x0, x5, tnc
+ PSHIFT x13, x5, cnt
+ NSHIFT x10, x4, tnc
+ PSHIFT x2, x4, cnt
+ cbnz x18, L(gt2)
orr x10, x10, x13
- stp x18, x10, [rp,#-16]
+ stp x2, x10, [rp,#-16]
ret
L(gt2): ldp x4, x5, [up,#-32]
orr x10, x10, x13
@@ -82,41 +89,39 @@
add rp, rp, #8
b L(lo2)
-L(b00): lsr x0, x5, tnc
- lsl x13, x5, cnt
- lsr x10, x4, tnc
- lsl x9, x4, cnt
- ldp x6, x7, [up,#-32]
+L(b00): NSHIFT x0, x5, tnc
+ PSHIFT x13, x5, cnt
+ NSHIFT x10, x4, tnc
+ PSHIFT x2, x4, cnt
+ ldp x6, x7, [up,#-32]!
orr x10, x10, x13
- str x10, [rp,#-8]
- add rp, rp, #24
+ str x10, [rp,#-8]!
b L(lo0)
ALIGN(16)
-L(top): ldp x4, x5, [up,#-48]
- sub rp, rp, #32 C integrate with stp?
- sub up, up, #32 C integrate with ldp?
- orr x11, x11, x9
+L(top): ldp x4, x5, [up,#-16]
orr x10, x10, x13
+ orr x11, x12, x2
stp x10, x11, [rp,#-16]
-L(lo2): lsr x11, x5, tnc
- lsl x13, x5, cnt
- lsr x10, x4, tnc
- lsl x9, x4, cnt
- ldp x6, x7, [up,#-32]
- orr x11, x11, x18
+ PSHIFT x2, x6, cnt
+L(lo2): NSHIFT x10, x4, tnc
+ PSHIFT x13, x5, cnt
+ NSHIFT x12, x5, tnc
+ ldp x6, x7, [up,#-32]!
orr x10, x10, x13
- stp x10, x11, [rp,#-32]
-L(lo0): sub n, n, #4
- lsr x11, x7, tnc
- lsl x13, x7, cnt
- lsr x10, x6, tnc
- lsl x18, x6, cnt
- cbnz n, L(top)
+ orr x11, x12, x2
+ stp x10, x11, [rp,#-32]!
+ PSHIFT x2, x4, cnt
+L(lo0): sub x18, x18, #1
+L(lo3): NSHIFT x10, x6, tnc
+ PSHIFT x13, x7, cnt
+ NSHIFT x12, x7, tnc
+ cbnz x18, L(top)
-L(end): orr x11, x11, x9
- orr x10, x10, x13
- stp x10, x11, [rp,#-48]
- str x18, [rp,#-56]
+L(end): orr x10, x10, x13
+ orr x11, x12, x2
+ PSHIFT x2, x6, cnt
+ stp x10, x11, [rp,#-16]
+ str x2, [rp,#-24]
ret
EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshiftc.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshiftc.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/lshiftc.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,130 @@
+dnl ARM64 mpn_lshiftc.
+
+dnl Copyright 2013, 2014, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU Lesser General Public License as published
+dnl by the Free Software Foundation; either version 3 of the License, or (at
+dnl your option) any later version.
+
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+dnl License for more details.
+
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb assumed optimal c/l
+C Cortex-A53 3.5-4.0 3.25
+C Cortex-A57 2.0 2.0
+C X-Gene 2.67 2.5
+
+C TODO
+C * The feed-in code used 1 ldr for odd sized and 2 ldr for even sizes. These
+C numbers should be 1 and 0, respectively. The str in wind-down should also
+C go.
+C * Using extr and with 63 separate loops we might reach 1.5 c/l on A57.
+C * A53's speed depends on alignment, tune/speed -w1 gives 3.5, -w0 gives 4.0.
+
+changecom(blah)
+
+define(`rp_arg', `x0')
+define(`up', `x1')
+define(`n', `x2')
+define(`cnt', `x3')
+
+define(`rp', `x16')
+
+define(`tnc',`x8')
+
+define(`PSHIFT', lsl)
+define(`NSHIFT', lsr)
+
+ASM_START()
+PROLOGUE(mpn_lshiftc)
+ add rp, rp_arg, n, lsl #3
+ add up, up, n, lsl #3
+ sub tnc, xzr, cnt
+ lsr x18, n, #2
+ tbz n, #0, L(bx0)
+
+L(bx1): ldr x4, [up,#-8]
+ tbnz n, #1, L(b11)
+
+L(b01): NSHIFT x0, x4, tnc
+ PSHIFT x2, x4, cnt
+ cbnz x18, L(gt1)
+ mvn x2, x2
+ str x2, [rp,#-8]
+ ret
+L(gt1): ldp x4, x5, [up,#-24]
+ sub up, up, #8
+ add rp, rp, #16
+ b L(lo2)
+
+L(b11): NSHIFT x0, x4, tnc
+ PSHIFT x2, x4, cnt
+ ldp x6, x7, [up,#-24]!
+ b L(lo3)
+
+L(bx0): ldp x4, x5, [up,#-16]
+ tbz n, #1, L(b00)
+
+L(b10): NSHIFT x0, x5, tnc
+ PSHIFT x13, x5, cnt
+ NSHIFT x10, x4, tnc
+ PSHIFT x2, x4, cnt
+ cbnz x18, L(gt2)
+ eon x10, x10, x13
+ mvn x2, x2
+ stp x2, x10, [rp,#-16]
+ ret
+L(gt2): ldp x4, x5, [up,#-32]
+ eon x10, x10, x13
+ str x10, [rp,#-8]
+ sub up, up, #16
+ add rp, rp, #8
+ b L(lo2)
+
+L(b00): NSHIFT x0, x5, tnc
+ PSHIFT x13, x5, cnt
+ NSHIFT x10, x4, tnc
+ PSHIFT x2, x4, cnt
+ ldp x6, x7, [up,#-32]!
+ eon x10, x10, x13
+ str x10, [rp,#-8]!
+ b L(lo0)
+
+ ALIGN(16)
+L(top): ldp x4, x5, [up,#-16]
+ eon x10, x10, x13
+ eon x11, x12, x2
+ stp x10, x11, [rp,#-16]
+ PSHIFT x2, x6, cnt
+L(lo2): NSHIFT x10, x4, tnc
+ PSHIFT x13, x5, cnt
+ NSHIFT x12, x5, tnc
+ ldp x6, x7, [up,#-32]!
+ eon x10, x10, x13
+ eon x11, x12, x2
+ stp x10, x11, [rp,#-32]!
+ PSHIFT x2, x4, cnt
+L(lo0): sub x18, x18, #1
+L(lo3): NSHIFT x10, x6, tnc
+ PSHIFT x13, x7, cnt
+ NSHIFT x12, x7, tnc
+ cbnz x18, L(top)
+
+L(end): eon x10, x10, x13
+ eon x11, x12, x2
+ PSHIFT x2, x6, cnt
+ stp x10, x11, [rp,#-16]
+ mvn x2, x2
+ str x2, [rp,#-24]
+ ret
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mod_34lsub1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mod_34lsub1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mod_34lsub1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,18 +31,19 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 2
+C Cortex-A57 1
+C X-Gene 1.45
define(`ap', x0)
define(`n', x1)
-changecom(@&*$)
+changecom(blah)
C mp_limb_t mpn_mod_34lsub1 (mp_srcptr up, mp_size_t n)
C TODO
-C * An alternative inner loop which could run at 0.722 c/l:
+C * An alternative inner loop which could run at 0.722 c/l on A57:
C adds x8, x8, x2
C adcs x9, x9, x3
C ldp x2, x3, [ap, #-32]
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mul_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/mul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
dnl Contributed to the GNU project by Torbjörn Granlund.
-dnl Copyright 2013 Free Software Foundation, Inc.
+dnl Copyright 2013, 2015, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -33,66 +33,95 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 7.5-8
+C Cortex-A57 7
+C Cortex-A72
+C X-Gene 4
+C TODO
+C * Start first multiply earlier.
+
+changecom(blah)
+
define(`rp', `x0')
define(`up', `x1')
define(`n', `x2')
define(`v0', `x3')
-ASM_START()
+
+PROLOGUE(mpn_mul_1c)
+ adds xzr, xzr, xzr C clear cy flag
+ b L(com)
+EPILOGUE()
+
PROLOGUE(mpn_mul_1)
- ldr x12, [up], #8
- and x6, n, #3
- and n, n, #-4
- cbz x6, L(fi0)
- cmp x6, #2
- b.cc L(fi1)
- b.eq L(fi2)
+ adds x4, xzr, xzr C clear register and cy flag
+L(com): lsr x18, n, #2
+ tbnz n, #0, L(bx1)
-L(fi3): mul x8, x12, v0
- umulh x13, x12, v0
- cmn xzr, xzr
- b L(L3)
-L(fi2): mul x7, x12, v0
- umulh x5, x12, v0
- cmn xzr, xzr
- b L(L2)
-L(fi0): mul x9, x12, v0
- umulh x5, x12, v0
- sub n, n, #4
- cmn xzr, xzr
- b L(L0)
-L(fi1): mul x10, x12, v0
- umulh x13, x12, v0
- cmn xzr, xzr
- cbz n, L(end)
+L(bx0): mov x11, x4
+ tbz n, #1, L(b00)
-L(top): sub n, n, #4
- ldr x12, [up], #8
- mul x6, x12, v0
- umulh x5, x12, v0
- str x10, [rp], #8
- adcs x9, x6, x13
-L(L0): ldr x12, [up], #8
- mul x6, x12, v0
- umulh x13, x12, v0
- str x9, [rp] ,#8
- adcs x8, x6, x5
-L(L3): ldr x12, [up], #8
- mul x6, x12, v0
- umulh x5, x12, v0
- str x8, [rp], #8
- adcs x7, x6, x13
-L(L2): ldr x12, [up], #8
- mul x6, x12, v0
- umulh x13, x12, v0
- str x7, [rp], #8
- adcs x10, x6, x5
- cbnz n, L(top)
+L(b10): ldp x4, x5, [up]
+ mul x8, x4, v0
+ umulh x10, x4, v0
+ cbz x18, L(2)
+ ldp x6, x7, [up,#16]!
+ mul x9, x5, v0
+ b L(mid)-8
-L(end): str x10, [rp]
- adc x0, x13, xzr
+L(2): mul x9, x5, v0
+ b L(2e)
+
+L(bx1): ldr x7, [up],#8
+ mul x9, x7, v0
+ umulh x11, x7, v0
+ adds x9, x9, x4
+ str x9, [rp],#8
+ tbnz n, #1, L(b10)
+
+L(b01): cbz x18, L(1)
+
+L(b00): ldp x6, x7, [up]
+ mul x8, x6, v0
+ umulh x10, x6, v0
+ ldp x4, x5, [up,#16]
+ mul x9, x7, v0
+ adcs x12, x8, x11
+ umulh x11, x7, v0
+ add rp, rp, #16
+ sub x18, x18, #1
+ cbz x18, L(end)
+
+ ALIGN(16)
+L(top): mul x8, x4, v0
+ ldp x6, x7, [up,#32]!
+ adcs x13, x9, x10
+ umulh x10, x4, v0
+ mul x9, x5, v0
+ stp x12, x13, [rp,#-16]
+ adcs x12, x8, x11
+ umulh x11, x5, v0
+L(mid): mul x8, x6, v0
+ ldp x4, x5, [up,#16]
+ adcs x13, x9, x10
+ umulh x10, x6, v0
+ mul x9, x7, v0
+ stp x12, x13, [rp],#32
+ adcs x12, x8, x11
+ umulh x11, x7, v0
+ sub x18, x18, #1
+ cbnz x18, L(top)
+
+L(end): mul x8, x4, v0
+ adcs x13, x9, x10
+ umulh x10, x4, v0
+ mul x9, x5, v0
+ stp x12, x13, [rp,#-16]
+L(2e): adcs x12, x8, x11
+ umulh x11, x5, v0
+ adcs x13, x9, x10
+ stp x12, x13, [rp]
+L(1): adc x0, x11, xzr
ret
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/popcount.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/popcount.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/popcount.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,8 +31,9 @@
include(`../config.m4')
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 2.5
+C Cortex-A57 1.14
+C X-Gene 3
C TODO
C * Consider greater unrolling.
@@ -42,7 +43,7 @@
C * Explore if explicit align directives, e.g., "[ptr:128]" help.
C * See rth's gmp-devel 2013-02/03 messages about final summation tricks.
-changecom(@&*$)
+changecom(blah)
C INPUT PARAMETERS
define(`ap', x0)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rsh1aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rsh1aors_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rsh1aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,168 @@
+dnl ARM64 mpn_rsh1add_n and mpn_rsh1sub_n.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb assumed optimal c/l
+C Cortex-A53 3.25-3.75 3.0 steady
+C Cortex-A57 2.15 1.75
+C X-Gene 2.75 2.5
+
+changecom(blah)
+
+define(`rp', `x0')
+define(`up', `x1')
+define(`vp', `x2')
+define(`n', `x3')
+
+ifdef(`OPERATION_rsh1add_n', `
+ define(`ADDSUB', adds)
+ define(`ADDSUBC', adcs)
+ define(`COND', `cs')
+ define(`func_n', mpn_rsh1add_n)')
+ifdef(`OPERATION_rsh1sub_n', `
+ define(`ADDSUB', subs)
+ define(`ADDSUBC', sbcs)
+ define(`COND', `cc')
+ define(`func_n', mpn_rsh1sub_n)')
+
+MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
+
+ASM_START()
+PROLOGUE(func_n)
+ lsr x18, n, #2
+
+ tbz n, #0, L(bx0)
+
+L(bx1): ldr x5, [up],#8
+ ldr x9, [vp],#8
+ tbnz n, #1, L(b11)
+
+L(b01): ADDSUB x13, x5, x9
+ and x10, x13, #1
+ cbz x18, L(1)
+ ldp x4, x5, [up],#48
+ ldp x8, x9, [vp],#48
+ ADDSUBC x14, x4, x8
+ ADDSUBC x15, x5, x9
+ ldp x4, x5, [up,#-32]
+ ldp x8, x9, [vp,#-32]
+ extr x17, x14, x13, #1
+ ADDSUBC x12, x4, x8
+ ADDSUBC x13, x5, x9
+ str x17, [rp], #24
+ sub x18, x18, #1
+ cbz x18, L(end)
+ b L(top)
+
+L(1): cset x14, COND
+ extr x17, x14, x13, #1
+ str x17, [rp]
+ mov x0, x10
+ ret
+
+L(b11): ADDSUB x15, x5, x9
+ and x10, x15, #1
+
+ ldp x4, x5, [up],#32
+ ldp x8, x9, [vp],#32
+ ADDSUBC x12, x4, x8
+ ADDSUBC x13, x5, x9
+ cbz x18, L(3)
+ ldp x4, x5, [up,#-16]
+ ldp x8, x9, [vp,#-16]
+ extr x17, x12, x15, #1
+ ADDSUBC x14, x4, x8
+ ADDSUBC x15, x5, x9
+ str x17, [rp], #8
+ b L(mid)
+
+L(3): extr x17, x12, x15, #1
+ str x17, [rp], #8
+ b L(2)
+
+L(bx0): tbz n, #1, L(b00)
+
+L(b10): ldp x4, x5, [up],#32
+ ldp x8, x9, [vp],#32
+ ADDSUB x12, x4, x8
+ ADDSUBC x13, x5, x9
+ and x10, x12, #1
+ cbz x18, L(2)
+ ldp x4, x5, [up,#-16]
+ ldp x8, x9, [vp,#-16]
+ ADDSUBC x14, x4, x8
+ ADDSUBC x15, x5, x9
+ b L(mid)
+
+L(b00): ldp x4, x5, [up],#48
+ ldp x8, x9, [vp],#48
+ ADDSUB x14, x4, x8
+ ADDSUBC x15, x5, x9
+ and x10, x14, #1
+ ldp x4, x5, [up,#-32]
+ ldp x8, x9, [vp,#-32]
+ ADDSUBC x12, x4, x8
+ ADDSUBC x13, x5, x9
+ add rp, rp, #16
+ sub x18, x18, #1
+ cbz x18, L(end)
+
+ ALIGN(16)
+L(top): ldp x4, x5, [up,#-16]
+ ldp x8, x9, [vp,#-16]
+ extr x16, x15, x14, #1
+ extr x17, x12, x15, #1
+ ADDSUBC x14, x4, x8
+ ADDSUBC x15, x5, x9
+ stp x16, x17, [rp,#-16]
+L(mid): ldp x4, x5, [up],#32
+ ldp x8, x9, [vp],#32
+ extr x16, x13, x12, #1
+ extr x17, x14, x13, #1
+ ADDSUBC x12, x4, x8
+ ADDSUBC x13, x5, x9
+ stp x16, x17, [rp],#32
+ sub x18, x18, #1
+ cbnz x18, L(top)
+
+L(end): extr x16, x15, x14, #1
+ extr x17, x12, x15, #1
+ stp x16, x17, [rp,#-16]
+L(2): cset x14, COND
+ extr x16, x13, x12, #1
+ extr x17, x14, x13, #1
+ stp x16, x17, [rp]
+
+L(ret): mov x0, x10
+ ret
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rshift.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rshift.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/rshift.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
dnl ARM64 mpn_rshift.
-dnl Copyright 2013, 2014 Free Software Foundation, Inc.
+dnl Copyright 2013, 2014, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
@@ -19,12 +19,20 @@
include(`../config.m4')
-C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C cycles/limb assumed optimal c/l
+C Cortex-A53 3.5-4.0 3.25
+C Cortex-A57 2.0 2.0
+C X-Gene 2.67 2.5
-changecom(@&*$)
+C TODO
+C * The feed-in code used 1 ldr for odd sized and 2 ldr for even sizes. These
+C numbers should be 1 and 0, respectively. The str in wind-down should also
+C go.
+C * Using extr and with 63 separate loops we might reach 1.25 c/l on A57.
+C * A53's speed depends on alignment, but not as simply as for lshift/lshiftc.
+changecom(blah)
+
define(`rp_arg', `x0')
define(`up', `x1')
define(`n', `x2')
@@ -34,88 +42,84 @@
define(`tnc',`x8')
+define(`PSHIFT', lsr)
+define(`NSHIFT', lsl)
+
ASM_START()
PROLOGUE(mpn_rshift)
mov rp, rp_arg
sub tnc, xzr, cnt
+ lsr x18, n, #2
tbz n, #0, L(bx0)
-L(bx1): ldr x4, [up,#0]
+L(bx1): ldr x5, [up]
tbnz n, #1, L(b11)
-L(b01): lsl x0, x4, tnc
- lsr x18, x4, cnt
- sub n, n, #1
- cbnz n, L(gt1)
- str x18, [rp,#0]
+L(b01): NSHIFT x0, x5, tnc
+ PSHIFT x2, x5, cnt
+ cbnz x18, L(gt1)
+ str x2, [rp]
ret
-L(gt1): ldp x5, x4, [up,#8]
+L(gt1): ldp x4, x5, [up,#8]
sub up, up, #8
sub rp, rp, #32
b L(lo2)
-L(b11): lsl x0, x4, tnc
- lsr x9, x4, cnt
- ldp x7, x6, [up,#8]
- add n, n, #1
- sub up, up, #24
- sub rp, rp, #48
- b L(lo0)
+L(b11): NSHIFT x0, x5, tnc
+ PSHIFT x2, x5, cnt
+ ldp x6, x7, [up,#8]!
+ sub rp, rp, #16
+ b L(lo3)
-L(bx0): ldp x5, x4, [up,#0]
+L(bx0): ldp x4, x5, [up]
tbz n, #1, L(b00)
-L(b10): lsl x0, x5, tnc
- lsr x13, x5, cnt
- lsl x10, x4, tnc
- lsr x18, x4, cnt
- sub n, n, #2
- cbnz n, L(gt2)
+L(b10): NSHIFT x0, x4, tnc
+ PSHIFT x13, x4, cnt
+ NSHIFT x10, x5, tnc
+ PSHIFT x2, x5, cnt
+ cbnz x18, L(gt2)
orr x10, x10, x13
- stp x10, x18, [rp,#0]
+ stp x10, x2, [rp]
ret
-L(gt2): ldp x5, x4, [up,#16]
+L(gt2): ldp x4, x5, [up,#16]
orr x10, x10, x13
- str x10, [rp,#0]
- sub rp, rp, #24
+ str x10, [rp],#-24
b L(lo2)
-L(b00): lsl x0, x5, tnc
- lsr x13, x5, cnt
- lsl x10, x4, tnc
- lsr x9, x4, cnt
- ldp x7, x6, [up,#16]
+L(b00): NSHIFT x0, x4, tnc
+ PSHIFT x13, x4, cnt
+ NSHIFT x10, x5, tnc
+ PSHIFT x2, x5, cnt
+ ldp x6, x7, [up,#16]!
orr x10, x10, x13
- str x10, [rp,#0]
- sub up, up, #16
- sub rp, rp, #40
+ str x10, [rp],#-8
b L(lo0)
ALIGN(16)
-L(top): ldp x5, x4, [up,#48]
- add rp, rp, #32 C integrate with stp?
- add up, up, #32 C integrate with ldp?
- orr x11, x11, x9
+L(top): ldp x4, x5, [up,#16]
orr x10, x10, x13
+ orr x11, x12, x2
stp x11, x10, [rp,#16]
-L(lo2): lsl x11, x5, tnc
- lsr x13, x5, cnt
- lsl x10, x4, tnc
- lsr x9, x4, cnt
- ldp x7, x6, [up,#32]
- orr x11, x11, x18
+ PSHIFT x2, x7, cnt
+L(lo2): NSHIFT x10, x5, tnc
+ NSHIFT x12, x4, tnc
+ PSHIFT x13, x4, cnt
+ ldp x6, x7, [up,#32]!
orr x10, x10, x13
- stp x11, x10, [rp,#32]
-L(lo0): sub n, n, #4
- lsl x11, x7, tnc
- lsr x13, x7, cnt
- lsl x10, x6, tnc
- lsr x18, x6, cnt
- cbnz n, L(top)
+ orr x11, x12, x2
+ stp x11, x10, [rp,#32]!
+ PSHIFT x2, x5, cnt
+L(lo0): sub x18, x18, #1
+L(lo3): NSHIFT x10, x7, tnc
+ NSHIFT x12, x6, tnc
+ PSHIFT x13, x6, cnt
+ cbnz x18, L(top)
-L(end): orr x11, x11, x9
- orr x10, x10, x13
- stp x11, x10, [rp,#48]
- str x18, [rp,#64]
+L(end): orr x10, x10, x13
+ orr x11, x12, x2
+ PSHIFT x2, x7, cnt
+ stp x11, x10, [rp,#16]
+ str x2, [rp,#32]
ret
EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sec_tabselect.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sec_tabselect.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sec_tabselect.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,14 +34,15 @@
C cycles/limb
-C Cortex-A53 ?
-C Cortex-A57 ?
+C Cortex-A53 2.25
+C Cortex-A57 1.33
+C X-Gene 2
C void
C mpn_sec_tabselect (mp_ptr rp, mp_srcptr *tab,
C mp_size_t n, mp_size_t nents, mp_size_t which)
-changecom(@&*$)
+changecom(blah)
define(`rp', `x0')
define(`tp', `x1')
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sqr_diag_addlsh1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sqr_diag_addlsh1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/sqr_diag_addlsh1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,102 @@
+dnl ARM64 mpn_sqr_diag_addlsh1.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2016, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C Cortex-A53 5.65
+C Cortex-A57 3.5
+C X-Gene 3.38
+
+changecom(blah)
+
+define(`rp', `x0')
+define(`tp', `x1')
+define(`up', `x2')
+define(`n', `x3')
+
+ASM_START()
+PROLOGUE(mpn_sqr_diag_addlsh1)
+ ldr x15, [up],#8
+ lsr x18, n, #1
+ tbz n, #0, L(bx0)
+
+L(bx1): adds x7, xzr, xzr
+ mul x12, x15, x15
+ ldr x16, [up],#8
+ ldp x4, x5, [tp],#16
+ umulh x11, x15, x15
+ b L(mid)
+
+L(bx0): adds x5, xzr, xzr
+ mul x12, x15, x15
+ ldr x17, [up],#16
+ ldp x6, x7, [tp],#32
+ umulh x11, x15, x15
+ sub x18, x18, #1
+ cbz x18, L(end)
+
+ ALIGN(16)
+L(top): extr x9, x6, x5, #63
+ mul x10, x17, x17
+ ldr x16, [up,#-8]
+ adcs x13, x9, x11
+ ldp x4, x5, [tp,#-16]
+ umulh x11, x17, x17
+ extr x8, x7, x6, #63
+ stp x12, x13, [rp],#16
+ adcs x12, x8, x10
+L(mid): extr x9, x4, x7, #63
+ mul x10, x16, x16
+ ldr x17, [up],#16
+ adcs x13, x9, x11
+ ldp x6, x7, [tp],#32
+ umulh x11, x16, x16
+ extr x8, x5, x4, #63
+ stp x12, x13, [rp],#16
+ adcs x12, x8, x10
+ sub x18, x18, #1
+ cbnz x18, L(top)
+
+L(end): extr x9, x6, x5, #63
+ mul x10, x17, x17
+ adcs x13, x9, x11
+ umulh x11, x17, x17
+ extr x8, x7, x6, #63
+ stp x12, x13, [rp]
+ adcs x12, x8, x10
+ extr x9, xzr, x7, #63
+ adcs x13, x9, x11
+ stp x12, x13, [rp,#16]
+
+ ret
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/xgene1/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/xgene1/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/xgene1/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,181 @@
+/* gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 2400 MHz AppliedMicro X-Gene */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2019-09-28, gcc 4.8 */
+
+#define DIVREM_1_NORM_THRESHOLD 0 /* always */
+#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1_1P_METHOD 1 /* 2.00% faster than 2 */
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 22
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 37.38% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 1
+#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_2_PI2_THRESHOLD 14
+#define DIVEXACT_1_THRESHOLD 0 /* always */
+#define BMOD_1_TO_MOD_1_THRESHOLD 27
+
+#define DIV_1_VS_MUL_1_PERCENT 249
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 61
+#define MUL_TOOM44_THRESHOLD 112
+#define MUL_TOOM6H_THRESHOLD 242
+#define MUL_TOOM8H_THRESHOLD 321
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 99
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 109
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 72
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 81
+#define SQR_TOOM4_THRESHOLD 154
+#define SQR_TOOM6_THRESHOLD 214
+#define SQR_TOOM8_THRESHOLD 284
+
+#define MULMID_TOOM42_THRESHOLD 46
+
+#define MULMOD_BNM1_THRESHOLD 11
+#define SQRMOD_BNM1_THRESHOLD 13
+
+#define MUL_FFT_MODF_THRESHOLD 412 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 412, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 19, 7}, { 12, 6}, { 25, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 25, 8}, \
+ { 13, 7}, { 27, 8}, { 15, 7}, { 31, 8}, \
+ { 17, 7}, { 35, 8}, { 21, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
+ { 41, 9}, { 23, 8}, { 49, 9}, { 27,10}, \
+ { 15, 9}, { 31, 8}, { 63, 9}, { 39,10}, \
+ { 23, 9}, { 55,11}, { 15,10}, { 31, 9}, \
+ { 71,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 99,10}, { 55,11}, { 31,10}, { 63, 9}, \
+ { 127,10}, { 71, 9}, { 143,10}, { 79,11}, \
+ { 47,10}, { 103,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 135, 9}, { 271,10}, \
+ { 143,11}, { 79, 9}, { 319,10}, { 167, 9}, \
+ { 351,11}, { 95, 9}, { 383, 8}, { 767,10}, \
+ { 207, 9}, { 415,11}, { 111,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,11}, { 143,10}, { 287, 9}, { 575,10}, \
+ { 319, 9}, { 639,10}, { 351,12}, { 95,10}, \
+ { 383, 9}, { 767,11}, { 207,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 447,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 98
+#define MUL_FFT_THRESHOLD 4736
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 340, 5}, { 17, 6}, { 9, 5}, { 19, 6}, \
+ { 19, 7}, { 10, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 21, 8}, { 11, 7}, { 24, 8}, \
+ { 15, 7}, { 31, 8}, { 21, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
+ { 39, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 31, 8}, { 63, 9}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 79,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 95, 9}, { 191,12}, { 31,11}, \
+ { 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
+ { 135, 9}, { 271,11}, { 79, 9}, { 319, 8}, \
+ { 639,10}, { 175,11}, { 95,10}, { 191, 9}, \
+ { 383,10}, { 207,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543,10}, \
+ { 287, 9}, { 575,10}, { 319, 9}, { 639,11}, \
+ { 175,10}, { 351,12}, { 95,11}, { 191,10}, \
+ { 383, 9}, { 767,11}, { 207,10}, { 415,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 87
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 45
+#define MULLO_MUL_N_THRESHOLD 8648
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 108
+#define SQRLO_SQR_THRESHOLD 6461
+
+#define DC_DIV_QR_THRESHOLD 64
+#define DC_DIVAPPR_Q_THRESHOLD 222
+#define DC_BDIV_QR_THRESHOLD 63
+#define DC_BDIV_Q_THRESHOLD 132
+
+#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_NEWTON_THRESHOLD 242
+#define INV_APPR_THRESHOLD 222
+
+#define BINV_NEWTON_THRESHOLD 254
+#define REDC_1_TO_REDC_N_THRESHOLD 66
+
+#define MU_DIV_QR_THRESHOLD 1234
+#define MU_DIVAPPR_Q_THRESHOLD 1234
+#define MUPI_DIV_QR_THRESHOLD 122
+#define MU_BDIV_QR_THRESHOLD 1210
+#define MU_BDIV_Q_THRESHOLD 1234
+
+#define POWM_SEC_TABLE 3,23,194,712,2499
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 22
+#define SET_STR_DC_THRESHOLD 381
+#define SET_STR_PRECOMPUTE_THRESHOLD 2503
+
+#define FAC_DSC_THRESHOLD 216
+#define FAC_ODD_THRESHOLD 26
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD2_DIV1_METHOD 5 /* 2.01% faster than 3 */
+#define HGCD_THRESHOLD 122
+#define HGCD_APPR_THRESHOLD 171
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 541
+#define GCDEXT_DC_THRESHOLD 386
+#define JACOBI_BASE_METHOD 4 /* 7.46% faster than 1 */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/arm64/xgene1/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/asm-defs.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/asm-defs.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/asm-defs.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1394,6 +1394,8 @@
define_mpn(dump)
define_mpn(gcd)
define_mpn(gcd_1)
+define_mpn(gcd_11)
+define_mpn(gcd_22)
define_mpn(gcdext)
define_mpn(get_str)
define_mpn(hamdist)
@@ -1453,6 +1455,9 @@
define_mpn(rsh1sub_nc)
define_mpn(rshift)
define_mpn(rshiftc)
+define_mpn(sbpi1_bdiv_q)
+define_mpn(sbpi1_bdiv_qr)
+define_mpn(sbpi1_bdiv_r)
define_mpn(scan0)
define_mpn(scan1)
define_mpn(set_str)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/add_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/add_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/add_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
/* This code runs at 4 cycles/limb. It may be possible to bring it down
to 3 cycles/limb. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/addmul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/addmul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/addmul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/mul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/mul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/mul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/submul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/submul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/cfp/submul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,11 +31,6 @@
#define GMP_LIMB_BITS 64
#define GMP_LIMB_BYTES 8
-#if 0
-#define UMUL_TIME 519
-#define UDIV_TIME 2360
-#endif
-
/* T90 Unicos 10.0.X in CFP mode */
/* Generated by tuneup.c, 2004-02-07, system compiler */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/hamdist.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/hamdist.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/hamdist.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/addmul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/addmul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/addmul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
should bring it down to perhaps 7 cycles/limb. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/invert_limb.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/invert_limb.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/invert_limb.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
be hard to improve upon, even with assembly code. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/mul_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
That is not perfect, mainly due to vector register shortage. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/sqr_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/sqr_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/sqr_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
/* This is just mpn_mul_basecase with trivial modifications. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/submul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/submul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/ieee/submul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
should bring it down to perhaps 7 cycles/limb. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/lshift.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/lshift.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/lshift.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/mulww.f
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/mulww.f 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/mulww.f 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,27 +3,27 @@
c Copyright 1996, 2000 Free Software Foundation, Inc.
c This file is part of the GNU MP Library.
-c
+c
c The GNU MP Library is free software; you can redistribute it and/or modify
c it under the terms of either:
-c
+c
c * the GNU Lesser General Public License as published by the Free
c Software Foundation; either version 3 of the License, or (at your
c option) any later version.
-c
+c
c or
-c
+c
c * the GNU General Public License as published by the Free Software
c Foundation; either version 2 of the License, or (at your option) any
c later version.
-c
+c
c or both in parallel, as here.
-c
+c
c The GNU MP Library is distributed in the hope that it will be useful, but
c WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
c or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
c for more details.
-c
+c
c You should have received copies of the GNU General Public License and the
c GNU Lesser General Public License along with the GNU MP Library. If not,
c see https://www.gnu.org/licenses/.
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/popcount.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/popcount.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/popcount.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
unsigned long int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/rshift.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/rshift.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/rshift.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
#include <intrinsics.h>
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/cray/sub_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/cray/sub_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/cray/sub_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
/* This code runs at 4 cycles/limb. It may be possible to bring it down
to 3 cycles/limb. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_add 1
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_add_1 1
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err1_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err1_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err1_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err2_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err2_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err2_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err3_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err3_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_err3_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n_sub_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n_sub_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/add_n_sub_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#ifndef L1_CACHE_SIZE
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/addmul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/addmul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/addmul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,8 @@
pointed to by RP. Return the most significant limb of the product,
adjusted for carry-out from the addition.
-Copyright 1992-1994, 1996, 2000, 2002, 2004 Free Software Foundation, Inc.
+Copyright 1992-1994, 1996, 2000, 2002, 2004, 2016 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -31,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -39,30 +39,36 @@
#if GMP_NAIL_BITS == 0
mp_limb_t
-mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t v0)
{
- mp_limb_t ul, cl, hpl, lpl, rl;
+ mp_limb_t u0, crec, c, p1, p0, r0;
ASSERT (n >= 1);
ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
- cl = 0;
+ crec = 0;
do
{
- ul = *up++;
- umul_ppmm (hpl, lpl, ul, vl);
+ u0 = *up++;
+ umul_ppmm (p1, p0, u0, v0);
- lpl += cl;
- cl = (lpl < cl) + hpl;
+ r0 = *rp;
- rl = *rp;
- lpl = rl + lpl;
- cl += lpl < rl;
- *rp++ = lpl;
+ p0 = r0 + p0;
+ c = r0 > p0;
+
+ p1 = p1 + c;
+
+ r0 = p0 + crec; /* cycle 0, 3, ... */
+ c = p0 > r0; /* cycle 1, 4, ... */
+
+ crec = p1 + c; /* cycle 2, 5, ... */
+
+ *rp++ = r0;
}
while (--n != 0);
- return cl;
+ return crec;
}
#endif
@@ -70,35 +76,35 @@
#if GMP_NAIL_BITS == 1
mp_limb_t
-mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t v0)
{
- mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, cl, xl, c1, c2, c3;
+ mp_limb_t shifted_v0, u0, r0, p0, p1, prev_p1, crec, xl, c1, c2, c3;
ASSERT (n >= 1);
ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
ASSERT_MPN (rp, n);
ASSERT_MPN (up, n);
- ASSERT_LIMB (vl);
+ ASSERT_LIMB (v0);
- shifted_vl = vl << GMP_NAIL_BITS;
- cl = 0;
- prev_hpl = 0;
+ shifted_v0 = v0 << GMP_NAIL_BITS;
+ crec = 0;
+ prev_p1 = 0;
do
{
- ul = *up++;
- rl = *rp;
- umul_ppmm (hpl, lpl, ul, shifted_vl);
- lpl >>= GMP_NAIL_BITS;
- ADDC_LIMB (c1, xl, prev_hpl, lpl);
- ADDC_LIMB (c2, xl, xl, rl);
- ADDC_LIMB (c3, xl, xl, cl);
- cl = c1 + c2 + c3;
+ u0 = *up++;
+ r0 = *rp;
+ umul_ppmm (p1, p0, u0, shifted_v0);
+ p0 >>= GMP_NAIL_BITS;
+ ADDC_LIMB (c1, xl, prev_p1, p0);
+ ADDC_LIMB (c2, xl, xl, r0);
+ ADDC_LIMB (c3, xl, xl, crec);
+ crec = c1 + c2 + c3;
*rp++ = xl;
- prev_hpl = hpl;
+ prev_p1 = p1;
}
while (--n != 0);
- return prev_hpl + cl;
+ return prev_p1 + crec;
}
#endif
@@ -106,34 +112,34 @@
#if GMP_NAIL_BITS >= 2
mp_limb_t
-mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+mpn_addmul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t v0)
{
- mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, xw, cl, xl;
+ mp_limb_t shifted_v0, u0, r0, p0, p1, prev_p1, xw, crec, xl;
ASSERT (n >= 1);
ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
ASSERT_MPN (rp, n);
ASSERT_MPN (up, n);
- ASSERT_LIMB (vl);
+ ASSERT_LIMB (v0);
- shifted_vl = vl << GMP_NAIL_BITS;
- cl = 0;
- prev_hpl = 0;
+ shifted_v0 = v0 << GMP_NAIL_BITS;
+ crec = 0;
+ prev_p1 = 0;
do
{
- ul = *up++;
- rl = *rp;
- umul_ppmm (hpl, lpl, ul, shifted_vl);
- lpl >>= GMP_NAIL_BITS;
- xw = prev_hpl + lpl + rl + cl;
- cl = xw >> GMP_NUMB_BITS;
+ u0 = *up++;
+ r0 = *rp;
+ umul_ppmm (p1, p0, u0, shifted_v0);
+ p0 >>= GMP_NAIL_BITS;
+ xw = prev_p1 + p0 + r0 + crec;
+ crec = xw >> GMP_NUMB_BITS;
xl = xw & GMP_NUMB_MASK;
*rp++ = xl;
- prev_hpl = hpl;
+ prev_p1 = p1;
}
while (--n != 0);
- return prev_hpl + cl;
+ return prev_p1 + crec;
}
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_dbm1c.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_dbm1c.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_dbm1c.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_q_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -5,7 +5,7 @@
CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
FUTURE GNU MP RELEASES.
-Copyright 2000-2003, 2005, 2009 Free Software Foundation, Inc.
+Copyright 2000-2003, 2005, 2009, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -33,7 +33,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -74,9 +73,10 @@
}
u = u >> shift;
- l = u - c;
+ SUBC_LIMB (c, l, u, c);
+
l = (l * di) & GMP_NUMB_MASK;
- rp[i] = l;
+ rp[n] = l;
}
else
{
@@ -113,13 +113,8 @@
ASSERT_MPN (up, n);
ASSERT_LIMB (d);
- if ((d & 1) == 0)
- {
- count_trailing_zeros (shift, d);
- d >>= shift;
- }
- else
- shift = 0;
+ count_trailing_zeros (shift, d);
+ d >>= shift;
binvert_limb (di, d);
return mpn_pi1_bdiv_q_1 (rp, up, n, d, di, shift);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bdiv_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/binvert.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/binvert.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/binvert.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright (C) 2004-2007, 2009, 2012 Free Software Foundation, Inc.
+Copyright (C) 2004-2007, 2009, 2012, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -84,6 +83,8 @@
else
mpn_dcpi1_bdiv_q (rp, xp, rn, up, rn, -di);
+ mpn_neg (rp, rp, rn);
+
/* Use Newton iterations to get the desired precision. */
for (; rn < n; rn = newrn)
{
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/broot.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/broot.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/broot.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Computes a^e (mod B). Uses right-to-left binary algorithm, since
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/brootinv.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/brootinv.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/brootinv.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
Contributed to the GNU project by Martin Boij (as part of perfpow.c).
-Copyright 2009, 2010, 2012, 2013 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2012, 2013, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -30,19 +30,23 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-/* Computes a^e (mod B). Uses right-to-left binary algorithm, since
+/* Computes a^2e (mod B). Uses right-to-left binary algorithm, since
typical use will have e small. */
static mp_limb_t
-powlimb (mp_limb_t a, mp_limb_t e)
+powsquaredlimb (mp_limb_t a, mp_limb_t e)
{
mp_limb_t r;
- for (r = 1; e > 0; e >>= 1, a *= a)
+ r = 1;
+ /* if (LIKELY (e != 0)) */
+ do {
+ a *= a;
if (e & 1)
r *= a;
+ e >>= 1;
+ } while (e != 0);
return r;
}
@@ -67,7 +71,9 @@
(4) Use a small table to get starting value.
- Scratch need: 5*bn, where bn = ceil (bnb / GMP_NUMB_BITS).
+ Scratch need: bn + (((bn + 1) >> 1) + 1) + scratch for mpn_powlo
+ Currently mpn_powlo requires 3*bn
+ so that 5*bn is surely enough, where bn = ceil (bnb / GMP_NUMB_BITS).
*/
void
@@ -76,14 +82,14 @@
mp_ptr tp2, tp3;
mp_limb_t kinv, k2, r0, y0;
mp_size_t order[GMP_LIMB_BITS + 1];
- int i, d;
+ int d;
ASSERT (bn > 0);
ASSERT ((k & 1) != 0);
tp2 = tp + bn;
- tp3 = tp + 2 * bn;
- k2 = k + 1;
+ tp3 = tp + bn + ((bn + 3) >> 1);
+ k2 = (k >> 1) + 1; /* (k + 1) / 2 , but avoid k+1 overflow */
binvert_limb (kinv, k);
@@ -90,22 +96,22 @@
/* 4-bit initial approximation:
y%16 | 1 3 5 7 9 11 13 15,
- k%4 +-------------------------+k2%4
- 1 | 1 11 13 7 9 3 5 15 | 2
+ k%4 +-------------------------+k2%2
+ 1 | 1 11 13 7 9 3 5 15 | 1
3 | 1 3 5 7 9 11 13 15 | 0
*/
y0 = yp[0];
- r0 = y0 ^ (((y0 << 1) ^ (y0 << 2)) & (k2 << 2) & 8); /* 4 bits */
- r0 = kinv * (k2 * r0 - y0 * powlimb(r0, k2 & 0x7f)); /* 8 bits */
- r0 = kinv * (k2 * r0 - y0 * powlimb(r0, k2 & 0x7fff)); /* 16 bits */
+ r0 = y0 ^ (((y0 << 1) ^ (y0 << 2)) & (k2 << 3) & 8); /* 4 bits */
+ r0 = kinv * (k2 * r0 * 2 - y0 * powsquaredlimb(r0, k2 & 0x3f)); /* 8 bits */
+ r0 = kinv * (k2 * r0 * 2 - y0 * powsquaredlimb(r0, k2 & 0x3fff)); /* 16 bits */
#if GMP_NUMB_BITS > 16
{
unsigned prec = 16;
do
{
- r0 = kinv * (k2 * r0 - y0 * powlimb(r0, k2));
+ r0 = kinv * (k2 * r0 * 2 - y0 * powsquaredlimb(r0, k2));
prec *= 2;
}
while (prec < GMP_NUMB_BITS);
@@ -116,25 +122,38 @@
if (bn == 1)
return;
- /* This initialization doesn't matter for the result (any garbage is
- cancelled in the iteration), but proper initialization makes
- valgrind happier. */
- MPN_ZERO (rp+1, bn-1);
-
d = 0;
- for (; bn > 1; bn = (bn + 1) >> 1)
+ for (; bn != 2; bn = (bn + 1) >> 1)
order[d++] = bn;
- for (i = d - 1; i >= 0; i--)
+ order[d] = 2;
+ bn = 1;
+
+ do
{
- bn = order[i];
+ mpn_sqr (tp, rp, bn); /* Result may overlap tp2 */
+ tp2[bn] = mpn_mul_1 (tp2, rp, bn, k2 << 1);
- mpn_mul_1 (tp, rp, bn, k2);
+ bn = order[d];
- mpn_powlo (tp2, rp, &k2, 1, bn, tp3);
- mpn_mullo_n (rp, yp, tp2, bn);
+ mpn_powlo (rp, tp, &k2, 1, bn, tp3);
+ mpn_mullo_n (tp, yp, rp, bn);
- mpn_sub_n (tp2, tp, rp, bn);
- mpn_pi1_bdiv_q_1 (rp, tp2, bn, k, kinv, 0);
+ /* mpn_sub (tp, tp2, ((bn + 1) >> 1) + 1, tp, bn); */
+ /* The function above is not handled, ((bn + 1) >> 1) + 1 <= bn*/
+ {
+ mp_size_t pbn = (bn + 3) >> 1; /* Size of tp2 */
+ int borrow;
+ borrow = mpn_sub_n (tp, tp2, tp, pbn) != 0;
+ if (bn > pbn) /* 3 < bn */
+ {
+ if (borrow)
+ mpn_com (tp + pbn, tp + pbn, bn - pbn);
+ else
+ mpn_neg (tp + pbn, tp + pbn, bn - pbn);
+ }
+ }
+ mpn_pi1_bdiv_q_1 (rp, tp, bn, k, kinv, 0);
}
+ while (--d >= 0);
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrt.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrt.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrt.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrtinv.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrtinv.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/bsqrtinv.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Compute r such that r^2 * y = 1 (mod 2^{b+1}).
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cmp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cmp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cmp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_cmp 1
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_add_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_add_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_add_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_sub_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_sub_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_sub_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_swap.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_swap.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/cnd_swap.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/com.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/com.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/com.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#undef mpn_com
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/comb_tables.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/comb_tables.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/comb_tables.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Entry i contains (i!/2^t) where t is chosen such that the parenthesis
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/compute_powtab.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/compute_powtab.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/compute_powtab.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,373 @@
+/* mpn_compute_powtab.
+
+ Contributed to the GNU project by Torbjorn Granlund.
+
+ THE FUNCTIONS IN THIS FILE ARE INTERNAL WITH MUTABLE INTERFACES. IT IS ONLY
+ SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
+ GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
+
+Copyright 1991-2017 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+/*
+ CAVEATS:
+ * The exptab and powtab vectors are in opposite orders. Probably OK.
+ * Consider getting rid of exptab, doing bit ops on the un argument instead.
+ * Consider rounding greatest power slightly upwards to save adjustments.
+ * In powtab_decide, consider computing cost from just the 2-3 largest
+ operands, since smaller operand contribute little. This makes most sense
+ if exptab is suppressed.
+*/
+
+#include "gmp-impl.h"
+
+#ifndef DIV_1_VS_MUL_1_PERCENT
+#define DIV_1_VS_MUL_1_PERCENT 150
+#endif
+
+#define SET_powers_t(dest, ptr, size, dib, b, sh) \
+ do { \
+ dest.p = ptr; \
+ dest.n = size; \
+ dest.digits_in_base = dib; \
+ dest.base = b; \
+ dest.shift = sh; \
+ } while (0)
+
+#if DIV_1_VS_MUL_1_PERCENT > 120
+#define HAVE_mpn_compute_powtab_mul 1
+static void
+mpn_compute_powtab_mul (powers_t *powtab, mp_ptr powtab_mem, mp_size_t un,
+ int base, const size_t *exptab, size_t n_pows)
+{
+ mp_size_t n;
+ mp_ptr p, t;
+ mp_limb_t cy;
+ long start_idx;
+ int c;
+
+ mp_limb_t big_base = mp_bases[base].big_base;
+ int chars_per_limb = mp_bases[base].chars_per_limb;
+
+ mp_ptr powtab_mem_ptr = powtab_mem;
+
+ size_t digits_in_base = chars_per_limb;
+
+ powers_t *pt = powtab;
+
+ p = powtab_mem_ptr;
+ powtab_mem_ptr += 1;
+ p[0] = big_base;
+
+ SET_powers_t (pt[0], p, 1, digits_in_base, base, 0);
+ pt++;
+
+ t = powtab_mem_ptr;
+ powtab_mem_ptr += 2;
+ t[1] = mpn_mul_1 (t, p, 1, big_base);
+ n = 2;
+
+ digits_in_base *= 2;
+
+ c = t[0] == 0;
+ t += c;
+ n -= c;
+ mp_size_t shift = c;
+
+ SET_powers_t (pt[0], t, n, digits_in_base, base, shift);
+ p = t;
+ pt++;
+
+ if (exptab[0] == ((size_t) chars_per_limb << n_pows))
+ {
+ start_idx = n_pows - 2;
+ }
+ else
+ {
+ if (((digits_in_base + chars_per_limb) << (n_pows-2)) <= exptab[0])
+ {
+ /* 3, sometimes adjusted to 4. */
+ t = powtab_mem_ptr;
+ powtab_mem_ptr += 4;
+ t[n] = cy = mpn_mul_1 (t, p, n, big_base);
+ n += cy != 0;;
+
+ digits_in_base += chars_per_limb;
+
+ c = t[0] == 0;
+ t += c;
+ n -= c;
+ shift += c;
+ }
+ else
+ {
+ /* 2 copy, will always become 3 with back-multiplication. */
+ t = powtab_mem_ptr;
+ powtab_mem_ptr += 3;
+ t[0] = p[0];
+ t[1] = p[1];
+ }
+
+ SET_powers_t (pt[0], t, n, digits_in_base, base, shift);
+ p = t;
+ pt++;
+ start_idx = n_pows - 3;
+ }
+
+ for (long pi = start_idx; pi >= 0; pi--)
+ {
+ t = powtab_mem_ptr;
+ powtab_mem_ptr += 2 * n + 2;
+
+ ASSERT (powtab_mem_ptr < powtab_mem + mpn_str_powtab_alloc (un));
+
+ mpn_sqr (t, p, n);
+
+ digits_in_base *= 2;
+ n *= 2;
+ n -= t[n - 1] == 0;
+ shift *= 2;
+
+ c = t[0] == 0;
+ t += c;
+ n -= c;
+ shift += c;
+
+ /* Adjust new value if it is too small as input to the next squaring. */
+ if (((digits_in_base + chars_per_limb) << pi) <= exptab[0])
+ {
+ t[n] = cy = mpn_mul_1 (t, t, n, big_base);
+ n += cy != 0;
+
+ digits_in_base += chars_per_limb;
+
+ c = t[0] == 0;
+ t += c;
+ n -= c;
+ shift += c;
+ }
+
+ SET_powers_t (pt[0], t, n, digits_in_base, base, shift);
+
+ /* Adjust previous value if it is not at its target power. */
+ if (pt[-1].digits_in_base < exptab[pi + 1])
+ {
+ mp_size_t n = pt[-1].n;
+ mp_ptr p = pt[-1].p;
+ p[n] = cy = mpn_mul_1 (p, p, n, big_base);
+ n += cy != 0;
+
+ ASSERT (pt[-1].digits_in_base + chars_per_limb == exptab[pi + 1]);
+ pt[-1].digits_in_base = exptab[pi + 1];
+
+ c = p[0] == 0;
+ pt[-1].p = p + c;
+ pt[-1].n = n - c;
+ pt[-1].shift += c;
+ }
+
+ p = t;
+ pt++;
+ }
+}
+#endif
+
+#if DIV_1_VS_MUL_1_PERCENT < 275
+#define HAVE_mpn_compute_powtab_div 1
+static void
+mpn_compute_powtab_div (powers_t *powtab, mp_ptr powtab_mem, mp_size_t un,
+ int base, const size_t *exptab, size_t n_pows)
+{
+ mp_ptr p, t;
+
+ mp_limb_t big_base = mp_bases[base].big_base;
+ int chars_per_limb = mp_bases[base].chars_per_limb;
+
+ mp_ptr powtab_mem_ptr = powtab_mem;
+
+ size_t digits_in_base = chars_per_limb;
+
+ powers_t *pt = powtab;
+
+ p = powtab_mem_ptr;
+ powtab_mem_ptr += 1;
+ p[0] = big_base;
+
+ SET_powers_t (pt[0], p, 1, digits_in_base, base, 0);
+ pt++;
+
+ mp_size_t n = 1;
+ mp_size_t shift = 0;
+ for (long pi = n_pows - 1; pi >= 0; pi--)
+ {
+ t = powtab_mem_ptr;
+ powtab_mem_ptr += 2 * n;
+
+ ASSERT (powtab_mem_ptr < powtab_mem + mpn_str_powtab_alloc (un));
+
+ mpn_sqr (t, p, n);
+ n = 2 * n - 1; n += t[n] != 0;
+ digits_in_base *= 2;
+
+ if (digits_in_base != exptab[pi]) /* if ((((un - 1) >> pi) & 2) == 0) */
+ {
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 || ! HAVE_NATIVE_mpn_divexact_1
+ if (__GMP_LIKELY (base == 10))
+ mpn_pi1_bdiv_q_1 (t, t, n, big_base >> MP_BASES_BIG_BASE_CTZ_10,
+ MP_BASES_BIG_BASE_BINVERTED_10,
+ MP_BASES_BIG_BASE_CTZ_10);
+ else
+#endif
+ /* FIXME: We could use _pi1 here if we add big_base_binverted and
+ big_base_ctz fields to struct bases. That would add about 2 KiB
+ to mp_bases.c.
+ FIXME: Use mpn_bdiv_q_1 here when mpn_divexact_1 is converted to
+ mpn_bdiv_q_1 for more machines. */
+ mpn_divexact_1 (t, t, n, big_base);
+
+ n -= t[n - 1] == 0;
+ digits_in_base -= chars_per_limb;
+ }
+
+ shift *= 2;
+ /* Strip low zero limbs, but be careful to keep the result divisible by
+ big_base. */
+ while (t[0] == 0 && (t[1] & ((big_base & -big_base) - 1)) == 0)
+ {
+ t++;
+ n--;
+ shift++;
+ }
+ p = t;
+
+ SET_powers_t (pt[0], p, n, digits_in_base, base, shift);
+ pt++;
+ }
+
+ /* Strip any remaining low zero limbs. */
+ pt -= n_pows + 1;
+ for (long pi = n_pows; pi >= 0; pi--)
+ {
+ mp_ptr t = pt[pi].p;
+ mp_size_t shift = pt[pi].shift;
+ mp_size_t n = pt[pi].n;
+ int c;
+ c = t[0] == 0;
+ t += c;
+ n -= c;
+ shift += c;
+ pt[pi].p = t;
+ pt[pi].shift = shift;
+ pt[pi].n = n;
+ }
+}
+#endif
+
+static long
+powtab_decide (size_t *exptab, size_t un, int base)
+{
+ int chars_per_limb = mp_bases[base].chars_per_limb;
+ long n_pows = 0;
+ for (size_t pn = (un + 1) >> 1; pn != 1; pn = (pn + 1) >> 1)
+ {
+ exptab[n_pows] = pn * chars_per_limb;
+ n_pows++;
+ }
+ exptab[n_pows] = chars_per_limb;
+
+#if HAVE_mpn_compute_powtab_mul && HAVE_mpn_compute_powtab_div
+ size_t pn = un - 1;
+ size_t xn = (un + 1) >> 1;
+ unsigned mcost = 1;
+ unsigned dcost = 1;
+ for (long i = n_pows - 2; i >= 0; i--)
+ {
+ size_t pow = (pn >> (i + 1)) + 1;
+
+ if (pow & 1)
+ dcost += pow;
+
+ if (xn != (pow << i))
+ {
+ if (pow > 2 && (pow & 1) == 0)
+ mcost += 2 * pow;
+ else
+ mcost += pow;
+ }
+ else
+ {
+ if (pow & 1)
+ mcost += pow;
+ }
+ }
+
+ dcost = dcost * DIV_1_VS_MUL_1_PERCENT / 100;
+
+ if (mcost <= dcost)
+ return n_pows;
+ else
+ return -n_pows;
+#elif HAVE_mpn_compute_powtab_mul
+ return n_pows;
+#elif HAVE_mpn_compute_powtab_div
+ return -n_pows;
+#else
+#error "no powtab function available"
+#endif
+}
+
+size_t
+mpn_compute_powtab (powers_t *powtab, mp_ptr powtab_mem, mp_size_t un, int base)
+{
+ size_t exptab[GMP_LIMB_BITS];
+
+ long n_pows = powtab_decide (exptab, un, base);
+
+#if HAVE_mpn_compute_powtab_mul && HAVE_mpn_compute_powtab_div
+ if (n_pows >= 0)
+ {
+ mpn_compute_powtab_mul (powtab, powtab_mem, un, base, exptab, n_pows);
+ return n_pows;
+ }
+ else
+ {
+ mpn_compute_powtab_div (powtab, powtab_mem, un, base, exptab, -n_pows);
+ return -n_pows;
+ }
+#elif HAVE_mpn_compute_powtab_mul
+ ASSERT (n_pows > 0);
+ mpn_compute_powtab_mul (powtab, powtab_mem, un, base, exptab, n_pows);
+ return n_pows;
+#elif HAVE_mpn_compute_powtab_div
+ ASSERT (n_pows < 0);
+ mpn_compute_powtab_div (powtab, powtab_mem, un, base, exptab, -n_pows);
+ return -n_pows;
+#else
+#error "no powtab function available"
+#endif
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/compute_powtab.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyd.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyd.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyd.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyi.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyi.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/copyi.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -7,7 +7,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2006, 2007, 2009-2011 Free Software Foundation, Inc.
+Copyright 2006, 2007, 2009-2011, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,24 +35,23 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-mp_size_t
+static mp_size_t
mpn_dcpi1_bdiv_q_n_itch (mp_size_t n)
{
- /* NOTE: Depends on mullo_n interface */
+ /* NOTE: Depends on mullo_n and mpn_dcpi1_bdiv_qr_n interface */
return n;
}
-/* Computes Q = N / D mod B^n, destroys N.
+/* Computes Q = - N / D mod B^n, destroys N.
N = {np,n}
D = {dp,n}
*/
-void
+static void
mpn_dcpi1_bdiv_q_n (mp_ptr qp,
mp_ptr np, mp_srcptr dp, mp_size_t n,
mp_limb_t dinv, mp_ptr tp)
@@ -68,12 +67,12 @@
cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, lo, dinv, tp);
mpn_mullo_n (tp, qp, dp + hi, lo);
- mpn_sub_n (np + hi, np + hi, tp, lo);
+ mpn_add_n (np + hi, np + hi, tp, lo);
if (lo < hi)
{
- cy += mpn_submul_1 (np + lo, qp, lo, dp[lo]);
- np[n - 1] -= cy;
+ cy += mpn_addmul_1 (np + lo, qp, lo, dp[lo]);
+ np[n - 1] += cy;
}
qp += lo;
np += lo;
@@ -82,7 +81,7 @@
mpn_sbpi1_bdiv_q (qp, np, n, dp, n, dinv);
}
-/* Computes Q = N / D mod B^nn, destroys N.
+/* Computes Q = - N / D mod B^nn, destroys N.
N = {np,nn}
D = {dp,dn}
@@ -130,7 +129,7 @@
mpn_mul (tp, dp + qn, dn - qn, qp, qn);
mpn_incr_u (tp + qn, cy);
- mpn_sub (np + qn, np + qn, nn - qn, tp, dn);
+ mpn_add (np + qn, np + qn, nn - qn, tp, dn);
cy = 0;
}
@@ -140,7 +139,7 @@
qn = nn - qn;
while (qn > dn)
{
- mpn_sub_1 (np + dn, np + dn, qn - dn, cy);
+ mpn_add_1 (np + dn, np + dn, qn - dn, cy);
cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
qp += dn;
np += dn;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_bdiv_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -7,7 +7,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2006, 2007, 2009, 2010 Free Software Foundation, Inc.
+Copyright 2006, 2007, 2009, 2010, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -43,12 +42,12 @@
Output:
- q = n * d^{-1} mod 2^{qn * GMP_NUMB_BITS},
+ q = -n * d^{-1} mod 2^{qn * GMP_NUMB_BITS},
- r = (n - q * d) * 2^{-qn * GMP_NUMB_BITS}
+ r = (n + q * d) * 2^{-qn * GMP_NUMB_BITS}
Stores q at qp. Stores the n least significant limbs of r at the high half
- of np, and returns the borrow from the subtraction n - q*d.
+ of np, and returns the carry from the addition n + q*d.
d must be odd. dinv is (-d)^-1 mod 2^GMP_NUMB_BITS. */
@@ -77,7 +76,7 @@
mpn_mul (tp, dp + lo, hi, qp, lo);
mpn_incr_u (tp + lo, cy);
- rh = mpn_sub (np + lo, np + lo, n + hi, tp, n);
+ rh = mpn_add (np + lo, np + lo, n + hi, tp, n);
if (BELOW_THRESHOLD (hi, DC_BDIV_QR_THRESHOLD))
cy = mpn_sbpi1_bdiv_qr (qp + lo, np + lo, 2 * hi, dp, hi, dinv);
@@ -87,7 +86,7 @@
mpn_mul (tp, qp + lo, hi, dp + hi, lo);
mpn_incr_u (tp + hi, cy);
- rh += mpn_sub_n (np + n, np + n, tp, n);
+ rh += mpn_add_n (np + n, np + n, tp, n);
return rh;
}
@@ -133,7 +132,7 @@
mpn_mul (tp, dp + qn, dn - qn, qp, qn);
mpn_incr_u (tp + qn, cy);
- rr = mpn_sub (np + qn, np + qn, nn - qn, tp, dn);
+ rr = mpn_add (np + qn, np + qn, nn - qn, tp, dn);
cy = 0;
}
@@ -143,7 +142,7 @@
qn = nn - dn - qn;
do
{
- rr += mpn_sub_1 (np + dn, np + dn, qn, cy);
+ rr += mpn_add_1 (np + dn, np + dn, qn, cy);
cy = mpn_dcpi1_bdiv_qr_n (qp, np, dp, dn, dinv, tp);
qp += dn;
np += dn;
@@ -168,7 +167,7 @@
mpn_mul (tp, dp + qn, dn - qn, qp, qn);
mpn_incr_u (tp + qn, cy);
- rr = mpn_sub (np + qn, np + qn, nn - qn, tp, dn);
+ rr = mpn_add (np + qn, np + qn, nn - qn, tp, dn);
cy = 0;
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_div_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_divappr_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_divappr_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dcpi1_divappr_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,12 +35,11 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
-mp_limb_t
+static mp_limb_t
mpn_dcpi1_divappr_q_n (mp_ptr qp, mp_ptr np, mp_srcptr dp, mp_size_t n,
gmp_pi1_t *dinv, mp_ptr tp)
{
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2009, 2010 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2015, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -119,9 +118,10 @@
ASSERT_ALWAYS (FUDGE >= 2);
+ dh = dp[dn - 1];
if (dn == 1)
{
- mpn_divrem_1 (qp, 0L, np, nn, dp[dn - 1]);
+ mpn_divrem_1 (qp, 0L, np, nn, dh);
return;
}
@@ -133,7 +133,6 @@
|_______| */
new_np = scratch;
- dh = dp[dn - 1];
if (LIKELY ((dh & GMP_NUMB_HIGHBIT) == 0))
{
count_leading_zeros (cnt, dh);
@@ -171,16 +170,8 @@
}
if (cy == 0)
qp[qn - 1] = qh;
- else if (UNLIKELY (qh != 0))
- {
- /* This happens only when the quotient is close to B^n and
- mpn_*_divappr_q returned B^n. */
- mp_size_t i, n;
- n = new_nn - dn;
- for (i = 0; i < n; i++)
- qp[i] = GMP_NUMB_MAX;
- qh = 0; /* currently ignored */
- }
+ else
+ ASSERT (qh == 0);
}
else /* divisor is already normalised */
{
@@ -228,7 +219,6 @@
new_np = TMP_ALLOC_LIMBS (new_nn + 1);
- dh = dp[dn - 1];
if (LIKELY ((dh & GMP_NUMB_HIGHBIT) == 0))
{
count_leading_zeros (cnt, dh);
@@ -315,7 +305,7 @@
rn -= rp[rn - 1] == 0;
if (rn > nn || mpn_cmp (np, rp, nn) < 0)
- mpn_decr_u (qp, 1);
+ MPN_DECR_U (qp, qn, 1);
}
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -47,7 +46,7 @@
#endif
/* Divides {up, n} by d. Writes the n-1 low quotient limbs at {qp,
- * n-1}, and the high quote limb at *qh. Returns remainder. */
+ * n-1}, and the high quotient limb at *qh. Returns remainder. */
mp_limb_t
mpn_div_qr_1 (mp_ptr qp, mp_limb_t *qh, mp_srcptr up, mp_size_t n,
mp_limb_t d)
@@ -100,7 +99,7 @@
count_leading_zeros (cnt, d);
d <<= cnt;
-#if HAVE_NATIVE_div_qr_1u_pi1
+#if HAVE_NATIVE_mpn_div_qr_1u_pi1
/* FIXME: Call loop doing on-the-fly normalization */
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -115,7 +114,8 @@
"subfe %0, %0, %0\n\t" \
"nor %0, %0, %0" \
: "=r" (m), "=r" (s1), "=&r" (s0) \
- : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+ : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0) \
+ __CLOBBER_CC)
#endif
#if defined (__s390x__) && W_TYPE_SIZE == 64
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1n_pi2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,10 +1,10 @@
-/* mpn_div_qr_1u_pi2.
+/* mpn_div_qr_1n_pi2.
THIS FILE CONTAINS AN INTERNAL FUNCTION WITH A MUTABLE INTERFACE. IT IS
ONLY SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2013 Free Software Foundation, Inc.
+Copyright 2013, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -42,13 +42,12 @@
* Not yet adequately tested.
*/
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
/* Define some longlong.h-style macros, but for wider operations.
- * add_sssaaaa is like longlong.h's add_ssaaaa but propagating
- carry-out into an additional sum operand.
+ * add_sssaaaa is like longlong.h's add_ssaaaa but propagating carry-out into
+ an additional sum operand.
*/
#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) && ! defined (NO_ASM)
@@ -70,14 +69,23 @@
"%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
#endif
+#if defined (__aarch64__) && W_TYPE_SIZE == 64
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("adds\t%2, %x6, %7\n\tadcs\t%1, %x4, %x5\n\tadc\t%0, %3, xzr"\
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "rZ" (s2), "%rZ" (a1), "rZ" (b1), "%rZ" (a0), "rI" (b0) \
+ __CLOBBER_CC)
+#endif
+
#if HAVE_HOST_CPU_FAMILY_powerpc && !defined (_LONG_LONG_LIMB)
/* This works fine for 32-bit and 64-bit limbs, except for 64-bit limbs with a
processor running in 32-bit mode, since the carry flag then gets the 32-bit
carry. */
#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
- __asm__ ("add%I7c\t%2,%6,%7\n\tadde\t%1,%4,%5\n\taddze\t%0,%0" \
+ __asm__ ("add%I7c\t%2,%6,%7\n\tadde\t%1,%4,%5\n\taddze\t%0,%3" \
: "=r" (s2), "=&r" (s1), "=&r" (s0) \
- : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+ : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0) \
+ __CLOBBER_CC)
#endif
#endif /* __GNUC__ */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1u_pi2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1u_pi2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_1u_pi2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,7 @@
ONLY SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2013 Free Software Foundation, Inc.
+Copyright 2013, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -42,13 +42,12 @@
* Not yet adequately tested.
*/
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
/* Define some longlong.h-style macros, but for wider operations.
- * add_sssaaaa is like longlong.h's add_ssaaaa but propagating
- carry-out into an additional sum operand.
+ * add_sssaaaa is like longlong.h's add_ssaaaa but propagating carry-out into
+ an additional sum operand.
*/
#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) && ! defined (NO_ASM)
@@ -70,14 +69,22 @@
"%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
#endif
+#if defined (__aarch64__) && W_TYPE_SIZE == 64
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("adds\t%2, %x6, %7\n\tadcs\t%1, %x4, %x5\n\tadc\t%0, %3, xzr"\
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "rZ" (s2), "%rZ" (a1), "rZ" (b1), "%rZ" (a0), "rI" (b0) __CLOBBER_CC)
+#endif
+
#if HAVE_HOST_CPU_FAMILY_powerpc && !defined (_LONG_LONG_LIMB)
/* This works fine for 32-bit and 64-bit limbs, except for 64-bit limbs with a
processor running in 32-bit mode, since the carry flag then gets the 32-bit
carry. */
#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
- __asm__ ("add%I7c\t%2,%6,%7\n\tadde\t%1,%4,%5\n\taddze\t%0,%0" \
+ __asm__ ("add%I7c\t%2,%6,%7\n\tadde\t%1,%4,%5\n\taddze\t%0,%3" \
: "=r" (s2), "=&r" (s1), "=&r" (s0) \
- : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+ : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0) \
+ __CLOBBER_CC)
#endif
#endif /* __GNUC__ */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -8,7 +8,7 @@
GUARANTEED THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 1993-1996, 1999-2002, 2011 Free Software Foundation, Inc.
+Copyright 1993-1996, 1999-2002, 2011, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -36,7 +36,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -50,10 +49,10 @@
#endif
/* Define some longlong.h-style macros, but for wider operations.
- * add_sssaaaa is like longlong.h's add_ssaaaa but the propagating
- carry-out into an additional sum operand.
- * add_csaac accepts two addends and a carry in, and generates a sum
- and a carry out. A little like a "full adder".
+ * add_sssaaaa is like longlong.h's add_ssaaaa but propagating carry-out into
+ an additional sum operand.
+ * add_csaac accepts two addends and a carry in, and generates a sum and a
+ carry out. A little like a "full adder".
*/
#if defined (__GNUC__) && ! defined (__INTEL_COMPILER) && ! defined (NO_ASM)
@@ -64,11 +63,6 @@
: "0" ((USItype)(s2)), \
"1" ((USItype)(a1)), "g" ((USItype)(b1)), \
"%2" ((USItype)(a0)), "g" ((USItype)(b0)))
-#define add_csaac(co, s, a, b, ci) \
- __asm__ ("bt\t$0, %2\n\tadc\t%5, %k1\n\tadc\t%k0, %k0" \
- : "=r" (co), "=r" (s) \
- : "rm" ((USItype)(ci)), "0" (CNST_LIMB(0)), \
- "%1" ((USItype)(a)), "g" ((USItype)(b)))
#endif
#if defined (__amd64__) && W_TYPE_SIZE == 64
@@ -78,21 +72,25 @@
: "0" ((UDItype)(s2)), \
"1" ((UDItype)(a1)), "rme" ((UDItype)(b1)), \
"%2" ((UDItype)(a0)), "rme" ((UDItype)(b0)))
-#define add_csaac(co, s, a, b, ci) \
- __asm__ ("bt\t$0, %2\n\tadc\t%5, %q1\n\tadc\t%q0, %q0" \
- : "=r" (co), "=r" (s) \
- : "rm" ((UDItype)(ci)), "0" (CNST_LIMB(0)), \
- "%1" ((UDItype)(a)), "g" ((UDItype)(b)))
#endif
+#if defined (__aarch64__) && W_TYPE_SIZE == 64
+#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
+ __asm__ ("adds\t%2, %x6, %7\n\tadcs\t%1, %x4, %x5\n\tadc\t%0, %3, xzr"\
+ : "=r" (s2), "=&r" (s1), "=&r" (s0) \
+ : "rZ" (s2), "%rZ" (a1), "rZ" (b1), "%rZ" (a0), "rI" (b0) \
+ __CLOBBER_CC)
+#endif
+
#if HAVE_HOST_CPU_FAMILY_powerpc && !defined (_LONG_LONG_LIMB)
/* This works fine for 32-bit and 64-bit limbs, except for 64-bit limbs with a
processor running in 32-bit mode, since the carry flag then gets the 32-bit
carry. */
#define add_sssaaaa(s2, s1, s0, a1, a0, b1, b0) \
- __asm__ ("add%I7c\t%2,%6,%7\n\tadde\t%1,%4,%5\n\taddze\t%0,%0" \
+ __asm__ ("add%I7c\t%2,%6,%7\n\tadde\t%1,%4,%5\n\taddze\t%0,%3" \
: "=r" (s2), "=&r" (s1), "=&r" (s0) \
- : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+ : "r" (s2), "r" (a1), "r" (b1), "%r" (a0), "rI" (b0) \
+ __CLOBBER_CC)
#endif
#endif /* __GNUC__ */
@@ -112,18 +110,6 @@
} while (0)
#endif
-#ifndef add_csaac
-#define add_csaac(co, s, a, b, ci) \
- do { \
- UWtype __s, __c; \
- __s = (a) + (b); \
- __c = __s < (a); \
- __s = __s + (ci); \
- (s) = __s; \
- (co) = __c + (__s < (ci)); \
- } while (0)
-#endif
-
/* Typically used with r1, r0 same as n3, n2. Other types of overlap
between inputs and outputs are not supported. */
#define udiv_qr_4by2(q1,q0, r1,r0, n3,n2,n1,n0, d1,d0, di1,di0) \
@@ -130,23 +116,19 @@
do { \
mp_limb_t _q3, _q2a, _q2, _q1, _q2c, _q1c, _q1d, _q0; \
mp_limb_t _t1, _t0; \
- mp_limb_t _c, _mask; \
+ mp_limb_t _mask; \
\
+ /* [q3,q2,q1,q0] = [n3,n2]*[di1,di0] + [n3,n2,n1,n0] + [0,1,0,0] */ \
+ umul_ppmm (_q2,_q1, n2, di1); \
umul_ppmm (_q3,_q2a, n3, di1); \
- umul_ppmm (_q2,_q1, n2, di1); \
+ ++_q2; /* _q2 cannot overflow */ \
+ add_ssaaaa (_q3,_q2, _q3,_q2, n3,_q2a); \
umul_ppmm (_q2c,_q1c, n3, di0); \
- add_sssaaaa (_q3,_q2,_q1, _q2,_q1, _q2c,_q1c); \
+ add_sssaaaa (_q3,_q2,_q1, _q2,_q1, n2,_q1c); \
umul_ppmm (_q1d,_q0, n2, di0); \
- add_sssaaaa (_q3,_q2,_q1, _q2,_q1, _q2a,_q1d); \
+ add_sssaaaa (_q2c,_q1,_q0, _q1,_q0, n1,n0); /* _q2c cannot overflow */ \
+ add_sssaaaa (_q3,_q2,_q1, _q2,_q1, _q2c,_q1d); \
\
- add_ssaaaa (r1, r0, n3, n2, CNST_LIMB(0), CNST_LIMB(1)); \
- \
- /* [q3,q2,q1,q0] += [n3,n3,n1,n0] */ \
- add_csaac (_c, _q0, _q0, n0, CNST_LIMB(0)); \
- add_csaac (_c, _q1, _q1, n1, _c); \
- add_csaac (_c, _q2, _q2, r0, _c); \
- _q3 = _q3 + r1 + _c; \
- \
umul_ppmm (_t1,_t0, _q2, d0); \
_t1 += _q2 * d1 + _q3 * d0; \
\
@@ -283,9 +265,9 @@
Return the most significant limb of the quotient.
Preconditions:
- 1. qp must either not overlap with the input operands at all, or
+ 1. qp must either not overlap with the other operands at all, or
qp >= np + 2 must hold true. (This means that it's possible to put
- the quotient in the high part of {np,nn}, right above the remainder.
+ the quotient in the high part of {np,nn}, right above the remainder.)
2. nn >= 2. */
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2n_pi1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2n_pi1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2n_pi1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2u_pi1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2u_pi1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/div_qr_2u_pi1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dive_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dive_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dive_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/diveby3.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/diveby3.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/diveby3.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if DIVEXACT_BY3_METHOD == 0
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divexact.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divexact.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divexact.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -8,7 +8,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2006, 2007, 2009 Free Software Foundation, Inc.
+Copyright 2006, 2007, 2009, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -37,7 +37,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -99,6 +98,9 @@
tp = TMP_ALLOC_LIMBS (mpn_bdiv_q_itch (qn, dn));
mpn_bdiv_q (qp, np, qn, dp, dn, tp);
TMP_FREE;
+
+ /* Since bdiv_q computes -N/D (mod B^{qn}), we must negate now. */
+ mpn_neg (qp, qp, qn);
}
#else
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divis.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divis.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divis.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,8 @@
CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
FUTURE GNU MP RELEASES.
-Copyright 2001, 2002, 2005, 2009, 2014 Free Software Foundation, Inc.
+Copyright 2001, 2002, 2005, 2009, 2014, 2017, 2018 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,7 +33,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -62,9 +62,9 @@
{
mp_limb_t alow, dlow, dmask;
mp_ptr qp, rp, tp;
- mp_size_t i;
mp_limb_t di;
unsigned twos;
+ int c;
TMP_DECL;
ASSERT (an >= 0);
@@ -182,18 +182,13 @@
mpn_mu_bdiv_qr (qp, rp, rp, an, dp, dn, tp);
}
- /* test for {rp,dn} zero or non-zero */
- i = 0;
- do
- {
- if (rp[i] != 0)
- {
- TMP_FREE;
- return 0;
- }
- }
- while (++i < dn);
+ /* In general, bdiv may return either R = 0 or R = D when D divides
+ A. But R = 0 can happen only when A = 0, which we already have
+ excluded. Furthermore, R == D (mod B^{dn}) implies no carry, so
+ we don't need to check the carry returned from bdiv. */
+ MPN_CMP (c, rp, dp, dn);
+
TMP_FREE;
- return 1;
+ return c == 0;
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,7 @@
/* mpn_divrem -- Divide natural numbers, producing both remainder and
quotient. This is now just a middle layer calling mpn_tdiv_qr.
-Copyright 1993-1997, 1999-2002, 2005 Free Software Foundation, Inc.
+Copyright 1993-1997, 1999-2002, 2005, 2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -72,7 +71,7 @@
}
else
{
- mp_ptr rp, q2p;
+ mp_ptr q2p;
mp_limb_t qhl;
mp_size_t qn;
TMP_DECL;
@@ -81,13 +80,11 @@
if (UNLIKELY (qxn != 0))
{
mp_ptr n2p;
- n2p = TMP_ALLOC_LIMBS (nn + qxn);
+ TMP_ALLOC_LIMBS_2 (n2p, nn + qxn,
+ q2p, nn - dn + qxn + 1);
MPN_ZERO (n2p, qxn);
MPN_COPY (n2p + qxn, np, nn);
- q2p = TMP_ALLOC_LIMBS (nn - dn + qxn + 1);
- rp = TMP_ALLOC_LIMBS (dn);
- mpn_tdiv_qr (q2p, rp, 0L, n2p, nn + qxn, dp, dn);
- MPN_COPY (np, rp, dn);
+ mpn_tdiv_qr (q2p, np, 0L, n2p, nn + qxn, dp, dn);
qn = nn - dn + qxn;
MPN_COPY (qp, q2p, qn);
qhl = q2p[qn];
@@ -95,9 +92,7 @@
else
{
q2p = TMP_ALLOC_LIMBS (nn - dn + 1);
- rp = TMP_ALLOC_LIMBS (dn);
- mpn_tdiv_qr (q2p, rp, 0L, np, nn, dp, dn);
- MPN_COPY (np, rp, dn); /* overwrite np area with remainder */
+ mpn_tdiv_qr (q2p, np, 0L, np, nn, dp, dn);
qn = nn - dn;
MPN_COPY (qp, q2p, qn);
qhl = q2p[qn];
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/divrem_2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dump.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dump.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/dump.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
#if GMP_NUMB_BITS % 4 == 0
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2_ui.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2_ui.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2_ui.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,7 @@
CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
FUTURE GNU MP RELEASES.
-Copyright 2001, 2002, 2005, 2009 Free Software Foundation, Inc.
+Copyright 2001, 2002, 2005, 2009, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -33,7 +33,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h>
-#include "gmp.h"
#include "gmp-impl.h"
/* change this to "#define TRACE(x) x" for diagnostics */
@@ -48,19 +47,13 @@
fp[0] is 0 and f1p[0] is 1. f1p[size-1] can be zero, since F[n-1]<F[n]
(for n>0).
- Notes:
+ Notes: F[2k+1] = 4*F[k]^2 - F[k-1]^2 + 2*(-1)^k.
In F[2k+1] with k even, +2 is applied to 4*F[k]^2 just by ORing into the
low limb.
- In F[2k+1] with k odd, -2 is applied to the low limb of 4*F[k]^2 -
- F[k-1]^2. This F[2k+1] is an F[4m+3] and such numbers are congruent to
- 1, 2 or 5 mod 8, which means no underflow reaching it with a -2 (since
- that would leave 6 or 7 mod 8).
-
- This property of F[4m+3] can be verified by induction on F[4m+3] =
- 7*F[4m-1] - F[4m-5], that formula being a standard lucas sequence
- identity U[i+j] = U[i]*V[j] - U[i-j]*Q^j.
+ In F[2k+1] with k odd, -2 is applied to F[k-1]^2 just by ORing into the
+ low limb.
*/
mp_size_t
@@ -132,15 +125,13 @@
/* Calculate F[2k+1] = 4*F[k]^2 - F[k-1]^2 + 2*(-1)^k.
n&mask is the low bit of our implied k. */
+
+ ASSERT ((fp[0] & 2) == 0);
+ /* fp is F[k-1]^2 == 0 or 1 mod 4, like all squares. */
+ fp[0] |= (n & mask ? 2 : 0); /* possible -2 */
#if HAVE_NATIVE_mpn_rsblsh2_n
fp[size] = mpn_rsblsh2_n (fp, fp, xp, size);
- if ((n & mask) == 0)
- MPN_INCR_U(fp, size + 1, 2); /* possible +2 */
- else
- {
- ASSERT (fp[0] >= 2);
- fp[0] -= 2; /* possible -2 */
- }
+ MPN_INCR_U(fp, size + 1, (n & mask ? 0 : 2)); /* possible +2 */
#else
{
mp_limb_t c;
@@ -148,8 +139,6 @@
c = mpn_lshift (xp, xp, size, 2);
xp[0] |= (n & mask ? 0 : 2); /* possible +2 */
c -= mpn_sub_n (fp, xp, fp, size);
- ASSERT (n & mask ? fp[0] != 0 && fp[0] != 1 : 1);
- fp[0] -= (n & mask ? 2 : 0); /* possible -2 */
fp[size] = c;
}
#endif
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2m.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2m.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2m.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,252 @@
+/* mpn_fib2m -- calculate Fibonacci numbers, modulo m.
+
+Contributed to the GNU project by Marco Bodrato, based on the previous
+fib2_ui.c file.
+
+ THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY. THEY'RE ALMOST
+ CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
+ FUTURE GNU MP RELEASES.
+
+Copyright 2001, 2002, 2005, 2009, 2018 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include <stdio.h>
+#include "gmp-impl.h"
+#include "longlong.h"
+
+
+/* Stores |{ap,n}-{bp,n}| in {rp,n},
+ returns the sign of {ap,n}-{bp,n}. */
+static int
+abs_sub_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ mp_limb_t x, y;
+ while (--n >= 0)
+ {
+ x = ap[n];
+ y = bp[n];
+ if (x != y)
+ {
+ ++n;
+ if (x > y)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (rp, ap, bp, n));
+ return 1;
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (rp, bp, ap, n));
+ return -1;
+ }
+ }
+ rp[n] = 0;
+ }
+ return 0;
+}
+
+/* Store F[n] at fp and F[n-1] at f1p. Both are computed modulo m.
+ fp and f1p should have room for mn*2+1 limbs.
+
+ The sign of one or both the values may be flipped (n-F, instead of F),
+ the return value is 0 (zero) if the signs are coherent (both positive
+ or both negative) and 1 (one) otherwise.
+
+ Notes:
+
+ In F[2k+1] with k even, +2 is applied to 4*F[k]^2 just by ORing into the
+ low limb.
+
+ In F[2k+1] with k odd, -2 is applied to F[k-1]^2 just by ORing into the
+ low limb.
+
+ TODO: Should {tp, 2 * mn} be passed as a scratch pointer?
+ Should the call to mpn_fib2_ui() obtain (up to) 2*mn limbs?
+*/
+
+int
+mpn_fib2m (mp_ptr fp, mp_ptr f1p, mp_srcptr np, mp_size_t nn, mp_srcptr mp, mp_size_t mn)
+{
+ unsigned long nfirst;
+ mp_limb_t nh;
+ mp_bitcnt_t nbi;
+ mp_size_t sn, fn;
+ int fcnt, ncnt;
+
+ ASSERT (! MPN_OVERLAP_P (fp, MAX(2*mn+1,5), f1p, MAX(2*mn+1,5)));
+ ASSERT (nn > 0 && np[nn - 1] != 0);
+
+ /* Estimate the maximal n such that fibonacci(n) fits in mn limbs. */
+#if GMP_NUMB_BITS % 16 == 0
+ if (UNLIKELY (ULONG_MAX / (23 * (GMP_NUMB_BITS / 16)) <= mn))
+ nfirst = ULONG_MAX;
+ else
+ nfirst = mn * (23 * (GMP_NUMB_BITS / 16));
+#else
+ {
+ mp_bitcnt_t mbi;
+ mbi = (mp_bitcnt_t) mn * GMP_NUMB_BITS;
+
+ if (UNLIKELY (ULONG_MAX / 23 < mbi))
+ {
+ if (UNLIKELY (ULONG_MAX / 23 * 16 <= mbi))
+ nfirst = ULONG_MAX;
+ else
+ nfirst = mbi / 16 * 23;
+ }
+ else
+ nfirst = mbi * 23 / 16;
+ }
+#endif
+
+ sn = nn - 1;
+ nh = np[sn];
+ count_leading_zeros (ncnt, nh);
+ count_leading_zeros (fcnt, nfirst);
+
+ if (fcnt >= ncnt)
+ {
+ ncnt = fcnt - ncnt;
+ nh >>= ncnt;
+ }
+ else if (sn > 0)
+ {
+ ncnt -= fcnt;
+ nh <<= ncnt;
+ ncnt = GMP_NUMB_BITS - ncnt;
+ --sn;
+ nh |= np[sn] >> ncnt;
+ }
+ else
+ ncnt = 0;
+
+ nbi = sn * GMP_NUMB_BITS + ncnt;
+ if (nh > nfirst)
+ {
+ nh >>= 1;
+ ++nbi;
+ }
+
+ ASSERT (nh <= nfirst);
+ /* Take a starting pair from mpn_fib2_ui. */
+ fn = mpn_fib2_ui (fp, f1p, nh);
+ MPN_ZERO (fp + fn, mn - fn);
+ MPN_ZERO (f1p + fn, mn - fn);
+
+ if (nbi == 0)
+ {
+ if (fn == mn)
+ {
+ mp_limb_t qp[2];
+ mpn_tdiv_qr (qp, fp, 0, fp, fn, mp, mn);
+ mpn_tdiv_qr (qp, f1p, 0, f1p, fn, mp, mn);
+ }
+
+ return 0;
+ }
+ else
+ {
+ mp_ptr tp;
+ unsigned pb = nh & 1;
+ int neg;
+ TMP_DECL;
+
+ TMP_MARK;
+
+ tp = TMP_ALLOC_LIMBS (2 * mn + (mn < 2));
+
+ do
+ {
+ mp_ptr rp;
+ /* Here fp==F[k] and f1p==F[k-1], with k being the bits of n from
+ nbi upwards.
+
+ Based on the next bit of n, we'll double to the pair
+ fp==F[2k],f1p==F[2k-1] or fp==F[2k+1],f1p==F[2k], according as
+ that bit is 0 or 1 respectively. */
+
+ mpn_sqr (tp, fp, mn);
+ mpn_sqr (fp, f1p, mn);
+
+ /* Calculate F[2k-1] = F[k]^2 + F[k-1]^2. */
+ f1p[2 * mn] = mpn_add_n (f1p, tp, fp, 2 * mn);
+
+ /* Calculate F[2k+1] = 4*F[k]^2 - F[k-1]^2 + 2*(-1)^k.
+ pb is the low bit of our implied k. */
+
+ /* fp is F[k-1]^2 == 0 or 1 mod 4, like all squares. */
+ ASSERT ((fp[0] & 2) == 0);
+ ASSERT (pb == (pb & 1));
+ ASSERT ((fp[0] + (pb ? 2 : 0)) == (fp[0] | (pb << 1)));
+ fp[0] |= pb << 1; /* possible -2 */
+#if HAVE_NATIVE_mpn_rsblsh2_n
+ fp[2 * mn] = 1 + mpn_rsblsh2_n (fp, fp, tp, 2 * mn);
+ MPN_INCR_U(fp, 2 * mn + 1, (1 ^ pb) << 1); /* possible +2 */
+ fp[2 * mn] = (fp[2 * mn] - 1) & GMP_NUMB_MAX;
+#else
+ {
+ mp_limb_t c;
+
+ c = mpn_lshift (tp, tp, 2 * mn, 2);
+ tp[0] |= (1 ^ pb) << 1; /* possible +2 */
+ c -= mpn_sub_n (fp, tp, fp, 2 * mn);
+ fp[2 * mn] = c & GMP_NUMB_MAX;
+ }
+#endif
+ neg = fp[2 * mn] == GMP_NUMB_MAX;
+
+ /* Calculate F[2k-1] = F[k]^2 + F[k-1]^2 */
+ /* Calculate F[2k+1] = 4*F[k]^2 - F[k-1]^2 + 2*(-1)^k */
+
+ /* Calculate F[2k] = F[2k+1] - F[2k-1], replacing the unwanted one of
+ F[2k+1] and F[2k-1]. */
+ --nbi;
+ pb = (np [nbi / GMP_NUMB_BITS] >> (nbi % GMP_NUMB_BITS)) & 1;
+ rp = pb ? f1p : fp;
+ if (neg)
+ {
+ /* Calculate -(F[2k+1] - F[2k-1]) */
+ rp[2 * mn] = f1p[2 * mn] + 1 - mpn_sub_n (rp, f1p, fp, 2 * mn);
+ neg = ! pb;
+ if (pb) /* fp not overwritten, negate it. */
+ fp [2 * mn] = 1 ^ mpn_neg (fp, fp, 2 * mn);
+ }
+ else
+ {
+ neg = abs_sub_n (rp, fp, f1p, 2 * mn + 1) < 0;
+ }
+
+ mpn_tdiv_qr (tp, fp, 0, fp, 2 * mn + 1, mp, mn);
+ mpn_tdiv_qr (tp, f1p, 0, f1p, 2 * mn + 1, mp, mn);
+ }
+ while (nbi != 0);
+
+ TMP_FREE;
+
+ return neg;
+ }
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/fib2m.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpn/gcd.c: mpn_gcd for gcd of two odd integers.
-Copyright 1991, 1993-1998, 2000-2005, 2008, 2010, 2012 Free Software
+Copyright 1991, 1993-1998, 2000-2005, 2008, 2010, 2012, 2019 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -77,61 +76,6 @@
ctx->gn = gn;
}
-#if GMP_NAIL_BITS > 0
-/* Nail supports should be easy, replacing the sub_ddmmss with nails
- * logic. */
-#error Nails not supported.
-#endif
-
-/* Use binary algorithm to compute G <-- GCD (U, V) for usize, vsize == 2.
- Both U and V must be odd. */
-static inline mp_size_t
-gcd_2 (mp_ptr gp, mp_srcptr up, mp_srcptr vp)
-{
- mp_limb_t u0, u1, v0, v1;
- mp_size_t gn;
-
- u0 = up[0];
- u1 = up[1];
- v0 = vp[0];
- v1 = vp[1];
-
- ASSERT (u0 & 1);
- ASSERT (v0 & 1);
-
- /* Check for u0 != v0 needed to ensure that argument to
- * count_trailing_zeros is non-zero. */
- while (u1 != v1 && u0 != v0)
- {
- unsigned long int r;
- if (u1 > v1)
- {
- sub_ddmmss (u1, u0, u1, u0, v1, v0);
- count_trailing_zeros (r, u0);
- u0 = ((u1 << (GMP_NUMB_BITS - r)) & GMP_NUMB_MASK) | (u0 >> r);
- u1 >>= r;
- }
- else /* u1 < v1. */
- {
- sub_ddmmss (v1, v0, v1, v0, u1, u0);
- count_trailing_zeros (r, v0);
- v0 = ((v1 << (GMP_NUMB_BITS - r)) & GMP_NUMB_MASK) | (v0 >> r);
- v1 >>= r;
- }
- }
-
- gp[0] = u0, gp[1] = u1, gn = 1 + (u1 != 0);
-
- /* If U == V == GCD, done. Otherwise, compute GCD (V, |U - V|). */
- if (u1 == v1 && u0 == v0)
- return gn;
-
- v0 = (u0 == v0) ? ((u1 > v1) ? u1-v1 : v1-u1) : ((u0 > v0) ? u0-v0 : v0-u0);
- gp[0] = mpn_gcd_1 (gp, gn, v0);
-
- return 1;
-}
-
mp_size_t
mpn_gcd (mp_ptr gp, mp_ptr up, mp_size_t usize, mp_ptr vp, mp_size_t n)
{
@@ -273,37 +217,49 @@
ASSERT(up[n-1] | vp[n-1]);
- if (n == 1)
- {
- *gp = mpn_gcd_1(up, 1, vp[0]);
- ctx.gn = 1;
- goto done;
- }
+ /* Due to the calling convention for mpn_gcd, at most one can be even. */
+ if ((up[0] & 1) == 0)
+ MP_PTR_SWAP (up, vp);
+ ASSERT ((up[0] & 1) != 0);
- /* Due to the calling convention for mpn_gcd, at most one can be
- even. */
+ {
+ mp_limb_t u0, u1, v0, v1;
+ mp_double_limb_t g;
- if (! (up[0] & 1))
- MP_PTR_SWAP (up, vp);
+ u0 = up[0];
+ v0 = vp[0];
- ASSERT (up[0] & 1);
+ if (n == 1)
+ {
+ int cnt;
+ count_trailing_zeros (cnt, v0);
+ *gp = mpn_gcd_11 (u0, v0 >> cnt);
+ ctx.gn = 1;
+ goto done;
+ }
- if (vp[0] == 0)
- {
- *gp = mpn_gcd_1 (up, 2, vp[1]);
- ctx.gn = 1;
- goto done;
- }
- else if (! (vp[0] & 1))
- {
- int r;
- count_trailing_zeros (r, vp[0]);
- vp[0] = ((vp[1] << (GMP_NUMB_BITS - r)) & GMP_NUMB_MASK) | (vp[0] >> r);
- vp[1] >>= r;
- }
+ v1 = vp[1];
+ if (UNLIKELY (v0 == 0))
+ {
+ v0 = v1;
+ v1 = 0;
+ /* FIXME: We could invoke a mpn_gcd_21 here, just like mpn_gcd_22 could
+ when this situation occurs internally. */
+ }
+ if ((v0 & 1) == 0)
+ {
+ int cnt;
+ count_trailing_zeros (cnt, v0);
+ v0 = ((v1 << (GMP_NUMB_BITS - cnt)) & GMP_NUMB_MASK) | (v0 >> cnt);
+ v1 >>= cnt;
+ }
- ctx.gn = gcd_2(gp, up, vp);
-
+ u1 = up[1];
+ g = mpn_gcd_22 (u1, u0, v1, v0);
+ gp[0] = g.d0;
+ gp[1] = g.d1;
+ ctx.gn = 1 + (g.d1 > 0);
+ }
done:
TMP_FREE;
return ctx.gn;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpn_gcd_1 -- mpn and limb greatest common divisor.
-Copyright 1994, 1996, 2000, 2001, 2009, 2012 Free Software Foundation, Inc.
+Copyright 1994, 1996, 2000, 2001, 2009, 2012, 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -28,28 +28,9 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
-#ifndef GCD_1_METHOD
-#define GCD_1_METHOD 2
-#endif
-
-#define USE_ZEROTAB 0
-
-#if USE_ZEROTAB
-#define MAXSHIFT 4
-#define MASK ((1 << MAXSHIFT) - 1)
-static const unsigned char zerotab[1 << MAXSHIFT] =
-{
-#if MAXSHIFT > 4
- 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
-#endif
- 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
-};
-#endif
-
/* Does not work for U == 0 or V == 0. It would be tough to make it work for
V == 0 since gcd(x,0) = x, and U does not generally fit in an mp_limb_t.
@@ -62,6 +43,7 @@
{
mp_limb_t ulimb;
unsigned long zero_bits, u_low_zero_bits;
+ int c;
ASSERT (size >= 1);
ASSERT (vlimb != 0);
@@ -87,112 +69,34 @@
if (ulimb == 0)
goto done;
- goto strip_u_maybe;
+ count_trailing_zeros (c, ulimb);
+ ulimb >>= c;
}
-
- /* size==1, so up[0]!=0 */
- count_trailing_zeros (u_low_zero_bits, ulimb);
- ulimb >>= u_low_zero_bits;
- zero_bits = MIN (zero_bits, u_low_zero_bits);
-
- /* make u bigger */
- if (vlimb > ulimb)
- MP_LIMB_T_SWAP (ulimb, vlimb);
-
- /* if u is much bigger than v, reduce using a division rather than
- chipping away at it bit-by-bit */
- if ((ulimb >> 16) > vlimb)
+ else
{
- ulimb %= vlimb;
- if (ulimb == 0)
- goto done;
- goto strip_u_maybe;
- }
+ /* size==1, so up[0]!=0 */
+ count_trailing_zeros (u_low_zero_bits, ulimb);
+ ulimb >>= u_low_zero_bits;
+ zero_bits = MIN (zero_bits, u_low_zero_bits);
- ASSERT (ulimb & 1);
- ASSERT (vlimb & 1);
+ /* make u bigger */
+ if (vlimb > ulimb)
+ MP_LIMB_T_SWAP (ulimb, vlimb);
-#if GCD_1_METHOD == 1
- while (ulimb != vlimb)
- {
- ASSERT (ulimb & 1);
- ASSERT (vlimb & 1);
-
- if (ulimb > vlimb)
+ /* if u is much bigger than v, reduce using a division rather than
+ chipping away at it bit-by-bit */
+ if ((ulimb >> 16) > vlimb)
{
- ulimb -= vlimb;
- do
- {
- ulimb >>= 1;
- ASSERT (ulimb != 0);
- strip_u_maybe:
- ;
- }
- while ((ulimb & 1) == 0);
- }
- else /* vlimb > ulimb. */
- {
- vlimb -= ulimb;
- do
- {
- vlimb >>= 1;
- ASSERT (vlimb != 0);
- }
- while ((vlimb & 1) == 0);
- }
- }
-#else
-# if GCD_1_METHOD == 2
+ ulimb %= vlimb;
+ if (ulimb == 0)
+ goto done;
- ulimb >>= 1;
- vlimb >>= 1;
-
- while (ulimb != vlimb)
- {
- int c;
- mp_limb_t t;
- mp_limb_t vgtu;
-
- t = ulimb - vlimb;
- vgtu = LIMB_HIGHBIT_TO_MASK (t);
-
- /* v <-- min (u, v) */
- vlimb += (vgtu & t);
-
- /* u <-- |u - v| */
- ulimb = (t ^ vgtu) - vgtu;
-
-#if USE_ZEROTAB
- /* Number of trailing zeros is the same no matter if we look at
- * t or ulimb, but using t gives more parallelism. */
- c = zerotab[t & MASK];
-
- while (UNLIKELY (c == MAXSHIFT))
- {
- ulimb >>= MAXSHIFT;
- if (0)
- strip_u_maybe:
- vlimb >>= 1;
-
- c = zerotab[ulimb & MASK];
+ count_trailing_zeros (c, ulimb);
+ ulimb >>= c;
}
-#else
- if (0)
- {
- strip_u_maybe:
- vlimb >>= 1;
- t = ulimb;
- }
- count_trailing_zeros (c, t);
-#endif
- ulimb >>= (c + 1);
}
- vlimb = (vlimb << 1) | 1;
-# else
-# error Unknown GCD_1_METHOD
-# endif
-#endif
+ vlimb = mpn_gcd_11 (ulimb, vlimb);
done:
return vlimb << zero_bits;
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_11.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_11.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_11.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,74 @@
+/* mpn_gcd_11 -- limb greatest common divisor.
+
+Copyright 1994, 1996, 2000, 2001, 2009, 2012, 2019 Free Software Foundation,
+Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb_t
+mpn_gcd_11 (mp_limb_t u, mp_limb_t v)
+{
+ ASSERT (u & v & 1);
+
+ /* In this loop, we represent the odd numbers ulimb and vlimb
+ without the redundant least significant one bit. This reduction
+ in size by one bit ensures that the high bit of t, below, is set
+ if and only if vlimb > ulimb. */
+
+ u >>= 1;
+ v >>= 1;
+
+ while (u != v)
+ {
+ mp_limb_t t;
+ mp_limb_t vgtu;
+ int c;
+
+ t = u - v;
+ vgtu = LIMB_HIGHBIT_TO_MASK (t);
+
+ /* v <-- min (u, v) */
+ v += (vgtu & t);
+
+ /* u <-- |u - v| */
+ u = (t ^ vgtu) - vgtu;
+
+ count_trailing_zeros (c, t);
+ /* We have c <= GMP_LIMB_BITS - 2 here, so that
+
+ ulimb >>= (c + 1);
+
+ would be safe. But unlike the addition c + 1, a separate
+ shift by 1 is independent of c, and can be executed in
+ parallel with count_trailing_zeros. */
+ u = (u >> 1) >> c;
+ }
+ return (u << 1) + 1;
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_11.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_22.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_22.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_22.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,131 @@
+/* mpn_gcd_22 -- double limb greatest common divisor.
+
+Copyright 1994, 1996, 2000, 2001, 2009, 2012, 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if GMP_NAIL_BITS > 0
+#error Nails not supported.
+#endif
+
+mp_double_limb_t
+mpn_gcd_22 (mp_limb_t u1, mp_limb_t u0, mp_limb_t v1, mp_limb_t v0)
+{
+ mp_double_limb_t g;
+ ASSERT (u0 & v0 & 1);
+
+ /* Implicit least significant bit */
+ u0 = (u0 >> 1) | (u1 << (GMP_LIMB_BITS - 1));
+ u1 >>= 1;
+
+ v0 = (v0 >> 1) | (v1 << (GMP_LIMB_BITS - 1));
+ v1 >>= 1;
+
+ while (u1 || v1) /* u1 == 0 can happen at most twice per call */
+ {
+ mp_limb_t vgtu, t1, t0;
+ sub_ddmmss (t1, t0, u1, u0, v1, v0);
+ vgtu = LIMB_HIGHBIT_TO_MASK(t1);
+
+ if (UNLIKELY (t0 == 0))
+ {
+ if (t1 == 0)
+ {
+ g.d1 = (u1 << 1) | (u0 >> (GMP_LIMB_BITS - 1));
+ g.d0 = (u0 << 1) | 1;
+ return g;
+ }
+ int c;
+ count_trailing_zeros (c, t1);
+
+ /* v1 = min (u1, v1) */
+ v1 += (vgtu & t1);
+ /* u0 = |u1 - v1| */
+ u0 = (t1 ^ vgtu) - vgtu;
+ ASSERT (c < GMP_LIMB_BITS - 1);
+ u0 >>= c + 1;
+ u1 = 0;
+ }
+ else
+ {
+ int c;
+ count_trailing_zeros (c, t0);
+ c++;
+ /* V <-- min (U, V).
+
+ Assembly version should use cmov. Another alternative,
+ avoiding carry propagation, would be
+
+ v0 += vgtu & t0; v1 += vtgu & (u1 - v1);
+ */
+ add_ssaaaa (v1, v0, v1, v0, vgtu & t1, vgtu & t0);
+ /* U <-- |U - V|
+ No carry handling needed in this conditional negation,
+ since t0 != 0. */
+ u0 = (t0 ^ vgtu) - vgtu;
+ u1 = t1 ^ vgtu;
+ if (UNLIKELY (c == GMP_LIMB_BITS))
+ {
+ u0 = u1;
+ u1 = 0;
+ }
+ else
+ {
+ u0 = (u0 >> c) | (u1 << (GMP_LIMB_BITS - c));
+ u1 >>= c;
+ }
+ }
+ }
+ while ((v0 | u0) & GMP_LIMB_HIGHBIT)
+ { /* At most two iterations */
+ mp_limb_t vgtu, t0;
+ int c;
+ sub_ddmmss (vgtu, t0, 0, u0, 0, v0);
+ if (UNLIKELY (t0 == 0))
+ {
+ g.d1 = u0 >> (GMP_LIMB_BITS - 1);
+ g.d0 = (u0 << 1) | 1;
+ return g;
+ }
+
+ /* v <-- min (u, v) */
+ v0 += (vgtu & t0);
+
+ /* u <-- |u - v| */
+ u0 = (t0 ^ vgtu) - vgtu;
+
+ count_trailing_zeros (c, t0);
+ u0 = (u0 >> 1) >> c;
+ }
+
+ g.d0 = mpn_gcd_11 ((u0 << 1) + 1, (v0 << 1) + 1);
+ g.d1 = 0;
+ return g;
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_22.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_subdiv_step.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_subdiv_step.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcd_subdiv_step.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
#include <stdlib.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -40,21 +39,8 @@
#define GCDEXT_1_BINARY_METHOD 2
#endif
-#ifndef USE_ZEROTAB
-#define USE_ZEROTAB 1
-#endif
-
#if GCDEXT_1_USE_BINARY
-#if USE_ZEROTAB
-static unsigned char zerotab[0x40] = {
- 6, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 5, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0,
- 4, 0, 1, 0, 2, 0, 1, 0, 3, 0, 1, 0, 2, 0, 1, 0
-};
-#endif
-
mp_limb_t
mpn_gcdext_1 (mp_limb_signed_t *sp, mp_limb_signed_t *tp,
mp_limb_t u, mp_limb_t v)
@@ -111,24 +97,10 @@
if (u > v)
{
u -= v;
-#if USE_ZEROTAB
- count = zerotab [u & 0x3f];
- u >>= count;
- if (UNLIKELY (count == 6))
- {
- unsigned c;
- do
- {
- c = zerotab[u & 0x3f];
- u >>= c;
- count += c;
- }
- while (c == 6);
- }
-#else
+
count_trailing_zeros (count, u);
u >>= count;
-#endif
+
t0 += t1; t1 <<= count;
s0 += s1; s1 <<= count;
}
@@ -135,24 +107,10 @@
else
{
v -= u;
-#if USE_ZEROTAB
- count = zerotab [v & 0x3f];
- v >>= count;
- if (UNLIKELY (count == 6))
- {
- unsigned c;
- do
- {
- c = zerotab[v & 0x3f];
- v >>= c;
- count += c;
- }
- while (c == 6);
- }
-#else
+
count_trailing_zeros (count, v);
v >>= count;
-#endif
+
t1 += t0; t0 <<= count;
s1 += s0; s0 <<= count;
}
@@ -194,22 +152,8 @@
/* Number of trailing zeros is the same no matter if we look at
* d or u, but using d gives more parallelism. */
-#if USE_ZEROTAB
- count = zerotab[d & 0x3f];
- if (UNLIKELY (count == 6))
- {
- unsigned c = 6;
- do
- {
- d >>= c;
- c = zerotab[d & 0x3f];
- count += c;
- }
- while (c == 6);
- }
-#else
count_trailing_zeros (count, d);
-#endif
+
det_sign ^= vgtu;
tx = vgtu & (t0 - t1);
@@ -238,7 +182,7 @@
ugh = ug/2 + (ug & 1);
vgh = vg/2 + (vg & 1);
- /* Now \xB12^{shift} g = s0 U - t0 V. Get rid of the power of two, using
+ /* Now 2^{shift} g = s0 U - t0 V. Get rid of the power of two, using
s0 U - t0 V = (s0 + V/g) U - (t0 + U/g) V. */
for (i = 0; i < shift; i++)
{
@@ -249,8 +193,11 @@
s0 += mask & vgh;
t0 += mask & ugh;
}
- /* FIXME: Try simplifying this condition. */
- if ( (s0 > 1 && 2*s0 >= vg) || (t0 > 1 && 2*t0 >= ug) )
+
+ ASSERT_ALWAYS (s0 <= vg);
+ ASSERT_ALWAYS (t0 <= ug);
+
+ if (s0 > vg - s0)
{
s0 -= vg;
t0 -= ug;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_lehmer.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_lehmer.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/gcdext_lehmer.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_d.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_d.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_d.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,8 @@
CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
FUTURE GNU MP RELEASES.
-Copyright 2003, 2004, 2007, 2009, 2010, 2012 Free Software Foundation, Inc.
+Copyright 2003, 2004, 2007, 2009, 2010, 2012, 2018 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,7 +33,12 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
+#include "config.h"
+
+#if HAVE_FLOAT_H
+#include <float.h> /* for DBL_MANT_DIG and FLT_RADIX */
+#endif
+
#include "gmp-impl.h"
#include "longlong.h"
@@ -355,7 +361,20 @@
#endif
#if ! FORMAT_RECOGNIZED
- { /* Non-IEEE or strange limb size, do something generic. */
+
+#if !defined(GMP_DBL_MANT_BITS)
+#if defined(DBL_MANT_DIG) && FLT_RADIX == 2
+#define GMP_DBL_MANT_BITS DBL_MANT_DIG
+#else
+/* FIXME: Chose a smarter default value. */
+#define GMP_DBL_MANT_BITS (16 * sizeof (double))
+#endif
+#endif
+
+ { /* Non-IEEE or strange limb size, generically convert
+ GMP_DBL_MANT_BITS bits. */
+ mp_limb_t l;
+ int m;
mp_size_t i;
double d, weight;
unsigned long uexp;
@@ -362,14 +381,21 @@
/* First generate an fp number disregarding exp, instead keeping things
within the numb base factor from 1, which should prevent overflow and
- underflow even for the most exponent limited fp formats. The
- termination criteria should be refined, since we now include too many
- limbs. */
- weight = 1/MP_BASE_AS_DOUBLE;
- d = up[size - 1];
- for (i = size - 2; i >= 0; i--)
+ underflow even for the most exponent limited fp formats. */
+ i = size - 1;
+ l = up[i];
+ count_leading_zeros (m, l);
+ m = m + GMP_DBL_MANT_BITS - GMP_LIMB_BITS;
+ if (m < 0)
+ l &= GMP_NUMB_MAX << -m;
+ d = l;
+ for (weight = 1/MP_BASE_AS_DOUBLE; m > 0 && --i >= 0;)
{
- d += up[i] * weight;
+ l = up[i];
+ m -= GMP_NUMB_BITS;
+ if (m < 0)
+ l &= GMP_NUMB_MAX << -m;
+ d += l * weight;
weight /= MP_BASE_AS_DOUBLE;
if (weight == 0)
break;
@@ -385,7 +411,7 @@
else
{
weight = 0.5;
- uexp = 1 - (unsigned long) (exp + 1);
+ uexp = NEG_CAST (unsigned long, exp);
}
#if 1
/* Square-and-multiply exponentiation. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/get_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,13 +2,12 @@
Contributed to the GNU project by Torbjorn Granlund.
- THE FUNCTIONS IN THIS FILE, EXCEPT mpn_get_str, ARE INTERNAL WITH A MUTABLE
- INTERFACE. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN
- FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE
- GNU MP RELEASE.
+ THE FUNCTIONS IN THIS FILE, EXCEPT mpn_get_str, ARE INTERNAL WITH MUTABLE
+ INTERFACES. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES.
+ IN FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A
+ FUTURE GNU MP RELEASE.
-Copyright 1991-1994, 1996, 2000-2002, 2004, 2006-2008, 2011, 2012 Free Software
-Foundation, Inc.
+Copyright 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -36,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -45,7 +43,7 @@
A) Divide U repeatedly by B, generating a quotient and remainder, until the
quotient becomes zero. The remainders hold the converted digits. Digits
- come out from right to left. (Used in mpn_sb_get_str.)
+ come out from right to left. (Used in mpn_bc_get_str.)
B) Divide U by b^g, for g such that 1/b <= U/b^g < 1, generating a fraction.
Then develop digits by multiplying the fraction repeatedly by b. Digits
@@ -90,7 +88,7 @@
...
else
if (un < GET_STR_PRECOMPUTE_THRESHOLD)
- mpn_sb_get_str (str, base, up, un);
+ mpn_bx_get_str (str, base, up, un);
else
precompute_power_tables
mpn_dc_get_str
@@ -98,18 +96,18 @@
mpn_dc_get_str:
mpn_tdiv_qr
if (qn < GET_STR_DC_THRESHOLD)
- mpn_sb_get_str
+ mpn_bc_get_str
else
mpn_dc_get_str
if (rn < GET_STR_DC_THRESHOLD)
- mpn_sb_get_str
+ mpn_bc_get_str
else
mpn_dc_get_str
The reason for the two threshold values is the cost of
- precompute_power_tables. GET_STR_PRECOMPUTE_THRESHOLD will be considerably
- larger than GET_STR_PRECOMPUTE_THRESHOLD. */
+ precompute_power_tables. GET_STR_PRECOMPUTE_THRESHOLD will be
+ considerably larger than GET_STR_DC_THRESHOLD. */
/* The x86s and m68020 have a quotient and remainder "div" instruction and
@@ -147,7 +145,7 @@
after the last digit of the result string. Complexity is O(un^2); intended
for small conversions. */
static unsigned char *
-mpn_sb_get_str (unsigned char *str, size_t len,
+mpn_bc_get_str (unsigned char *str, size_t len,
mp_ptr up, mp_size_t un, int base)
{
mp_limb_t rl, ul;
@@ -315,7 +313,7 @@
if (BELOW_THRESHOLD (un, GET_STR_DC_THRESHOLD))
{
if (un != 0)
- str = mpn_sb_get_str (str, len, up, un, powtab->base);
+ str = mpn_bc_get_str (str, len, up, un, powtab->base);
else
{
while (len != 0)
@@ -359,7 +357,6 @@
return str;
}
-
/* There are no leading zeros on the digits generated at str, but that's not
currently a documented feature. The current mpz_out_str and mpz_get_str
rely on it. */
@@ -367,13 +364,9 @@
size_t
mpn_get_str (unsigned char *str, int base, mp_ptr up, mp_size_t un)
{
- mp_ptr powtab_mem, powtab_mem_ptr;
- mp_limb_t big_base;
- size_t digits_in_base;
+ mp_ptr powtab_mem;
powers_t powtab[GMP_LIMB_BITS];
int pi;
- mp_size_t n;
- mp_ptr p, t;
size_t out_len;
mp_ptr tmp;
TMP_DECL;
@@ -434,116 +427,21 @@
/* General case. The base is not a power of 2. */
if (BELOW_THRESHOLD (un, GET_STR_PRECOMPUTE_THRESHOLD))
- return mpn_sb_get_str (str, (size_t) 0, up, un, base) - str;
+ return mpn_bc_get_str (str, (size_t) 0, up, un, base) - str;
TMP_MARK;
/* Allocate one large block for the powers of big_base. */
- powtab_mem = TMP_BALLOC_LIMBS (mpn_dc_get_str_powtab_alloc (un));
- powtab_mem_ptr = powtab_mem;
+ powtab_mem = TMP_BALLOC_LIMBS (mpn_str_powtab_alloc (un));
/* Compute a table of powers, were the largest power is >= sqrt(U). */
+ size_t ndig;
+ mp_size_t xn;
+ DIGITS_IN_BASE_PER_LIMB (ndig, un, base);
+ xn = 1 + ndig / mp_bases[base].chars_per_limb; /* FIXME: scalar integer division */
- big_base = mp_bases[base].big_base;
- digits_in_base = mp_bases[base].chars_per_limb;
+ pi = 1 + mpn_compute_powtab (powtab, powtab_mem, xn, base);
- {
- mp_size_t n_pows, xn, pn, exptab[GMP_LIMB_BITS], bexp;
- mp_limb_t cy;
- mp_size_t shift;
- size_t ndig;
-
- DIGITS_IN_BASE_PER_LIMB (ndig, un, base);
- xn = 1 + ndig / mp_bases[base].chars_per_limb; /* FIXME: scalar integer division */
-
- n_pows = 0;
- for (pn = xn; pn != 1; pn = (pn + 1) >> 1)
- {
- exptab[n_pows] = pn;
- n_pows++;
- }
- exptab[n_pows] = 1;
-
- powtab[0].p = &big_base;
- powtab[0].n = 1;
- powtab[0].digits_in_base = digits_in_base;
- powtab[0].base = base;
- powtab[0].shift = 0;
-
- powtab[1].p = powtab_mem_ptr; powtab_mem_ptr += 2;
- powtab[1].p[0] = big_base;
- powtab[1].n = 1;
- powtab[1].digits_in_base = digits_in_base;
- powtab[1].base = base;
- powtab[1].shift = 0;
-
- n = 1;
- p = &big_base;
- bexp = 1;
- shift = 0;
- for (pi = 2; pi < n_pows; pi++)
- {
- t = powtab_mem_ptr;
- powtab_mem_ptr += 2 * n + 2;
-
- ASSERT_ALWAYS (powtab_mem_ptr < powtab_mem + mpn_dc_get_str_powtab_alloc (un));
-
- mpn_sqr (t, p, n);
-
- digits_in_base *= 2;
- n *= 2; n -= t[n - 1] == 0;
- bexp *= 2;
-
- if (bexp + 1 < exptab[n_pows - pi])
- {
- digits_in_base += mp_bases[base].chars_per_limb;
- cy = mpn_mul_1 (t, t, n, big_base);
- t[n] = cy;
- n += cy != 0;
- bexp += 1;
- }
- shift *= 2;
- /* Strip low zero limbs. */
- while (t[0] == 0)
- {
- t++;
- n--;
- shift++;
- }
- p = t;
- powtab[pi].p = p;
- powtab[pi].n = n;
- powtab[pi].digits_in_base = digits_in_base;
- powtab[pi].base = base;
- powtab[pi].shift = shift;
- }
-
- for (pi = 1; pi < n_pows; pi++)
- {
- t = powtab[pi].p;
- n = powtab[pi].n;
- cy = mpn_mul_1 (t, t, n, big_base);
- t[n] = cy;
- n += cy != 0;
- if (t[0] == 0)
- {
- powtab[pi].p = t + 1;
- n--;
- powtab[pi].shift++;
- }
- powtab[pi].n = n;
- powtab[pi].digits_in_base += mp_bases[base].chars_per_limb;
- }
-
-#if 0
- { int i;
- printf ("Computed table values for base=%d, un=%d, xn=%d:\n", base, un, xn);
- for (i = 0; i < n_pows; i++)
- printf ("%2d: %10ld %10ld %11ld %ld\n", i, exptab[n_pows-i], powtab[i].n, powtab[i].digits_in_base, powtab[i].shift);
- }
-#endif
- }
-
/* Using our precomputed powers, now in powtab[], convert our number. */
tmp = TMP_BALLOC_LIMBS (mpn_dc_get_str_itch (un));
out_len = mpn_dc_get_str (str, 0, up, un, powtab + (pi - 1), tmp) - str;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,8 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 1996, 1998, 2000-2004, 2008, 2012 Free Software Foundation, Inc.
+Copyright 1996, 1998, 2000-2004, 2008, 2012, 2019 Free Software Foundation,
+Inc.
This file is part of the GNU MP Library.
@@ -32,181 +33,466 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
-#if GMP_NAIL_BITS == 0
+#ifndef HGCD2_DIV1_METHOD
+#define HGCD2_DIV1_METHOD 3
+#endif
-/* Copied from the old mpn/generic/gcdext.c, and modified slightly to return
- the remainder. */
+#ifndef HGCD2_DIV2_METHOD
+#define HGCD2_DIV2_METHOD 2
+#endif
-/* Single-limb division optimized for small quotients. */
-static inline mp_limb_t
-div1 (mp_ptr rp,
- mp_limb_t n0,
- mp_limb_t d0)
+#if GMP_NAIL_BITS != 0
+#error Nails not implemented
+#endif
+
+#if HAVE_NATIVE_mpn_div_11
+
+#define div1 mpn_div_11
+/* Single-limb division optimized for small quotients.
+ Returned value holds d0 = r, d1 = q. */
+mp_double_limb_t div1 (mp_limb_t, mp_limb_t);
+
+#elif HGCD2_DIV1_METHOD == 1
+
+static inline mp_double_limb_t
+div1 (mp_limb_t n0, mp_limb_t d0)
{
- mp_limb_t q = 0;
+ mp_double_limb_t res;
+ res.d1 = n0 / d0;
+ res.d0 = n0 - res.d1 * d0;
- if ((mp_limb_signed_t) n0 < 0)
+ return res;
+}
+
+#elif HGCD2_DIV1_METHOD == 2
+
+static mp_double_limb_t
+div1 (mp_limb_t n0, mp_limb_t d0)
+{
+ mp_double_limb_t res;
+ int ncnt, dcnt, cnt;
+ mp_limb_t q;
+ mp_limb_t mask;
+
+ ASSERT (n0 >= d0);
+
+ count_leading_zeros (ncnt, n0);
+ count_leading_zeros (dcnt, d0);
+ cnt = dcnt - ncnt;
+
+ d0 <<= cnt;
+
+ q = -(mp_limb_t) (n0 >= d0);
+ n0 -= d0 & q;
+ d0 >>= 1;
+ q = -q;
+
+ while (--cnt >= 0)
{
- int cnt;
- for (cnt = 1; (mp_limb_signed_t) d0 >= 0; cnt++)
- {
- d0 = d0 << 1;
- }
+ mask = -(mp_limb_t) (n0 >= d0);
+ n0 -= d0 & mask;
+ d0 >>= 1;
+ q = (q << 1) - mask;
+ }
- q = 0;
- while (cnt)
- {
- q <<= 1;
- if (n0 >= d0)
- {
- n0 = n0 - d0;
- q |= 1;
- }
- d0 = d0 >> 1;
- cnt--;
- }
+ res.d0 = n0;
+ res.d1 = q;
+ return res;
+}
+
+#elif HGCD2_DIV1_METHOD == 3
+
+static inline mp_double_limb_t
+div1 (mp_limb_t n0, mp_limb_t d0)
+{
+ mp_double_limb_t res;
+ if (UNLIKELY ((d0 >> (GMP_LIMB_BITS - 3)) != 0)
+ || UNLIKELY (n0 >= (d0 << 3)))
+ {
+ res.d1 = n0 / d0;
+ res.d0 = n0 - res.d1 * d0;
}
else
{
- int cnt;
- for (cnt = 0; n0 >= d0; cnt++)
- {
- d0 = d0 << 1;
- }
+ mp_limb_t q, mask;
- q = 0;
- while (cnt)
- {
- d0 = d0 >> 1;
- q <<= 1;
- if (n0 >= d0)
- {
- n0 = n0 - d0;
- q |= 1;
- }
- cnt--;
- }
+ d0 <<= 2;
+
+ mask = -(mp_limb_t) (n0 >= d0);
+ n0 -= d0 & mask;
+ q = 4 & mask;
+
+ d0 >>= 1;
+ mask = -(mp_limb_t) (n0 >= d0);
+ n0 -= d0 & mask;
+ q += 2 & mask;
+
+ d0 >>= 1;
+ mask = -(mp_limb_t) (n0 >= d0);
+ n0 -= d0 & mask;
+ q -= mask;
+
+ res.d0 = n0;
+ res.d1 = q;
}
- *rp = n0;
- return q;
+ return res;
}
+#elif HGCD2_DIV1_METHOD == 4
+
+/* Table quotients. We extract the NBITS most significant bits of the
+ numerator limb, and the corresponding bits from the divisor limb, and use
+ these to form an index into the table. This method is probably only useful
+ for short pipelines with slow multiplication.
+
+ Possible improvements:
+
+ * Perhaps extract the highest NBITS of the divisor instead of the same bits
+ as from the numerator. That would require another count_leading_zeros,
+ and a post-multiply shift of the quotient.
+
+ * Compress tables? Their values are tiny, and there are lots of zero
+ entries (which are never used).
+
+ * Round the table entries more cleverly?
+*/
+
+#ifndef NBITS
+#define NBITS 5
+#endif
+
+#if NBITS == 5
+/* This needs full division about 13.2% of the time. */
+static const unsigned char tab[512] = {
+17, 9, 5,4,3,2,2,2,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+18, 9, 6,4,3,2,2,2,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+19,10, 6,4,3,3,2,2,2,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+20,10, 6,5,3,3,2,2,2,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+21,11, 7,5,4,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+22,11, 7,5,4,3,3,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+23,12, 7,5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+24,12, 8,6,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+25,13, 8,6,5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+26,13, 8,6,5,4,3,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+27,14, 9,6,5,4,3,3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+28,14, 9,7,5,4,3,3,3,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+29,15,10,7,5,4,4,3,3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+30,15,10,7,6,5,4,3,3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+31,16,10,7,6,5,4,3,3,3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+32,16,11,8,6,5,4,3,3,3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+};
+#elif NBITS == 6
+/* This needs full division about 9.8% of the time. */
+static const unsigned char tab[2048] = {
+33,17,11, 8, 6, 5,4,4,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 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,
+34,17,11, 8, 6, 5,4,4,3,3,3,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 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,
+35,18,12, 9, 7, 5,5,4,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 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,
+36,18,12, 9, 7, 6,5,4,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 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,
+37,19,13, 9, 7, 6,5,4,4,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 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,
+38,19,13, 9, 7, 6,5,4,4,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 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,
+39,20,13,10, 7, 6,5,4,4,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,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,
+40,20,14,10, 8, 6,5,5,4,3,3,3,3,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,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,
+41,21,14,10, 8, 6,5,5,4,4,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+42,21,14,10, 8, 7,6,5,4,4,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+43,22,15,11, 8, 7,6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+44,22,15,11, 9, 7,6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+45,23,15,11, 9, 7,6,5,5,4,4,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+46,23,16,11, 9, 7,6,5,5,4,4,3,3,3,3,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+47,24,16,12, 9, 7,6,5,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+48,24,16,12, 9, 8,6,6,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+49,25,17,12,10, 8,7,6,5,4,4,4,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+50,25,17,13,10, 8,7,6,5,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+51,26,18,13,10, 8,7,6,5,5,4,4,3,3,3,3,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+52,26,18,13,10, 8,7,6,5,5,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+53,27,18,13,10, 9,7,6,5,5,4,4,4,3,3,3,3,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+54,27,19,14,11, 9,7,6,6,5,4,4,4,3,3,3,3,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+55,28,19,14,11, 9,7,6,6,5,5,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+56,28,19,14,11, 9,8,7,6,5,5,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,1,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+57,29,20,14,11, 9,8,7,6,5,5,4,4,4,3,3,3,3,2,2,2,2,2,2,2,2,2,2,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+58,29,20,15,11, 9,8,7,6,5,5,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,1,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+59,30,20,15,12,10,8,7,6,5,5,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+60,30,21,15,12,10,8,7,6,6,5,5,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,1,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+61,31,21,15,12,10,8,7,6,6,5,5,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+62,31,22,16,12,10,9,7,6,6,5,5,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,1,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+63,32,22,16,13,10,9,7,7,6,5,5,4,4,4,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,2,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+64,32,22,16,13,10,9,8,7,6,5,5,4,4,4,3,3,3,3,3,3,2,2,2,2,2,2,2,2,2,2,1,
+ 1, 1, 1, 1, 1, 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
+};
+#else
+#error No table for provided NBITS
+#endif
+
+static const unsigned char *tabp = tab - (1 << (NBITS - 1) << NBITS);
+
+static inline mp_double_limb_t
+div1 (mp_limb_t n0, mp_limb_t d0)
+{
+ int ncnt;
+ size_t nbi, dbi;
+ mp_limb_t q0;
+ mp_limb_t r0;
+ mp_limb_t mask;
+ mp_double_limb_t res;
+
+ ASSERT (n0 >= d0); /* Actually only msb position is critical. */
+
+ count_leading_zeros (ncnt, n0);
+ nbi = n0 << ncnt >> (GMP_LIMB_BITS - NBITS);
+ dbi = d0 << ncnt >> (GMP_LIMB_BITS - NBITS);
+
+ q0 = tabp[(nbi << NBITS) + dbi];
+ r0 = n0 - q0 * d0;
+ mask = -(mp_limb_t) (r0 >= d0);
+ q0 -= mask;
+ r0 -= d0 & mask;
+
+ if (UNLIKELY (r0 >= d0))
+ {
+ q0 = n0 / d0;
+ r0 = n0 - q0 * d0;
+ }
+
+ res.d1 = q0;
+ res.d0 = r0;
+ return res;
+}
+
+#elif HGCD2_DIV1_METHOD == 5
+
+/* Table inverses of divisors. We don't bother with suppressing the msb from
+ the tables. We index with the NBITS most significant divisor bits,
+ including the always-set highest bit, but use addressing trickery via tabp
+ to suppress it.
+
+ Possible improvements:
+
+ * Do first multiply using 32-bit operations on 64-bit computers. At least
+ on most Arm64 cores, that uses 3 times less resources. It also saves on
+ many x86-64 processors.
+*/
+
+#ifndef NBITS
+#define NBITS 7
+#endif
+
+#if NBITS == 5
+/* This needs full division about 1.63% of the time. */
+static const unsigned char tab[16] = {
+ 63, 59, 55, 52, 50, 47, 45, 43, 41, 39, 38, 36, 35, 34, 33, 32
+};
+static const unsigned char *tabp = tab - (1 << (NBITS - 1));
+#elif NBITS == 6
+/* This needs full division about 0.93% of the time. */
+static const unsigned char tab[32] = {
+127,123,119,116,112,109,106,104,101, 98, 96, 94, 92, 90, 88, 86,
+ 84, 82, 80, 79, 77, 76, 74, 73, 72, 70, 69, 68, 67, 66, 65, 64
+};
+static const unsigned char *tabp = tab - (1 << (NBITS - 1));
+#elif NBITS == 7
+/* This needs full division about 0.49% of the time. */
+static const unsigned char tab[64] = {
+255,251,247,243,239,236,233,229,226,223,220,217,214,211,209,206,
+203,201,198,196,194,191,189,187,185,183,181,179,177,175,173,171,
+169,167,166,164,162,161,159,158,156,155,153,152,150,149,147,146,
+145,143,142,141,140,139,137,136,135,134,133,132,131,130,129,128
+};
+static const unsigned char *tabp = tab - (1 << (NBITS - 1));
+#elif NBITS == 8
+/* This needs full division about 0.26% of the time. */
+static const unsigned short tab[128] = {
+511,507,503,499,495,491,488,484,480,477,473,470,467,463,460,457,
+454,450,447,444,441,438,435,433,430,427,424,421,419,416,413,411,
+408,406,403,401,398,396,393,391,389,386,384,382,380,377,375,373,
+371,369,367,365,363,361,359,357,355,353,351,349,347,345,343,342,
+340,338,336,335,333,331,329,328,326,325,323,321,320,318,317,315,
+314,312,311,309,308,306,305,303,302,301,299,298,296,295,294,292,
+291,290,288,287,286,285,283,282,281,280,279,277,276,275,274,273,
+272,270,269,268,267,266,265,264,263,262,261,260,259,258,257,256
+};
+static const unsigned short *tabp = tab - (1 << (NBITS - 1));
+#else
+#error No table for provided NBITS
+#endif
+
+static inline mp_double_limb_t
+div1 (mp_limb_t n0, mp_limb_t d0)
+{
+ int ncnt, dcnt;
+ size_t dbi;
+ mp_limb_t inv;
+ mp_limb_t q0;
+ mp_limb_t r0;
+ mp_limb_t mask;
+ mp_double_limb_t res;
+
+ count_leading_zeros (ncnt, n0);
+ count_leading_zeros (dcnt, d0);
+
+ dbi = d0 << dcnt >> (GMP_LIMB_BITS - NBITS);
+ inv = tabp[dbi];
+ q0 = ((n0 << ncnt) >> (NBITS + 1)) * inv >> (GMP_LIMB_BITS - 1 + ncnt - dcnt);
+ r0 = n0 - q0 * d0;
+ mask = -(mp_limb_t) (r0 >= d0);
+ q0 -= mask;
+ r0 -= d0 & mask;
+
+ if (UNLIKELY (r0 >= d0))
+ {
+ q0 = n0 / d0;
+ r0 = n0 - q0 * d0;
+ }
+
+ res.d1 = q0;
+ res.d0 = r0;
+ return res;
+}
+
+#else
+#error Unknown HGCD2_DIV1_METHOD
+#endif
+
+#if HAVE_NATIVE_mpn_div_22
+
+#define div2 mpn_div_22
/* Two-limb division optimized for small quotients. */
-static inline mp_limb_t
+mp_limb_t div2 (mp_ptr, mp_limb_t, mp_limb_t, mp_limb_t, mp_limb_t);
+
+#elif HGCD2_DIV2_METHOD == 1
+
+static mp_limb_t
div2 (mp_ptr rp,
- mp_limb_t nh, mp_limb_t nl,
- mp_limb_t dh, mp_limb_t dl)
+ mp_limb_t n1, mp_limb_t n0,
+ mp_limb_t d1, mp_limb_t d0)
{
- mp_limb_t q = 0;
+ mp_double_limb_t rq = div1 (n1, d1);
+ if (UNLIKELY (rq.d1 > d1))
+ {
+ mp_limb_t n2, q, t1, t0;
+ int c;
- if ((mp_limb_signed_t) nh < 0)
- {
- int cnt;
- for (cnt = 1; (mp_limb_signed_t) dh >= 0; cnt++)
+ /* Normalize */
+ count_leading_zeros (c, d1);
+ ASSERT (c > 0);
+
+ n2 = n1 >> (GMP_LIMB_BITS - c);
+ n1 = (n1 << c) | (n0 >> (GMP_LIMB_BITS - c));
+ n0 <<= c;
+ d1 = (d1 << c) | (d0 >> (GMP_LIMB_BITS - c));
+ d0 <<= c;
+
+ udiv_qrnnd (q, n1, n2, n1, d1);
+ umul_ppmm (t1, t0, q, d0);
+ if (t1 > n1 || (t1 == n1 && t0 > n0))
{
- dh = (dh << 1) | (dl >> (GMP_LIMB_BITS - 1));
- dl = dl << 1;
+ ASSERT (q > 0);
+ q--;
+ sub_ddmmss (t1, t0, t1, t0, d1, d0);
}
+ sub_ddmmss (n1, n0, n1, n0, t1, t0);
- while (cnt)
- {
- q <<= 1;
- if (nh > dh || (nh == dh && nl >= dl))
- {
- sub_ddmmss (nh, nl, nh, nl, dh, dl);
- q |= 1;
- }
- dl = (dh << (GMP_LIMB_BITS - 1)) | (dl >> 1);
- dh = dh >> 1;
- cnt--;
- }
+ /* Undo normalization */
+ rp[0] = (n0 >> c) | (n1 << (GMP_LIMB_BITS - c));
+ rp[1] = n1 >> c;
+
+ return q;
}
else
{
- int cnt;
- for (cnt = 0; nh > dh || (nh == dh && nl >= dl); cnt++)
+ mp_limb_t q, t1, t0;
+ n1 = rq.d0;
+ q = rq.d1;
+ umul_ppmm (t1, t0, q, d0);
+ if (UNLIKELY (t1 >= n1) && (t1 > n1 || t0 > n0))
{
- dh = (dh << 1) | (dl >> (GMP_LIMB_BITS - 1));
- dl = dl << 1;
+ ASSERT (q > 0);
+ q--;
+ sub_ddmmss (t1, t0, t1, t0, d1, d0);
}
-
- while (cnt)
- {
- dl = (dh << (GMP_LIMB_BITS - 1)) | (dl >> 1);
- dh = dh >> 1;
- q <<= 1;
- if (nh > dh || (nh == dh && nl >= dl))
- {
- sub_ddmmss (nh, nl, nh, nl, dh, dl);
- q |= 1;
- }
- cnt--;
- }
+ sub_ddmmss (rp[1], rp[0], n1, n0, t1, t0);
+ return q;
}
+}
- rp[0] = nl;
- rp[1] = nh;
+#elif HGCD2_DIV2_METHOD == 2
- return q;
-}
-
-#if 0
-/* This div2 uses less branches, but it seems to nevertheless be
- slightly slower than the above code. */
-static inline mp_limb_t
+/* Bit-wise div2. Relies on fast count_leading_zeros. */
+static mp_limb_t
div2 (mp_ptr rp,
- mp_limb_t nh, mp_limb_t nl,
- mp_limb_t dh, mp_limb_t dl)
+ mp_limb_t n1, mp_limb_t n0,
+ mp_limb_t d1, mp_limb_t d0)
{
mp_limb_t q = 0;
int ncnt;
int dcnt;
- count_leading_zeros (ncnt, nh);
- count_leading_zeros (dcnt, dh);
+ count_leading_zeros (ncnt, n1);
+ count_leading_zeros (dcnt, d1);
dcnt -= ncnt;
- dh = (dh << dcnt) + (-(dcnt > 0) & (dl >> (GMP_LIMB_BITS - dcnt)));
- dl <<= dcnt;
+ d1 = (d1 << dcnt) + (d0 >> 1 >> (GMP_LIMB_BITS - 1 - dcnt));
+ d0 <<= dcnt;
do
{
- mp_limb_t bit;
+ mp_limb_t mask;
q <<= 1;
- if (UNLIKELY (nh == dh))
- bit = (nl >= dl);
+ if (UNLIKELY (n1 == d1))
+ mask = -(n0 >= d0);
else
- bit = (nh > dh);
+ mask = -(n1 > d1);
- q |= bit;
+ q -= mask;
- sub_ddmmss (nh, nl, nh, nl, (-bit) & dh, (-bit) & dl);
+ sub_ddmmss (n1, n0, n1, n0, mask & d1, mask & d0);
- dl = (dh << (GMP_LIMB_BITS - 1)) | (dl >> 1);
- dh = dh >> 1;
+ d0 = (d1 << (GMP_LIMB_BITS - 1)) | (d0 >> 1);
+ d1 = d1 >> 1;
}
while (dcnt--);
- rp[0] = nl;
- rp[1] = nh;
+ rp[0] = n0;
+ rp[1] = n1;
return q;
}
+#else
+#error Unknown HGCD2_DIV2_METHOD
#endif
-#else /* GMP_NAIL_BITS != 0 */
-/* Check all functions for nail support. */
-/* hgcd2 should be defined to take inputs including nail bits, and
- produce a matrix with elements also including nail bits. This is
- necessary, for the matrix elements to be useful with mpn_mul_1,
- mpn_addmul_1 and friends. */
-#error Not implemented
-#endif /* GMP_NAIL_BITS != 0 */
-
/* Reduces a,b until |a-b| (almost) fits in one limb + 1 bit. Constructs
matrix M. Returns 1 if we make progress, i.e. can perform at least
one subtraction. Otherwise returns zero. */
@@ -341,9 +627,8 @@
}
}
- /* NOTE: Since we discard the least significant half limb, we don't
- get a truly maximal M (corresponding to |a - b| <
- 2^{GMP_LIMB_BITS +1}). */
+ /* NOTE: Since we discard the least significant half limb, we don't get a
+ truly maximal M (corresponding to |a - b| < 2^{GMP_LIMB_BITS +1}). */
/* Single precision loop */
for (;;)
{
@@ -361,9 +646,10 @@
}
else
{
- mp_limb_t r;
- mp_limb_t q = div1 (&r, ah, bh);
- ah = r;
+ mp_double_limb_t rq = div1 (ah, bh);
+ mp_limb_t q = rq.d1;
+ ah = rq.d0;
+
if (ah < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2 + 1)))
{
/* A is too small, but q is correct. */
@@ -390,9 +676,10 @@
}
else
{
- mp_limb_t r;
- mp_limb_t q = div1 (&r, bh, ah);
- bh = r;
+ mp_double_limb_t rq = div1 (bh, ah);
+ mp_limb_t q = rq.d1;
+ bh = rq.d0;
+
if (bh < (CNST_LIMB(1) << (GMP_LIMB_BITS / 2 + 1)))
{
/* B is too small, but q is correct. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2_jacobi.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2_jacobi.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd2_jacobi.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_appr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_appr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_appr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_jacobi.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_jacobi.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_jacobi.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_matrix.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_matrix.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_matrix.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_reduce.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_reduce.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_reduce.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_step.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_step.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/hgcd_step.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invert.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invert.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invert.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright (C) 2007, 2009, 2010, 2012, 2014-2015 Free Software Foundation, Inc.
+Copyright (C) 2007, 2009, 2010, 2012, 2014-2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -52,15 +51,11 @@
else if (BELOW_THRESHOLD (n, INV_APPR_THRESHOLD))
{
/* Maximum scratch needed by this branch: 2*n */
- mp_size_t i;
mp_ptr xp;
xp = scratch; /* 2 * n limbs */
/* n > 1 here */
- i = n;
- do
- xp[--i] = GMP_NUMB_MAX;
- while (i);
+ MPN_FILL (xp, n, GMP_NUMB_MAX);
mpn_com (xp + n, dp, n);
if (n == 2) {
mpn_divrem_2 (ip, 0, xp, 4, dp);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invertappr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invertappr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/invertappr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -12,7 +12,8 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright (C) 2007, 2009, 2010, 2012, 2015 Free Software Foundation, Inc.
+Copyright (C) 2007, 2009, 2010, 2012, 2015, 2016 Free Software
+Foundation, Inc.
This file is part of the GNU MP Library.
@@ -40,7 +41,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -97,13 +97,8 @@
if (n == 1)
invert_limb (*ip, *dp);
else {
- mp_size_t i;
-
/* n > 1 here */
- i = n;
- do
- xp[--i] = GMP_NUMB_MAX;
- while (i);
+ MPN_FILL (xp, n, GMP_NUMB_MAX);
mpn_com (xp + n, dp, n);
/* Now xp contains B^2n - {dp,n}*B^n - 1 */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacbase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacbase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacbase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -175,7 +174,7 @@
storage etc. */
scratch = MPN_GCD_SUBDIV_STEP_ITCH(n);
- if (ABOVE_THRESHOLD (n, GCD_DC_THRESHOLD))
+ if (ABOVE_THRESHOLD (n, JACOBI_DC_THRESHOLD))
{
mp_size_t hgcd_scratch;
mp_size_t update_scratch;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi_2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi_2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/jacobi_2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/logops_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/logops_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/logops_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#ifdef OPERATION_and_n
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshift.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshift.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshift.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Shift U (pointed to by up and n limbs long) cnt bits to the left
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshiftc.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshiftc.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/lshiftc.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Shift U (pointed to by up and n limbs long) cnt bits to the left
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -127,7 +126,7 @@
* Resulting elements are of size up to rn + mn + 1.
*
* Temporary storage: 3 rn + 3 mn + 5. */
-void
+static void
mpn_matrix22_mul_strassen (mp_ptr r0, mp_ptr r1, mp_ptr r2, mp_ptr r3, mp_size_t rn,
mp_srcptr m0, mp_srcptr m1, mp_srcptr m2, mp_srcptr m3, mp_size_t mn,
mp_ptr tp)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul1_inverse_vector.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul1_inverse_vector.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/matrix22_mul1_inverse_vector.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -114,7 +113,8 @@
"subfe %0, %0, %0\n\t" \
"nor %0, %0, %0" \
: "=r" (m), "=r" (s1), "=&r" (s0) \
- : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0))
+ : "r" (a1), "r" (b1), "%r" (a0), "rI" (b0) \
+ __CLOBBER_CC)
#endif
#if defined (__s390x__) && W_TYPE_SIZE == 64
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -37,7 +37,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_3.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_3.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_3.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpn_mod_1s_3p (ap, n, b, cps)
Divide (ap,,n) by b. Return the single-limb remainder.
- Requires that d < B / 3.
+ Requires that b < B / 3.
Contributed to the GNU project by Torbjorn Granlund.
Based on a suggestion by Peter L. Montgomery.
@@ -37,7 +37,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_4.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_4.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_1_4.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpn_mod_1s_4p (ap, n, b, cps)
Divide (ap,,n) by b. Return the single-limb remainder.
- Requires that d < B / 4.
+ Requires that b < B / 4.
Contributed to the GNU project by Torbjorn Granlund.
Based on a suggestion by Peter L. Montgomery.
@@ -37,7 +37,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_34lsub1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_34lsub1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mod_34lsub1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -97,9 +96,7 @@
mp_limb_t
mpn_mod_34lsub1 (mp_srcptr p, mp_size_t n)
{
- mp_limb_t c0 = 0;
- mp_limb_t c1 = 0;
- mp_limb_t c2 = 0;
+ mp_limb_t c0, c1, c2;
mp_limb_t a0, a1, a2;
ASSERT (n >= 1);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mode1o.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mode1o.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mode1o.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -8,7 +8,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2005-2007, 2009, 2010 Free Software Foundation, Inc.
+Copyright 2005-2007, 2009, 2010, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -44,7 +44,6 @@
for developing quotient bits. This algorithm was presented at ICMS 2006.
*/
-#include "gmp.h"
#include "gmp-impl.h"
@@ -66,8 +65,8 @@
particular, when dn==in, tp and rp could use the same space.
FIXME: Trim final quotient calculation to qn limbs of precision.
*/
-void
-mpn_mu_bdiv_q (mp_ptr qp,
+static void
+mpn_mu_bdiv_q_old (mp_ptr qp,
mp_srcptr np, mp_size_t nn,
mp_srcptr dp, mp_size_t dn,
mp_ptr scratch)
@@ -225,6 +224,16 @@
}
}
+void
+mpn_mu_bdiv_q (mp_ptr qp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr scratch)
+{
+ mpn_mu_bdiv_q_old (qp, np, nn, dp, dn, scratch);
+ mpn_neg (qp, qp, nn);
+}
+
mp_size_t
mpn_mu_bdiv_q_itch (mp_size_t nn, mp_size_t dn)
{
@@ -270,4 +279,3 @@
itch_binvert = mpn_binvert_itch (in);
return in + MAX (itches, itch_binvert);
}
-
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_bdiv_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -8,7 +8,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2005-2007, 2009, 2010, 2012 Free Software Foundation, Inc.
+Copyright 2005-2007, 2009, 2010, 2012, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -44,7 +44,6 @@
for developing quotient bits. This algorithm was presented at ICMS 2006.
*/
-#include "gmp.h"
#include "gmp-impl.h"
@@ -65,12 +64,12 @@
FIXME: Trim allocation for (qn > dn) case, 3*dn might be possible. In
particular, when dn==in, tp and rp could use the same space.
*/
-mp_limb_t
-mpn_mu_bdiv_qr (mp_ptr qp,
- mp_ptr rp,
- mp_srcptr np, mp_size_t nn,
- mp_srcptr dp, mp_size_t dn,
- mp_ptr scratch)
+static mp_limb_t
+mpn_mu_bdiv_qr_old (mp_ptr qp,
+ mp_ptr rp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr scratch)
{
mp_size_t qn;
mp_size_t in;
@@ -243,6 +242,39 @@
}
}
+mp_limb_t
+mpn_mu_bdiv_qr (mp_ptr qp,
+ mp_ptr rp,
+ mp_srcptr np, mp_size_t nn,
+ mp_srcptr dp, mp_size_t dn,
+ mp_ptr scratch)
+{
+ mp_limb_t cy = mpn_mu_bdiv_qr_old (qp, rp, np, nn, dp, dn, scratch);
+
+ /* R' B^{qn} = U - Q' D
+ *
+ * Q = B^{qn} - Q' (assuming Q' != 0)
+ *
+ * R B^{qn} = U + Q D = U + B^{qn} D - Q' D
+ * = B^{qn} D + R'
+ */
+
+ if (UNLIKELY (!mpn_neg (qp, qp, nn - dn)))
+ {
+ /* Zero quotient. */
+ ASSERT (cy == 0);
+ return 0;
+ }
+ else
+ {
+ mp_limb_t cy2 = mpn_add_n (rp, rp, dp, dn);
+ ASSERT (cy2 >= cy);
+
+ return cy2 - cy;
+ }
+}
+
+
mp_size_t
mpn_mu_bdiv_qr_itch (mp_size_t nn, mp_size_t dn)
{
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -59,7 +59,6 @@
*/
#include <stdlib.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_div_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -72,7 +72,6 @@
#endif
#include <stdlib.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -91,6 +90,7 @@
static mp_limb_t mpn_mu_div_qr2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+static mp_size_t mpn_mu_div_qr_choose_in (mp_size_t, mp_size_t, int);
mp_limb_t
@@ -363,7 +363,7 @@
(c) qn < dn/3: in = qn
In all cases we have in <= dn.
*/
-mp_size_t
+static mp_size_t
mpn_mu_div_qr_choose_in (mp_size_t qn, mp_size_t dn, int k)
{
mp_size_t in;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_divappr_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_divappr_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mu_divappr_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -68,9 +68,11 @@
#endif
#include <stdlib.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
+static mp_limb_t mpn_preinv_mu_divappr_q (mp_ptr, mp_srcptr, mp_size_t,
+ mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr);
+static mp_size_t mpn_mu_divappr_q_choose_in (mp_size_t, mp_size_t, int);
mp_limb_t
mpn_mu_divappr_q (mp_ptr qp,
@@ -156,7 +158,7 @@
return qh;
}
-mp_limb_t
+static mp_limb_t
mpn_preinv_mu_divappr_q (mp_ptr qp,
mp_srcptr np,
mp_size_t nn,
@@ -312,7 +314,7 @@
(c) qn < dn/3: in = qn
In all cases we have in <= dn.
*/
-mp_size_t
+static mp_size_t
mpn_mu_divappr_q_choose_in (mp_size_t qn, mp_size_t dn, int k)
{
mp_size_t in;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
Contributed to the GNU project by Torbjorn Granlund.
Copyright 1991, 1993, 1994, 1996, 1997, 1999-2003, 2005-2007, 2009, 2010, 2012,
-2014 Free Software Foundation, Inc.
+2014, 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -109,12 +108,8 @@
* That problem is even more prevalent for toomX3. We therefore use special
THRESHOLD variables there.
-
- * Is our ITCH allocation correct?
*/
-#define ITCH (16*vn + 100)
-
mp_limb_t
mpn_mul (mp_ptr prodp,
mp_srcptr up, mp_size_t un,
@@ -125,13 +120,18 @@
ASSERT (! MPN_OVERLAP_P (prodp, un+vn, up, un));
ASSERT (! MPN_OVERLAP_P (prodp, un+vn, vp, vn));
- if (un == vn)
+ if (BELOW_THRESHOLD (un, MUL_TOOM22_THRESHOLD))
{
- if (up == vp)
- mpn_sqr (prodp, up, un);
- else
- mpn_mul_n (prodp, up, vp, un);
+ /* When un (and thus vn) is below the toom22 range, do mul_basecase.
+ Test un and not vn here not to thwart the un >> vn code below.
+ This special case is not necessary, but cuts the overhead for the
+ smallest operands. */
+ mpn_mul_basecase (prodp, up, un, vp, vn);
}
+ else if (un == vn)
+ {
+ mpn_mul_n (prodp, up, vp, un);
+ }
else if (vn < MUL_TOOM22_THRESHOLD)
{ /* plain schoolbook multiplication */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_fft.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_fft.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_fft.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 1998-2010, 2012, 2013 Free Software Foundation, Inc.
+Copyright 1998-2010, 2012, 2013, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -66,7 +66,6 @@
#define TRACE(x)
#endif
-#include "gmp.h"
#include "gmp-impl.h"
#ifdef WANT_ADDSUB
@@ -289,7 +288,27 @@
}
}
+#if HAVE_NATIVE_mpn_add_n_sub_n
+static inline void
+mpn_fft_add_sub_modF (mp_ptr A0, mp_ptr Ai, mp_srcptr tp, mp_size_t n)
+{
+ mp_limb_t cyas, c, x;
+ cyas = mpn_add_n_sub_n (A0, Ai, A0, tp, n);
+
+ c = A0[n] - tp[n] - (cyas & 1);
+ x = (-c) & -((c & GMP_LIMB_HIGHBIT) != 0);
+ Ai[n] = x + c;
+ MPN_INCR_U (Ai, n + 1, x);
+
+ c = A0[n] + tp[n] + (cyas >> 1);
+ x = (c - 1) & -(c != 0);
+ A0[n] = c - x;
+ MPN_DECR_U (A0, n + 1, x);
+}
+
+#else /* ! HAVE_NATIVE_mpn_add_n_sub_n */
+
/* r <- a+b mod 2^(n*GMP_NUMB_BITS)+1.
Assumes a and b are semi-normalized.
*/
@@ -351,6 +370,7 @@
}
#endif
}
+#endif /* HAVE_NATIVE_mpn_add_n_sub_n */
/* input: A[0] ... A[inc*(K-1)] are residues mod 2^N+1 where
N=n*GMP_NUMB_BITS, and 2^omega is a primitive root mod 2^N+1
@@ -389,8 +409,12 @@
/* Ap[inc] <- Ap[0] + Ap[inc] * 2^(lk[1] * omega)
Ap[0] <- Ap[0] + Ap[inc] * 2^(lk[0] * omega) */
mpn_fft_mul_2exp_modF (tp, Ap[inc], lk[0] * omega, n);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_fft_add_sub_modF (Ap[0], Ap[inc], tp, n);
+#else
mpn_fft_sub_modF (Ap[inc], Ap[0], tp, n);
mpn_fft_add_modF (Ap[0], Ap[0], tp, n);
+#endif
}
}
}
@@ -576,8 +600,12 @@
/* Ap[K2] <- Ap[0] + Ap[K2] * 2^((j + K2) * omega)
Ap[0] <- Ap[0] + Ap[K2] * 2^(j * omega) */
mpn_fft_mul_2exp_modF (tp, Ap[K2], j * omega, n);
+#if HAVE_NATIVE_mpn_add_n_sub_n
+ mpn_fft_add_sub_modF (Ap[0], Ap[K2], tp, n);
+#else
mpn_fft_sub_modF (Ap[K2], Ap[0], tp, n);
mpn_fft_add_modF (Ap[0], Ap[0], tp, n);
+#endif
}
}
}
@@ -966,7 +994,6 @@
oldcc = cc;
#if HAVE_NATIVE_mpn_add_n_sub_n
c2 = mpn_add_n_sub_n (pad_op + l, pad_op, pad_op, pad_op + l, l);
- /* c2 & 1 is the borrow, c2 & 2 is the carry */
cc += c2 >> 1; /* carry out from high <- low + high */
c2 = c2 & 1; /* borrow out from low <- low - high */
#else
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mul_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* FIXME: Should optionally use mpn_mul_2/mpn_addmul_2. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mullo_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmid_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmod_bnm1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmod_bnm1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/mulmod_bnm1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -77,7 +76,7 @@
ASSERT (tp[2*rn] < GMP_NUMB_MAX);
cy = tp[2*rn] + mpn_sub_n (rp, tp, tp+rn, rn);
rp[rn] = 0;
- MPN_INCR_U (rp, rn+1, cy );
+ MPN_INCR_U (rp, rn+1, cy);
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/neg.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/neg.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/neg.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_neg 1
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/nussbaumer_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/nussbaumer_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/nussbaumer_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Multiply {ap,an} by {bp,bn}, and put the result in {pp, an+bn} */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfpow.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfpow.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfpow.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfsqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfsqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/perfsqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
see https://www.gnu.org/licenses/. */
#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/popham.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/popham.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/popham.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if OPERATION_popcount
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pow_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pow_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pow_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -79,13 +78,15 @@
if (bn == 1)
{
- mp_limb_t bl = bp[0];
+ mp_limb_t rl, rh, bl = bp[0];
if ((cnt & 1) != 0)
MP_PTR_SWAP (rp, tp);
- mpn_sqr (rp, bp, bn);
- rn = 2 * bn; rn -= rp[rn - 1] == 0;
+ umul_ppmm (rh, rl, bl, bl << GMP_NAIL_BITS);
+ rp[0] = rl >> GMP_NAIL_BITS;
+ rp[1] = rh;
+ rn = 1 + (rh != 0);
for (i = GMP_LIMB_BITS - cnt - 1;;)
{
@@ -92,8 +93,8 @@
exp <<= 1;
if ((exp & GMP_LIMB_HIGHBIT) != 0)
{
- rp[rn] = mpn_mul_1 (rp, rp, rn, bl);
- rn += rp[rn] != 0;
+ rp[rn] = rh = mpn_mul_1 (rp, rp, rn, bl);
+ rn += rh != 0;
}
if (--i == 0)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powlo.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powlo.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powlo.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* mpn_powlo -- Compute R = U^E mod B^n, where B is the limb base.
-Copyright 2007-2009, 2012, 2015 Free Software Foundation, Inc.
+Copyright 2007-2009, 2012, 2015, 2016, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -29,7 +29,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -38,9 +37,9 @@
((p[(bi - 1) / GMP_LIMB_BITS] >> (bi - 1) % GMP_LIMB_BITS) & 1)
static inline mp_limb_t
-getbits (const mp_limb_t *p, mp_bitcnt_t bi, int nbits)
+getbits (const mp_limb_t *p, mp_bitcnt_t bi, unsigned nbits)
{
- int nbits_in_r;
+ unsigned nbits_in_r;
mp_limb_t r;
mp_size_t i;
@@ -61,13 +60,13 @@
}
}
-static inline int
+static inline unsigned
win_size (mp_bitcnt_t eb)
{
- int k;
- static mp_bitcnt_t x[] = {1,7,25,81,241,673,1793,4609,11521,28161,~(mp_bitcnt_t)0};
+ unsigned k;
+ static mp_bitcnt_t x[] = {7,25,81,241,673,1793,4609,11521,28161,~(mp_bitcnt_t)0};
ASSERT (eb > 1);
- for (k = 1; eb > x[k]; ++k)
+ for (k = 0; eb > x[k++];)
;
return k;
}
@@ -82,12 +81,13 @@
mp_srcptr ep, mp_size_t en,
mp_size_t n, mp_ptr tp)
{
- int cnt;
+ unsigned cnt;
mp_bitcnt_t ebi;
- int windowsize, this_windowsize;
+ unsigned windowsize, this_windowsize;
mp_limb_t expbits;
- mp_limb_t *pp, *this_pp, *last_pp;
+ mp_limb_t *pp;
long i;
+ int flipflop;
TMP_DECL;
ASSERT (en > 1 || (en == 1 && ep[0] > 1));
@@ -97,41 +97,56 @@
MPN_SIZEINBASE_2EXP(ebi, ep, en, 1);
windowsize = win_size (ebi);
- ASSERT (windowsize < ebi);
+ if (windowsize > 1)
+ {
+ mp_limb_t *this_pp, *last_pp;
+ ASSERT (windowsize < ebi);
- pp = TMP_ALLOC_LIMBS ((n << (windowsize - 1)));
+ pp = TMP_ALLOC_LIMBS ((n << (windowsize - 1)));
- this_pp = pp;
+ this_pp = pp;
- MPN_COPY (this_pp, bp, n);
+ MPN_COPY (this_pp, bp, n);
- /* Store b^2 in tp. */
- mpn_sqrlo (tp, bp, n);
+ /* Store b^2 in tp. */
+ mpn_sqrlo (tp, bp, n);
- /* Precompute odd powers of b and put them in the temporary area at pp. */
- for (i = (1 << (windowsize - 1)) - 1; i > 0; i--)
+ /* Precompute odd powers of b and put them in the temporary area at pp. */
+ i = (1 << (windowsize - 1)) - 1;
+ do
+ {
+ last_pp = this_pp;
+ this_pp += n;
+ mpn_mullo_n (this_pp, last_pp, tp, n);
+ } while (--i != 0);
+
+ expbits = getbits (ep, ebi, windowsize);
+
+ /* THINK: Should we initialise the case expbits % 4 == 0 with a mullo? */
+ count_trailing_zeros (cnt, expbits);
+ ebi -= windowsize;
+ ebi += cnt;
+ expbits >>= cnt;
+
+ MPN_COPY (rp, pp + n * (expbits >> 1), n);
+ }
+ else
{
- last_pp = this_pp;
- this_pp += n;
- mpn_mullo_n (this_pp, last_pp, tp, n);
+ pp = tp + n;
+ MPN_COPY (pp, bp, n);
+ MPN_COPY (rp, bp, n);
+ --ebi;
}
- expbits = getbits (ep, ebi, windowsize);
+ flipflop = 0;
- /* FIXME: for even expbits, we can init with a mullo. */
- count_trailing_zeros (cnt, expbits);
- ebi -= windowsize;
- ebi += cnt;
- expbits >>= cnt;
-
- MPN_COPY (rp, pp + n * (expbits >> 1), n);
-
do
{
while (getbit (ep, ebi) == 0)
{
mpn_sqrlo (tp, rp, n);
- MPN_COPY (rp, tp, n);
+ MP_PTR_SWAP (rp, tp);
+ flipflop = ! flipflop;
if (--ebi == 0)
goto done;
}
@@ -140,14 +155,8 @@
bits <= windowsize, and such that the least significant bit is 1. */
expbits = getbits (ep, ebi, windowsize);
- this_windowsize = windowsize;
- if (ebi < windowsize)
- {
- this_windowsize -= windowsize - ebi;
- ebi = 0;
- }
- else
- ebi -= windowsize;
+ this_windowsize = MIN (windowsize, ebi);
+ ebi -= this_windowsize;
count_trailing_zeros (cnt, expbits);
this_windowsize -= cnt;
@@ -164,11 +173,16 @@
if (this_windowsize != 0)
mpn_sqrlo (tp, rp, n);
else
- MPN_COPY (tp, rp, n);
-
+ {
+ MP_PTR_SWAP (rp, tp);
+ flipflop = ! flipflop;
+ }
+
mpn_mullo_n (rp, tp, pp + n * (expbits >> 1), n);
} while (ebi != 0);
done:
+ if (flipflop)
+ MPN_COPY (tp, rp, n);
TMP_FREE;
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powm.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powm.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/powm.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2007-2012 Free Software Foundation, Inc.
+Copyright 2007-2012, 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -81,18 +81,43 @@
mod M.
*/
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
+#undef MPN_REDC_0
+#define MPN_REDC_0(rp, up, mp, invm) \
+ do { \
+ mp_limb_t p1, r0, u0, _dummy; \
+ u0 = *(up); \
+ umul_ppmm (p1, _dummy, *(mp), (u0 * (invm)) & GMP_NUMB_MASK); \
+ ASSERT (((u0 + _dummy) & GMP_NUMB_MASK) == 0); \
+ p1 += (u0 != 0); \
+ r0 = (up)[1] + p1; \
+ if (p1 > r0) \
+ r0 -= *(mp); \
+ *(rp) = r0; \
+ } while (0)
+
#undef MPN_REDC_1
+#if HAVE_NATIVE_mpn_sbpi1_bdiv_r
#define MPN_REDC_1(rp, up, mp, n, invm) \
do { \
mp_limb_t cy; \
+ cy = mpn_sbpi1_bdiv_r (up, 2 * n, mp, n, invm); \
+ if (cy != 0) \
+ mpn_sub_n (rp, up + n, mp, n); \
+ else \
+ MPN_COPY (rp, up + n, n); \
+ } while (0)
+#else
+#define MPN_REDC_1(rp, up, mp, n, invm) \
+ do { \
+ mp_limb_t cy; \
cy = mpn_redc_1 (rp, up, mp, n, invm); \
if (cy != 0) \
mpn_sub_n (rp, rp, mp, n); \
} while (0)
+#endif
#undef MPN_REDC_2
#define MPN_REDC_2(rp, up, mp, n, mip) \
@@ -130,7 +155,7 @@
nbits_in_r = GMP_NUMB_BITS - bi; /* number of bits now in r */
if (nbits_in_r < nbits) /* did we get enough bits? */
r += p[i + 1] << nbits_in_r; /* prepend bits from higher word */
- return r & (((mp_limb_t ) 1 << nbits) - 1);
+ return r & (((mp_limb_t) 1 << nbits) - 1);
}
}
@@ -237,6 +262,11 @@
/* Store b^2 at rp. */
mpn_sqr (tp, this_pp, n);
+#if 0
+ if (n == 1) {
+ MPN_REDC_0 (rp, tp, mp, mip[0]);
+ } else
+#endif
#if WANT_REDC_2
if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
MPN_REDC_1 (rp, tp, mp, n, mip[0]);
@@ -251,6 +281,13 @@
/* Precompute odd powers of b and put them in the temporary area at pp. */
for (i = (1 << (windowsize - 1)) - 1; i > 0; i--)
+#if 1
+ if (n == 1) {
+ umul_ppmm((tp)[1], *(tp), *(this_pp), *(rp));
+ ++this_pp ;
+ MPN_REDC_0 (this_pp, tp, mp, mip[0]);
+ } else
+#endif
{
mpn_mul_n (tp, this_pp, rp, n);
this_pp += n;
@@ -286,8 +323,7 @@
{ \
MPN_SQR (tp, rp, n); \
MPN_REDUCE (rp, tp, mp, n, mip); \
- ebi--; \
- if (ebi == 0) \
+ if (--ebi == 0) \
goto done; \
} \
\
@@ -314,9 +350,8 @@
{ \
MPN_SQR (tp, rp, n); \
MPN_REDUCE (rp, tp, mp, n, mip); \
- this_windowsize--; \
} \
- while (this_windowsize != 0); \
+ while (--this_windowsize != 0); \
\
MPN_MUL_N (tp, rp, pp + n * (expbits >> 1), n); \
MPN_REDUCE (rp, tp, mp, n, mip); \
@@ -323,6 +358,17 @@
}
+ if (n == 1)
+ {
+#undef MPN_MUL_N
+#undef MPN_SQR
+#undef MPN_REDUCE
+#define MPN_MUL_N(r,a,b,n) umul_ppmm((r)[1], *(r), *(a), *(b))
+#define MPN_SQR(r,a,n) umul_ppmm((r)[1], *(r), *(a), *(a))
+#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_0(rp, tp, mp, mip[0])
+ INNERLOOP;
+ }
+ else
#if WANT_REDC_2
if (REDC_1_TO_REDC_2_THRESHOLD < MUL_TOOM22_THRESHOLD)
{
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_divrem_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_divrem_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_divrem_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_mod_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_mod_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/pre_mod_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/random2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
static void gmp_rrandomb (mp_ptr, gmp_randstate_t, mp_bitcnt_t);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
mp_limb_t
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/redc_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/remove.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/remove.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/remove.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -7,7 +7,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2009, 2012-2014 Free Software Foundation, Inc.
+Copyright 2009, 2012-2014, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if GMP_LIMB_BITS > 50
@@ -114,10 +113,15 @@
qp[qn] = 0;
mpn_bdiv_qr_wrap (qp2, tp, qp, qn + 1, pp, pn);
if (!mpn_zero_p (tp, pn))
- break; /* could not divide by V^npowers */
+ {
+ if (mpn_cmp (tp, pp, pn) != 0)
+ break; /* could not divide by V^npowers */
+ }
MP_PTR_SWAP (qp, qp2);
qn = qn - pn;
+ mpn_neg (qp, qp, qn+1);
+
qn += qp[qn] != 0;
pwpsp[npowers] = pp;
@@ -155,10 +159,15 @@
qp[qn] = 0;
mpn_bdiv_qr_wrap (qp2, tp, qp, qn + 1, pwpsp[i], pn);
if (!mpn_zero_p (tp, pn))
- continue; /* could not divide by V^i */
+ {
+ if (mpn_cmp (tp, pwpsp[i], pn) != 0)
+ continue; /* could not divide by V^i */
+ }
MP_PTR_SWAP (qp, qp2);
qn = qn - pn;
+ mpn_neg (qp, qp, qn+1);
+
qn += qp[qn] != 0;
pwr += (mp_bitcnt_t) 1 << i;
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rootrem.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rootrem.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rootrem.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
Contributed by Paul Zimmermann (algorithm) and
Paul Zimmermann and Torbjorn Granlund (implementation).
- Marco Bodrato wrote logbased_root to seed the loop.
+ Marco Bodrato wrote logbased_root to seed the loop.
THE FUNCTIONS IN THIS FILE ARE INTERNAL, AND HAVE MUTABLE INTERFACES. IT'S
ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT'S ALMOST
@@ -44,7 +44,6 @@
#include <stdio.h> /* for NULL */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -479,7 +478,7 @@
/* 8: current buffer: {sp,sn} */
- };
+ }
/* otherwise we have rn > 0, thus the return value is ok */
if (!approx || sp[0] <= CNST_LIMB (1))
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rshift.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rshift.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/rshift.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Shift U (pointed to by up and N limbs long) cnt bits to the right
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,13 +1,13 @@
/* mpn_sbpi1_bdiv_q -- schoolbook Hensel division with precomputed inverse,
returning quotient only.
- Contributed to the GNU project by Niels Möller.
+ Contributed to the GNU project by Niels Möller and Torbjörn Granlund.
THE FUNCTIONS IN THIS FILE ARE INTERNAL FUNCTIONS WITH MUTABLE INTERFACES.
IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS
ALMOST GUARANTEED THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2005, 2006, 2009, 2011, 2012 Free Software Foundation, Inc.
+Copyright 2005, 2006, 2009, 2011, 2012, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,66 +35,62 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
+/* Computes Q = - U / D mod B^un, destroys U.
-/* Computes Q = N / D mod B^nn, destroys N.
-
D must be odd. dinv is (-D)^-1 mod B.
+*/
- The straightforward way to compute Q is to cancel one limb at a time, using
-
- qp[i] = D^{-1} * np[i] (mod B)
- N -= B^i * qp[i] * D
-
- But we prefer addition to subtraction, since mpn_addmul_1 is often faster
- than mpn_submul_1. Q = - N / D can be computed by iterating
-
- qp[i] = (-D)^{-1} * np[i] (mod B)
- N += B^i * qp[i] * D
-
- And then we flip the sign, -Q = (not Q) + 1. */
-
void
mpn_sbpi1_bdiv_q (mp_ptr qp,
- mp_ptr np, mp_size_t nn,
+ mp_ptr up, mp_size_t un,
mp_srcptr dp, mp_size_t dn,
mp_limb_t dinv)
{
mp_size_t i;
- mp_limb_t cy, q;
+ mp_limb_t q;
ASSERT (dn > 0);
- ASSERT (nn >= dn);
+ ASSERT (un >= dn);
ASSERT ((dp[0] & 1) != 0);
- /* FIXME: Add ASSERTs for allowable overlapping; i.e., that qp = np is OK,
- but some over N/Q overlaps will not work. */
+ ASSERT (-(dp[0] * dinv) == 1);
+ ASSERT (up == qp || !MPN_OVERLAP_P (up, un, qp, un - dn));
- for (i = nn - dn; i > 0; i--)
+ if (un > dn)
{
- q = dinv * np[0];
- cy = mpn_addmul_1 (np, dp, dn, q);
- mpn_add_1 (np + dn, np + dn, i, cy);
- ASSERT (np[0] == 0);
- qp[0] = ~q;
- qp++;
- np++;
+ mp_limb_t cy, hi;
+ for (i = un - dn - 1, cy = 0; i > 0; i--)
+ {
+ q = dinv * up[0];
+ hi = mpn_addmul_1 (up, dp, dn, q);
+
+ ASSERT (up[0] == 0);
+ *qp++ = q;
+ hi += cy;
+ cy = hi < cy;
+ hi += up[dn];
+ cy += hi < up[dn];
+ up[dn] = hi;
+ up++;
+ }
+ q = dinv * up[0];
+ hi = cy + mpn_addmul_1 (up, dp, dn, q);
+ ASSERT (up[0] == 0);
+ *qp++ = q;
+ up[dn] += hi;
+ up++;
}
-
for (i = dn; i > 1; i--)
{
- q = dinv * np[0];
- mpn_addmul_1 (np, dp, i, q);
- ASSERT (np[0] == 0);
- qp[0] = ~q;
- qp++;
- np++;
+ mp_limb_t q = dinv * up[0];
+ mpn_addmul_1 (up, dp, i, q);
+ ASSERT (up[0] == 0);
+ *qp++ = q;
+ up++;
}
/* Final limb */
- q = dinv * np[0];
- qp[0] = ~q;
- mpn_add_1 (qp - nn + 1, qp - nn + 1, nn, 1);
+ *qp = dinv * up[0];
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,13 +1,13 @@
/* mpn_sbpi1_bdiv_qr -- schoolbook Hensel division with precomputed inverse,
returning quotient and remainder.
- Contributed to the GNU project by Niels Möller.
+ Contributed to the GNU project by Niels Möller and Torbjörn Granlund.
THE FUNCTIONS IN THIS FILE ARE INTERNAL FUNCTIONS WITH MUTABLE INTERFACES.
IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS
ALMOST GUARANTEED THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
-Copyright 2006, 2009, 2011, 2012 Free Software Foundation, Inc.
+Copyright 2006, 2009, 2011, 2012, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,85 +35,48 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
-/* Computes a binary quotient of size qn = nn - dn.
+/* Computes a binary quotient of size qn = un - dn.
Output:
- Q = N * D^{-1} mod B^qn,
+ Q = -U * D^{-1} mod B^qn,
- R = (N - Q * D) * B^(-qn)
+ R = (U + Q * D) * B^(-qn)
- Stores the dn least significant limbs of R at {np + nn - dn, dn},
- and returns the borrow from the subtraction N - Q*D.
+ Stores the dn least significant limbs of R at {up + un - dn, dn},
+ and returns the carry from the addition N + Q*D.
D must be odd. dinv is (-D)^-1 mod B. */
mp_limb_t
mpn_sbpi1_bdiv_qr (mp_ptr qp,
- mp_ptr np, mp_size_t nn,
+ mp_ptr up, mp_size_t un,
mp_srcptr dp, mp_size_t dn, mp_limb_t dinv)
{
- mp_size_t qn;
mp_size_t i;
- mp_limb_t rh;
- mp_limb_t ql;
+ mp_limb_t cy;
ASSERT (dn > 0);
- ASSERT (nn > dn);
+ ASSERT (un > dn);
ASSERT ((dp[0] & 1) != 0);
- /* FIXME: Add ASSERTs for allowable overlapping; i.e., that qp = np is OK,
- but some over N/Q overlaps will not work. */
+ ASSERT (-(dp[0] * dinv) == 1);
+ ASSERT (up == qp || !MPN_OVERLAP_P (up, un, qp, un - dn));
- qn = nn - dn;
-
- rh = 0;
-
- /* To complete the negation, this value is added to q. */
- ql = 1;
- while (qn > dn)
+ for (i = un - dn, cy = 0; i != 0; i--)
{
- for (i = 0; i < dn; i++)
- {
- mp_limb_t q;
+ mp_limb_t q = dinv * up[0];
+ mp_limb_t hi = mpn_addmul_1 (up, dp, dn, q);
+ *qp++ = q;
- q = dinv * np[i];
- np[i] = mpn_addmul_1 (np + i, dp, dn, q);
- qp[i] = ~q;
- }
- rh += mpn_add (np + dn, np + dn, qn, np, dn);
- ql = mpn_add_1 (qp, qp, dn, ql);
-
- qp += dn; qn -= dn;
- np += dn; nn -= dn;
+ hi += cy;
+ cy = hi < cy;
+ hi += up[dn];
+ cy += hi < up[dn];
+ up[dn] = hi;
+ up++;
}
- for (i = 0; i < qn; i++)
- {
- mp_limb_t q;
-
- q = dinv * np[i];
- np[i] = mpn_addmul_1 (np + i, dp, dn, q);
- qp[i] = ~q;
- }
-
- rh += mpn_add_n (np + dn, np + dn, np, qn);
- ql = mpn_add_1 (qp, qp, qn, ql);
-
- if (UNLIKELY (ql > 0))
- {
- /* q == 0 */
- ASSERT (rh == 0);
- return 0;
- }
- else
- {
- mp_limb_t cy;
-
- cy = mpn_sub_n (np + qn, np + qn, dp, dn);
- ASSERT (cy >= rh);
- return cy - rh;
- }
+ return cy;
}
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_r.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_r.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_r.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,79 @@
+/* mpn_sbpi1_bdiv_r -- schoolbook Hensel division with precomputed inverse,
+ returning remainder.
+
+ Contributed to the GNU project by Niels Möller and Torbjörn Granlund.
+
+ THE FUNCTIONS IN THIS FILE ARE INTERNAL FUNCTIONS WITH MUTABLE INTERFACES.
+ IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS
+ ALMOST GUARANTEED THAT THEY'LL CHANGE OR DISAPPEAR IN A FUTURE GMP RELEASE.
+
+Copyright 2006, 2009, 2011, 2012, 2017 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include "gmp-impl.h"
+
+
+/* Computes a binary quotient of size qn = un - dn.
+ Output:
+
+ Q = -U * D^{-1} mod B^qn,
+
+ R = (U + Q * D) * B^(-qn)
+
+ Stores the dn least significant limbs of R at {up + un - dn, dn},
+ and returns the carry from the addition N + Q*D.
+
+ D must be odd. dinv is (-D)^-1 mod B. */
+
+mp_limb_t
+mpn_sbpi1_bdiv_r (mp_ptr up, mp_size_t un,
+ mp_srcptr dp, mp_size_t dn, mp_limb_t dinv)
+{
+ mp_size_t i;
+ mp_limb_t cy;
+
+ ASSERT (dn > 0);
+ ASSERT (un > dn);
+ ASSERT ((dp[0] & 1) != 0);
+ ASSERT (-(dp[0] * dinv) == 1);
+
+ for (i = un - dn, cy = 0; i != 0; i--)
+ {
+ mp_limb_t q = dinv * up[0];
+ mp_limb_t hi = mpn_addmul_1 (up, dp, dn, q);
+
+ hi += cy;
+ cy = hi < cy;
+ hi += up[dn];
+ cy += hi < up[dn];
+ up[dn] = hi;
+ up++;
+ }
+
+ return cy;
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_bdiv_r.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_div_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_divappr_q.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_divappr_q.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sbpi1_divappr_q.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -37,7 +37,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan0.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan0.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan0.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/scan1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_aors_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_aors_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_aors_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if OPERATION_sec_add_1
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_div.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_div.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_div.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,7 @@
Contributed to the GNU project by Torbjörn Granlund.
-Copyright 2011-2014 Free Software Foundation, Inc.
+Copyright 2011-2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -73,7 +72,6 @@
{
mp_limb_t d1, d0;
unsigned int cnt;
- gmp_pi1_t dinv;
mp_limb_t inv32;
ASSERT (dn >= 1);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_invert.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_invert.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_invert.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if 0
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_pi1_div.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_pi1_div.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_pi1_div.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_powm.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_powm.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_powm.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
Contributed to the GNU project by Torbjörn Granlund.
-Copyright 2007-2009, 2011-2014 Free Software Foundation, Inc.
+Copyright 2007-2009, 2011-2014, 2018-2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,14 +35,17 @@
/*
BASIC ALGORITHM, Compute U^E mod M, where M < B^n is odd.
- 1. T <- (B^n * U) mod M Convert to REDC form
+ 1. T <- (B^n * U) mod M; convert to REDC form
- 2. Compute table U^0, U^1, U^2... of E-dependent size
+ 2. Compute table U^0, U^1, U^2... of floor(log(E))-dependent size
3. While there are more bits in E
W <- power left-to-right base-k
+ The article "Defeating modexp side-channel attacks with data-independent
+ execution traces", https://gmplib.org/~tege/modexp-silent.pdf, has details.
+
TODO:
* Make getbits a macro, thereby allowing it to update the index operand.
@@ -56,18 +59,27 @@
slowdown.
*/
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
#undef MPN_REDC_1_SEC
+#if HAVE_NATIVE_mpn_sbpi1_bdiv_r
#define MPN_REDC_1_SEC(rp, up, mp, n, invm) \
do { \
mp_limb_t cy; \
+ cy = mpn_sbpi1_bdiv_r (up, 2 * n, mp, n, invm); \
+ mpn_cnd_sub_n (cy, rp, up + n, mp, n); \
+ } while (0)
+#else
+#define MPN_REDC_1_SEC(rp, up, mp, n, invm) \
+ do { \
+ mp_limb_t cy; \
cy = mpn_redc_1 (rp, up, mp, n, invm); \
mpn_cnd_sub_n (cy, rp, rp, mp, n); \
} while (0)
+#endif
+#if HAVE_NATIVE_mpn_addmul_2 || HAVE_NATIVE_mpn_redc_2
#undef MPN_REDC_2_SEC
#define MPN_REDC_2_SEC(rp, up, mp, n, mip) \
do { \
@@ -75,9 +87,10 @@
cy = mpn_redc_2 (rp, up, mp, n, mip); \
mpn_cnd_sub_n (cy, rp, rp, mp, n); \
} while (0)
-
-#if HAVE_NATIVE_mpn_addmul_2 || HAVE_NATIVE_mpn_redc_2
-#define WANT_REDC_2 1
+#else
+#define MPN_REDC_2_SEC(rp, up, mp, n, mip) /* empty */
+#undef REDC_1_TO_REDC_2_THRESHOLD
+#define REDC_1_TO_REDC_2_THRESHOLD MP_SIZE_T_MAX
#endif
/* Define our own mpn squaring function. We do this since we cannot use a
@@ -85,24 +98,6 @@
SQR_TOOM2_THRESHOLD. This is so because of fixed size stack allocations
made inside mpn_sqr_basecase. */
-#if HAVE_NATIVE_mpn_sqr_diagonal
-#define MPN_SQR_DIAGONAL(rp, up, n) \
- mpn_sqr_diagonal (rp, up, n)
-#else
-#define MPN_SQR_DIAGONAL(rp, up, n) \
- do { \
- mp_size_t _i; \
- for (_i = 0; _i < (n); _i++) \
- { \
- mp_limb_t ul, lpl; \
- ul = (up)[_i]; \
- umul_ppmm ((rp)[2 * _i + 1], lpl, ul, ul << GMP_NAIL_BITS); \
- (rp)[2 * _i] = lpl >> GMP_NAIL_BITS; \
- } \
- } while (0)
-#endif
-
-
#if ! HAVE_NATIVE_mpn_sqr_basecase
/* The limit of the generic code is SQR_TOOM2_THRESHOLD. */
#define SQR_BASECASE_LIM SQR_TOOM2_THRESHOLD
@@ -128,17 +123,17 @@
#ifndef SQR_BASECASE_LIM
/* If SQR_BASECASE_LIM is now not defined, use mpn_sqr_basecase for any operand
size. */
-#define mpn_local_sqr(rp,up,n,tp) mpn_sqr_basecase(rp,up,n)
-#else
-/* Else use mpn_sqr_basecase for its allowed sizes, else mpn_mul_basecase. */
-#define mpn_local_sqr(rp,up,n,tp) \
+#define SQR_BASECASE_LIM MP_SIZE_T_MAX
+#endif
+
+#define mpn_local_sqr(rp,up,n) \
do { \
- if (BELOW_THRESHOLD (n, SQR_BASECASE_LIM)) \
+ if (ABOVE_THRESHOLD (n, SQR_BASECASE_THRESHOLD) \
+ && BELOW_THRESHOLD (n, SQR_BASECASE_LIM)) \
mpn_sqr_basecase (rp, up, n); \
else \
mpn_mul_basecase(rp, up, n, up, n); \
} while (0)
-#endif
#define getbit(p,bi) \
((p[(bi - 1) / GMP_NUMB_BITS] >> (bi - 1) % GMP_NUMB_BITS) & 1)
@@ -222,7 +217,7 @@
mp_limb_t ip[2], *mip;
int windowsize, this_windowsize;
mp_limb_t expbits;
- mp_ptr pp, this_pp;
+ mp_ptr pp, this_pp, ps;
long i;
int cnd;
@@ -235,7 +230,6 @@
windowsize = win_size (enb);
-#if WANT_REDC_2
if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
{
mip = ip;
@@ -248,11 +242,6 @@
mpn_binvert (mip, mp, 2, tp);
mip[0] = -mip[0]; mip[1] = ~mip[1];
}
-#else
- mip = ip;
- binvert_limb (mip[0], mp[0]);
- mip[0] = -mip[0];
-#endif
pp = tp;
tp += (n << windowsize); /* put tp after power table */
@@ -275,20 +264,36 @@
/* Precompute powers of b and put them in the temporary area at pp. */
/* scratch: | n | n | ... | | 2n | */
/* | pp[0] | pp[1] | ... | pp[2^windowsize-1] | product | */
- for (i = (1 << windowsize) - 2; i > 0; i--)
+ ps = pp + n; /* initially B^1 */
+ if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
{
- mpn_mul_basecase (tp, this_pp, n, pp + n, n);
- this_pp += n;
-#if WANT_REDC_2
- if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
- MPN_REDC_1_SEC (this_pp, tp, mp, n, mip[0]);
- else
- MPN_REDC_2_SEC (this_pp, tp, mp, n, mip);
-#else
- MPN_REDC_1_SEC (this_pp, tp, mp, n, mip[0]);
-#endif
+ for (i = (1 << windowsize) - 2; i > 0; i -= 2)
+ {
+ mpn_local_sqr (tp, ps, n);
+ ps += n;
+ this_pp += n;
+ MPN_REDC_1_SEC (this_pp, tp, mp, n, mip[0]);
+
+ mpn_mul_basecase (tp, this_pp, n, pp + n, n);
+ this_pp += n;
+ MPN_REDC_1_SEC (this_pp, tp, mp, n, mip[0]);
+ }
}
+ else
+ {
+ for (i = (1 << windowsize) - 2; i > 0; i -= 2)
+ {
+ mpn_local_sqr (tp, ps, n);
+ ps += n;
+ this_pp += n;
+ MPN_REDC_2_SEC (this_pp, tp, mp, n, mip);
+ mpn_mul_basecase (tp, this_pp, n, pp + n, n);
+ this_pp += n;
+ MPN_REDC_2_SEC (this_pp, tp, mp, n, mip);
+ }
+ }
+
expbits = getbits (ep, enb, windowsize);
ASSERT_ALWAYS (enb >= windowsize);
enb -= windowsize;
@@ -314,7 +319,7 @@
\
do \
{ \
- mpn_local_sqr (tp, rp, n, tp + 2 * n); \
+ mpn_local_sqr (tp, rp, n); \
MPN_REDUCE (rp, tp, mp, n, mip); \
this_windowsize--; \
} \
@@ -326,48 +331,27 @@
MPN_REDUCE (rp, tp, mp, n, mip); \
}
-#if WANT_REDC_2
if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
{
-#undef MPN_MUL_N
-#undef MPN_SQR
#undef MPN_REDUCE
-#define MPN_MUL_N(r,a,b,n) mpn_mul_basecase (r,a,n,b,n)
-#define MPN_SQR(r,a,n) mpn_sqr_basecase (r,a,n)
#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1_SEC (rp, tp, mp, n, mip[0])
INNERLOOP;
}
else
{
-#undef MPN_MUL_N
-#undef MPN_SQR
#undef MPN_REDUCE
-#define MPN_MUL_N(r,a,b,n) mpn_mul_basecase (r,a,n,b,n)
-#define MPN_SQR(r,a,n) mpn_sqr_basecase (r,a,n)
#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_2_SEC (rp, tp, mp, n, mip)
INNERLOOP;
}
-#else
-#undef MPN_MUL_N
-#undef MPN_SQR
-#undef MPN_REDUCE
-#define MPN_MUL_N(r,a,b,n) mpn_mul_basecase (r,a,n,b,n)
-#define MPN_SQR(r,a,n) mpn_sqr_basecase (r,a,n)
-#define MPN_REDUCE(rp,tp,mp,n,mip) MPN_REDC_1_SEC (rp, tp, mp, n, mip[0])
- INNERLOOP;
-#endif
MPN_COPY (tp, rp, n);
MPN_ZERO (tp + n, n);
-#if WANT_REDC_2
if (BELOW_THRESHOLD (n, REDC_1_TO_REDC_2_THRESHOLD))
MPN_REDC_1_SEC (rp, tp, mp, n, mip[0]);
else
MPN_REDC_2_SEC (rp, tp, mp, n, mip);
-#else
- MPN_REDC_1_SEC (rp, tp, mp, n, mip[0]);
-#endif
+
cnd = mpn_sub_n (tp, rp, mp, n); /* we need just retval */
mpn_cnd_sub_n (!cnd, rp, rp, mp, n);
}
@@ -378,6 +362,7 @@
int windowsize;
mp_size_t redcify_itch, itch;
+ /* FIXME: no more _local/_basecase difference. */
/* The top scratch usage will either be when reducing B in the 2nd redcify
call, or more typically n*2^windowsize + 3n or 4n, in the main loop. (It
is 3n or 4n depending on if we use mpn_local_sqr or a native
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,7 +30,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if ! HAVE_NATIVE_mpn_sqr_basecase
@@ -65,7 +64,7 @@
size. */
mpn_sqr_basecase (rp, ap, an);
#else
-/* Else use mpn_sqr_basecase for its allowed sizes, else mpn_mul_basecase. */
+/* Else use mpn_mul_basecase. */
mpn_mul_basecase (rp, ap, an, ap, an);
#endif
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_tabselect.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_tabselect.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sec_tabselect.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/set_str.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/set_str.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/set_str.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,13 +4,12 @@
Contributed to the GNU project by Torbjorn Granlund.
- THE FUNCTIONS IN THIS FILE, EXCEPT mpn_set_str, ARE INTERNAL WITH A MUTABLE
- INTERFACE. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES. IN
- FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A FUTURE
- GNU MP RELEASE.
+ THE FUNCTIONS IN THIS FILE, EXCEPT mpn_set_str, ARE INTERNAL WITH MUTABLE
+ INTERFACES. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES.
+ IN FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A
+ FUTURE GNU MP RELEASE.
-Copyright 1991-1994, 1996, 2000-2002, 2004, 2006-2008, 2012, 2013 Free
-Software Foundation, Inc.
+Copyright 1991-2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -64,9 +63,7 @@
cubes, not squares.
*/
-#include "gmp.h"
#include "gmp-impl.h"
-#include "longlong.h"
mp_size_t
mpn_set_str (mp_ptr rp, const unsigned char *str, size_t str_len, int base)
@@ -120,15 +117,16 @@
chars_per_limb = mp_bases[base].chars_per_limb;
- un = str_len / chars_per_limb + 1;
+ un = str_len / chars_per_limb + 1; /* FIXME: scalar integer division */
/* Allocate one large block for the powers of big_base. */
- powtab_mem = TMP_BALLOC_LIMBS (mpn_dc_set_str_powtab_alloc (un));
+ powtab_mem = TMP_BALLOC_LIMBS (mpn_str_powtab_alloc (un));
- mpn_set_str_compute_powtab (powtab, powtab_mem, un, base);
+ size_t n_pows = mpn_compute_powtab (powtab, powtab_mem, un, base);
+ powers_t *pt = powtab + n_pows;
tp = TMP_BALLOC_LIMBS (mpn_dc_set_str_itch (un));
- size = mpn_dc_set_str (rp, str, str_len, powtab, tp);
+ size = mpn_dc_set_str (rp, str, str_len, pt, tp);
TMP_FREE;
return size;
@@ -135,88 +133,6 @@
}
}
-void
-mpn_set_str_compute_powtab (powers_t *powtab, mp_ptr powtab_mem, mp_size_t un, int base)
-{
- mp_ptr powtab_mem_ptr;
- long i, pi;
- mp_size_t n;
- mp_ptr p, t;
- mp_limb_t big_base;
- int chars_per_limb;
- size_t digits_in_base;
- mp_size_t shift;
-
- powtab_mem_ptr = powtab_mem;
-
- chars_per_limb = mp_bases[base].chars_per_limb;
- big_base = mp_bases[base].big_base;
-
- p = powtab_mem_ptr;
- powtab_mem_ptr += 1;
-
- digits_in_base = chars_per_limb;
-
- p[0] = big_base;
- n = 1;
-
- count_leading_zeros (i, un - 1);
- i = GMP_LIMB_BITS - 1 - i;
-
- powtab[i].p = p;
- powtab[i].n = n;
- powtab[i].digits_in_base = digits_in_base;
- powtab[i].base = base;
- powtab[i].shift = 0;
-
- shift = 0;
- for (pi = i - 1; pi >= 0; pi--)
- {
- t = powtab_mem_ptr;
- powtab_mem_ptr += 2 * n;
-
- ASSERT_ALWAYS (powtab_mem_ptr < powtab_mem + mpn_dc_set_str_powtab_alloc (un));
-
- mpn_sqr (t, p, n);
- n = 2 * n - 1; n += t[n] != 0;
- digits_in_base *= 2;
-#if 1
- if ((((un - 1) >> pi) & 2) == 0)
- {
- mpn_divexact_1 (t, t, n, big_base);
- n -= t[n - 1] == 0;
- digits_in_base -= chars_per_limb;
- }
-#else
- if (CLEVER_CONDITION_1 ())
- {
- /* perform adjustment operation of previous */
- cy = mpn_mul_1 (p, p, n, big_base);
- }
- if (CLEVER_CONDITION_2 ())
- {
- /* perform adjustment operation of new */
- cy = mpn_mul_1 (t, t, n, big_base);
- }
-#endif
- shift *= 2;
- /* Strip low zero limbs, but be careful to keep the result divisible by
- big_base. */
- while (t[0] == 0 && (t[1] & ((big_base & -big_base) - 1)) == 0)
- {
- t++;
- n--;
- shift++;
- }
- p = t;
- powtab[pi].p = p;
- powtab[pi].n = n;
- powtab[pi].digits_in_base = digits_in_base;
- powtab[pi].base = base;
- powtab[pi].shift = shift;
- }
-}
-
mp_size_t
mpn_dc_set_str (mp_ptr rp, const unsigned char *str, size_t str_len,
const powers_t *powtab, mp_ptr tp)
@@ -232,7 +148,7 @@
if (BELOW_THRESHOLD (str_len, SET_STR_DC_THRESHOLD))
return mpn_bc_set_str (rp, str, str_len, powtab->base);
else
- return mpn_dc_set_str (rp, str, str_len, powtab + 1, tp);
+ return mpn_dc_set_str (rp, str, str_len, powtab - 1, tp);
}
len_hi = str_len - len_lo;
@@ -241,7 +157,7 @@
if (BELOW_THRESHOLD (len_hi, SET_STR_DC_THRESHOLD))
hn = mpn_bc_set_str (tp, str, len_hi, powtab->base);
else
- hn = mpn_dc_set_str (tp, str, len_hi, powtab + 1, rp);
+ hn = mpn_dc_set_str (tp, str, len_hi, powtab - 1, rp);
sn = powtab->shift;
@@ -264,7 +180,7 @@
if (BELOW_THRESHOLD (len_lo, SET_STR_DC_THRESHOLD))
ln = mpn_bc_set_str (tp, str, len_lo, powtab->base);
else
- ln = mpn_dc_set_str (tp, str, len_lo, powtab + 1, tp + powtab->n + sn + 1);
+ ln = mpn_dc_set_str (tp, str, len_lo, powtab - 1, tp + powtab->n + sn + 1);
if (ln != 0)
{
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sizeinbase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sizeinbase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sizeinbase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -33,7 +33,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqr_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -5,8 +5,8 @@
SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
-Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011 Free Software
-Foundation, Inc.
+Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011, 2017 Free
+Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -283,10 +282,45 @@
#endif
+#if ! defined (READY_WITH_mpn_sqr_basecase) && HAVE_NATIVE_mpn_sqr_diag_addlsh1
+
+/* mpn_sqr_basecase using mpn_addmul_1 and mpn_sqr_diag_addlsh1, avoiding stack
+ allocation. */
+void
+mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n)
+{
+ if (n == 1)
+ {
+ mp_limb_t ul, lpl;
+ ul = up[0];
+ umul_ppmm (rp[1], lpl, ul, ul << GMP_NAIL_BITS);
+ rp[0] = lpl >> GMP_NAIL_BITS;
+ }
+ else
+ {
+ mp_size_t i;
+ mp_ptr xp;
+
+ rp += 1;
+ rp[n - 1] = mpn_mul_1 (rp, up + 1, n - 1, up[0]);
+ for (i = n - 2; i != 0; i--)
+ {
+ up += 1;
+ rp += 2;
+ rp[i] = mpn_addmul_1 (rp, up + 1, i, up[0]);
+ }
+
+ xp = rp - 2 * n + 3;
+ mpn_sqr_diag_addlsh1 (xp, xp + 1, up - n + 2, n);
+ }
+}
+#define READY_WITH_mpn_sqr_basecase
+#endif
+
+
#if ! defined (READY_WITH_mpn_sqr_basecase)
/* Default mpn_sqr_basecase using mpn_addmul_1. */
-
void
mpn_sqr_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n)
{
@@ -295,14 +329,15 @@
ASSERT (n >= 1);
ASSERT (! MPN_OVERLAP_P (rp, 2*n, up, n));
- {
- mp_limb_t ul, lpl;
- ul = up[0];
- umul_ppmm (rp[1], lpl, ul, ul << GMP_NAIL_BITS);
- rp[0] = lpl >> GMP_NAIL_BITS;
- }
- if (n > 1)
+ if (n == 1)
{
+ mp_limb_t ul, lpl;
+ ul = up[0];
+ umul_ppmm (rp[1], lpl, ul, ul << GMP_NAIL_BITS);
+ rp[0] = lpl >> GMP_NAIL_BITS;
+ }
+ else
+ {
mp_limb_t tarr[2 * SQR_TOOM2_THRESHOLD];
mp_ptr tp = tarr;
mp_limb_t cy;
@@ -322,4 +357,5 @@
MPN_SQR_DIAG_ADDLSH1 (rp, tp, up, n);
}
}
+#define READY_WITH_mpn_sqr_basecase
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo_basecase.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo_basecase.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrlo_basecase.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -5,8 +5,8 @@
SAFE TO REACH THIS FUNCTION THROUGH DOCUMENTED INTERFACES.
-Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011, 2015
-Free Software Foundation, Inc.
+Copyright 1991-1994, 1996, 1997, 2000-2005, 2008, 2010, 2011, 2015,
+2016 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -99,6 +98,14 @@
#ifndef SQRLO_SPECIAL_CASES
#define SQRLO_SPECIAL_CASES 2
#endif
+
+#if TUNE_PROGRAM_BUILD || WANT_FAT_BINARY
+#define MAYBE_special_cases 1
+#else
+#define MAYBE_special_cases \
+ ((SQRLO_BASECASE_THRESHOLD <= SQRLO_SPECIAL_CASES) && (SQRLO_DC_THRESHOLD != 0))
+#endif
+
void
mpn_sqrlo_basecase (mp_ptr rp, mp_srcptr up, mp_size_t n)
{
@@ -109,7 +116,7 @@
ul = up[0];
- if (n <= SQRLO_SPECIAL_CASES)
+ if (MAYBE_special_cases && n <= SQRLO_SPECIAL_CASES)
{
#if SQRLO_SPECIAL_CASES == 1
rp[0] = (ul * ul) & GMP_NUMB_MASK;
@@ -179,3 +186,9 @@
}
}
#undef SQRLO_SPECIAL_CASES
+#undef MAYBE_special_cases
+#undef SQRLO_BASECASE_ALLOC
+#undef SQRLO_SHORTCUT_MULTIPLICATIONS
+#undef MPN_SQR_DIAGONAL
+#undef MPN_SQRLO_DIAGONAL
+#undef MPN_SQRLO_DIAG_ADDLSH1
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrmod_bnm1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrmod_bnm1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrmod_bnm1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -75,7 +74,7 @@
ASSERT (tp[2*rn] < GMP_NUMB_MAX);
cy = tp[2*rn] + mpn_sub_n (rp, tp, tp+rn, rn);
rp[rn] = 0;
- MPN_INCR_U (rp, rn+1, cy );
+ MPN_INCR_U (rp, rn+1, cy);
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrtrem.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrtrem.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sqrtrem.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,12 +3,12 @@
Contributed to the GNU project by Paul Zimmermann (most code),
Torbjorn Granlund (mpn_sqrtrem1) and Marco Bodrato (mpn_dc_sqrt).
- THE FUNCTIONS IN THIS FILE EXCEPT mpn_sqrtrem ARE INTERNAL WITH A
- MUTABLE INTERFACE. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED
- INTERFACES. IN FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR
- DISAPPEAR IN A FUTURE GMP RELEASE.
+ THE FUNCTIONS IN THIS FILE EXCEPT mpn_sqrtrem ARE INTERNAL WITH MUTABLE
+ INTERFACES. IT IS ONLY SAFE TO REACH THEM THROUGH DOCUMENTED INTERFACES.
+ IN FACT, IT IS ALMOST GUARANTEED THAT THEY WILL CHANGE OR DISAPPEAR IN A
+ FUTURE GMP RELEASE.
-Copyright 1999-2002, 2004, 2005, 2008, 2010, 2012, 2015 Free Software
+Copyright 1999-2002, 2004, 2005, 2008, 2010, 2012, 2015, 2017 Free Software
Foundation, Inc.
This file is part of the GNU MP Library.
@@ -44,7 +44,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
#define USE_DIVAPPR_Q 1
@@ -167,12 +166,24 @@
#define Prec (GMP_NUMB_BITS >> 1)
+#if ! defined(SQRTREM2_INPLACE)
+#define SQRTREM2_INPLACE 0
+#endif
/* same as mpn_sqrtrem, but for size=2 and {np, 2} normalized
return cc such that {np, 2} = sp[0]^2 + cc*2^GMP_NUMB_BITS + rp[0] */
+#if SQRTREM2_INPLACE
+#define CALL_SQRTREM2_INPLACE(sp,rp) mpn_sqrtrem2 (sp, rp)
static mp_limb_t
+mpn_sqrtrem2 (mp_ptr sp, mp_ptr rp)
+{
+ mp_srcptr np = rp;
+#else
+#define CALL_SQRTREM2_INPLACE(sp,rp) mpn_sqrtrem2 (sp, rp, rp)
+static mp_limb_t
mpn_sqrtrem2 (mp_ptr sp, mp_ptr rp, mp_srcptr np)
{
+#endif
mp_limb_t q, u, np0, sp0, rp0, q2;
int cc;
@@ -223,44 +234,43 @@
int c, b; /* carry out of remainder */
mp_size_t l, h;
+ ASSERT (n > 1);
ASSERT (np[2 * n - 1] >= GMP_NUMB_HIGHBIT / 2);
- if (n == 1)
- c = mpn_sqrtrem2 (sp, np, np);
+ l = n / 2;
+ h = n - l;
+ if (h == 1)
+ q = CALL_SQRTREM2_INPLACE (sp + l, np + 2 * l);
else
+ q = mpn_dc_sqrtrem (sp + l, np + 2 * l, h, 0, scratch);
+ if (q != 0)
+ ASSERT_CARRY (mpn_sub_n (np + 2 * l, np + 2 * l, sp + l, h));
+ TRACE(printf("tdiv_qr(,,,,%u,,%u) -> %u\n", (unsigned) n, (unsigned) h, (unsigned) (n - h + 1)));
+ mpn_tdiv_qr (scratch, np + l, 0, np + l, n, sp + l, h);
+ q += scratch[l];
+ c = scratch[0] & 1;
+ mpn_rshift (sp, scratch, l, 1);
+ sp[l - 1] |= (q << (GMP_NUMB_BITS - 1)) & GMP_NUMB_MASK;
+ if (UNLIKELY ((sp[0] & approx) != 0)) /* (sp[0] & mask) > 1 */
+ return 1; /* Remainder is non-zero */
+ q >>= 1;
+ if (c != 0)
+ c = mpn_add_n (np + l, np + l, sp + l, h);
+ TRACE(printf("sqr(,,%u)\n", (unsigned) l));
+ mpn_sqr (np + n, sp, l);
+ b = q + mpn_sub_n (np, np, np + n, 2 * l);
+ c -= (l == h) ? b : mpn_sub_1 (np + 2 * l, np + 2 * l, 1, (mp_limb_t) b);
+
+ if (c < 0)
{
- l = n / 2;
- h = n - l;
- q = mpn_dc_sqrtrem (sp + l, np + 2 * l, h, 0, scratch);
- if (q != 0)
- ASSERT_CARRY (mpn_sub_n (np + 2 * l, np + 2 * l, sp + l, h));
- TRACE(printf("tdiv_qr(,,,,%u,,%u) -> %u\n", (unsigned) n, (unsigned) h, (unsigned) (n - h + 1)));
- mpn_tdiv_qr (scratch, np + l, 0, np + l, n, sp + l, h);
- q += scratch[l];
- c = scratch[0] & 1;
- mpn_rshift (sp, scratch, l, 1);
- sp[l - 1] |= (q << (GMP_NUMB_BITS - 1)) & GMP_NUMB_MASK;
- if (UNLIKELY ((sp[0] & approx) != 0)) /* (sp[0] & mask) > 1 */
- return 1; /* Remainder is non-zero */
- q >>= 1;
- if (c != 0)
- c = mpn_add_n (np + l, np + l, sp + l, h);
- TRACE(printf("sqr(,,%u)\n", (unsigned) l));
- mpn_sqr (np + n, sp, l);
- b = q + mpn_sub_n (np, np, np + n, 2 * l);
- c -= (l == h) ? b : mpn_sub_1 (np + 2 * l, np + 2 * l, 1, (mp_limb_t) b);
-
- if (c < 0)
- {
- q = mpn_add_1 (sp + l, sp + l, h, q);
+ q = mpn_add_1 (sp + l, sp + l, h, q);
#if HAVE_NATIVE_mpn_addlsh1_n_ip1 || HAVE_NATIVE_mpn_addlsh1_n
- c += mpn_addlsh1_n_ip1 (np, sp, n) + 2 * q;
+ c += mpn_addlsh1_n_ip1 (np, sp, n) + 2 * q;
#else
- c += mpn_addmul_1 (np, sp, n, CNST_LIMB(2)) + 2 * q;
+ c += mpn_addmul_1 (np, sp, n, CNST_LIMB(2)) + 2 * q;
#endif
- c -= mpn_sub_1 (np, np, n, CNST_LIMB(1));
- q -= mpn_sub_1 (sp, sp, n, CNST_LIMB(1));
- }
+ c -= mpn_sub_1 (np, np, n, CNST_LIMB(1));
+ q -= mpn_sub_1 (sp, sp, n, CNST_LIMB(1));
}
return c;
@@ -420,7 +430,7 @@
mp_size_t
mpn_sqrtrem (mp_ptr sp, mp_ptr rp, mp_srcptr np, mp_size_t nn)
{
- mp_limb_t *tp, s0[1], cc, high, rl;
+ mp_limb_t cc, high, rl;
int c;
mp_size_t rn, tn;
TMP_DECL;
@@ -459,6 +469,32 @@
}
return rl != 0;
}
+ if (nn == 2) {
+ mp_limb_t tp [2];
+ if (rp == NULL) rp = tp;
+ if (c == 0)
+ {
+#if SQRTREM2_INPLACE
+ rp[1] = high;
+ rp[0] = np[0];
+ cc = CALL_SQRTREM2_INPLACE (sp, rp);
+#else
+ cc = mpn_sqrtrem2 (sp, rp, np);
+#endif
+ rp[1] = cc;
+ return ((rp[0] | cc) != 0) + cc;
+ }
+ else
+ {
+ rl = np[0];
+ rp[1] = (high << (2*c)) | (rl >> (GMP_NUMB_BITS - 2*c));
+ rp[0] = rl << (2*c);
+ CALL_SQRTREM2_INPLACE (sp, rp);
+ cc = sp[0] >>= c; /* c != 0, the highest bit of the root cc is 0. */
+ rp[0] = rl -= cc*cc; /* Computed modulo 2^GMP_LIMB_BITS, because it's smaller. */
+ return rl != 0;
+ }
+ }
tn = (nn + 1) / 2; /* 2*tn is the smallest even integer >= nn */
if ((rp == NULL) && (nn > 8))
@@ -466,8 +502,8 @@
TMP_MARK;
if (((nn & 1) | c) != 0)
{
- mp_limb_t mask;
- mp_ptr scratch;
+ mp_limb_t s0[1], mask;
+ mp_ptr tp, scratch;
TMP_ALLOC_LIMBS_2 (tp, 2 * tn, scratch, tn / 2 + 1);
tp[0] = 0; /* needed only when 2*tn > nn, but saves a test */
if (c != 0)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/strongfibo.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/strongfibo.c (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/strongfibo.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,216 @@
+/* mpn_fib2m -- calculate Fibonacci numbers, modulo m.
+
+Contributed to the GNU project by Marco Bodrato.
+
+ THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY. THEY'RE ALMOST
+ CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
+ FUTURE GNU MP RELEASES.
+
+Copyright 2001, 2002, 2005, 2009, 2018 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#include <stdio.h>
+#include "gmp-impl.h"
+
+/* Stores |{ap,n}-{bp,n}| in {rp,n},
+ returns the sign of {ap,n}-{bp,n}. */
+static int
+abs_sub_n (mp_ptr rp, mp_srcptr ap, mp_srcptr bp, mp_size_t n)
+{
+ mp_limb_t x, y;
+ while (--n >= 0)
+ {
+ x = ap[n];
+ y = bp[n];
+ if (x != y)
+ {
+ ++n;
+ if (x > y)
+ {
+ ASSERT_NOCARRY (mpn_sub_n (rp, ap, bp, n));
+ return 1;
+ }
+ else
+ {
+ ASSERT_NOCARRY (mpn_sub_n (rp, bp, ap, n));
+ return -1;
+ }
+ }
+ rp[n] = 0;
+ }
+ return 0;
+}
+
+/* Computes at most count terms of the sequence needed by the
+ Lucas-Lehmer-Riesel test, indexing backward:
+ L_i = L_{i+1}^2 - 2
+
+ The sequence is computed modulo M = {mp, mn}.
+ The starting point is given in L_{count+1} = {lp, mn}.
+ The scratch pointed by sp, needs a space of at least 3 * mn + 1 limbs.
+
+ Returns the index i>0 if L_i = 0 (mod M) is found within the
+ computed count terms of the sequence. Otherwise it returns zero.
+
+ Note: (+/-2)^2-2=2, (+/-1)^2-2=-1, 0^2-2=-2
+ */
+
+static mp_bitcnt_t
+mpn_llriter (mp_ptr lp, mp_srcptr mp, mp_size_t mn, mp_bitcnt_t count, mp_ptr sp)
+{
+ do
+ {
+ mpn_sqr (sp, lp, mn);
+ mpn_tdiv_qr (sp + 2 * mn, lp, 0, sp, 2 * mn, mp, mn);
+ if (lp[0] < 5)
+ {
+ /* If L^2 % M < 5, |L^2 % M - 2| <= 2 */
+ if (mn == 1 || mpn_zero_p (lp + 1, mn - 1))
+ return (lp[0] == 2) ? count : 0;
+ else
+ MPN_DECR_U (lp, mn, 2);
+ }
+ else
+ lp[0] -= 2;
+ } while (--count != 0);
+ return 0;
+}
+
+/* Store the Lucas' number L[n] at lp (maybe), computed modulo m. lp
+ and scratch should have room for mn*2+1 limbs.
+
+ Returns the size of L[n] normally.
+
+ If F[n] is zero modulo m, or L[n] is, returns 0 and lp is
+ undefined.
+*/
+
+static mp_size_t
+mpn_lucm (mp_ptr lp, mp_srcptr np, mp_size_t nn, mp_srcptr mp, mp_size_t mn, mp_ptr scratch)
+{
+ int neg;
+ mp_limb_t cy;
+
+ ASSERT (! MPN_OVERLAP_P (lp, MAX(2*mn+1,5), scratch, MAX(2*mn+1,5)));
+ ASSERT (nn > 0);
+
+ neg = mpn_fib2m (lp, scratch, np, nn, mp, mn);
+
+ /* F[n] = +/-{lp, mn}, F[n-1] = +/-{scratch, mn} */
+ if (mpn_zero_p (lp, mn))
+ return 0;
+
+ if (neg) /* One sign is opposite, use sub instead of add. */
+ {
+#if HAVE_NATIVE_mpn_rsblsh1_n || HAVE_NATIVE_mpn_sublsh1_n
+#if HAVE_NATIVE_mpn_rsblsh1_n
+ cy = mpn_rsblsh1_n (lp, lp, scratch, mn); /* L[n] = +/-(2F[n-1]-(-F[n])) */
+#else
+ cy = mpn_sublsh1_n (lp, lp, scratch, mn); /* L[n] = -/+(F[n]-(-2F[n-1])) */
+ if (cy != 0)
+ cy = mpn_add_n (lp, lp, mp, mn) - cy;
+#endif
+ if (cy > 1)
+ cy += mpn_add_n (lp, lp, mp, mn);
+#else
+ cy = mpn_lshift (scratch, scratch, mn, 1); /* 2F[n-1] */
+ if (UNLIKELY (cy))
+ cy -= mpn_sub_n (lp, scratch, lp, mn); /* L[n] = +/-(2F[n-1]-(-F[n])) */
+ else
+ abs_sub_n (lp, lp, scratch, mn);
+#endif
+ ASSERT (cy <= 1);
+ }
+ else
+ {
+#if HAVE_NATIVE_mpn_addlsh1_n
+ cy = mpn_addlsh1_n (lp, lp, scratch, mn); /* L[n] = +/-(2F[n-1]+F[n])) */
+#else
+ cy = mpn_lshift (scratch, scratch, mn, 1);
+ cy+= mpn_add_n (lp, lp, scratch, mn);
+#endif
+ ASSERT (cy <= 2);
+ }
+ while (cy || mpn_cmp (lp, mp, mn) >= 0)
+ cy -= mpn_sub_n (lp, lp, mp, mn);
+ MPN_NORMALIZE (lp, mn);
+ return mn;
+}
+
+int
+mpn_strongfibo (mp_srcptr mp, mp_size_t mn, mp_ptr scratch)
+{
+ mp_ptr lp, sp;
+ mp_size_t en;
+ mp_bitcnt_t b0;
+ TMP_DECL;
+
+#if GMP_NUMB_BITS % 4 == 0
+ b0 = mpn_scan0 (mp, 0);
+#else
+ {
+ mpz_t m = MPZ_ROINIT_N(mp, mn);
+ b0 = mpz_scan0 (m, 0);
+ }
+ if (UNLIKELY (b0 == mn * GMP_NUMB_BITS))
+ {
+ en = 1;
+ scratch [0] = 1;
+ }
+ else
+#endif
+ {
+ int cnt = b0 % GMP_NUMB_BITS;
+ en = b0 / GMP_NUMB_BITS;
+ if (LIKELY (cnt != 0))
+ mpn_rshift (scratch, mp + en, mn - en, cnt);
+ else
+ MPN_COPY (scratch, mp + en, mn - en);
+ en = mn - en;
+ scratch [0] |= 1;
+ en -= scratch [en - 1] == 0;
+ }
+ TMP_MARK;
+
+ lp = TMP_ALLOC_LIMBS (4 * mn + 6);
+ sp = lp + 2 * mn + 3;
+ en = mpn_lucm (sp, scratch, en, mp, mn, lp);
+ if (en != 0 && LIKELY (--b0 != 0))
+ {
+ mpn_sqr (lp, sp, en);
+ lp [0] |= 2; /* V^2 + 2 */
+ if (LIKELY (2 * en >= mn))
+ mpn_tdiv_qr (sp, lp, 0, lp, 2 * en, mp, mn);
+ else
+ MPN_ZERO (lp + 2 * en, mn - 2 * en);
+ if (! mpn_zero_p (lp, mn) && LIKELY (--b0 != 0))
+ b0 = mpn_llriter (lp, mp, mn, b0, lp + mn + 1);
+ }
+ TMP_FREE;
+ return (b0 != 0);
+}
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/strongfibo.c
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_sub 1
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_sub_1 1
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err1_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err1_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err1_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err2_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err2_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err2_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err3_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err3_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_err3_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/*
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_n.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_n.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/sub_n.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/submul_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/submul_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/submul_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,7 +31,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -39,30 +38,36 @@
#if GMP_NAIL_BITS == 0
mp_limb_t
-mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t v0)
{
- mp_limb_t ul, cl, hpl, lpl, rl;
+ mp_limb_t u0, crec, c, p1, p0, r0;
ASSERT (n >= 1);
ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
- cl = 0;
+ crec = 0;
do
{
- ul = *up++;
- umul_ppmm (hpl, lpl, ul, vl);
+ u0 = *up++;
+ umul_ppmm (p1, p0, u0, v0);
- lpl += cl;
- cl = (lpl < cl) + hpl;
+ r0 = *rp;
- rl = *rp;
- lpl = rl - lpl;
- cl += lpl > rl;
- *rp++ = lpl;
+ p0 = r0 - p0;
+ c = r0 < p0;
+
+ p1 = p1 + c;
+
+ r0 = p0 - crec; /* cycle 0, 3, ... */
+ c = p0 < r0; /* cycle 1, 4, ... */
+
+ crec = p1 + c; /* cycle 2, 5, ... */
+
+ *rp++ = r0;
}
while (--n != 0);
- return cl;
+ return crec;
}
#endif
@@ -70,35 +75,35 @@
#if GMP_NAIL_BITS == 1
mp_limb_t
-mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t v0)
{
- mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, cl, xl, c1, c2, c3;
+ mp_limb_t shifted_v0, u0, r0, p0, p1, prev_p1, cl, xl, c1, c2, c3;
ASSERT (n >= 1);
ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
ASSERT_MPN (rp, n);
ASSERT_MPN (up, n);
- ASSERT_LIMB (vl);
+ ASSERT_LIMB (v0);
- shifted_vl = vl << GMP_NAIL_BITS;
+ shifted_v0 = v0 << GMP_NAIL_BITS;
cl = 0;
- prev_hpl = 0;
+ prev_p1 = 0;
do
{
- ul = *up++;
- rl = *rp;
- umul_ppmm (hpl, lpl, ul, shifted_vl);
- lpl >>= GMP_NAIL_BITS;
- SUBC_LIMB (c1, xl, rl, prev_hpl);
- SUBC_LIMB (c2, xl, xl, lpl);
+ u0 = *up++;
+ r0 = *rp;
+ umul_ppmm (p1, p0, u0, shifted_v0);
+ p0 >>= GMP_NAIL_BITS;
+ SUBC_LIMB (c1, xl, r0, prev_p1);
+ SUBC_LIMB (c2, xl, xl, p0);
SUBC_LIMB (c3, xl, xl, cl);
cl = c1 + c2 + c3;
*rp++ = xl;
- prev_hpl = hpl;
+ prev_p1 = p1;
}
while (--n != 0);
- return prev_hpl + cl;
+ return prev_p1 + cl;
}
#endif
@@ -106,34 +111,34 @@
#if GMP_NAIL_BITS >= 2
mp_limb_t
-mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t vl)
+mpn_submul_1 (mp_ptr rp, mp_srcptr up, mp_size_t n, mp_limb_t v0)
{
- mp_limb_t shifted_vl, ul, rl, lpl, hpl, prev_hpl, xw, cl, xl;
+ mp_limb_t shifted_v0, u0, r0, p0, p1, prev_p1, xw, cl, xl;
ASSERT (n >= 1);
ASSERT (MPN_SAME_OR_SEPARATE_P (rp, up, n));
ASSERT_MPN (rp, n);
ASSERT_MPN (up, n);
- ASSERT_LIMB (vl);
+ ASSERT_LIMB (v0);
- shifted_vl = vl << GMP_NAIL_BITS;
+ shifted_v0 = v0 << GMP_NAIL_BITS;
cl = 0;
- prev_hpl = 0;
+ prev_p1 = 0;
do
{
- ul = *up++;
- rl = *rp;
- umul_ppmm (hpl, lpl, ul, shifted_vl);
- lpl >>= GMP_NAIL_BITS;
- xw = rl - (prev_hpl + lpl) + cl;
+ u0 = *up++;
+ r0 = *rp;
+ umul_ppmm (p1, p0, u0, shifted_v0);
+ p0 >>= GMP_NAIL_BITS;
+ xw = r0 - (prev_p1 + p0) + cl;
cl = (mp_limb_signed_t) xw >> GMP_NUMB_BITS; /* FIXME: non-portable */
xl = xw & GMP_NUMB_MASK;
*rp++ = xl;
- prev_hpl = hpl;
+ prev_p1 = p1;
}
while (--n != 0);
- return prev_hpl - cl;
+ return prev_p1 - cl;
}
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/tdiv_qr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/tdiv_qr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/tdiv_qr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -5,13 +5,13 @@
operands are unaffected.
Preconditions:
- 1. The most significant limb of of the divisor must be non-zero.
+ 1. The most significant limb of the divisor must be non-zero.
2. nn >= dn, even if qxn is non-zero. (??? relax this ???)
The time complexity of this is O(qn*qn+M(dn,qn)), where M(m,n) is the time
complexity of multiplication.
-Copyright 1997, 2000-2002, 2005, 2009 Free Software Foundation, Inc.
+Copyright 1997, 2000-2002, 2005, 2009, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -39,7 +39,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -69,7 +68,7 @@
case 2:
{
- mp_ptr n2p, d2p;
+ mp_ptr n2p;
mp_limb_t qhl, cy;
TMP_DECL;
TMP_MARK;
@@ -76,10 +75,9 @@
if ((dp[1] & GMP_NUMB_HIGHBIT) == 0)
{
int cnt;
- mp_limb_t dtmp[2];
+ mp_limb_t d2p[2];
count_leading_zeros (cnt, dp[1]);
cnt -= GMP_NAIL_BITS;
- d2p = dtmp;
d2p[1] = (dp[1] << cnt) | (dp[0] >> (GMP_NUMB_BITS - cnt));
d2p[0] = (dp[0] << cnt) & GMP_NUMB_MASK;
n2p = TMP_ALLOC_LIMBS (nn + 1);
@@ -94,10 +92,9 @@
}
else
{
- d2p = (mp_ptr) dp;
n2p = TMP_ALLOC_LIMBS (nn);
MPN_COPY (n2p, np, nn);
- qhl = mpn_divrem_2 (qp, 0L, n2p, nn, d2p);
+ qhl = mpn_divrem_2 (qp, 0L, n2p, nn, dp);
qp[nn - 2] = qhl; /* always store nn-2+1 quotient limbs */
rp[0] = n2p[0];
rp[1] = n2p[1];
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom22_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom22_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom22_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -7,7 +7,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2006-2010, 2012, 2014 Free Software Foundation, Inc.
+Copyright 2006-2010, 2012, 2014, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, 0, +inf
@@ -196,16 +195,27 @@
if (vm1_neg)
cy += mpn_add_n (pp + n, pp + n, vm1, 2 * n);
- else
+ else {
cy -= mpn_sub_n (pp + n, pp + n, vm1, 2 * n);
+ if (UNLIKELY (cy + 1 == 0)) { /* cy is negative */
+ /* The total contribution of v0+vinf-vm1 can not be negative. */
+#if WANT_ASSERT
+ /* The borrow in cy stops the propagation of the carry cy2, */
+ ASSERT (cy2 == 1);
+ cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, cy2);
+ ASSERT (cy == 0);
+#else
+ /* we simply fill the area with zeros. */
+ MPN_FILL (pp + 2 * n, n, 0);
+#endif
+ return;
+ }
+ }
- ASSERT (cy + 1 <= 3);
+ ASSERT (cy <= 2);
ASSERT (cy2 <= 2);
MPN_INCR_U (pp + 2 * n, s + t, cy2);
- if (LIKELY (cy <= 2))
- /* if s+t==n, cy is zero, but we should not acces pp[3*n] at all. */
- MPN_INCR_U (pp + 3 * n, s + t - n, cy);
- else
- MPN_DECR_U (pp + 3 * n, s + t - n, 1);
+ /* if s+t==n, cy is zero, but we should not access pp[3*n] at all. */
+ MPN_INCR_U (pp + 3 * n, s + t - n, cy);
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom2_sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom2_sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom2_sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2006-2010, 2012, 2014 Free Software Foundation, Inc.
+Copyright 2006-2010, 2012, 2014, 2018 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, 0, +inf
@@ -135,12 +134,22 @@
cy -= mpn_sub_n (pp + n, pp + n, vm1, 2 * n);
- ASSERT (cy + 1 <= 3);
+ ASSERT (cy + 1 <= 3);
ASSERT (cy2 <= 2);
- MPN_INCR_U (pp + 2 * n, s + s, cy2);
- if (LIKELY (cy <= 2))
+ if (LIKELY (cy <= 2)) {
+ MPN_INCR_U (pp + 2 * n, s + s, cy2);
MPN_INCR_U (pp + 3 * n, s + s - n, cy);
- else
- MPN_DECR_U (pp + 3 * n, s + s - n, 1);
+ } else { /* cy is negative */
+ /* The total contribution of v0+vinf-vm1 can not be negative. */
+#if WANT_ASSERT
+ /* The borrow in cy stops the propagation of the carry cy2, */
+ ASSERT (cy2 == 1);
+ cy += mpn_add_1 (pp + 2 * n, pp + 2 * n, n, cy2);
+ ASSERT (cy == 0);
+#else
+ /* we simply fill the area with zeros. */
+ MPN_FILL (pp + 2 * n, n, 0);
+#endif
+ }
}
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom32_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom32_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom32_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -40,7 +40,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, 0, +1, +inf
@@ -105,7 +104,7 @@
/* FIXME: Keep v1[2*n] and vm1[2*n] in scalar variables? */
- /* Compute ap1 = a0 + a1 + a3, am1 = a0 - a1 + a3 */
+ /* Compute ap1 = a0 + a1 + a2, am1 = a0 - a1 + a2 */
ap1_hi = mpn_add (ap1, a0, n, a2, s);
#if HAVE_NATIVE_mpn_add_n_sub_n
if (ap1_hi == 0 && mpn_cmp (ap1, a1, n) < 0)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom33_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom33_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom33_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -8,7 +8,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2006-2008, 2010, 2012 Free Software Foundation, Inc.
+Copyright 2006-2008, 2010, 2012, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -37,7 +37,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, 0, +1, +2, +inf
@@ -283,8 +282,8 @@
}
else if (as1[n] != 0)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy = 2 * bs1[n] + mpn_addlsh1_n (v1 + n, v1 + n, bs1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy = 2 * bs1[n] + mpn_addlsh1_n_ip1 (v1 + n, bs1, n);
#else
cy = 2 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(2));
#endif
@@ -297,8 +296,8 @@
}
else if (bs1[n] != 0)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy += mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy += mpn_addlsh1_n_ip1 (v1 + n, as1, n);
#else
cy += mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom3_sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom3_sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom3_sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -7,7 +7,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2006-2010, 2012 Free Software Foundation, Inc.
+Copyright 2006-2010, 2012, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, 0, +1, +2, +inf
@@ -193,8 +192,8 @@
}
else if (as1[n] != 0)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy = 2 * as1[n] + mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy = 2 * as1[n] + mpn_addlsh1_n_ip1 (v1 + n, as1, n);
#else
cy = 2 * as1[n] + mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
#endif
@@ -207,8 +206,8 @@
}
else if (as1[n] != 0)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy += mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy += mpn_addlsh1_n_ip1 (v1 + n, as1, n);
#else
cy += mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -40,7 +40,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, 0, +1, +2, +inf
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mulmid.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mulmid.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom42_mulmid.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom43_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom43_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom43_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -39,7 +39,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -2, -1, 0, +1, +2, +inf
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom44_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom44_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom44_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -36,7 +36,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: 0, +1, -1, +2, -2, 1/2, +inf
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom4_sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom4_sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom4_sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -1, -1/2, 0, +1/2, +1, +2, +inf
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom52_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom52_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom52_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -39,7 +39,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: -2, -1, 0, +1, +2, +inf
@@ -161,7 +160,7 @@
/* Compute bs2 and bsm2, recycling bs1 and bsm1. bs2=bs1+b1; bsm2=bsm1-b1 */
mpn_add (bs2, bs1, n+1, b1, t);
- if (flags & toom6_vm1_neg )
+ if (flags & toom6_vm1_neg)
{
bsm2[n] = mpn_add (bsm2, bsm1, n, b1, t);
flags = (enum toom6_flags) (flags ^ toom6_vm2_neg);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom53_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom53_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom53_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -10,7 +10,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2006-2008, 2012, 2014 Free Software Foundation, Inc.
+Copyright 2006-2008, 2012, 2014, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -39,7 +39,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in: 0, +1, -1, +2, -2, 1/2, +inf
@@ -264,8 +263,8 @@
}
else if (asm1[n] == 2)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy = 2 * bsm1[n] + mpn_addlsh1_n (vm1 + n, vm1 + n, bsm1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy = 2 * bsm1[n] + mpn_addlsh1_n_ip1 (vm1 + n, bsm1, n);
#else
cy = 2 * bsm1[n] + mpn_addmul_1 (vm1 + n, bsm1, n, CNST_LIMB(2));
#endif
@@ -289,8 +288,8 @@
}
else if (as1[n] == 2)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy = 2 * bs1[n] + mpn_addlsh1_n (v1 + n, v1 + n, bs1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy = 2 * bs1[n] + mpn_addlsh1_n_ip1 (v1 + n, bs1, n);
#else
cy = 2 * bs1[n] + mpn_addmul_1 (v1 + n, bs1, n, CNST_LIMB(2));
#endif
@@ -307,8 +306,8 @@
}
else if (bs1[n] == 2)
{
-#if HAVE_NATIVE_mpn_addlsh1_n
- cy += mpn_addlsh1_n (v1 + n, v1 + n, as1, n);
+#if HAVE_NATIVE_mpn_addlsh1_n_ip1
+ cy += mpn_addlsh1_n_ip1 (v1 + n, as1, n);
#else
cy += mpn_addmul_1 (v1 + n, as1, n, CNST_LIMB(2));
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom54_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom54_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom54_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom62_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom62_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom62_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -39,7 +39,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluate in:
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom63_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom63_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom63_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Stores |{ap,n}-{bp,n}| in {rp,n}, returns the sign. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6_sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6_sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6_sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6h_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6h_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom6h_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8_sqr.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8_sqr.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8_sqr.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if GMP_NUMB_BITS < 29
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8h_mul.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8h_mul.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom8h_mul.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_couple_handling.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_couple_handling.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_couple_handling.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Gets {pp,n} and (sign?-1:1)*{np,n}. Computes at once:
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
int
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_dgr3_pm2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Needs n+1 limbs of temporary storage. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluates a polynomial of degree k > 3, in the points +1 and -1. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* DO_addlsh2(d,a,b,n,cy) computes cy,{d,n} <- {a,n} + 4*(cy,{b,n}), it
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2exp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2exp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2exp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
/* Evaluates a polynomial of degree k > 2, in the points +2^shift and -2^shift. */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2rexp.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2rexp.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_eval_pm2rexp.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if HAVE_NATIVE_mpn_addlsh_n
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_12pts.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_12pts.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_12pts.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2009, 2010, 2012 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2012, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
@@ -170,7 +169,7 @@
we want to compute f(2^(GMP_NUMB_BITS * n)) for a polynomial f of
degree 11 (or 10), given the 12 (rsp. 11) values:
- r0 = limit at infinity of f(x) / x^7,
+ r0 = limit at infinity of f(x) / x^11,
r1 = f(4),f(-4),
r2 = f(2),f(-2),
r3 = f(1),f(-1),
@@ -287,12 +286,22 @@
ASSERT_NOCARRY(mpn_sub_n (r3, r3, r2, n3p1));
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (r4, r2, r4, n3p1);
+ r4 [n3p1 - 1] &= GMP_NUMB_MASK >> 1;
+#else
mpn_sub_n (r4, r2, r4, n3p1);
ASSERT_NOCARRY(mpn_rshift(r4, r4, n3p1, 1));
+#endif
ASSERT_NOCARRY(mpn_sub_n (r2, r2, r4, n3p1));
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (r5, r5, r1, n3p1);
+ r5 [n3p1 - 1] &= GMP_NUMB_MASK >> 1;
+#else
mpn_add_n (r5, r5, r1, n3p1);
ASSERT_NOCARRY(mpn_rshift(r5, r5, n3p1, 1));
+#endif
/* last interpolation steps... */
ASSERT_NOCARRY(mpn_sub_n (r3, r3, r1, n3p1));
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_16pts.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_16pts.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_16pts.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -6,7 +6,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2009, 2010, 2012 Free Software Foundation, Inc.
+Copyright 2009, 2010, 2012, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,6 @@
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#if GMP_NUMB_BITS < 29
@@ -254,7 +253,7 @@
f(2^(GMP_NUMB_BITS * n)) for a polynomial f of degree 15 (or
14), given the 16 (rsp. 15) values:
- r0 = limit at infinity of f(x) / x^7,
+ r0 = limit at infinity of f(x) / x^15,
r1 = f(8),f(-8),
r2 = f(4),f(-4),
r3 = f(2),f(-2),
@@ -439,16 +438,31 @@
ASSERT_NOCARRY(mpn_sub_n (r4, r4, r3, n3p1));
ASSERT_NOCARRY(mpn_sub_n (r4, r4, r2, n3p1));
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (r6, r2, r6, n3p1);
+ r6 [n3p1 - 1] &= GMP_NUMB_MASK >> 1;
+#else
mpn_add_n (r6, r2, r6, n3p1);
ASSERT_NOCARRY(mpn_rshift(r6, r6, n3p1, 1));
+#endif
ASSERT_NOCARRY(mpn_sub_n (r2, r2, r6, n3p1));
+#ifdef HAVE_NATIVE_mpn_rsh1sub_n
+ mpn_rsh1sub_n (r5, r3, r5, n3p1);
+ r5 [n3p1 - 1] &= GMP_NUMB_MASK >> 1;
+#else
mpn_sub_n (r5, r3, r5, n3p1);
ASSERT_NOCARRY(mpn_rshift(r5, r5, n3p1, 1));
+#endif
ASSERT_NOCARRY(mpn_sub_n (r3, r3, r5, n3p1));
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (r7, r1, r7, n3p1);
+ r7 [n3p1 - 1] &= GMP_NUMB_MASK >> 1;
+#else
mpn_add_n (r7, r1, r7, n3p1);
ASSERT_NOCARRY(mpn_rshift(r7, r7, n3p1, 1));
+#endif
ASSERT_NOCARRY(mpn_sub_n (r1, r1, r7, n3p1));
/* last interpolation steps... */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_5pts.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_5pts.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_5pts.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_6pts.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_6pts.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_6pts.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,13 +34,14 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
+#define BINVERT_3 MODLIMB_INVERSE_3
+
/* For odd divisors, mpn_divexact_1 works fine with two's complement. */
#ifndef mpn_divexact_by3
-#if HAVE_NATIVE_mpn_pi1_bdiv_q_1 && MODLIMB_INVERSE_3
-#define mpn_divexact_by3(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,3,MODLIMB_INVERSE_3,0)
+#if HAVE_NATIVE_mpn_pi1_bdiv_q_1
+#define mpn_divexact_by3(dst,src,size) mpn_pi1_bdiv_q_1(dst,src,size,3,BINVERT_3,0)
#else
#define mpn_divexact_by3(dst,src,size) mpn_divexact_1(dst,src,size,3)
#endif
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_7pts.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_7pts.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_7pts.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -7,7 +7,7 @@
SAFE TO REACH IT THROUGH DOCUMENTED INTERFACES. IN FACT, IT IS ALMOST
GUARANTEED THAT IT WILL CHANGE OR DISAPPEAR IN A FUTURE GNU MP RELEASE.
-Copyright 2006, 2007, 2009, 2014 Free Software Foundation, Inc.
+Copyright 2006, 2007, 2009, 2014, 2015 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -35,7 +35,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#define BINVERT_3 MODLIMB_INVERSE_3
@@ -211,8 +210,14 @@
mpn_sub_n (w3, w3, w5, m);
mpn_divexact_by15 (w1, w1, m);
+#ifdef HAVE_NATIVE_mpn_rsh1add_n
+ mpn_rsh1add_n (w1, w1, w5, m);
+ w1[m - 1] &= GMP_NUMB_MASK >> 1;
+#else
mpn_add_n (w1, w1, w5, m); ASSERT (!(w1[0] & 1));
mpn_rshift (w1, w1, m, 1); /* w1>=0 now */
+#endif
+
mpn_sub_n (w5, w5, w1, m);
/* These bounds are valid for the 4x4 polynomial product of toom44,
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_8pts.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_8pts.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/toom_interpolate_8pts.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -34,7 +34,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#define BINVERT_3 MODLIMB_INVERSE_3
@@ -184,12 +183,12 @@
cy = mpn_add_n (pp + n, pp + n, r7, n); /* Hr8+Lr7-Lr5 */
cy-= mpn_sub_n (pp + n, pp + n, r5, n);
- if (0 > cy)
- MPN_DECR_U (r7 + n, 2*n + 1, 1);
- else
- MPN_INCR_U (r7 + n, 2*n + 1, cy);
+ if (cy > 0) {
+ MPN_INCR_U (r7 + n, 2*n + 1, 1);
+ cy = 0;
+ }
- cy = mpn_sub_n (pp + 2*n, r7 + n, r5 + n, n); /* Mr7-Mr5 */
+ cy = mpn_sub_nc (pp + 2*n, r7 + n, r5 + n, n, -cy); /* Mr7-Mr5 */
MPN_DECR_U (r7 + 2*n, n + 1, cy);
cy = mpn_add_n (pp + 3*n, r5, r7+ 2*n, n+1); /* Hr7+Lr5 */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/trialdiv.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/trialdiv.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/trialdiv.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -54,7 +54,6 @@
of the return value.
*/
-#include "gmp.h"
#include "gmp-impl.h"
struct gmp_primes_dtab {
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/udiv_w_sdiv.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/udiv_w_sdiv.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/udiv_w_sdiv.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -37,7 +37,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
void
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero_p.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero_p.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/generic/zero_p.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,5 +30,4 @@
#define __GMP_FORCE_mpn_zero_p 1
-#include "gmp.h"
#include "gmp-impl.h"
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,238 +0,0 @@
-dnl Itanium-2 mpn_gcd_1 -- mpn by 1 gcd.
-
-dnl Contributed to the GNU project by Kevin Ryde, innerloop by Torbjorn
-dnl Granlund.
-
-dnl Copyright 2002-2005, 2012, 2013, 2015 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-
-C cycles/bitpair (1x1 gcd)
-C Itanium: ?
-C Itanium 2: 5.1
-
-
-C mpn_gcd_1 (mp_srcptr xp, mp_size_t xsize, mp_limb_t y);
-C
-C The entry sequence is designed to expect xsize>1 and hence a modexact
-C call. This ought to be more common than a 1x1 operation. Our critical
-C path is thus stripping factors of 2 from y, calling modexact, then
-C stripping factors of 2 from the x remainder returned.
-C
-C The common factors of 2 between x and y must be determined using the
-C original x, not the remainder from the modexact. This is done with
-C x_orig which is xp[0]. There's plenty of time to do this while the rest
-C of the modexact etc is happening.
-C
-C It's possible xp[0] is zero. In this case the trailing zeros calculation
-C popc((x-1)&~x) gives 63, and that's clearly no less than what y will
-C have, making min(x_twos,y_twos) == y_twos.
-C
-C The main loop consists of transforming x,y to abs(x-y),min(x,y), and then
-C stripping factors of 2 from abs(x-y). Those factors of two are
-C determined from just y-x, without the abs(), since there's the same
-C number of trailing zeros on n or -n in twos complement. That makes the
-C dependent chain 8 cycles deep.
-C
-C The selection of x-y versus y-x for abs(x-y), and the selection of the
-C minimum of x and y, is done in parallel with the critical path.
-C
-C The algorithm takes about 0.68 iterations per bit (two N bit operands) on
-C average, hence the final 5.8 cycles/bitpair.
-C
-C Not done:
-C
-C An alternate algorithm which didn't strip all twos, but instead applied
-C tbit and predicated extr on x, and then y, was attempted. The loop was 6
-C cycles, but the algorithm is an average 1.25 iterations per bitpair for a
-C total 7.25 c/bp, which is slower than the current approach.
-C
-C Alternatives:
-C
-C Perhaps we could do something tricky by extracting a few high bits and a
-C few low bits from the operands, and looking up a table which would give a
-C set of predicates to control some shifts or subtracts or whatever. That
-C could knock off multiple bits per iteration.
-C
-C The right shifts are a bit of a bottleneck (shr at 2 or 3 cycles, or extr
-C only going down I0), perhaps it'd be possible to shift left instead,
-C using add. That would mean keeping track of the lowest not-yet-zeroed
-C bit, using some sort of mask.
-C
-C TODO:
-C * Once mod_1_N exists in assembly for Itanium, add conditional calls.
-C * Call bmod_1 even for n=1 when up[0] >> v0 (like other gcd_1 impls).
-C * Probably avoid popcnt also outside of loop, instead use ctz_table.
-
-ASM_START()
- .explicit C What does this mean?
-
-C HP's assembler requires these declarations for importing mpn_modexact_1c_odd
- .global mpn_modexact_1c_odd
- .type mpn_modexact_1c_odd, at function
-
-C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
-
-deflit(MAXSHIFT, 7)
-deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
-
-C .section ".rodata"
- .rodata
- ALIGN(m4_lshift(1,MAXSHIFT)) C align table to allow using dep
-ctz_table:
- data1 MAXSHIFT
-forloop(i,1,MASK,
-` data1 m4_count_trailing_zeros(i)
-')
-
-PROLOGUE(mpn_gcd_1)
-
- C r32 xp
- C r33 xsize
- C r34 y
-
-define(x, r8)
-define(xp_orig, r32)
-define(xsize, r33)
-define(y, r34) define(inputs, 3)
-define(save_rp, r35)
-define(save_pfs, r36)
-define(x_orig, r37)
-define(x_orig_one, r38)
-define(y_twos, r39) define(locals, 5)
-define(out_xp, r40)
-define(out_xsize, r41)
-define(out_divisor, r42)
-define(out_carry, r43) define(outputs, 4)
-
- .prologue
- {.mmi;
-ifdef(`HAVE_ABI_32',
-` addp4 r9 = 0, xp_orig define(xp,r9)', C M0
-` define(xp,xp_orig)')
- .save ar.pfs, save_pfs
- alloc save_pfs = ar.pfs, inputs, locals, outputs, 0 C M2
- .save rp, save_rp
- mov save_rp = b0 C I0
-}{.mbb; .body
- add r10 = -1, y C M3 y-1
- nop.b 0 C B0
- nop.b 0 C B1
- ;;
-
-}{.mmi; ld8 x = [xp] C M0 x = xp[0] if no modexact
- ld8 x_orig = [xp] C M1 orig x for common twos
- cmp.ne p6,p0 = 1, xsize C I0
-}{.mmi; andcm y_twos = r10, y C M2 (y-1)&~y
- mov out_xp = xp_orig C M3
- mov out_xsize = xsize C I1
- ;;
-}{.mmi; mov out_carry = 0 C M0
- nop.m 0 C M1
- popcnt y_twos = y_twos C I0 y twos
- ;;
-}{.mmi; add x_orig_one = -1, x_orig C M0 orig x-1
- nop.m 0 C M1
- shr.u out_divisor = y, y_twos C I0 y without twos
-}{.mib; nop.m 0 C M2
- shr.u y = y, y_twos C I1 y without twos
- (p6) br.call.sptk.many b0 = mpn_modexact_1c_odd C if xsize>1
- ;;
-}
- C modexact can leave x==0
- {.mmi; cmp.eq p6,p0 = 0, x C M0 if {xp,xsize} % y == 0
- andcm x_orig = x_orig_one, x_orig C M1 orig (x-1)&~x
- add r9 = -1, x C I0 x-1
- ;;
-}{.mmi; andcm r9 = r9, x C M0 (x-1)&~x
- nop.m 0 C M1
- mov b0 = save_rp C I0
- ;;
-}{.mii; nop.m 0 C M0
- popcnt x_orig = x_orig C I0 orig x twos
- popcnt r9 = r9 C I0 x twos
- ;;
-}{.mmi; cmp.lt p7,p0 = x_orig, y_twos C M0 orig x_twos < y_twos
- addl r22 = @ltoff(ctz_table), r1
- shr.u x = x, r9 C I0 x odd
- ;;
-}{.mib;
- (p7) mov y_twos = x_orig C M0 common twos
- add r10 = -1, y C I0 y-1
- (p6) br.dpnt.few L(done_y) C B0 x%y==0 then result y
- ;;
-}
- mov r25 = m4_lshift(MASK, MAXSHIFT)
- ld8 r22 = [r22]
- br L(ent)
- ;;
-
- ALIGN(32)
-L(top):
- .pred.rel "mutex", p6,p7
- {.mmi; (p7) mov y = x
- (p6) sub x = x, y
- dep r21 = r19, r22, 0, MAXSHIFT C concat(table,lowbits)
-}{.mmi; and r20 = MASK, r19
- (p7) mov x = r19
- nop 0
- ;;
-}
-L(mid):
-{.mmb; ld1 r16 = [r21]
- cmp.eq p10,p0 = 0, r20
- (p10) br.spnt.few.clr L(shift_alot)
- ;;
-}{.mmi; nop 0
- nop 0
- shr.u x = x, r16
- ;;
-}
-L(ent):
- {.mmi; sub r19 = y, x
- cmp.gtu p6,p7 = x, y
- cmp.ne p8,p0 = x, y
-}{.mmb; nop 0
- nop 0
- (p8) br.sptk.few.clr L(top)
-}
-
-L(done_y): C result is y
- mov ar.pfs = save_pfs C I0
- shl r8 = y, y_twos C I common factors of 2
- br.ret.sptk.many b0
-
-L(shift_alot):
- and r20 = x, r25
- shr.u x = x, MAXSHIFT
- ;;
- dep r21 = x, r22, 0, MAXSHIFT
- br L(mid)
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,110 @@
+dnl Itanium-2 mpn_gcd_11
+
+dnl Copyright 2002-2005, 2012, 2013, 2015, 2019 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+
+C cycles/bitpair (1x1 gcd)
+C Itanium: ?
+C Itanium 2: 4.5
+
+
+ASM_START()
+
+C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
+
+deflit(MAXSHIFT, 7)
+deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
+
+ .rodata
+ ALIGN(m4_lshift(1,MAXSHIFT)) C align table to allow using dep
+ctz_table:
+ data1 MAXSHIFT
+forloop(i,1,MASK,
+` data1 m4_count_trailing_zeros(i)-1
+')
+
+define(`x0', r32)
+define(`y0', r33)
+
+PROLOGUE(mpn_gcd_11)
+ .prologue
+ .body
+ addl r22 = @ltoff(ctz_table), r1
+ ;;
+ ld8 r22 = [r22]
+ br L(ent)
+ ;;
+
+ ALIGN(32)
+L(top):
+ .pred.rel "mutex", p6,p7
+ {.mmi; (p7) mov y0 = x0
+ (p6) sub x0 = x0, y0
+ dep r21 = r19, r22, 0, MAXSHIFT C concat(table,lowbits)
+}{.mmi; and r20 = MASK, r19
+ (p7) mov x0 = r19
+ and r23 = 6, r19
+ ;;
+}{.mmi; cmp.eq p6,p0 = 4, r23
+ cmp.eq p7,p0 = 0, r23
+ shr.u x0 = x0, 1 C shift-by-1, always OK
+}{.mmb; ld1 r16 = [r21]
+ cmp.eq p10,p0 = 0, r20
+ (p10) br.spnt.few.clr L(count_better)
+ ;;
+}
+L(bck):
+ .pred.rel "mutex", p6,p7
+ {.mii; nop 0
+ (p6) shr.u x0 = x0, 1 C u was ...100 before shift-by-1 above
+ (p7) shr.u x0 = x0, r16 C u was ...000 before shift-by-1 above
+ ;;
+}
+L(ent):
+ {.mmi; sub r19 = y0, x0
+ cmp.gtu p6,p7 = x0, y0
+ cmp.ne p8,p0 = x0, y0
+}{.mmb; nop 0
+ nop 0
+ (p8) br.sptk.few.clr L(top)
+}
+
+L(end): mov r8 = y0
+ br.ret.sptk.many b0
+
+L(count_better):
+ add r20 = -1, x0
+ ;;
+ andcm r23 = r20, x0
+ ;;
+ popcnt r16 = r23
+ br L(bck)
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/ia64/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2000-2005, 2009-2011, 2014, 2015 Free Software Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -31,174 +31,182 @@
#define GMP_LIMB_BITS 64
#define GMP_LIMB_BYTES 8
-/* 900MHz Itanium2 (titanic.gmplib.org) */
-/* FFT tuning limit = 60 M */
-/* Generated by tuneup.c, 2015-10-11, gcc 4.4 */
+/* 900MHz Itanium2 (olympic.gmplib.org) */
+/* FFT tuning limit = 59,194,709 */
+/* Generated by tuneup.c, 2019-10-13, gcc 4.2 */
-#define MOD_1_1P_METHOD 2
+#define MOD_1_1P_METHOD 2 /* 17.40% faster than 1 */
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 3
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 26
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 18
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1N_PI1_METHOD 1 /* 1.35% faster than 2 */
#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DIV_QR_2_PI2_THRESHOLD 12
+#define DIV_QR_2_PI2_THRESHOLD 10
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
#define BMOD_1_TO_MOD_1_THRESHOLD MP_SIZE_T_MAX /* never */
-#define MUL_TOOM22_THRESHOLD 39
-#define MUL_TOOM33_THRESHOLD 129
-#define MUL_TOOM44_THRESHOLD 214
-#define MUL_TOOM6H_THRESHOLD 318
-#define MUL_TOOM8H_THRESHOLD 430
+#define DIV_1_VS_MUL_1_PERCENT 316
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 121
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 145
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 124
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 151
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 201
+#define MUL_TOOM22_THRESHOLD 47
+#define MUL_TOOM33_THRESHOLD 89
+#define MUL_TOOM44_THRESHOLD 220
+#define MUL_TOOM6H_THRESHOLD 327
+#define MUL_TOOM8H_THRESHOLD 454
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 153
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 143
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 153
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 226
+
#define SQR_BASECASE_THRESHOLD 11
-#define SQR_TOOM2_THRESHOLD 85
-#define SQR_TOOM3_THRESHOLD 131
-#define SQR_TOOM4_THRESHOLD 494
-#define SQR_TOOM6_THRESHOLD 0 /* always */
-#define SQR_TOOM8_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 98
+#define SQR_TOOM3_THRESHOLD 135
+#define SQR_TOOM4_THRESHOLD 272
+#define SQR_TOOM6_THRESHOLD 354
+#define SQR_TOOM8_THRESHOLD 490
-#define MULMID_TOOM42_THRESHOLD 98
+#define MULMID_TOOM42_THRESHOLD 99
#define MULMOD_BNM1_THRESHOLD 23
-#define SQRMOD_BNM1_THRESHOLD 25
+#define SQRMOD_BNM1_THRESHOLD 27
-#define MUL_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 840 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 500, 5}, { 29, 6}, { 35, 7}, { 18, 6}, \
- { 37, 7}, { 19, 6}, { 39, 7}, { 33, 8}, \
- { 17, 7}, { 37, 8}, { 19, 7}, { 39, 8}, \
- { 21, 7}, { 43, 8}, { 37, 9}, { 19, 8}, \
- { 43, 9}, { 23, 8}, { 49, 9}, { 27, 8}, \
- { 57, 9}, { 43,10}, { 23, 9}, { 59,10}, \
- { 31, 9}, { 71,10}, { 39, 9}, { 87,10}, \
+ { { 840, 5}, { 30, 6}, { 16, 5}, { 33, 6}, \
+ { 17, 5}, { 36, 6}, { 35, 7}, { 18, 6}, \
+ { 37, 7}, { 19, 6}, { 42, 7}, { 37, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 47, 8}, \
+ { 43, 9}, { 23, 8}, { 51, 9}, { 27, 8}, \
+ { 57, 9}, { 31, 8}, { 63, 9}, { 35, 8}, \
+ { 71, 9}, { 43,10}, { 23, 9}, { 55,10}, \
+ { 31, 9}, { 71,10}, { 39, 9}, { 83,10}, \
{ 47, 9}, { 99,10}, { 55,11}, { 31,10}, \
{ 87,11}, { 47,10}, { 111,12}, { 31,11}, \
- { 63,10}, { 143,11}, { 79,10}, { 167,11}, \
+ { 63,10}, { 135,11}, { 79,10}, { 167,11}, \
{ 95,10}, { 191,11}, { 111,12}, { 63,11}, \
{ 143,10}, { 287,11}, { 159,12}, { 95,11}, \
- { 191,10}, { 399,11}, { 207,10}, { 431,13}, \
- { 63,12}, { 127,11}, { 271,10}, { 543,11}, \
- { 287,10}, { 575,11}, { 303,12}, { 159,11}, \
- { 335,10}, { 671,11}, { 367,12}, { 191,11}, \
- { 431,12}, { 223,13}, { 127,12}, { 255,11}, \
- { 543,12}, { 287,11}, { 607,12}, { 351,11}, \
- { 703,13}, { 191,12}, { 415,11}, { 863,12}, \
- { 447,14}, { 127,13}, { 255,12}, { 607,13}, \
- { 319,12}, { 735,13}, { 383,12}, { 863,13}, \
- { 447,12}, { 927,11}, { 1855,12}, { 959,14}, \
- { 255,13}, { 575,12}, { 1247,13}, { 703,14}, \
- { 383,13}, { 831,12}, { 1727,13}, { 895,12}, \
- { 1791,15}, { 255,14}, { 511,13}, { 1087,12}, \
- { 2175,13}, { 1151,14}, { 639,13}, { 1343,12}, \
- { 2687,13}, { 1471,14}, { 767,13}, { 1599,12}, \
- { 3199,13}, { 1663,14}, { 895,13}, { 1855,15}, \
- { 511,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
- { 2431,14}, { 1279,13}, { 2687,14}, { 1407,15}, \
- { 767,14}, { 1663,13}, { 3455,14}, { 1791,16}, \
- { 511,15}, { 1023,14}, { 2431,15}, { 1279,14}, \
- { 2943,15}, { 1535,14}, { 3455,15}, { 1791,14}, \
- { 16384,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
- { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
- {4194304,23}, {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 142
-#define MUL_FFT_THRESHOLD 5760
+ { 207,13}, { 63,12}, { 127,11}, { 271,12}, \
+ { 159,11}, { 335,10}, { 671,12}, { 191,10}, \
+ { 799,12}, { 223,13}, { 127,12}, { 287,11}, \
+ { 607,12}, { 319,11}, { 671,13}, { 191,12}, \
+ { 383,11}, { 799,10}, { 1599,12}, { 415,11}, \
+ { 863,14}, { 127,13}, { 255,12}, { 543,11}, \
+ { 1119,12}, { 607,13}, { 319,12}, { 735,11}, \
+ { 1471,12}, { 863,13}, { 447,12}, { 927,11}, \
+ { 1855,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1055,11}, { 2111,12}, { 1119,13}, { 575,12}, \
+ { 1247,13}, { 639,12}, { 1311,13}, { 703,12}, \
+ { 1471,13}, { 831,12}, { 1727,13}, { 895,12}, \
+ { 1791,13}, { 959,15}, { 255,14}, { 511,13}, \
+ { 1087,12}, { 2239,13}, { 1215,14}, { 639,13}, \
+ { 1471,14}, { 767,13}, { 1727,14}, { 895,13}, \
+ { 1855,12}, { 3711,13}, { 1919,15}, { 511,14}, \
+ { 1023,13}, { 2111,12}, { 4223,13}, { 2175,14}, \
+ { 1151,13}, { 2495,14}, { 1279,13}, { 2623,14}, \
+ { 1407,15}, { 767,14}, { 1663,13}, { 3455,14}, \
+ { 1919,16}, { 511,15}, { 1023,14}, { 2175,13}, \
+ { 4479,14}, { 2431,15}, { 1279,14}, { 2943,15}, \
+ { 1535,14}, { 3455,15}, { 1791,14}, { 16384,15}, \
+ { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
+ { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
+ {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 149
+#define MUL_FFT_THRESHOLD 8576
-#define SQR_FFT_MODF_THRESHOLD 464 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 765 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 464, 5}, { 29, 6}, { 15, 5}, { 31, 6}, \
- { 35, 7}, { 18, 6}, { 37, 7}, { 33, 8}, \
- { 17, 7}, { 37, 8}, { 19, 7}, { 40, 8}, \
- { 29, 9}, { 15, 8}, { 37, 9}, { 19, 8}, \
+ { { 765, 5}, { 36, 6}, { 37, 7}, { 19, 6}, \
+ { 42, 7}, { 43, 8}, { 37, 9}, { 19, 8}, \
{ 43, 9}, { 23, 8}, { 49, 9}, { 27, 8}, \
{ 57, 9}, { 43,10}, { 23, 9}, { 55,10}, \
{ 31, 9}, { 71,10}, { 39, 9}, { 83,10}, \
{ 47, 9}, { 99,10}, { 55,11}, { 31,10}, \
{ 87,11}, { 47,10}, { 111,12}, { 31,11}, \
- { 63,10}, { 135,11}, { 79,10}, { 167,11}, \
- { 95,10}, { 191,11}, { 111,12}, { 63,11}, \
- { 143,10}, { 287,11}, { 159,10}, { 319,12}, \
- { 95,11}, { 191,10}, { 399,11}, { 207,10}, \
- { 415,13}, { 63,12}, { 127,11}, { 255,10}, \
- { 511,11}, { 271,10}, { 543,11}, { 287,10}, \
- { 575,11}, { 303,12}, { 159,11}, { 335,10}, \
- { 671,11}, { 367,10}, { 735,12}, { 191,11}, \
- { 399,10}, { 799,11}, { 431,12}, { 223,11}, \
- { 463,13}, { 127,12}, { 255,11}, { 543,12}, \
- { 287,11}, { 607,12}, { 319,11}, { 671,12}, \
- { 351,11}, { 735,13}, { 191,12}, { 415,11}, \
- { 863,12}, { 447,14}, { 127,13}, { 255,12}, \
- { 607,13}, { 319,12}, { 735,13}, { 383,12}, \
- { 863,13}, { 447,12}, { 959,14}, { 255,13}, \
- { 575,12}, { 1183,13}, { 703,14}, { 383,13}, \
- { 831,12}, { 1663,13}, { 895,12}, { 1791,15}, \
- { 255,14}, { 511,13}, { 1087,12}, { 2175,13}, \
- { 1151,14}, { 639,13}, { 1343,12}, { 2687,13}, \
- { 1407,14}, { 767,13}, { 1599,12}, { 3199,13}, \
- { 1663,14}, { 895,13}, { 1855,15}, { 511,14}, \
- { 1023,13}, { 2175,14}, { 1151,13}, { 2431,14}, \
- { 1279,13}, { 2687,14}, { 1407,15}, { 767,14}, \
- { 1663,13}, { 3327,14}, { 1791,16}, { 511,15}, \
- { 1023,14}, { 2431,15}, { 1279,14}, { 2943,15}, \
- { 1535,14}, { 3327,15}, { 1791,14}, { 16384,15}, \
+ { 63,10}, { 135,11}, { 79,10}, { 175,11}, \
+ { 95,10}, { 199,11}, { 111,12}, { 63,11}, \
+ { 159,12}, { 95,11}, { 191,10}, { 399,11}, \
+ { 207,13}, { 63,12}, { 127,10}, { 511, 9}, \
+ { 1023,10}, { 527,11}, { 271,12}, { 159,10}, \
+ { 703,12}, { 191,11}, { 399,10}, { 799,11}, \
+ { 431,12}, { 223,13}, { 127,12}, { 255,11}, \
+ { 527,10}, { 1055,11}, { 559,12}, { 287,11}, \
+ { 607,10}, { 1215,11}, { 703,13}, { 191,12}, \
+ { 383,11}, { 799,12}, { 415,11}, { 863,12}, \
+ { 447,14}, { 127,13}, { 255,12}, { 511,11}, \
+ { 1055,12}, { 543,11}, { 1119,12}, { 607,11}, \
+ { 1215,12}, { 735,13}, { 383,12}, { 799,11}, \
+ { 1599,12}, { 863,13}, { 447,12}, { 991,14}, \
+ { 255,13}, { 511,12}, { 1055,11}, { 2111,12}, \
+ { 1119,13}, { 575,12}, { 1215,13}, { 639,12}, \
+ { 1311,13}, { 703,12}, { 1407,14}, { 383,13}, \
+ { 767,12}, { 1599,13}, { 831,12}, { 1727,13}, \
+ { 895,12}, { 1791,13}, { 959,12}, { 1919,15}, \
+ { 255,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1087,12}, { 2239,13}, { 1151,12}, { 2303,13}, \
+ { 1215,14}, { 639,13}, { 1279,12}, { 2559,13}, \
+ { 1471,14}, { 767,13}, { 1727,14}, { 895,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2239,14}, \
+ { 1151,13}, { 2495,14}, { 1279,13}, { 2623,14}, \
+ { 1407,15}, { 767,14}, { 1663,13}, { 3455,14}, \
+ { 1919,16}, { 511,15}, { 1023,14}, { 2175,13}, \
+ { 4479,14}, { 2431,15}, { 1279,14}, { 2943,15}, \
+ { 1535,14}, { 3455,15}, { 1791,14}, { 16384,15}, \
{ 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
{ 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
{8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 149
-#define SQR_FFT_THRESHOLD 4032
+#define SQR_FFT_TABLE3_SIZE 153
+#define SQR_FFT_THRESHOLD 6272
-#define MULLO_BASECASE_THRESHOLD 36
+#define MULLO_BASECASE_THRESHOLD 39
#define MULLO_DC_THRESHOLD 0 /* never mpn_mullo_basecase */
-#define MULLO_MUL_N_THRESHOLD 11278
+#define MULLO_MUL_N_THRESHOLD 17050
#define SQRLO_BASECASE_THRESHOLD 0 /* always */
-#define SQRLO_DC_THRESHOLD 11
-#define SQRLO_SQR_THRESHOLD 7916
+#define SQRLO_DC_THRESHOLD 134
+#define SQRLO_SQR_THRESHOLD 12322
-#define DC_DIV_QR_THRESHOLD 59
-#define DC_DIVAPPR_Q_THRESHOLD 222
-#define DC_BDIV_QR_THRESHOLD 94
-#define DC_BDIV_Q_THRESHOLD 264
+#define DC_DIV_QR_THRESHOLD 73
+#define DC_DIVAPPR_Q_THRESHOLD 262
+#define DC_BDIV_QR_THRESHOLD 111
+#define DC_BDIV_Q_THRESHOLD 315
-#define INV_MULMOD_BNM1_THRESHOLD 78
-#define INV_NEWTON_THRESHOLD 133
-#define INV_APPR_THRESHOLD 133
+#define INV_MULMOD_BNM1_THRESHOLD 92
+#define INV_NEWTON_THRESHOLD 15
+#define INV_APPR_THRESHOLD 17
-#define BINV_NEWTON_THRESHOLD 250
+#define BINV_NEWTON_THRESHOLD 280
#define REDC_1_TO_REDC_2_THRESHOLD 0 /* always */
-#define REDC_2_TO_REDC_N_THRESHOLD 148
+#define REDC_2_TO_REDC_N_THRESHOLD 172
-#define MU_DIV_QR_THRESHOLD 1187
-#define MU_DIVAPPR_Q_THRESHOLD 1120
+#define MU_DIV_QR_THRESHOLD 1470
+#define MU_DIVAPPR_Q_THRESHOLD 1210
#define MUPI_DIV_QR_THRESHOLD 0 /* always */
-#define MU_BDIV_QR_THRESHOLD 1210
-#define MU_BDIV_Q_THRESHOLD 1470
+#define MU_BDIV_QR_THRESHOLD 1566
+#define MU_BDIV_Q_THRESHOLD 1787
-#define POWM_SEC_TABLE 1,34,321,1985
+#define POWM_SEC_TABLE 3,22,139,1867
-#define GET_STR_DC_THRESHOLD 15
-#define GET_STR_PRECOMPUTE_THRESHOLD 21
-#define SET_STR_DC_THRESHOLD 1216
-#define SET_STR_PRECOMPUTE_THRESHOLD 3170
+#define GET_STR_DC_THRESHOLD 14
+#define GET_STR_PRECOMPUTE_THRESHOLD 42
+#define SET_STR_DC_THRESHOLD 1339
+#define SET_STR_PRECOMPUTE_THRESHOLD 3934
-#define FAC_DSC_THRESHOLD 746
+#define FAC_DSC_THRESHOLD 866
#define FAC_ODD_THRESHOLD 0 /* always */
-#define MATRIX22_STRASSEN_THRESHOLD 24
-#define HGCD_THRESHOLD 117
-#define HGCD_APPR_THRESHOLD 111
-#define HGCD_REDUCE_THRESHOLD 3389
-#define GCD_DC_THRESHOLD 460
-#define GCDEXT_DC_THRESHOLD 411
-#define JACOBI_BASE_METHOD 2
+#define MATRIX22_STRASSEN_THRESHOLD 20
+#define HGCD2_DIV1_METHOD 3 /* 13.73% faster than 1 */
+#define HGCD_THRESHOLD 129
+#define HGCD_APPR_THRESHOLD 202
+#define HGCD_REDUCE_THRESHOLD 4455
+#define GCD_DC_THRESHOLD 658
+#define GCDEXT_DC_THRESHOLD 469
+#define JACOBI_BASE_METHOD 2 /* 0.62% faster than 4 */
+
+/* Tuneup completed successfully, took 199042 seconds */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/lisp/gmpasm-mode.el
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/lisp/gmpasm-mode.el 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/lisp/gmpasm-mode.el 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,27 +4,27 @@
;; Copyright 1999-2002 Free Software Foundation, Inc.
;; This file is part of the GNU MP Library.
-;;
+;;
;; The GNU MP Library is free software; you can redistribute it and/or modify
;; it under the terms of either:
-;;
+;;
;; * 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.
-;;
+;;
;; or
-;;
+;;
;; * the GNU General Public License as published by the Free Software
;; Foundation; either version 2 of the License, or (at your option) any
;; later version.
-;;
+;;
;; or both in parallel, as here.
-;;
+;;
;; The GNU MP 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 General Public License
;; for more details.
-;;
+;;
;; You should have received copies of the GNU General Public License and the
;; GNU Lesser General Public License along with the GNU MP Library. If not,
;; see https://www.gnu.org/licenses/.
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/addmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/addmul_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/addmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,101 +0,0 @@
-dnl MIPS64 mpn_addmul_1 -- Multiply a limb vector with a single limb and add
-dnl the product to a second limb vector.
-
-dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C INPUT PARAMETERS
-C res_ptr $4
-C s1_ptr $5
-C size $6
-C s2_limb $7
-
-ASM_START()
-PROLOGUE(mpn_addmul_1)
-
-C feed-in phase 0
- ld $8,0($5)
-
-C feed-in phase 1
- daddiu $5,$5,8
- dmultu $8,$7
-
- daddiu $6,$6,-1
- beq $6,$0,$LC0
- move $2,$0 C zero cy2
-
- daddiu $6,$6,-1
- beq $6,$0,$LC1
- ld $8,0($5) C load new s1 limb as early as possible
-
-Loop: ld $10,0($4)
- mflo $3
- mfhi $9
- daddiu $5,$5,8
- daddu $3,$3,$2 C add old carry limb to low product limb
- dmultu $8,$7
- ld $8,0($5) C load new s1 limb as early as possible
- daddiu $6,$6,-1 C decrement loop counter
- sltu $2,$3,$2 C carry from previous addition -> $2
- daddu $3,$10,$3
- sltu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- daddiu $4,$4,8
- bne $6,$0,Loop
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 1
-$LC1: ld $10,0($4)
- mflo $3
- mfhi $9
- daddu $3,$3,$2
- sltu $2,$3,$2
- dmultu $8,$7
- daddu $3,$10,$3
- sltu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- daddiu $4,$4,8
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 0
-$LC0: ld $10,0($4)
- mflo $3
- mfhi $9
- daddu $3,$3,$2
- sltu $2,$3,$2
- daddu $3,$10,$3
- sltu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- j $31
- daddu $2,$9,$2 C add high product limb and carry from addition
-EPILOGUE(mpn_addmul_1)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/addmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/addmul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/addmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,101 @@
+dnl MIPS64 mpn_addmul_1 -- Multiply a limb vector with a single limb and add
+dnl the product to a second limb vector.
+
+dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+C res_ptr $4
+C s1_ptr $5
+C size $6
+C s2_limb $7
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+
+C feed-in phase 0
+ ld $8,0($5)
+
+C feed-in phase 1
+ daddiu $5,$5,8
+ dmultu $8,$7
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC1
+ ld $8,0($5) C load new s1 limb as early as possible
+
+Loop: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddiu $5,$5,8
+ daddu $3,$3,$2 C add old carry limb to low product limb
+ dmultu $8,$7
+ ld $8,0($5) C load new s1 limb as early as possible
+ daddiu $6,$6,-1 C decrement loop counter
+ sltu $2,$3,$2 C carry from previous addition -> $2
+ daddu $3,$10,$3
+ sltu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ daddiu $4,$4,8
+ bne $6,$0,Loop
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddu $3,$3,$2
+ sltu $2,$3,$2
+ dmultu $8,$7
+ daddu $3,$10,$3
+ sltu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ daddiu $4,$4,8
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddu $3,$3,$2
+ sltu $2,$3,$2
+ daddu $3,$10,$3
+ sltu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ j $31
+ daddu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_addmul_1)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/mul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/mul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/mul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,92 @@
+dnl MIPS64 mpn_mul_1 -- Multiply a limb vector with a single limb and store
+dnl the product in a second limb vector.
+
+dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+C res_ptr $4
+C s1_ptr $5
+C size $6
+C s2_limb $7
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+
+C feed-in phase 0
+ ld $8,0($5)
+
+C feed-in phase 1
+ daddiu $5,$5,8
+ dmultu $8,$7
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC1
+ ld $8,0($5) C load new s1 limb as early as possible
+
+Loop: nop
+ mflo $10
+ mfhi $9
+ daddiu $5,$5,8
+ daddu $10,$10,$2 C add old carry limb to low product limb
+ dmultu $8,$7
+ ld $8,0($5) C load new s1 limb as early as possible
+ daddiu $6,$6,-1 C decrement loop counter
+ sltu $2,$10,$2 C carry from previous addition -> $2
+ nop
+ nop
+ sd $10,0($4)
+ daddiu $4,$4,8
+ bne $6,$0,Loop
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: mflo $10
+ mfhi $9
+ daddu $10,$10,$2
+ sltu $2,$10,$2
+ dmultu $8,$7
+ sd $10,0($4)
+ daddiu $4,$4,8
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: mflo $10
+ mfhi $9
+ daddu $10,$10,$2
+ sltu $2,$10,$2
+ sd $10,0($4)
+ j $31
+ daddu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_mul_1)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/sqr_diagonal.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/sqr_diagonal.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/sqr_diagonal.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,77 @@
+dnl MIPS64 mpn_sqr_diagonal.
+
+dnl Copyright 2001, 2002 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+
+dnl INPUT PARAMETERS
+dnl rp $4
+dnl up $5
+dnl n $6
+
+include(`../config.m4')
+
+ASM_START()
+PROLOGUE(mpn_sqr_diagonal)
+ ld r8,0(r5)
+ daddiu r6,r6,-2
+ dmultu r8,r8
+ bltz r6,$Lend1
+ nop
+ ld r8,8(r5)
+ beq r6,r0,$Lend2
+ nop
+
+$Loop: mflo r10
+ mfhi r9
+ daddiu r6,r6,-1
+ sd r10,0(r4)
+ sd r9,8(r4)
+ dmultu r8,r8
+ ld r8,16(r5)
+ daddiu r5,r5,8
+ bne r6,r0,$Loop
+ daddiu r4,r4,16
+
+$Lend2: mflo r10
+ mfhi r9
+ sd r10,0(r4)
+ sd r9,8(r4)
+ dmultu r8,r8
+ mflo r10
+ mfhi r9
+ sd r10,16(r4)
+ j r31
+ sd r9,24(r4)
+
+$Lend1: mflo r10
+ mfhi r9
+ sd r10,0(r4)
+ j r31
+ sd r9,8(r4)
+EPILOGUE(mpn_sqr_diagonal)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/submul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/submul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/submul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,101 @@
+dnl MIPS64 mpn_submul_1 -- Multiply a limb vector with a single limb and
+dnl subtract the product from a second limb vector.
+
+dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+C res_ptr $4
+C s1_ptr $5
+C size $6
+C s2_limb $7
+
+ASM_START()
+PROLOGUE(mpn_submul_1)
+
+C feed-in phase 0
+ ld $8,0($5)
+
+C feed-in phase 1
+ daddiu $5,$5,8
+ dmultu $8,$7
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC0
+ move $2,$0 C zero cy2
+
+ daddiu $6,$6,-1
+ beq $6,$0,$LC1
+ ld $8,0($5) C load new s1 limb as early as possible
+
+Loop: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddiu $5,$5,8
+ daddu $3,$3,$2 C add old carry limb to low product limb
+ dmultu $8,$7
+ ld $8,0($5) C load new s1 limb as early as possible
+ daddiu $6,$6,-1 C decrement loop counter
+ sltu $2,$3,$2 C carry from previous addition -> $2
+ dsubu $3,$10,$3
+ sgtu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ daddiu $4,$4,8
+ bne $6,$0,Loop
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 1
+$LC1: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddu $3,$3,$2
+ sltu $2,$3,$2
+ dmultu $8,$7
+ dsubu $3,$10,$3
+ sgtu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ daddiu $4,$4,8
+ daddu $2,$9,$2 C add high product limb and carry from addition
+
+C wind-down phase 0
+$LC0: ld $10,0($4)
+ mflo $3
+ mfhi $9
+ daddu $3,$3,$2
+ sltu $2,$3,$2
+ dsubu $3,$10,$3
+ sgtu $10,$3,$10
+ daddu $2,$2,$10
+ sd $3,0($4)
+ j $31
+ daddu $2,$9,$2 C add high product limb and carry from addition
+EPILOGUE(mpn_submul_1)
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/umul.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/umul.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/hilo/umul.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,45 @@
+dnl MIPS64 umul_ppmm -- longlong.h support.
+
+dnl Copyright 2002 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+C plp $4
+C u $5
+C v $6
+
+ASM_START()
+PROLOGUE(mpn_umul_ppmm)
+ dmultu $5,$6
+ mflo $3
+ mfhi $2
+ j $31
+ sd $3,0($4)
+EPILOGUE(mpn_umul_ppmm)
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/mul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/mul_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/mul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,92 +0,0 @@
-dnl MIPS64 mpn_mul_1 -- Multiply a limb vector with a single limb and store
-dnl the product in a second limb vector.
-
-dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C INPUT PARAMETERS
-C res_ptr $4
-C s1_ptr $5
-C size $6
-C s2_limb $7
-
-ASM_START()
-PROLOGUE(mpn_mul_1)
-
-C feed-in phase 0
- ld $8,0($5)
-
-C feed-in phase 1
- daddiu $5,$5,8
- dmultu $8,$7
-
- daddiu $6,$6,-1
- beq $6,$0,$LC0
- move $2,$0 C zero cy2
-
- daddiu $6,$6,-1
- beq $6,$0,$LC1
- ld $8,0($5) C load new s1 limb as early as possible
-
-Loop: nop
- mflo $10
- mfhi $9
- daddiu $5,$5,8
- daddu $10,$10,$2 C add old carry limb to low product limb
- dmultu $8,$7
- ld $8,0($5) C load new s1 limb as early as possible
- daddiu $6,$6,-1 C decrement loop counter
- sltu $2,$10,$2 C carry from previous addition -> $2
- nop
- nop
- sd $10,0($4)
- daddiu $4,$4,8
- bne $6,$0,Loop
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 1
-$LC1: mflo $10
- mfhi $9
- daddu $10,$10,$2
- sltu $2,$10,$2
- dmultu $8,$7
- sd $10,0($4)
- daddiu $4,$4,8
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 0
-$LC0: mflo $10
- mfhi $9
- daddu $10,$10,$2
- sltu $2,$10,$2
- sd $10,0($4)
- j $31
- daddu $2,$9,$2 C add high product limb and carry from addition
-EPILOGUE(mpn_mul_1)
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/sqr_diagonal.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/sqr_diagonal.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/sqr_diagonal.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,77 +0,0 @@
-dnl MIPS64 mpn_sqr_diagonal.
-
-dnl Copyright 2001, 2002 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-
-dnl INPUT PARAMETERS
-dnl rp $4
-dnl up $5
-dnl n $6
-
-include(`../config.m4')
-
-ASM_START()
-PROLOGUE(mpn_sqr_diagonal)
- ld r8,0(r5)
- daddiu r6,r6,-2
- dmultu r8,r8
- bltz r6,$Lend1
- nop
- ld r8,8(r5)
- beq r6,r0,$Lend2
- nop
-
-$Loop: mflo r10
- mfhi r9
- daddiu r6,r6,-1
- sd r10,0(r4)
- sd r9,8(r4)
- dmultu r8,r8
- ld r8,16(r5)
- daddiu r5,r5,8
- bne r6,r0,$Loop
- daddiu r4,r4,16
-
-$Lend2: mflo r10
- mfhi r9
- sd r10,0(r4)
- sd r9,8(r4)
- dmultu r8,r8
- mflo r10
- mfhi r9
- sd r10,16(r4)
- j r31
- sd r9,24(r4)
-
-$Lend1: mflo r10
- mfhi r9
- sd r10,0(r4)
- j r31
- sd r9,8(r4)
-EPILOGUE(mpn_sqr_diagonal)
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/submul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/submul_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/submul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,101 +0,0 @@
-dnl MIPS64 mpn_submul_1 -- Multiply a limb vector with a single limb and
-dnl subtract the product from a second limb vector.
-
-dnl Copyright 1992, 1994, 1995, 2000-2002 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C INPUT PARAMETERS
-C res_ptr $4
-C s1_ptr $5
-C size $6
-C s2_limb $7
-
-ASM_START()
-PROLOGUE(mpn_submul_1)
-
-C feed-in phase 0
- ld $8,0($5)
-
-C feed-in phase 1
- daddiu $5,$5,8
- dmultu $8,$7
-
- daddiu $6,$6,-1
- beq $6,$0,$LC0
- move $2,$0 C zero cy2
-
- daddiu $6,$6,-1
- beq $6,$0,$LC1
- ld $8,0($5) C load new s1 limb as early as possible
-
-Loop: ld $10,0($4)
- mflo $3
- mfhi $9
- daddiu $5,$5,8
- daddu $3,$3,$2 C add old carry limb to low product limb
- dmultu $8,$7
- ld $8,0($5) C load new s1 limb as early as possible
- daddiu $6,$6,-1 C decrement loop counter
- sltu $2,$3,$2 C carry from previous addition -> $2
- dsubu $3,$10,$3
- sgtu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- daddiu $4,$4,8
- bne $6,$0,Loop
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 1
-$LC1: ld $10,0($4)
- mflo $3
- mfhi $9
- daddu $3,$3,$2
- sltu $2,$3,$2
- dmultu $8,$7
- dsubu $3,$10,$3
- sgtu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- daddiu $4,$4,8
- daddu $2,$9,$2 C add high product limb and carry from addition
-
-C wind-down phase 0
-$LC0: ld $10,0($4)
- mflo $3
- mfhi $9
- daddu $3,$3,$2
- sltu $2,$3,$2
- dsubu $3,$10,$3
- sgtu $10,$3,$10
- daddu $2,$2,$10
- sd $3,0($4)
- j $31
- daddu $2,$9,$2 C add high product limb and carry from addition
-EPILOGUE(mpn_submul_1)
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/umul.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/umul.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/mips64/umul.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,45 +0,0 @@
-dnl MIPS64 umul_ppmm -- longlong.h support.
-
-dnl Copyright 2002 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C INPUT PARAMETERS
-C plp $4
-C u $5
-C v $6
-
-ASM_START()
-PROLOGUE(mpn_umul_ppmm)
- dmultu $5,$6
- mflo $3
- mfhi $2
- j $31
- sd $3,0($4)
-EPILOGUE(mpn_umul_ppmm)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/pa64/umul.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/pa64/umul.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/pa64/umul.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -95,4 +95,3 @@
bve (%r2)
ldo -128(%r30),%r30
EPILOGUE(mpn_umul_ppmm_r)
-
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/divrem_2.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/divrem_2.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/divrem_2.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
dnl PPC-32 mpn_divrem_2 -- Divide an mpn number by a normalized 2-limb number.
-dnl Copyright 2007, 2008, 2012 Free Software Foundation, Inc.
+dnl Copyright 2007, 2008, 2012, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -98,7 +98,7 @@
cmplw cr6, r6, r0
addi r31, r31, -1 C q1--
crorc 28, 28, 25
- bc+ 12, 28, L(9)
+ blt+ cr7, L(9)
addi r31, r31, -1 C q1--
add r0, r0, r10
L(9): subf r0, r6, r0
@@ -115,7 +115,7 @@
cmplw cr6, r11, r0
addi r6, r6, -1 C q0--
crorc 28, 28, 25
- bc+ 12, 28, L(13)
+ blt+ cr7, L(13)
C add r0, r0, r10 C final remainder
addi r6, r6, -1 C q0--
L(13): rlwimi r6, r31, 16, 0, 15 C assemble final quotient
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p4/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p4/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p4/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -51,6 +51,8 @@
#define DIVEXACT_1_THRESHOLD 0 /* always */
#define BMOD_1_TO_MOD_1_THRESHOLD 45
+#define DIV_1_VS_MUL_1_PERCENT 225
+
#define MUL_TOOM22_THRESHOLD 20
#define MUL_TOOM33_THRESHOLD 73
#define MUL_TOOM44_THRESHOLD 130
@@ -166,6 +168,9 @@
#define MULLO_BASECASE_THRESHOLD 0 /* always */
#define MULLO_DC_THRESHOLD 55
#define MULLO_MUL_N_THRESHOLD 13463
+#define SQRLO_BASECASE_THRESHOLD 4
+#define SQRLO_DC_THRESHOLD 169
+#define SQRLO_SQR_THRESHOLD 9335
#define DC_DIV_QR_THRESHOLD 50
#define DC_DIVAPPR_Q_THRESHOLD 196
@@ -187,6 +192,14 @@
#define POWM_SEC_TABLE 3,28,78,480,1099
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 24
+#define SET_STR_DC_THRESHOLD 381
+#define SET_STR_PRECOMPUTE_THRESHOLD 1002
+
+#define FAC_DSC_THRESHOLD 179
+#define FAC_ODD_THRESHOLD 28
+
#define MATRIX22_STRASSEN_THRESHOLD 9
#define HGCD_THRESHOLD 93
#define HGCD_APPR_THRESHOLD 109
@@ -194,11 +207,3 @@
#define GCD_DC_THRESHOLD 379
#define GCDEXT_DC_THRESHOLD 273
#define JACOBI_BASE_METHOD 4
-
-#define GET_STR_DC_THRESHOLD 11
-#define GET_STR_PRECOMPUTE_THRESHOLD 24
-#define SET_STR_DC_THRESHOLD 381
-#define SET_STR_PRECOMPUTE_THRESHOLD 1002
-
-#define FAC_DSC_THRESHOLD 179
-#define FAC_ODD_THRESHOLD 28
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p7/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p7/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/p7/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* PowerPC-32 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2004, 2008-2011 Free Software Foundation, Inc.
+Copyright 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -31,7 +31,9 @@
#define GMP_LIMB_BITS 32
#define GMP_LIMB_BYTES 4
-/* 3550 MHz POWER7/T4 */
+/* 4150 MHz POWER8/T4 */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2017-02-18, gcc 6.1 */
#define DIVREM_1_NORM_THRESHOLD 0 /* always */
#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
@@ -38,122 +40,131 @@
#define MOD_1_1P_METHOD 1
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 9
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 8
#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
-#define MOD_1_2_TO_MOD_1_4_THRESHOLD 34
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 15
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 22
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
#define USE_PREINV_DIVREM_1 1
-#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_1N_PI1_METHOD 2
+#define DIV_QR_1_NORM_THRESHOLD 4
+#define DIV_QR_1_UNNORM_THRESHOLD 3
+#define DIV_QR_2_PI2_THRESHOLD 15
#define DIVEXACT_1_THRESHOLD 0 /* always */
-#define BMOD_1_TO_MOD_1_THRESHOLD 34
+#define BMOD_1_TO_MOD_1_THRESHOLD 39
+#define DIV_1_VS_MUL_1_PERCENT 343
+
#define MUL_TOOM22_THRESHOLD 20
-#define MUL_TOOM33_THRESHOLD 89
-#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 202
#define MUL_TOOM6H_THRESHOLD 286
-#define MUL_TOOM8H_THRESHOLD 363
+#define MUL_TOOM8H_THRESHOLD 430
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 121
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 89
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 113
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 137
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 140
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 128
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 145
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 121
-#define SQR_BASECASE_THRESHOLD 4
-#define SQR_TOOM2_THRESHOLD 50
-#define SQR_TOOM3_THRESHOLD 89
-#define SQR_TOOM4_THRESHOLD 154
-#define SQR_TOOM6_THRESHOLD 222
-#define SQR_TOOM8_THRESHOLD 381
+#define SQR_BASECASE_THRESHOLD 0 /* always */
+#define SQR_TOOM2_THRESHOLD 26
+#define SQR_TOOM3_THRESHOLD 97
+#define SQR_TOOM4_THRESHOLD 236
+#define SQR_TOOM6_THRESHOLD 318
+#define SQR_TOOM8_THRESHOLD 478
-#define MULMID_TOOM42_THRESHOLD 40
+#define MULMID_TOOM42_THRESHOLD 34
#define MULMOD_BNM1_THRESHOLD 18
-#define SQRMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 18
-#define POWM_SEC_TABLE 4,35,225,780,2212
-
-#define MUL_FFT_MODF_THRESHOLD 476 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 444 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 476, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
- { 12, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
- { 14, 5}, { 29, 6}, { 21, 7}, { 11, 6}, \
- { 25, 7}, { 13, 6}, { 29, 7}, { 15, 6}, \
- { 31, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
- { 39, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { { 444, 5}, { 21, 6}, { 12, 5}, { 25, 6}, \
+ { 13, 5}, { 27, 6}, { 21, 7}, { 11, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 17, 6}, \
+ { 35, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
{ 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
{ 27, 9}, { 15, 8}, { 39, 9}, { 23, 8}, \
- { 51,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
- { 39, 8}, { 79, 9}, { 47, 8}, { 95, 9}, \
- { 55,10}, { 31, 9}, { 79,10}, { 47, 9}, \
- { 95,11}, { 31,10}, { 63, 9}, { 135,10}, \
- { 79, 9}, { 159,10}, { 95,11}, { 63,10}, \
- { 159,11}, { 95,12}, { 63,11}, { 127,10}, \
+ { 51,10}, { 15, 9}, { 31, 8}, { 63, 9}, \
+ { 39, 8}, { 79, 9}, { 47,10}, { 31, 9}, \
+ { 79,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
+ { 191,10}, { 111,11}, { 63,10}, { 127, 9}, \
+ { 255,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
{ 255, 9}, { 511,10}, { 271, 9}, { 543, 8}, \
- { 1087,11}, { 159,10}, { 319, 9}, { 639,10}, \
- { 335, 9}, { 671, 8}, { 1343,10}, { 351,11}, \
- { 191,10}, { 415, 9}, { 831,10}, { 431,11}, \
- { 223,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
- { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 77
-#define MUL_FFT_THRESHOLD 5312
+ { 1087,10}, { 287,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 351,11}, { 191,10}, { 415, 9}, \
+ { 831,11}, { 223,12}, { 4096,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 70
+#define MUL_FFT_THRESHOLD 4544
-#define SQR_FFT_MODF_THRESHOLD 344 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 332 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 344, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { { 332, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
{ 21, 7}, { 11, 6}, { 24, 7}, { 13, 6}, \
{ 27, 7}, { 15, 6}, { 31, 7}, { 21, 8}, \
{ 11, 7}, { 27, 8}, { 15, 7}, { 33, 8}, \
{ 19, 7}, { 39, 8}, { 27, 9}, { 15, 8}, \
{ 39, 9}, { 23, 8}, { 47,10}, { 15, 9}, \
- { 31, 8}, { 63, 9}, { 39, 8}, { 79, 9}, \
- { 47,10}, { 31, 9}, { 79,10}, { 47,11}, \
- { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
- { 159,10}, { 95, 9}, { 191,11}, { 63,10}, \
- { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
- { 143, 9}, { 287, 8}, { 575, 9}, { 303,10}, \
- { 159,11}, { 95,10}, { 191,12}, { 63,11}, \
- { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
- { 543, 8}, { 1087,10}, { 287, 9}, { 575,10}, \
- { 303,11}, { 159,10}, { 319, 9}, { 639,10}, \
- { 335, 9}, { 671,10}, { 351, 9}, { 703,11}, \
- { 191,10}, { 383, 9}, { 767,10}, { 415, 9}, \
- { 831,11}, { 223,10}, { 447,12}, { 4096,13}, \
+ { 31, 8}, { 63, 9}, { 47,10}, { 31, 9}, \
+ { 79,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255, 9}, { 135,10}, { 95, 9}, \
+ { 191,11}, { 63,10}, { 127, 9}, { 255, 8}, \
+ { 511, 9}, { 271,10}, { 143, 9}, { 287, 8}, \
+ { 575, 9}, { 303, 8}, { 607,10}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543,10}, \
+ { 287, 9}, { 575,10}, { 303, 9}, { 607,11}, \
+ { 159,10}, { 319, 9}, { 639,10}, { 351, 9}, \
+ { 703,11}, { 191,10}, { 383, 9}, { 767,10}, \
+ { 415,11}, { 223,10}, { 447,12}, { 4096,13}, \
{ 8192,14}, { 16384,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 79
-#define SQR_FFT_THRESHOLD 3712
+#define SQR_FFT_TABLE3_SIZE 75
+#define SQR_FFT_THRESHOLD 3520
-#define MULLO_BASECASE_THRESHOLD 2
-#define MULLO_DC_THRESHOLD 34
-#define MULLO_MUL_N_THRESHOLD 10323
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 36
+#define MULLO_MUL_N_THRESHOLD 8648
+#define SQRLO_BASECASE_THRESHOLD 5
+#define SQRLO_DC_THRESHOLD 193
+#define SQRLO_SQR_THRESHOLD 6675
-#define DC_DIV_QR_THRESHOLD 52
-#define DC_DIVAPPR_Q_THRESHOLD 202
-#define DC_BDIV_QR_THRESHOLD 68
-#define DC_BDIV_Q_THRESHOLD 152
+#define DC_DIV_QR_THRESHOLD 33
+#define DC_DIVAPPR_Q_THRESHOLD 134
+#define DC_BDIV_QR_THRESHOLD 51
+#define DC_BDIV_Q_THRESHOLD 134
#define INV_MULMOD_BNM1_THRESHOLD 66
-#define INV_NEWTON_THRESHOLD 226
-#define INV_APPR_THRESHOLD 189
+#define INV_NEWTON_THRESHOLD 132
+#define INV_APPR_THRESHOLD 131
#define BINV_NEWTON_THRESHOLD 292
-#define REDC_1_TO_REDC_N_THRESHOLD 79
+#define REDC_1_TO_REDC_N_THRESHOLD 67
-#define MU_DIV_QR_THRESHOLD 1442
-#define MU_DIVAPPR_Q_THRESHOLD 1442
-#define MUPI_DIV_QR_THRESHOLD 91
-#define MU_BDIV_QR_THRESHOLD 1308
-#define MU_BDIV_Q_THRESHOLD 1442
+#define MU_DIV_QR_THRESHOLD 1334
+#define MU_DIVAPPR_Q_THRESHOLD 1334
+#define MUPI_DIV_QR_THRESHOLD 62
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1470
+#define POWM_SEC_TABLE 3,25,114,480,1486
+
+#define GET_STR_DC_THRESHOLD 8
+#define GET_STR_PRECOMPUTE_THRESHOLD 14
+#define SET_STR_DC_THRESHOLD 644
+#define SET_STR_PRECOMPUTE_THRESHOLD 1365
+
+#define FAC_DSC_THRESHOLD 107
+#define FAC_ODD_THRESHOLD 29
+
#define MATRIX22_STRASSEN_THRESHOLD 16
-#define HGCD_THRESHOLD 126
-#define HGCD_APPR_THRESHOLD 139
+#define HGCD_THRESHOLD 95
+#define HGCD_APPR_THRESHOLD 121
#define HGCD_REDUCE_THRESHOLD 2681
-#define GCD_DC_THRESHOLD 573
-#define GCDEXT_DC_THRESHOLD 448
+#define GCD_DC_THRESHOLD 456
+#define GCDEXT_DC_THRESHOLD 386
#define JACOBI_BASE_METHOD 4
-
-#define GET_STR_DC_THRESHOLD 9
-#define GET_STR_PRECOMPUTE_THRESHOLD 20
-#define SET_STR_DC_THRESHOLD 834
-#define SET_STR_PRECOMPUTE_THRESHOLD 1888
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/powerpc-defs.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/powerpc-defs.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc32/powerpc-defs.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
dnl m4 macros for PowerPC assembler (32 and 64 bit).
-dnl Copyright 2000, 2002, 2003 Free Software Foundation, Inc.
+dnl Copyright 2000, 2002, 2003, 2017, 2018 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -100,5 +100,22 @@
define(ASSERT_counter,1)
+dnl Manually assemble some new instructions
+dnl
+define(`maddld',m4_assert_numargs(4)`dnl
+.long eval(0x10000033+m4_lshift($1,21)+m4_lshift($2,16)+m4_lshift($3,11)+m4_lshift($4,6))')
+
+define(`maddhdu',m4_assert_numargs(4)`dnl
+.long eval(0x10000031+m4_lshift($1,21)+m4_lshift($2,16)+m4_lshift($3,11)+m4_lshift($4,6))')
+
+define(`popcntd',m4_assert_numargs(2)`dnl
+.long eval(0x7c0003f4+m4_lshift($2,21)+m4_lshift($1,16))')
+
+define(`divdeu',m4_assert_numargs(3)`dnl
+.long eval(0x7c000312+m4_lshift($1,21)+m4_lshift($2,16)+m4_lshift($3,11))')
+
+define(`addex',m4_assert_numargs(4)`dnl
+.long eval(0x7c000154+m4_lshift($1,21)+m4_lshift($2,16)+m4_lshift($3,11)+m4_lshift($4,9))')
+
divert
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/aix.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/aix.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/aix.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,6 +29,8 @@
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
+define(`AIX')
+
define(`ASM_START',
`.machine "any"
.toc')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/darwin.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/darwin.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/darwin.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,6 +29,8 @@
dnl GNU Lesser General Public License along with the GNU MP Library. If not,
dnl see https://www.gnu.org/licenses/.
+define(`DARWIN')
+
define(`ASM_START',`')
dnl Called: PROLOGUE_cpu(GSYM_PREFIX`'foo[,toc])
@@ -35,8 +37,6 @@
dnl EPILOGUE_cpu(GSYM_PREFIX`'foo)
dnl
-define(`DARWIN')
-
define(`PROLOGUE_cpu',
m4_assert_numargs_range(1,2)
`ifelse(`$2',toc,,
@@ -46,8 +46,7 @@
.align 5
$1:')
-define(`EPILOGUE_cpu',
-m4_assert_numargs(1))
+define(`lea_list', `')
dnl LEAL -- Load Effective Address Local. This is to be used for symbols
dnl defined in the same file. It will not work for externally defined
@@ -74,7 +73,7 @@
define(`LEA',
m4_assert_numargs(2)
`ifdef(`PIC',
-`define(`EPILOGUE_cpu',
+`define(`lea_list',
` .non_lazy_symbol_pointer
`L'$2`'$non_lazy_ptr:
.indirect_symbol $2
@@ -112,6 +111,10 @@
define(`CALL',
`bl GSYM_PREFIX`'$1')
+define(`EPILOGUE_cpu',
+`lea_list'
+`define(`lea_list', `')')
+
define(`ASM_END', `dnl')
define(`EXTRA_REGISTER', r2)
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/p4/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/p4/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/p4/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* PowerPC-64 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 2008, 2009, 2011 Free Software Foundation, Inc.
+Copyright 2008, 2009, 2011, 2017 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -29,6 +29,8 @@
see https://www.gnu.org/licenses/. */
/* 1800 MHz PPC970 */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2017-01-01, gcc 4.0 */
#define DIVREM_1_NORM_THRESHOLD 0 /* always */
#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
@@ -39,135 +41,142 @@
#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
#define MOD_1_1_TO_MOD_1_2_THRESHOLD 6
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 46
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 14
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 15
#define USE_PREINV_DIVREM_1 1
-#define DIV_QR_2_PI2_THRESHOLD 12
+#define DIV_QR_1N_PI1_METHOD 1
+#define DIV_QR_1_NORM_THRESHOLD 2
+#define DIV_QR_1_UNNORM_THRESHOLD 2
+#define DIV_QR_2_PI2_THRESHOLD 15
#define DIVEXACT_1_THRESHOLD 0 /* always */
-#define BMOD_1_TO_MOD_1_THRESHOLD 90
+#define BMOD_1_TO_MOD_1_THRESHOLD 88
-#define MUL_TOOM22_THRESHOLD 16
-#define MUL_TOOM33_THRESHOLD 57
-#define MUL_TOOM44_THRESHOLD 94
-#define MUL_TOOM6H_THRESHOLD 125
+#define DIV_1_VS_MUL_1_PERCENT 269
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 60
+#define MUL_TOOM44_THRESHOLD 88
+#define MUL_TOOM6H_THRESHOLD 124
#define MUL_TOOM8H_THRESHOLD 187
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 99
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 61
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
#define MUL_TOOM42_TO_TOOM53_THRESHOLD 61
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 70
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 60
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 74
#define SQR_BASECASE_THRESHOLD 4
-#define SQR_TOOM2_THRESHOLD 30
-#define SQR_TOOM3_THRESHOLD 98
-#define SQR_TOOM4_THRESHOLD 136
-#define SQR_TOOM6_THRESHOLD 180
+#define SQR_TOOM2_THRESHOLD 28
+#define SQR_TOOM3_THRESHOLD 90
+#define SQR_TOOM4_THRESHOLD 143
+#define SQR_TOOM6_THRESHOLD 181
#define SQR_TOOM8_THRESHOLD 272
#define MULMID_TOOM42_THRESHOLD 34
-#define MULMOD_BNM1_THRESHOLD 12
-#define SQRMOD_BNM1_THRESHOLD 13
+#define MULMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 15
-#define MUL_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 252 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 244, 5}, { 13, 6}, { 7, 5}, { 15, 6}, \
+ { { 252, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 7, 5}, { 15, 6}, { 13, 5}, { 27, 6}, \
{ 15, 7}, { 8, 6}, { 17, 7}, { 9, 6}, \
- { 19, 7}, { 13, 8}, { 7, 7}, { 17, 8}, \
- { 9, 7}, { 20, 8}, { 11, 7}, { 23, 8}, \
- { 13, 7}, { 29, 8}, { 19, 9}, { 11, 8}, \
- { 27,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
- { 19, 8}, { 39, 9}, { 23, 8}, { 47, 9}, \
- { 27,10}, { 15, 9}, { 39,10}, { 23, 9}, \
- { 47,11}, { 15,10}, { 31, 9}, { 67,10}, \
- { 39, 9}, { 83,10}, { 47, 9}, { 95, 8}, \
- { 191, 9}, { 99,10}, { 55,11}, { 31,10}, \
- { 63, 9}, { 127, 8}, { 255,10}, { 71, 9}, \
- { 143, 8}, { 287,10}, { 79, 9}, { 159, 8}, \
- { 319,11}, { 47,10}, { 95, 9}, { 191, 8}, \
- { 383,10}, { 103,12}, { 31,11}, { 63,10}, \
- { 127, 9}, { 255, 8}, { 511,10}, { 143, 9}, \
- { 287,11}, { 79,10}, { 159, 9}, { 319, 8}, \
- { 639,10}, { 175, 9}, { 351, 8}, { 703,11}, \
- { 95,10}, { 191, 9}, { 383, 8}, { 767,10}, \
- { 207, 9}, { 415,10}, { 223, 9}, { 447,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511,11}, \
- { 143,10}, { 287, 9}, { 575, 8}, { 1151,11}, \
+ { 19, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 21, 9}, { 11, 8}, { 27,10}, { 7, 9}, \
+ { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
+ { 23, 8}, { 47, 9}, { 27,10}, { 15, 9}, \
+ { 39,10}, { 23, 9}, { 47,11}, { 15,10}, \
+ { 31, 9}, { 67,10}, { 39, 9}, { 83,10}, \
+ { 47, 9}, { 95, 8}, { 191,10}, { 55,11}, \
+ { 31,10}, { 63, 9}, { 127, 8}, { 255,10}, \
+ { 71, 9}, { 143, 8}, { 287,10}, { 79, 9}, \
+ { 159, 8}, { 319,11}, { 47,10}, { 95, 9}, \
+ { 191, 8}, { 383,10}, { 103,12}, { 31,11}, \
+ { 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
+ { 143, 9}, { 287,11}, { 79,10}, { 159, 9}, \
+ { 319, 8}, { 639,10}, { 175, 9}, { 351, 8}, \
+ { 703,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,10}, { 207, 9}, { 415,10}, { 223, 9}, \
+ { 447,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,11}, { 143,10}, { 287, 9}, { 575,11}, \
{ 159,10}, { 319, 9}, { 639,11}, { 175,10}, \
{ 351, 9}, { 703,12}, { 95,11}, { 191,10}, \
- { 383, 9}, { 767,11}, { 207,10}, { 415, 9}, \
- { 831,11}, { 223,10}, { 447,13}, { 8192,14}, \
- { 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 106
-#define MUL_FFT_THRESHOLD 2688
+ { 383, 9}, { 767,11}, { 207,10}, { 415,11}, \
+ { 223,10}, { 447,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define MUL_FFT_TABLE3_SIZE 105
+#define MUL_FFT_THRESHOLD 5248
-#define SQR_FFT_MODF_THRESHOLD 212 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 236 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 212, 5}, { 13, 6}, { 15, 7}, { 8, 6}, \
- { 17, 7}, { 9, 6}, { 19, 7}, { 13, 8}, \
- { 7, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
- { 11, 7}, { 23, 8}, { 13, 7}, { 27, 9}, \
- { 7, 8}, { 21, 9}, { 11, 8}, { 25,10}, \
- { 7, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
- { 39, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
- { 15, 9}, { 39,10}, { 23, 9}, { 47,11}, \
- { 15,10}, { 31, 9}, { 63, 8}, { 127, 9}, \
- { 67,10}, { 39, 9}, { 79, 8}, { 159,10}, \
- { 47, 9}, { 95, 8}, { 191,11}, { 31,10}, \
- { 63, 9}, { 127, 8}, { 255,10}, { 71, 9}, \
- { 143, 8}, { 287,10}, { 79, 9}, { 159, 8}, \
- { 319,11}, { 47, 9}, { 191, 8}, { 383,12}, \
+ { { 236, 5}, { 13, 6}, { 15, 7}, { 8, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 17, 8}, \
+ { 9, 7}, { 20, 8}, { 11, 7}, { 24, 8}, \
+ { 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
+ { 25,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
+ { 19, 8}, { 39, 9}, { 23, 8}, { 47, 9}, \
+ { 27,10}, { 15, 9}, { 39,10}, { 23, 9}, \
+ { 47,11}, { 15,10}, { 31, 9}, { 67,10}, \
+ { 39, 9}, { 79, 8}, { 159,10}, { 47, 9}, \
+ { 95, 8}, { 191,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255,10}, { 71, 9}, { 143, 8}, \
+ { 287,10}, { 79, 9}, { 159, 8}, { 319,11}, \
+ { 47,10}, { 95, 9}, { 191, 8}, { 383,12}, \
{ 31,11}, { 63,10}, { 127, 9}, { 255, 8}, \
{ 511,10}, { 143, 9}, { 287, 8}, { 575,11}, \
{ 79,10}, { 159, 9}, { 319, 8}, { 639,10}, \
- { 175, 9}, { 351, 8}, { 703,10}, { 191, 9}, \
- { 383, 8}, { 767,10}, { 207, 9}, { 415,11}, \
- { 111,10}, { 223,12}, { 63,11}, { 127,10}, \
+ { 175, 9}, { 351, 8}, { 703,11}, { 95,10}, \
+ { 191, 9}, { 383, 8}, { 767,10}, { 207, 9}, \
+ { 415,10}, { 223,12}, { 63,11}, { 127,10}, \
{ 255, 9}, { 511,11}, { 143,10}, { 287, 9}, \
{ 575,11}, { 159,10}, { 319, 9}, { 639,11}, \
- { 175,10}, { 351, 9}, { 703, 8}, { 1407,11}, \
- { 191,10}, { 383, 9}, { 767,11}, { 207,10}, \
- { 415,11}, { 223,10}, { 447,13}, { 8192,14}, \
- { 16384,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 102
-#define SQR_FFT_THRESHOLD 1984
+ { 175,10}, { 351, 9}, { 703,11}, { 191,10}, \
+ { 383, 9}, { 767,11}, { 207,10}, { 415,11}, \
+ { 223,10}, { 447,13}, { 8192,14}, { 16384,15}, \
+ { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 97
+#define SQR_FFT_THRESHOLD 3200
#define MULLO_BASECASE_THRESHOLD 0 /* always */
-#define MULLO_DC_THRESHOLD 55
-#define MULLO_MUL_N_THRESHOLD 5240
+#define MULLO_DC_THRESHOLD 56
+#define MULLO_MUL_N_THRESHOLD 8648
+#define SQRLO_BASECASE_THRESHOLD 2
+#define SQRLO_DC_THRESHOLD 106
+#define SQRLO_SQR_THRESHOLD 6293
-#define DC_DIV_QR_THRESHOLD 27
-#define DC_DIVAPPR_Q_THRESHOLD 108
+#define DC_DIV_QR_THRESHOLD 28
+#define DC_DIVAPPR_Q_THRESHOLD 102
#define DC_BDIV_QR_THRESHOLD 51
-#define DC_BDIV_Q_THRESHOLD 126
+#define DC_BDIV_Q_THRESHOLD 124
-#define INV_MULMOD_BNM1_THRESHOLD 38
-#define INV_NEWTON_THRESHOLD 129
-#define INV_APPR_THRESHOLD 116
+#define INV_MULMOD_BNM1_THRESHOLD 34
+#define INV_NEWTON_THRESHOLD 123
+#define INV_APPR_THRESHOLD 109
-#define BINV_NEWTON_THRESHOLD 198
+#define BINV_NEWTON_THRESHOLD 206
#define REDC_1_TO_REDC_N_THRESHOLD 51
#define MU_DIV_QR_THRESHOLD 807
#define MU_DIVAPPR_Q_THRESHOLD 807
-#define MUPI_DIV_QR_THRESHOLD 54
+#define MUPI_DIV_QR_THRESHOLD 53
#define MU_BDIV_QR_THRESHOLD 748
#define MU_BDIV_Q_THRESHOLD 872
-#define POWM_SEC_TABLE 4,35,152,780,2145
+#define POWM_SEC_TABLE 2,23,66,440,1555
-#define MATRIX22_STRASSEN_THRESHOLD 11
-#define HGCD_THRESHOLD 104
-#define HGCD_APPR_THRESHOLD 118
-#define HGCD_REDUCE_THRESHOLD 1329
+#define GET_STR_DC_THRESHOLD 7
+#define GET_STR_PRECOMPUTE_THRESHOLD 17
+#define SET_STR_DC_THRESHOLD 1035
+#define SET_STR_PRECOMPUTE_THRESHOLD 2170
+
+#define FAC_DSC_THRESHOLD 542
+#define FAC_ODD_THRESHOLD 24
+
+#define MATRIX22_STRASSEN_THRESHOLD 10
+#define HGCD_THRESHOLD 108
+#define HGCD_APPR_THRESHOLD 116
+#define HGCD_REDUCE_THRESHOLD 1437
#define GCD_DC_THRESHOLD 268
#define GCDEXT_DC_THRESHOLD 241
#define JACOBI_BASE_METHOD 4
-
-#define GET_STR_DC_THRESHOLD 9
-#define GET_STR_PRECOMPUTE_THRESHOLD 18
-#define SET_STR_DC_THRESHOLD 996
-#define SET_STR_PRECOMPUTE_THRESHOLD 2170
-
-#define FAC_DSC_THRESHOLD 442
-#define FAC_ODD_THRESHOLD 26
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/submul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/submul_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode32/submul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -79,4 +79,3 @@
srdi r3, r4, 32
blr
EPILOGUE()
-
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,146 @@
+dnl PowerPC-64 mpn_bdiv_q_1, mpn_pi1_bdiv_q_1 -- Hensel division by 1-limb
+dnl divisor.
+
+dnl Copyright 2006, 2010, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C norm unorm
+C POWER3/PPC630 13-19
+C POWER4/PPC970 16
+C POWER5 16 16
+C POWER6 37 46
+C POWER7 12 12
+C POWER8 12 12
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`d', `r6')
+define(`di', `r7')
+define(`cnt',`r8')
+
+define(`tnc',`r10')
+
+ASM_START()
+
+EXTERN(binvert_limb_table)
+
+PROLOGUE(mpn_bdiv_q_1,toc)
+ addi r7, n, -1
+ cmpdi cr1, n, 1
+ ld r12, 0(up)
+ li cnt, 0
+ neg r0, d
+ and r0, d, r0
+ cntlzd r0, r0
+ subfic cnt, r0, 63
+ srd d, d, cnt
+L(7):
+ mtctr r7
+ LEA( r10, binvert_limb_table)
+ rldicl r11, d, 63, 57
+ lbzx r0, r10, r11
+ mulld r9, r0, r0
+ sldi r0, r0, 1
+ mulld r9, d, r9
+ subf r0, r9, r0
+ mulld r10, r0, r0
+ sldi r0, r0, 1
+ mulld r10, d, r10
+ subf r0, r10, r0
+ mulld r9, r0, r0
+ sldi r0, r0, 1
+ mulld r9, d, r9
+ subf di, r9, r0 C di = 1/d mod 2^64
+ifdef(`AIX',
+` C For AIX it is not clear how to jump into another function.
+ b .mpn_pi1_bdiv_q_1
+',`
+ C For non-AIX, dispatch into the pi1 variant.
+ bne cr0, L(norm)
+ b L(unorm)
+')
+EPILOGUE()
+
+PROLOGUE(mpn_pi1_bdiv_q_1)
+ cmpdi cr0, cnt, 0
+ ld r12, 0(up)
+ addic r0, n, -1 C set carry as side effect
+ cmpdi cr1, n, 1
+ mtctr r0
+ beq cr0, L(norm)
+
+L(unorm):
+ subfic tnc, cnt, 64 C set carry as side effect
+ li r5, 0
+ srd r11, r12, cnt
+ beq cr1, L(ed1)
+
+ ALIGN(16)
+L(tpu): ld r12, 8(up)
+ nop
+ addi up, up, 8
+ sld r0, r12, tnc
+ or r11, r11, r0
+ subfe r9, r5, r11
+ srd r11, r12, cnt
+ mulld r0, di, r9
+ mulhdu r5, r0, d
+ std r0, 0(rp)
+ addi rp, rp, 8
+ bdnz L(tpu)
+
+ subfe r11, r5, r11
+L(ed1): mulld r0, di, r11
+ std r0, 0(rp)
+ blr
+
+ ALIGN(16)
+L(norm):
+ mulld r11, r12, di
+ mulhdu r5, r11, d
+ std r11, 0(rp)
+ beqlr cr1
+
+ ALIGN(16)
+L(tpn): ld r9, 8(up)
+ addi up, up, 8
+ subfe r5, r5, r9
+ mulld r11, di, r5
+ mulhdu r5, r11, d C result not used in last iteration
+ std r11, 8(rp)
+ addi rp, rp, 8
+ bdnz L(tpn)
+
+ blr
+EPILOGUE()
+ASM_END()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/dive_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/dive_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/dive_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -30,13 +30,14 @@
include(`../config.m4')
-C cycles/limb
-C norm unorm
-C POWER3/PPC630 13-19
-C POWER4/PPC970 16
-C POWER5 16 16
-C POWER6 37 46
-C POWER7 12 12
+C cycles/limb
+C norm unorm
+C POWER3/PPC630 13-19
+C POWER4/PPC970 16
+C POWER5 16 16
+C POWER6 37 46
+C POWER7 12 12
+C POWER8 12 12
C TODO
C * Check if n=1 code is really an improvement. It probably isn't.
@@ -87,6 +88,7 @@
sldi r0, r0, 1
mulld r9, d, r9
subf r7, r9, r0 C r7 = 1/d mod 2^64
+
bne cr0, L(norm)
subfic r8, r10, 64 C set carry as side effect
li r5, 0
@@ -123,10 +125,11 @@
addi up, up, 8
subfe r5, r5, r9
mulld r11, r7, r5
- mulhdu r5, r11, d C result not used
+ mulhdu r5, r11, d C result not used in last iteration
std r11, 8(rp)
addi rp, rp, 8
bdnz L(loop1)
+
blr
EPILOGUE()
ASM_END()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/divrem_2.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/divrem_2.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/divrem_2.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -91,7 +91,7 @@
cmpld cr7, r29, r30
blt cr7, L(8)
mfcr r0
- rlwinm r0, r0, 30, 1
+ rlwinm r0, r0, 30, 31, 31
subfc r9, r28, r31
addze. r0, r0
nop
@@ -176,7 +176,7 @@
blr
L(fix):
mfcr r0
- rlwinm r0, r0, 30, 1
+ rlwinm r0, r0, 30, 31, 31
subfc r9, r28, r31
addze. r0, r0
beq cr0, L(bck)
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,125 +0,0 @@
-dnl PowerPC-64 mpn_gcd_1.
-
-dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C cycles/bit (approx)
-C POWER3/PPC630 ?
-C POWER4/PPC970 8.5
-C POWER5 ?
-C POWER6 10.1
-C POWER7 9.4
-C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
-
-C INPUT PARAMETERS
-define(`up', `r3')
-define(`n', `r4')
-define(`v0', `r5')
-
-ifdef(`BMOD_1_TO_MOD_1_THRESHOLD',,
- `define(`BMOD_1_TO_MOD_1_THRESHOLD',30)')
-
-EXTERN_FUNC(mpn_mod_1)
-EXTERN_FUNC(mpn_modexact_1c_odd)
-
-ASM_START()
-PROLOGUE(mpn_gcd_1,toc)
- mflr r0
- std r30, -16(r1)
- std r31, -8(r1)
- std r0, 16(r1)
- stdu r1, -128(r1)
-
- ld r7, 0(up) C U low limb
- or r0, r5, r7 C x | y
-
- neg r6, r0
- and r6, r6, r0
- cntlzd r31, r6 C common twos
- subfic r31, r31, 63
-
- neg r6, r5
- and r6, r6, r5
- cntlzd r8, r6
- subfic r8, r8, 63
- srd r5, r5, r8
- mr r30, r5 C v0 saved
-
- cmpdi r4, BMOD_1_TO_MOD_1_THRESHOLD
- blt L(bmod)
- CALL( mpn_mod_1)
- b L(reduced)
-L(bmod):
- li r6, 0
- CALL( mpn_modexact_1c_odd)
-L(reduced):
-
-define(`mask', `r0')dnl
-define(`a1', `r4')dnl
-define(`a2', `r5')dnl
-define(`d1', `r6')dnl
-define(`d2', `r7')dnl
-define(`cnt', `r9')dnl
-
- neg. r6, r3
- and r6, r6, r3
- cntlzd cnt, r6
- subfic cnt, cnt, 63
- li r12, 63
- bne L(mid)
- b L(end)
-
- ALIGN(16)
-L(top):
- and a1, r10, mask C d - a
- andc a2, r11, mask C a - d
- and d1, r3, mask C a
- andc d2, r30, mask C d
- or r3, a1, a2 C new a
- subf cnt, cnt, r12
- or r30, d1, d2 C new d
-L(mid): srd r3, r3, cnt
- sub. r10, r30, r3 C r10 = d - a
- subc r11, r3, r30 C r11 = a - d
- neg r8, r10
- and r8, r8, r10
- subfe mask, mask, mask
- cntlzd cnt, r8
- bne L(top)
-
-L(end): sld r3, r30, r31
-
- addi r1, r1, 128
- ld r0, 16(r1)
- ld r30, -16(r1)
- ld r31, -8(r1)
- mtlr r0
- blr
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,77 @@
+dnl PowerPC-64 mpn_gcd_11.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C POWER3/PPC630 ?
+C POWER4/PPC970 8.5 obsolete
+C POWER5 ?
+C POWER6 ?
+C POWER7 9.4 obsolete
+C POWER8 ?
+C POWER9 ?
+C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
+
+define(`u0', `r3')
+define(`v0', `r4')
+
+define(`mask', `r0')dnl
+define(`a1', `r4')dnl
+define(`a2', `r5')dnl
+define(`d1', `r6')dnl
+define(`d2', `r7')dnl
+define(`cnt', `r9')dnl
+
+ASM_START()
+PROLOGUE(mpn_gcd_11)
+ li r12, 63
+ mr r8, v0
+ subf. r10, u0, v0 C r10 = d - a
+ beq L(end)
+
+ ALIGN(16)
+L(top): subfc r11, r8, r3 C r11 = a - d
+ and d2, r11, r10
+ subfe mask, mask, mask
+ cntlzd cnt, d2
+ and a1, r10, mask C d - a
+ andc a2, r11, mask C a - d
+ and d1, r3, mask C a
+ andc d2, r8, mask C d
+ or r3, a1, a2 C new a
+ subf cnt, cnt, r12
+ or r8, d1, d2 C new d
+ srd r3, r3, cnt
+ subf. r10, r3, r8 C r10 = d - a
+ bne L(top)
+
+L(end): blr
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p4/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p4/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p4/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -50,6 +50,8 @@
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
#define BMOD_1_TO_MOD_1_THRESHOLD 35
+#define DIV_1_VS_MUL_1_PERCENT 218
+
#define MUL_TOOM22_THRESHOLD 14
#define MUL_TOOM33_THRESHOLD 53
#define MUL_TOOM44_THRESHOLD 136
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,110 +0,0 @@
-dnl PowerPC-64 mpn_gcd_1.
-
-dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-C cycles/bit (approx)
-C POWER3/PPC630 -
-C POWER4/PPC970 -
-C POWER5 -
-C POWER6 -
-C POWER7 7.6
-C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
-
-C INPUT PARAMETERS
-define(`up', `r3')
-define(`n', `r4')
-define(`v0', `r5')
-
-EXTERN_FUNC(mpn_mod_1)
-EXTERN_FUNC(mpn_modexact_1c_odd)
-
-ASM_START()
-PROLOGUE(mpn_gcd_1,toc)
- mflr r0
- std r30, -16(r1)
- std r31, -8(r1)
- std r0, 16(r1)
- stdu r1, -128(r1)
-
- ld r7, 0(up) C U low limb
- or r0, r5, r7 C x | y
-
- neg r6, r0
- and r6, r6, r0
- cntlzd r31, r6 C common twos
- subfic r31, r31, 63
-
- neg r6, r5
- and r6, r6, r5
- cntlzd r8, r6
- subfic r8, r8, 63
- srd r5, r5, r8
- mr r30, r5 C v0 saved
-
- cmpdi r4, BMOD_1_TO_MOD_1_THRESHOLD
- blt L(bmod)
- CALL( mpn_mod_1)
- b L(reduced)
-L(bmod):
- li r6, 0
- CALL( mpn_modexact_1c_odd)
-L(reduced):
-
-define(`cnt', `r9')dnl
-
- neg. r6, r3
- and r6, r6, r3
- cntlzd cnt, r6
- li r12, 63
- bne L(mid)
- b L(end)
-
- ALIGN(16)
-L(top): isel r30, r3, r30, 29 C y = min(x,y)
- isel r3, r10, r11, 29 C x = |y - x|
-L(mid): subf cnt, cnt, r12 C cnt = 63-cnt
- srd r3, r3, cnt
- subf r10, r3, r30 C r10 = y - x
- subf r11, r30, r3 C r11 = x - y
- cmpld cr7, r30, r3
- and r8, r11, r10 C isolate lsb
- cntlzd cnt, r8
- bne cr7, L(top)
-
-L(end): sld r3, r30, r31
-
- addi r1, r1, 128
- ld r0, 16(r1)
- ld r30, -16(r1)
- ld r31, -8(r1)
- mtlr r0
- blr
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,67 @@
+dnl PowerPC-64 mpn_gcd_11.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 7.6 obsolete
+C POWER8 ?
+C POWER9 ?
+C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
+
+C INPUT PARAMETERS
+define(`u0', `r3')
+define(`v0', `r4')
+
+define(`cnt', `r9')dnl
+
+ASM_START()
+PROLOGUE(mpn_gcd_11)
+ li r12, 63
+ b L(odd)
+
+ ALIGN(16)
+L(top): and r8, r11, r10 C isolate lsb
+ cntlzd cnt, r8
+ isel v0, u0, v0, 29 C v = min(u,v)
+ isel u0, r10, r11, 29 C u = |u - v|
+ subf cnt, cnt, r12 C cnt = 63-cnt
+ srd u0, u0, cnt
+L(odd): cmpld cr7, v0, u0
+ subf r10, u0, v0 C r10 = v - u
+ subf r11, v0, u0 C r11 = u - v
+ bne cr7, L(top)
+
+L(end): blr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_22.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_22.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gcd_22.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,146 @@
+dnl PowerPC-64 mpn_gcd_22 optimised for POWER7 and POWER8.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013, 2019 Free Software Foundation,
+dnl Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 12.3
+C POWER8 13.4
+C POWER9 10.6
+
+C We define SLOW if this target uses a slow struct return mechanism, with
+C r3 as an implicit parameter for the struct pointer.
+undefine(`SLOW')dnl
+ifdef(`AIX',`define(`SLOW',`due to AIX')',`
+ ifdef(`DARWIN',,`
+ ifdef(`ELFv2_ABI',,`define(`SLOW',`due to ELFv1')')dnl
+ ')
+')
+
+ifdef(`SLOW',`
+define(`IFSLOW', `$1')
+define(`u1', `r4')
+define(`u0', `r5')
+define(`v1', `r6')
+define(`v0', `r7')
+',`
+define(`IFSLOW', `')
+define(`u1', `r3')
+define(`u0', `r4')
+define(`v1', `r5')
+define(`v0', `r6')
+')
+
+define(`tmp', `r0')
+define(`t0', `r8')
+define(`t1', `r9')
+define(`s0', `r10')
+define(`s1', `r11')
+define(`cnt', `r12')
+
+ASM_START()
+PROLOGUE(mpn_gcd_22)
+L(top): subfc. t0, v0, u0 C 0 12
+ beq cr0, L(lowz)
+ subfe t1, v1, u1 C 2 14
+ subfe. tmp, tmp, tmp C 4 set cr0 from the carry bit
+ subfc s0, u0, v0 C 0
+ subfe s1, u1, v1 C 2
+
+L(bck): and tmp, s0, t0 C 2
+ cntlzd cnt, tmp C 4
+ addi tmp, cnt, 1 C 6
+ subfic cnt, cnt, 63 C 6
+
+ isel v0, v0, u0, 2 C 6 use condition set by subfe
+ isel v1, v1, u1, 2 C 6
+ isel u0, t0, s0, 2 C 6
+ isel u1, t1, s1, 2 C 6
+
+ srd u0, u0, cnt C 8
+ sld tmp, u1, tmp C 8
+ srd u1, u1, cnt C 8
+ or u0, u0, tmp C 10
+
+ or. r0, u1, v1 C 10
+ bne L(top)
+
+
+ li r0, 63
+ b L(odd)
+ ALIGN(16)
+L(top1):isel v0, u0, v0, 29 C v = min(u,v)
+ isel u0, r10, r11, 29 C u = |u - v|
+ subf cnt, cnt, r0 C cnt = 63-cnt
+ srd u0, u0, cnt
+L(odd): subf r10, u0, v0 C r10 = v - u
+ subf r11, v0, u0 C r11 = u - v
+ cmpld cr7, v0, u0
+ and r8, r11, r10 C isolate lsb
+ cntlzd cnt, r8
+ bne cr7, L(top1)
+
+ifdef(`SLOW',`
+ std v0, 0(r3)
+ std r10, 8(r3) C zero
+',`
+ mr r3, v0
+ li r4, 0
+')
+ blr
+
+
+L(lowz):C We come here when v0 - u0 = 0
+ C 1. If v1 - u1 = 0, then gcd is u = v.
+ C 2. Else compute gcd_21({v1,v0}, |u1-v1|)
+ subfc. t0, v1, u1 C 2 8
+ beq L(end)
+ li t1, 0
+ subfe. tmp, tmp, tmp C 4 set cr0 from the carry bit
+ subf s0, u1, v1 C 2
+ li s1, 0
+ b L(bck)
+
+L(end):
+ifdef(`SLOW',`
+ std v0, 0(r3)
+ std v1, 8(r3)
+ blr
+',`
+ mr r3, v0
+ mr r4, v1
+ blr
+')
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p7/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* POWER7 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 1999-2003, 2009-2011, 2013-2015 Free Software
-Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,214 +31,144 @@
#define GMP_LIMB_BITS 64
#define GMP_LIMB_BYTES 8
-/* 3425 MHz POWER8/SMT4 (gcc112.fsffrance.org) */
-/* FFT tuning limit = 100 M */
-/* Generated by tuneup.c, 2015-10-09, gcc 4.9 */
+/* 3720 MHz POWER7/SMT4 */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2019-10-02, gcc 4.8 */
#define MOD_1_NORM_THRESHOLD 0 /* always */
#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 13
-#define MOD_1_2_TO_MOD_1_4_THRESHOLD 26
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 9
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 8
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 16
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
#define USE_PREINV_DIVREM_1 0
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 2
+#define DIV_QR_1N_PI1_METHOD 1 /* 3.47% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 1
#define DIV_QR_1_UNNORM_THRESHOLD 1
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 35
+#define BMOD_1_TO_MOD_1_THRESHOLD 27
+#define DIV_1_VS_MUL_1_PERCENT 341
+
#define MUL_TOOM22_THRESHOLD 22
-#define MUL_TOOM33_THRESHOLD 72
-#define MUL_TOOM44_THRESHOLD 202
-#define MUL_TOOM6H_THRESHOLD 278
+#define MUL_TOOM33_THRESHOLD 71
+#define MUL_TOOM44_THRESHOLD 196
+#define MUL_TOOM6H_THRESHOLD 298
#define MUL_TOOM8H_THRESHOLD 406
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 69
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 134
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 128
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 137
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 140
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 132
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 139
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 120
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_TOOM2_THRESHOLD 32
-#define SQR_TOOM3_THRESHOLD 96
-#define SQR_TOOM4_THRESHOLD 178
-#define SQR_TOOM6_THRESHOLD 270
-#define SQR_TOOM8_THRESHOLD 357
+#define SQR_TOOM3_THRESHOLD 105
+#define SQR_TOOM4_THRESHOLD 190
+#define SQR_TOOM6_THRESHOLD 318
+#define SQR_TOOM8_THRESHOLD 547
-#define MULMID_TOOM42_THRESHOLD 42
+#define MULMID_TOOM42_THRESHOLD 56
-#define MULMOD_BNM1_THRESHOLD 16
-#define SQRMOD_BNM1_THRESHOLD 19
+#define MULMOD_BNM1_THRESHOLD 18
+#define SQRMOD_BNM1_THRESHOLD 20
-#define MUL_FFT_MODF_THRESHOLD 404 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 436 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 404, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
- { 21, 7}, { 12, 6}, { 25, 7}, { 21, 8}, \
+ { { 436, 5}, { 21, 6}, { 21, 7}, { 11, 6}, \
+ { 23, 7}, { 12, 6}, { 25, 7}, { 21, 8}, \
{ 11, 7}, { 25, 8}, { 13, 7}, { 28, 8}, \
- { 15, 7}, { 32, 8}, { 17, 7}, { 35, 8}, \
+ { 15, 7}, { 33, 8}, { 17, 7}, { 35, 8}, \
{ 19, 7}, { 39, 8}, { 21, 9}, { 11, 8}, \
- { 27, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
- { 41, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
- { 15, 9}, { 39,10}, { 23, 9}, { 51,11}, \
- { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
- { 79,10}, { 47, 9}, { 95,10}, { 55,11}, \
- { 31,10}, { 79,11}, { 47,10}, { 95,12}, \
+ { 29, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
+ { 41, 9}, { 23, 8}, { 49, 9}, { 27,10}, \
+ { 15, 9}, { 31, 8}, { 63, 9}, { 43,10}, \
+ { 23, 9}, { 55,11}, { 15,10}, { 31, 9}, \
+ { 67,10}, { 39, 9}, { 79,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 63, 9}, \
+ { 127,10}, { 79,11}, { 47,10}, { 103,12}, \
{ 31,11}, { 63,10}, { 135,11}, { 79,10}, \
- { 159,11}, { 95,10}, { 191, 9}, { 383,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
- { 271,11}, { 143,10}, { 287, 9}, { 575,11}, \
+ { 159,11}, { 95,10}, { 191, 9}, { 383,11}, \
+ { 111,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,11}, { 143,10}, { 287, 9}, { 575,11}, \
{ 159,10}, { 319,12}, { 95,11}, { 191,10}, \
- { 383,13}, { 63,12}, { 127,11}, { 255, 9}, \
- { 1023,10}, { 543, 9}, { 1087,11}, { 287,10}, \
- { 575, 9}, { 1151,11}, { 303,12}, { 159,11}, \
- { 319,10}, { 639,11}, { 335,10}, { 671,11}, \
- { 351,10}, { 703, 9}, { 1407,11}, { 383,10}, \
- { 767,11}, { 415,10}, { 831,12}, { 223,11}, \
- { 447,10}, { 895,13}, { 127,12}, { 255,11}, \
- { 511,10}, { 1023,11}, { 543,10}, { 1087,12}, \
- { 287,11}, { 575,10}, { 1151,11}, { 607,10}, \
- { 1215,12}, { 319,11}, { 639,10}, { 1279,11}, \
- { 671,12}, { 351,11}, { 703,10}, { 1407,13}, \
- { 191,12}, { 383,11}, { 767,12}, { 415,11}, \
- { 831,10}, { 1663,12}, { 447,11}, { 895,14}, \
- { 127,13}, { 255,12}, { 511,11}, { 1023,12}, \
- { 543,11}, { 1087,10}, { 2175,12}, { 575,11}, \
- { 1151,12}, { 607,11}, { 1215,13}, { 319,12}, \
- { 639,11}, { 1279,12}, { 671,11}, { 1343,12}, \
- { 703,13}, { 383,12}, { 767,11}, { 1535,12}, \
- { 831,11}, { 1663,13}, { 447,12}, { 959,11}, \
- { 1919,14}, { 255,13}, { 511,12}, { 1087,11}, \
- { 2175,13}, { 575,12}, { 1215,11}, { 2431,13}, \
- { 639,12}, { 1343,13}, { 703,12}, { 1407,14}, \
- { 383,13}, { 767,12}, { 1535,13}, { 831,12}, \
- { 1663,13}, { 959,12}, { 1919,15}, { 255,14}, \
- { 511,13}, { 1023,11}, { 4223,13}, { 1087,12}, \
- { 2175,13}, { 1215,12}, { 2431,14}, { 639,13}, \
- { 1343,12}, { 2687,13}, { 1407,12}, { 2815,14}, \
- { 767,13}, { 1535,12}, { 3071,13}, { 1599,12}, \
- { 3199,13}, { 1663,14}, { 895,13}, { 1919,15}, \
- { 511,14}, { 1023,13}, { 2047,12}, { 4095,13}, \
- { 2175,14}, { 1151,13}, { 2431,12}, { 4863,14}, \
- { 1279,13}, { 2687,14}, { 1407,13}, { 2815,15}, \
- { 767,14}, { 1535,13}, { 3199,14}, { 1663,13}, \
- { 3327,12}, { 6655,13}, { 3455,12}, { 6911,14}, \
- { 1919,13}, { 3839,16}, { 511,15}, { 1023,14}, \
- { 2047,13}, { 4095,14}, { 2175,13}, { 4351,12}, \
- { 8703,14}, { 2431,13}, { 4863,15}, { 1279,14}, \
- { 2943,13}, { 5887,12}, { 11775,15}, { 1535,14}, \
- { 3327,13}, { 6655,14}, { 3455,13}, { 6911,15}, \
- { 1791,14}, { 3583,13}, { 7167,14}, { 3839,16}, \
- { 1023,15}, { 2047,14}, { 4351,13}, { 8703,14}, \
- { 4479,15}, { 2303,14}, { 4863,13}, { 9983,15}, \
- { 2559,14}, { 5247,15}, { 2815,14}, { 5631,13}, \
- { 11263,14}, { 5887,13}, { 11775,16}, { 65536,17}, \
+ { 383, 9}, { 767,11}, { 207,10}, { 415,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
{ 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
{2097152,22}, {4194304,23}, {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 247
-#define MUL_FFT_THRESHOLD 4544
+#define MUL_FFT_TABLE3_SIZE 83
+#define MUL_FFT_THRESHOLD 4736
-#define SQR_FFT_MODF_THRESHOLD 344 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 368 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 344, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
- { 21, 7}, { 11, 6}, { 23, 7}, { 21, 8}, \
- { 11, 7}, { 25, 8}, { 13, 7}, { 27, 8}, \
- { 15, 7}, { 31, 8}, { 21, 9}, { 11, 8}, \
- { 27, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
- { 41, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
- { 15, 9}, { 39,10}, { 23, 9}, { 51,11}, \
+ { { 368, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 12, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 25, 8}, \
+ { 13, 7}, { 28, 8}, { 15, 7}, { 32, 8}, \
+ { 17, 7}, { 35, 8}, { 19, 7}, { 39, 8}, \
+ { 21, 9}, { 11, 8}, { 29, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 31, 8}, \
+ { 63, 9}, { 39,10}, { 23, 9}, { 51,11}, \
{ 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
- { 79,10}, { 55,11}, { 31,10}, { 79,11}, \
- { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
- { 127, 9}, { 255,11}, { 79, 9}, { 319,11}, \
- { 95,10}, { 191, 9}, { 383,12}, { 63,11}, \
- { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
- { 543,11}, { 143,10}, { 287, 9}, { 575,10}, \
- { 303, 9}, { 607,10}, { 319,12}, { 95,11}, \
- { 191,10}, { 383,13}, { 63,12}, { 127,11}, \
- { 255,10}, { 511,11}, { 271,10}, { 543,11}, \
- { 287,10}, { 575,11}, { 303,10}, { 607,11}, \
- { 319,10}, { 639,11}, { 351,10}, { 703,12}, \
- { 191,11}, { 383,10}, { 767,11}, { 415,12}, \
- { 223,11}, { 447,10}, { 895,13}, { 127,12}, \
- { 255,11}, { 511,10}, { 1023,11}, { 543,12}, \
- { 287,11}, { 575,10}, { 1151,11}, { 607,12}, \
- { 319,11}, { 639,10}, { 1279,12}, { 351,11}, \
- { 703,13}, { 191,12}, { 383,11}, { 767,12}, \
- { 415,11}, { 831,12}, { 447,11}, { 895,14}, \
- { 127,13}, { 255,12}, { 511,11}, { 1023,12}, \
- { 575,11}, { 1151,12}, { 607,13}, { 319,12}, \
- { 639,11}, { 1279,12}, { 671,11}, { 1343,12}, \
- { 703,11}, { 1407,13}, { 383,12}, { 767,11}, \
- { 1535,12}, { 831,11}, { 1663,13}, { 447,12}, \
- { 959,11}, { 1919,14}, { 255,13}, { 511,12}, \
- { 1087,11}, { 2175,13}, { 575,12}, { 1215,11}, \
- { 2431,13}, { 639,12}, { 1343,13}, { 703,12}, \
- { 1407,14}, { 383,13}, { 767,12}, { 1535,13}, \
- { 831,12}, { 1663,13}, { 959,12}, { 1919,15}, \
- { 255,14}, { 511,13}, { 1087,12}, { 2175,13}, \
- { 1215,12}, { 2431,14}, { 639,13}, { 1343,12}, \
- { 2687,13}, { 1407,12}, { 2815,14}, { 767,13}, \
- { 1663,14}, { 895,13}, { 1919,12}, { 3839,15}, \
- { 511,14}, { 1023,13}, { 2175,14}, { 1151,13}, \
- { 2431,12}, { 4863,14}, { 1407,13}, { 2815,15}, \
- { 767,14}, { 1535,13}, { 3071,14}, { 1663,13}, \
- { 3455,14}, { 1791,13}, { 3583,14}, { 1919,13}, \
- { 3839,16}, { 511,15}, { 1023,14}, { 2431,13}, \
- { 4863,15}, { 1279,14}, { 2815,13}, { 5631,14}, \
- { 2943,13}, { 5887,12}, { 11775,15}, { 1535,14}, \
- { 3199,15}, { 1791,14}, { 3583,13}, { 7679,12}, \
- { 15359,16}, { 1023,15}, { 2047,14}, { 4223,15}, \
- { 2303,14}, { 4863,13}, { 9983,15}, { 2815,14}, \
- { 5631,13}, { 11263,14}, { 5887,13}, { 11775,16}, \
+ { 79,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 79,11}, { 47,10}, { 95,12}, \
+ { 31,11}, { 63,10}, { 135,11}, { 79,10}, \
+ { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
+ { 383,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,11}, { 143,10}, { 287, 9}, \
+ { 575,10}, { 303,11}, { 159,10}, { 319, 9}, \
+ { 639,12}, { 95,11}, { 191,10}, { 383, 9}, \
+ { 767,13}, { 8192,14}, { 16384,15}, { 32768,16}, \
{ 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
{1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 212
-#define SQR_FFT_THRESHOLD 2880
+#define SQR_FFT_TABLE3_SIZE 84
+#define SQR_FFT_THRESHOLD 3264
#define MULLO_BASECASE_THRESHOLD 3
-#define MULLO_DC_THRESHOLD 23
-#define MULLO_MUL_N_THRESHOLD 8907
+#define MULLO_DC_THRESHOLD 35
+#define MULLO_MUL_N_THRESHOLD 9449
#define SQRLO_BASECASE_THRESHOLD 3
-#define SQRLO_DC_THRESHOLD 114
-#define SQRLO_SQR_THRESHOLD 5742
+#define SQRLO_DC_THRESHOLD 119
+#define SQRLO_SQR_THRESHOLD 6440
-#define DC_DIV_QR_THRESHOLD 32
-#define DC_DIVAPPR_Q_THRESHOLD 148
-#define DC_BDIV_QR_THRESHOLD 47
-#define DC_BDIV_Q_THRESHOLD 108
+#define DC_DIV_QR_THRESHOLD 33
+#define DC_DIVAPPR_Q_THRESHOLD 124
+#define DC_BDIV_QR_THRESHOLD 62
+#define DC_BDIV_Q_THRESHOLD 144
-#define INV_MULMOD_BNM1_THRESHOLD 58
-#define INV_NEWTON_THRESHOLD 147
-#define INV_APPR_THRESHOLD 132
+#define INV_MULMOD_BNM1_THRESHOLD 67
+#define INV_NEWTON_THRESHOLD 123
+#define INV_APPR_THRESHOLD 123
-#define BINV_NEWTON_THRESHOLD 278
-#define REDC_1_TO_REDC_2_THRESHOLD 59
-#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
+#define BINV_NEWTON_THRESHOLD 284
+#define REDC_1_TO_REDC_2_THRESHOLD 18
+#define REDC_2_TO_REDC_N_THRESHOLD 109
-#define MU_DIV_QR_THRESHOLD 1142
-#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MU_DIV_QR_THRESHOLD 1387
+#define MU_DIVAPPR_Q_THRESHOLD 1334
#define MUPI_DIV_QR_THRESHOLD 50
-#define MU_BDIV_QR_THRESHOLD 1120
-#define MU_BDIV_Q_THRESHOLD 1470
+#define MU_BDIV_QR_THRESHOLD 1308
+#define MU_BDIV_Q_THRESHOLD 1499
-#define POWM_SEC_TABLE 3,25,194,712,2177
+#define POWM_SEC_TABLE 1,23,121,579,642
-#define GET_STR_DC_THRESHOLD 8
-#define GET_STR_PRECOMPUTE_THRESHOLD 17
-#define SET_STR_DC_THRESHOLD 795
-#define SET_STR_PRECOMPUTE_THRESHOLD 2655
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 18
+#define SET_STR_DC_THRESHOLD 1562
+#define SET_STR_PRECOMPUTE_THRESHOLD 3100
-#define FAC_DSC_THRESHOLD 378
-#define FAC_ODD_THRESHOLD 24
+#define FAC_DSC_THRESHOLD 774
+#define FAC_ODD_THRESHOLD 25
-#define MATRIX22_STRASSEN_THRESHOLD 11
-#define HGCD_THRESHOLD 90
-#define HGCD_APPR_THRESHOLD 136
-#define HGCD_REDUCE_THRESHOLD 2479
-#define GCD_DC_THRESHOLD 393
-#define GCDEXT_DC_THRESHOLD 408
-#define JACOBI_BASE_METHOD 4
+#define MATRIX22_STRASSEN_THRESHOLD 18
+#define HGCD2_DIV1_METHOD 5 /* 3.27% faster than 3 */
+#define HGCD_THRESHOLD 118
+#define HGCD_APPR_THRESHOLD 150
+#define HGCD_REDUCE_THRESHOLD 3014
+#define GCD_DC_THRESHOLD 386
+#define GCDEXT_DC_THRESHOLD 365
+#define JACOBI_BASE_METHOD 4 /* 27.64% faster than 1 */
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,170 @@
+/* POWER8 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2017 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 4150 MHz POWER8/SMT4 */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2019-09-24, gcc 7.2 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 11
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 22
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define USE_PREINV_DIVREM_1 0
+#define DIV_QR_1N_PI1_METHOD 2 /* 16.97% faster than 1 */
+#define DIV_QR_1_NORM_THRESHOLD 2
+#define DIV_QR_1_UNNORM_THRESHOLD 1
+#define DIV_QR_2_PI2_THRESHOLD 9
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 34
+
+#define DIV_1_VS_MUL_1_PERCENT 276
+
+#define MUL_TOOM22_THRESHOLD 18
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 195
+#define MUL_TOOM6H_THRESHOLD 278
+#define MUL_TOOM8H_THRESHOLD 406
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 73
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 131
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 121
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 138
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 32
+#define SQR_TOOM3_THRESHOLD 97
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 303
+#define SQR_TOOM8_THRESHOLD 454
+
+#define MULMID_TOOM42_THRESHOLD 42
+
+#define MULMOD_BNM1_THRESHOLD 15
+#define SQRMOD_BNM1_THRESHOLD 19
+
+#define MUL_FFT_MODF_THRESHOLD 404 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 404, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 12, 6}, \
+ { 25, 7}, { 21, 8}, { 11, 7}, { 25, 8}, \
+ { 13, 7}, { 27, 8}, { 15, 7}, { 31, 8}, \
+ { 17, 7}, { 35, 8}, { 19, 7}, { 39, 8}, \
+ { 21, 9}, { 11, 8}, { 27, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 63,10}, { 39, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 131,10}, \
+ { 79,11}, { 47,10}, { 95,12}, { 31,11}, \
+ { 63,10}, { 127, 9}, { 255,10}, { 135,11}, \
+ { 79,10}, { 159,11}, { 95, 8}, { 767, 7}, \
+ { 1599,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,11}, { 143,10}, { 287, 9}, \
+ { 575,11}, { 159,12}, { 95,11}, { 191,10}, \
+ { 383,13}, { 8192,14}, { 16384,15}, { 32768,16}, \
+ { 65536,17}, { 131072,18}, { 262144,19}, { 524288,20}, \
+ {1048576,21}, {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 80
+#define MUL_FFT_THRESHOLD 4736
+
+#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 340, 5}, { 19, 6}, { 10, 5}, { 21, 6}, \
+ { 21, 7}, { 11, 6}, { 23, 7}, { 21, 8}, \
+ { 11, 7}, { 25, 8}, { 13, 7}, { 27, 8}, \
+ { 15, 7}, { 31, 8}, { 21, 9}, { 11, 8}, \
+ { 27, 9}, { 15, 8}, { 33, 9}, { 19, 8}, \
+ { 41, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 47,11}, \
+ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
+ { 79,10}, { 47,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,11}, { 79, 9}, { 319,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 143,10}, \
+ { 287, 9}, { 575,10}, { 303, 9}, { 607,10}, \
+ { 319,12}, { 95,11}, { 191,10}, { 383,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 71
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 3
+#define MULLO_DC_THRESHOLD 33
+#define MULLO_MUL_N_THRESHOLD 9174
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 114
+#define SQRLO_SQR_THRESHOLD 6461
+
+#define DC_DIV_QR_THRESHOLD 38
+#define DC_DIVAPPR_Q_THRESHOLD 158
+#define DC_BDIV_QR_THRESHOLD 48
+#define DC_BDIV_Q_THRESHOLD 112
+
+#define INV_MULMOD_BNM1_THRESHOLD 74
+#define INV_NEWTON_THRESHOLD 132
+#define INV_APPR_THRESHOLD 131
+
+#define BINV_NEWTON_THRESHOLD 278
+#define REDC_1_TO_REDC_2_THRESHOLD 56
+#define REDC_2_TO_REDC_N_THRESHOLD 0 /* always */
+
+#define MU_DIV_QR_THRESHOLD 1142
+#define MU_DIVAPPR_Q_THRESHOLD 1142
+#define MUPI_DIV_QR_THRESHOLD 46
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1470
+
+#define POWM_SEC_TABLE 3,19,117,672,1867
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 18
+#define SET_STR_DC_THRESHOLD 608
+#define SET_STR_PRECOMPUTE_THRESHOLD 2405
+
+#define FAC_DSC_THRESHOLD 164
+#define FAC_ODD_THRESHOLD 0 /* always */
+
+#define MATRIX22_STRASSEN_THRESHOLD 14
+#define HGCD2_DIV1_METHOD 1 /* 6.88% faster than 3 */
+#define HGCD_THRESHOLD 114
+#define HGCD_APPR_THRESHOLD 118
+#define HGCD_REDUCE_THRESHOLD 2205
+#define GCD_DC_THRESHOLD 440
+#define GCDEXT_DC_THRESHOLD 345
+#define JACOBI_BASE_METHOD 1 /* 0.74% faster than 4 */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/invert_limb.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/invert_limb.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p8/invert_limb.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
dnl PowerPC-64 mpn_invert_limb -- Invert a normalized limb.
-dnl Copyright 2015 Free Software Foundation, Inc.
+dnl Copyright 2015, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -45,7 +45,7 @@
PROLOGUE(mpn_invert_limb)
sldi. r4, r3, 1
neg r5, r3
- divdeu r3, r5, r3
+ divdeu( r3, r5, r3)
beq- L(1)
blr
L(1): li r3, -1
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/add_n_sub_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/add_n_sub_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/add_n_sub_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,112 @@
+dnl PowerPC-64 mpn_add_n_sub_n optimised for POWER9.
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 -
+C POWER8 -
+C POWER9 2.25
+
+
+C INPUT PARAMETERS
+define(`arp', `r3')
+define(`srp', `r4')
+define(`up', `r5')
+define(`vp', `r6')
+define(`n', `r7')
+
+ASM_START()
+PROLOGUE(mpn_add_n_sub_n)
+ cmpdi cr7, n, 2
+ subfo r0, r0, r0 C clear OV
+ rldicl. r9, n, 0, 63 C n & 1
+ beq cr0, L(bx0)
+
+L(bx1): ld r10, 0(up)
+ ld r11, 0(vp)
+ ble cr7, L(1)
+ srdi r7, r7, 1
+ mtctr r7
+ ld r8, 8(up)
+ ld r9, 8(vp)
+ addex( r0, r10, r11, 0)
+ subfc r12, r11, r10
+ addi up, up, -8
+ addi vp, vp, -8
+ b L(lo1)
+
+L(bx0): ld r8, 0(up)
+ ld r9, 0(vp)
+ ld r10, 8(up)
+ ld r11, 8(vp)
+ addex( r0, r8, r9, 0)
+ subfc r12, r9, r8
+ addi arp, arp, 8
+ addi srp, srp, 8
+ ble cr7, L(end)
+ addi r7, r7, -1
+ srdi r7, r7, 1
+ mtctr r7
+
+L(top): ld r8, 16(up)
+ ld r9, 16(vp)
+ std r0, -8(arp)
+ std r12, -8(srp)
+ addex( r0, r10, r11, 0)
+ subfe r12, r11, r10
+L(lo1): ld r10, 24(up)
+ ld r11, 24(vp)
+ std r0, 0(arp)
+ std r12, 0(srp)
+ addex( r0, r8, r9, 0)
+ subfe r12, r9, r8
+ addi up, up, 16
+ addi vp, vp, 16
+ addi arp, arp, 16
+ addi srp, srp, 16
+ bdnz L(top)
+
+L(end): std r0, -8(arp)
+ std r12, -8(srp)
+L(1): addex( r0, r10, r11, 0)
+ subfe r12, r11, r10
+ std r0, 0(arp)
+ std r12, 0(srp)
+ subfe r3, r3, r3
+ addex( r3, r3, r3, 0)
+ rldicl r3, r3, 1, 62
+ blr
+EPILOGUE()
+ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,130 @@
+dnl Power9 mpn_addmul_1.
+
+dnl Copyright 2017, 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 -
+C POWER8 -
+C POWER9 2.5
+
+C TODO
+C * Schedule for Power9 pipeline.
+C * Unroll 4x if that proves beneficial.
+C * This is marginally faster (but much smaller) than ../aorsmul_1.asm.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`v0', `r6')
+
+ASM_START()
+PROLOGUE(mpn_addmul_1)
+ cmpdi cr6, n, 2
+ addi r0, n, -1 C FIXME: postpone
+ srdi r0, r0, 1 C FIXME: postpone
+ mtctr r0 C FIXME: postpone
+ rldicl. r0, n, 0,63 C r0 = n & 3, set cr0
+ bne cr0, L(b1)
+
+L(b0): ld r10, 0(rp)
+ ld r12, 0(up)
+ ld r11, 8(rp)
+ ld r0, 8(up)
+ maddld( r9, r12, v0, r10)
+ maddhdu(r7, r12, v0, r10)
+ ble cr6, L(2)
+ ld r10, 16(rp)
+ ld r12, 16(up)
+ maddld( r8, r0, v0, r11)
+ maddhdu(r5, r0, v0, r11)
+ addic up, up, 16
+ addi rp, rp, -8
+ b L(mid)
+
+L(b1): ld r11, 0(rp)
+ ld r0, 0(up)
+ ble cr6, L(1)
+ ld r10, 8(rp)
+ ld r12, 8(up)
+ maddld( r8, r0, v0, r11)
+ maddhdu(r5, r0, v0, r11)
+ ld r11, 16(rp)
+ ld r0, 16(up)
+ maddld( r9, r12, v0, r10)
+ maddhdu(r7, r12, v0, r10)
+ addic up, up, 24
+ bdz L(end)
+
+ ALIGN(16)
+L(top): ld r10, 24(rp)
+ ld r12, 0(up)
+ std r8, 0(rp)
+ adde r9, r5, r9
+ maddld( r8, r0, v0, r11) C W:0,2,4
+ maddhdu(r5, r0, v0, r11) C W:1,3,5
+L(mid): ld r11, 32(rp)
+ ld r0, 8(up)
+ std r9, 8(rp)
+ adde r8, r7, r8
+ maddld( r9, r12, v0, r10) C W:1,3,5
+ maddhdu(r7, r12, v0, r10) C W:2,4,6
+ addi rp, rp, 16
+ addi up, up, 16
+ bdnz L(top)
+
+L(end): std r8, 0(rp)
+ maddld( r8, r0, v0, r11)
+ adde r9, r5, r9
+ maddhdu(r5, r0, v0, r11)
+ std r9, 8(rp)
+ adde r8, r7, r8
+ std r8, 16(rp)
+ addze r3, r5
+ blr
+
+L(2): maddld( r8, r0, v0, r11)
+ maddhdu(r5, r0, v0, r11)
+ std r9, 0(rp)
+ addc r8, r7, r8
+ std r8, 8(rp)
+ addze r3, r5
+ blr
+
+L(1): maddld( r8, r0, v0, r11)
+ std r8, 0(rp)
+ maddhdu(r3, r0, v0, r11)
+ blr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_2.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_2.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/addmul_2.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,182 @@
+dnl Power9 mpn_addmul_2.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU Lesser General Public License as published
+dnl by the Free Software Foundation; either version 3 of the License, or (at
+dnl your option) any later version.
+
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+dnl License for more details.
+
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C power9: 1.62
+
+C STATUS
+C * Not written with any power9 pipeline understanding.
+C * The 4x unrolling was not motivated by any timing tests.
+C * No local scheduling for performance tweaking has been done.
+C * Decrease load scheduling!
+
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5') C Note: Reused as scratch
+define(`vp', `r6') C Note: Reused for v1
+
+define(`v0', `r7')
+define(`v1', `r6')
+
+
+ASM_START()
+PROLOGUE(mpn_addmul_2)
+ std r26, -48(r1)
+ std r27, -40(r1)
+ std r28, -32(r1)
+ std r29, -24(r1)
+ std r30, -16(r1)
+ std r31, -8(r1)
+
+ subfic r0, r1, 0 C clear CA
+ subfo r0, r0, r0 C clear OV and r0
+
+ cmpdi cr7, n, 4
+
+ ld v0, 0(vp)
+ ld v1, 8(vp)
+
+ srdi r10, n, 2
+ mtctr r10
+
+ rldicl. r9, n, 0, 63
+ bne cr0, L(bx1)
+
+L(bx0): rldicl. r9, n, 63, 63
+
+ ld r28, 0(rp)
+ ld r8, 0(up)
+ ld r11, 8(rp)
+ ld r9, 8(up)
+ maddld( r26, r8, v0, r28)
+ maddhdu(r31, r8, v0, r28)
+ blt cr7, L(2)
+ ld r28, 16(rp)
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ bne cr0, L(b10)
+
+L(b00): addi up, up, -8
+ addi rp, rp, -24
+ b L(lo0)
+
+L(b10): addi up, up, 8
+ addi rp, rp, -8
+ b L(lo2)
+
+L(2): addi rp, rp, -8
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ b L(cj2)
+
+L(bx1): rldicl. r9, n, 63, 63
+
+ ld r29, 0(rp)
+ ld r9, 0(up)
+ ld r10, 8(rp)
+ ld r8, 8(up)
+ maddld( r27, r9, v0, r29)
+ maddhdu(r30, r9, v0, r29)
+ ld r29, 16(rp)
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ bne cr0, L(b11)
+
+L(b01): addi rp, rp, -16
+ b L(lo1)
+L(b11): addi up, up, 16
+ blt cr7, L(end)
+
+L(top): ld r9, 0(up)
+ maddld( r26, r8, v0, r10) C 0 4 -> adde
+ maddhdu(r31, r8, v0, r10) C 1 5
+ adde r0, r27, r0 C 7 11
+ ld r28, 24(rp)
+ std r0, 0(rp)
+ maddld( r5, r8, v1, r29) C 1 5 -> addex
+ maddhdu(r10, r8, v1, r29) C 2 6
+ addex( r0, r12, r30, 0) C 8 12
+L(lo2): ld r8, 8(up)
+ maddld( r27, r9, v0, r11) C 1 5 -> adde
+ maddhdu(r30, r9, v0, r11) C 2 6
+ adde r0, r26, r0 C 8 12
+ ld r29, 32(rp)
+ std r0, 8(rp)
+ maddld( r12, r9, v1, r28) C 2 6 -> addex
+ maddhdu(r11, r9, v1, r28) C 3 7
+ addex( r0, r5, r31, 0) C 5 9 13
+L(lo1): ld r9, 16(up)
+ maddld( r26, r8, v0, r10) C 2 6 -> adde
+ maddhdu(r31, r8, v0, r10) C 3 7
+ adde r0, r27, r0 C 5 9 13
+ ld r28, 40(rp)
+ std r0, 16(rp)
+ maddld( r5, r8, v1, r29) C 3 7 -> addex
+ maddhdu(r10, r8, v1, r29) C 4 8
+ addex( r0, r12, r30, 0) C 6 10
+L(lo0): ld r8, 24(up)
+ maddld( r27, r9, v0, r11) C 3 7 -> adde
+ maddhdu(r30, r9, v0, r11) C 4 8
+ adde r0, r26, r0 C 6 10
+ ld r29, 48(rp)
+ std r0, 24(rp)
+ maddld( r12, r9, v1, r28) C 4 8 -> addex
+ maddhdu(r11, r9, v1, r28) C 5 9
+ addex( r0, r5, r31, 0) C 7 11
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): ld r9, 0(up)
+ maddld( r26, r8, v0, r10) C 0 4
+ maddhdu(r31, r8, v0, r10) C 1 5
+ adde r0, r27, r0 C 7 11
+ std r0, 0(rp) C -4
+ maddld( r5, r8, v1, r29) C 1 5
+ maddhdu(r10, r8, v1, r29) C 2 6
+ addex( r0, r12, r30, 0) C 8 12
+L(cj2): maddld( r27, r9, v0, r11) C 1 5 -2
+ maddhdu(r30, r9, v0, r11) C 2 6 -1
+ adde r0, r26, r0 C 8 12 -3
+ std r0, 8(rp) C -3
+ mulld r12, r9, v1 C 2 6 -1
+ mulhdu r11, r9, v1 C 3 7 0 = return limb
+ addex( r0, r5, r31, 0) C 5 9 13
+ adde r0, r27, r0 C 5 9 13 -2
+ std r0, 16(rp) C -2
+ addex( r0, r12, r30, 0) C 6 10 -1
+ adde r0, r0, r10 C -1
+ std r0, 24(rp) C -1
+ li r4, 0
+ addze r3, r11
+ addex( r3, r3, r4, 0)
+
+L(ret): ld r26, -48(r1)
+ ld r27, -40(r1)
+ ld r28, -32(r1)
+ ld r29, -24(r1)
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+EPILOGUE()
+ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/aorsmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/aorsmul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/aorsmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,179 @@
+dnl POWER9 mpn_addmul_1 and mpn_submul_1.
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C mpn_addmul_1 mpn_submul_1
+C cycles/limb cycles/limb
+C POWER3/PPC630 - -
+C POWER4/PPC970 - -
+C POWER5 - -
+C POWER6 - -
+C POWER7 - -
+C POWER8 - -
+C POWER9 2.63 2.63
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`v0', `r6')
+
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUBC', adde)
+ define(`ADDSUB', addc)
+ define(`func', mpn_addmul_1)
+ define(`AM', `$1')
+ define(`SM', `')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUBC', subfe)
+ define(`ADDSUB', subfc)
+ define(`func', mpn_submul_1)
+ define(`AM', `')
+ define(`SM', `$1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+PROLOGUE(func)
+ cmpdi cr7, n, 3
+ srdi r10, n, 2
+ mtctr r10
+ rldicl. r9, n, 0, 63
+ ld r11, 0(up)
+ bne cr0, L(bx1)
+
+L(bx0): rldicl. r9, n, 63, 63
+AM(` subfzeo r12, n ') C ov = 0, ca = 0
+AM(` li r12, 0 ')
+SM(` subfco r12, r12, r12 ') C r12 = 0, ov = 0, ca = 1
+ ld r9, 8(up)
+ mulld r0, r11, v0
+ mulhdu r5, r11, v0
+ blt cr7, L(2)
+ ld r8, 16(up)
+ bne cr0, L(b10)
+
+L(b00): addi rp, rp, -24
+ b L(lo0)
+L(b10): addi rp, rp, -8
+ addi up, up, 16
+ b L(lo2)
+
+L(2): addi rp, rp, -8
+ b L(cj2)
+
+L(bx1): rldicl. r9, n, 63, 63
+AM(` subfzeo r5, n ') C ov = 0, ca = 0
+AM(` li r5, 0 ')
+SM(` subfco r5, r5, r5 ') C r5 = 0, ov = 0, ca = 1
+ blt cr7, L(1)
+ ld r8, 8(up)
+ mulld r7, r11, v0
+ mulhdu r12, r11, v0
+ ld r9, 16(up)
+ bne cr0, L(b11)
+
+L(b01): addi rp, rp, -16
+ addi up, up, 8
+ b L(lo1)
+
+L(1): mulld r7, r11, v0
+ mulhdu r12, r11, v0
+ ld r11, 0(rp)
+ ADDSUB r10, r7, r11
+ std r10, 0(rp)
+AM(` addze r3, r12 ')
+SM(` subfe r0, r0, r0 ')
+SM(` sub r3, r12, r0 ')
+ blr
+
+L(b11): addi up, up, 24
+ ble cr7, L(end)
+
+ ALIGN(16)
+L(top): ld r11, 0(rp)
+ mulld r0, r8, v0
+ addex( r7, r7, r5, 0)
+ mulhdu r5, r8, v0
+ ld r8, 0(up)
+ ADDSUBC r10, r7, r11
+ std r10, 0(rp)
+L(lo2): ld r11, 8(rp)
+ mulld r7, r9, v0
+ addex( r0, r0, r12, 0)
+ mulhdu r12, r9, v0
+ ld r9, 8(up)
+ ADDSUBC r10, r0, r11
+ std r10, 8(rp)
+L(lo1): ld r11, 16(rp)
+ mulld r0, r8, v0
+ addex( r7, r7, r5, 0)
+ mulhdu r5, r8, v0
+ ld r8, 16(up)
+ ADDSUBC r10, r7, r11
+ std r10, 16(rp)
+L(lo0): ld r11, 24(rp)
+ mulld r7, r9, v0
+ addex( r0, r0, r12, 0)
+ mulhdu r12, r9, v0
+ ld r9, 24(up)
+ ADDSUBC r10, r0, r11
+ std r10, 24(rp)
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): ld r11, 0(rp)
+ mulld r0, r8, v0
+ addex( r7, r7, r5, 0)
+ mulhdu r5, r8, v0
+ ADDSUBC r10, r7, r11
+ std r10, 0(rp)
+L(cj2): ld r11, 8(rp)
+ mulld r7, r9, v0
+ addex( r0, r0, r12, 0)
+ mulhdu r12, r9, v0
+ ADDSUBC r10, r0, r11
+ std r10, 8(rp)
+ ld r11, 16(rp)
+ addex( r7, r7, r5, 0)
+ ADDSUBC r10, r7, r11
+ std r10, 16(rp)
+ li r0, 0
+ addex( r3, r12, r0, 0)
+AM(` addze r3, r3 ')
+SM(` subfe r0, r0, r0 ')
+SM(` sub r3, r3, r0 ')
+ blr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,64 @@
+dnl PowerPC-64 mpn_gcd_11.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013, 2019 Free Software Foundation,
+dnl Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 -
+C POWER8 -
+C POWER9 5.75
+C Numbers measured with: speed -CD -s16-64 -t48 mpn_gcd_1
+
+define(`u0', `r3')
+define(`v0', `r4')
+
+define(`cnt', `r9')dnl
+
+ASM_START()
+PROLOGUE(mpn_gcd_11)
+ b L(odd)
+
+ ALIGN(16)
+L(top): isel v0, u0, v0, 29 C v = min(u,v)
+ isel u0, r10, r11, 29 C u = |v - u|
+ srd u0, u0, cnt
+L(odd): subf r10, u0, v0 C r10 = v - u
+ subf r11, v0, u0 C r11 = u - v
+ cmpld cr7, v0, u0
+ cnttzd cnt, r10
+ bne cr7, L(top)
+
+L(end): blr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_22.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_22.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gcd_22.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,143 @@
+dnl PowerPC-64 mpn_gcd_22 optimised for POWER9.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013, 2019 Free Software Foundation,
+dnl Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/bit (approx)
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 -
+C POWER8 -
+C POWER9 9.58
+
+C We define SLOW if this target uses a slow struct return mechanism, with
+C r3 as an implicit parameter for the struct pointer.
+undefine(`SLOW')dnl
+ifdef(`AIX',`define(`SLOW',`due to AIX')',`
+ ifdef(`DARWIN',,`
+ ifdef(`ELFv2_ABI',,`define(`SLOW',`due to ELFv1')')dnl
+ ')
+')
+
+ifdef(`SLOW',`
+define(`IFSLOW', `$1')
+define(`u1', `r4')
+define(`u0', `r5')
+define(`v1', `r6')
+define(`v0', `r7')
+',`
+define(`IFSLOW', `')
+define(`u1', `r3')
+define(`u0', `r4')
+define(`v1', `r5')
+define(`v0', `r6')
+')
+
+define(`tmp', `r0')
+define(`t0', `r8')
+define(`t1', `r9')
+define(`s0', `r10')
+define(`s1', `r11')
+define(`cnt', `r12')
+
+ASM_START()
+PROLOGUE(mpn_gcd_22)
+ cmpld cr7, v0, u0
+L(top): subfc t0, v0, u0 C 0 12
+ beq cr7, L(lowz)
+ subfe t1, v1, u1 C 2 14
+ subfe. tmp, tmp, tmp C 4 set cr0 from the carry bit
+ subfc s0, u0, v0 C 0
+ subfe s1, u1, v1 C 2
+
+L(bck): cnttzd cnt, t0 C 2
+ subfic tmp, cnt, 64 C 4
+
+ isel v0, v0, u0, 2 C 6 use condition set by subfe
+ isel u0, t0, s0, 2 C 6
+ isel v1, v1, u1, 2 C 6
+ isel u1, t1, s1, 2 C 6
+
+ srd u0, u0, cnt C 8
+ sld tmp, u1, tmp C 8
+ srd u1, u1, cnt C 8
+ or u0, u0, tmp C 10
+
+ or. r0, u1, v1 C 10
+ cmpld cr7, v0, u0
+ bne L(top)
+
+
+ b L(odd)
+ ALIGN(16)
+L(top1):isel v0, u0, v0, 29 C v = min(u,v)
+ isel u0, r10, r11, 29 C u = |u - v|
+ srd u0, u0, cnt
+L(odd): subf r10, u0, v0 C r10 = v - u
+ subf r11, v0, u0 C r11 = u - v
+ cmpld cr7, v0, u0
+ cnttzd cnt, r10
+ bne cr7, L(top1)
+
+ifdef(`SLOW',`
+ std v0, 0(r3)
+ std r10, 8(r3)
+',`
+ mr r3, v0
+ li r4, 0
+')
+ blr
+
+
+L(lowz):C We come here when v0 - u0 = 0
+ C 1. If v1 - u1 = 0, then gcd is u = v.
+ C 2. Else compute gcd_21({v1,v0}, |u1-v1|)
+ subfc. t0, v1, u1 C 2 8
+ beq L(end)
+ li t1, 0
+ subfe. tmp, tmp, tmp C 4 set cr0 from the carry bit
+ subf s0, u1, v1 C 2
+ li s1, 0
+ b L(bck)
+
+L(end):
+ifdef(`SLOW',`
+ std v0, 0(r3)
+ std v1, 8(r3)
+ blr
+',`
+ mr r3, v0
+ mr r4, v1
+ blr
+')
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,253 @@
+/* POWER9 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 2200MHz POWER9 */
+/* FFT tuning limit = 221,245,838 */
+/* Generated by tuneup.c, 2019-10-29, gcc 8.3 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 7
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 44
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
+#define USE_PREINV_DIVREM_1 0
+#define DIV_QR_1N_PI1_METHOD 2 /* 19.28% faster than 1 */
+#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1_UNNORM_THRESHOLD 2
+#define DIV_QR_2_PI2_THRESHOLD 7
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 33
+
+#define DIV_1_VS_MUL_1_PERCENT 365
+
+#define MUL_TOOM22_THRESHOLD 34
+#define MUL_TOOM33_THRESHOLD 109
+#define MUL_TOOM44_THRESHOLD 458
+#define MUL_TOOM6H_THRESHOLD 517
+#define MUL_TOOM8H_THRESHOLD 608
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 113
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 292
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 204
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 211
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 178
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 46
+#define SQR_TOOM3_THRESHOLD 158
+#define SQR_TOOM4_THRESHOLD 674
+#define SQR_TOOM6_THRESHOLD 0 /* always */
+#define SQR_TOOM8_THRESHOLD 898
+
+#define MULMID_TOOM42_THRESHOLD 70
+
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 25
+
+#define MUL_FFT_MODF_THRESHOLD 404 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 404, 5}, { 23, 6}, { 12, 5}, { 25, 6}, \
+ { 13, 5}, { 27, 6}, { 27, 7}, { 14, 6}, \
+ { 29, 7}, { 15, 6}, { 31, 7}, { 25, 8}, \
+ { 13, 7}, { 28, 8}, { 15, 7}, { 32, 8}, \
+ { 17, 7}, { 35, 8}, { 27, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 39, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 31, 8}, \
+ { 63, 9}, { 35, 8}, { 71, 9}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 71,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
+ { 135,11}, { 79,10}, { 159,11}, { 95,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,11}, \
+ { 143,10}, { 287, 9}, { 575,10}, { 303,11}, \
+ { 159,12}, { 95,11}, { 191,13}, { 63,12}, \
+ { 127,11}, { 255,10}, { 511,11}, { 271,10}, \
+ { 543,11}, { 287,10}, { 575,11}, { 303,12}, \
+ { 159,11}, { 319,10}, { 639,11}, { 335,10}, \
+ { 671,11}, { 351,10}, { 703,11}, { 367,10}, \
+ { 735,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,10}, { 831,12}, { 223,11}, { 447,10}, \
+ { 895,11}, { 479,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,11}, { 543,12}, { 287,11}, \
+ { 575,10}, { 1151,11}, { 607,12}, { 319,11}, \
+ { 639,10}, { 1279,11}, { 671,12}, { 351,11}, \
+ { 703,10}, { 1407,11}, { 735,13}, { 191,12}, \
+ { 383,11}, { 767,10}, { 1535,11}, { 799,12}, \
+ { 415,11}, { 831,10}, { 1663,11}, { 863,12}, \
+ { 447,11}, { 895,12}, { 479,14}, { 127,13}, \
+ { 255,12}, { 511,11}, { 1023,12}, { 543,11}, \
+ { 1087,12}, { 575,11}, { 1151,12}, { 607,13}, \
+ { 319,12}, { 639,11}, { 1279,12}, { 671,11}, \
+ { 1343,12}, { 703,11}, { 1407,12}, { 735,11}, \
+ { 1471,13}, { 383,12}, { 767,11}, { 1535,12}, \
+ { 799,11}, { 1599,12}, { 831,11}, { 1663,13}, \
+ { 447,12}, { 895,11}, { 1791,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1087,11}, { 2175,13}, \
+ { 575,12}, { 1215,13}, { 639,12}, { 1343,13}, \
+ { 703,12}, { 1471,14}, { 383,13}, { 767,12}, \
+ { 1599,13}, { 831,12}, { 1727,13}, { 895,11}, \
+ { 3583,12}, { 1919,15}, { 255,14}, { 511,13}, \
+ { 1087,12}, { 2175,13}, { 1215,14}, { 639,13}, \
+ { 1343,12}, { 2687,13}, { 1471,14}, { 767,13}, \
+ { 1599,12}, { 3199,13}, { 1727,14}, { 895,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,14}, \
+ { 1151,13}, { 2431,12}, { 4863,14}, { 1279,13}, \
+ { 2687,14}, { 1407,13}, { 2943,15}, { 767,14}, \
+ { 1535,13}, { 3199,14}, { 1663,13}, { 3455,12}, \
+ { 6911,14}, { 1919,16}, { 511,15}, { 1023,14}, \
+ { 2175,13}, { 4479,14}, { 2431,13}, { 4863,15}, \
+ { 1279,14}, { 2943,13}, { 5887,15}, { 1535,14}, \
+ { 3455,13}, { 6911,15}, { 1791,14}, { 3839,13}, \
+ { 7679,16}, { 1023,15}, { 2047,14}, { 4351,15}, \
+ { 2303,14}, { 4863,15}, { 2815,14}, { 5887,16}, \
+ { 1535,15}, { 3327,14}, { 6911,15}, { 3839,14}, \
+ { 7679,17}, { 1023,16}, { 2047,15}, { 4351,14}, \
+ { 8959,15}, { 4863,16}, { 2559,15}, { 5887,14}, \
+ { 11775,16}, { 3071,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 243
+#define MUL_FFT_THRESHOLD 3712
+
+#define SQR_FFT_MODF_THRESHOLD 404 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 404, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 29, 7}, { 15, 6}, { 31, 7}, { 25, 8}, \
+ { 13, 7}, { 28, 8}, { 15, 7}, { 32, 8}, \
+ { 17, 7}, { 35, 8}, { 29, 9}, { 15, 8}, \
+ { 35, 9}, { 19, 8}, { 41, 9}, { 23, 8}, \
+ { 47, 9}, { 27,10}, { 15, 9}, { 39,10}, \
+ { 23, 9}, { 51,11}, { 15,10}, { 31, 9}, \
+ { 71,10}, { 39, 9}, { 83,10}, { 47, 9}, \
+ { 95,10}, { 55,11}, { 31,10}, { 79,11}, \
+ { 47,10}, { 95,12}, { 31,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 135,11}, { 79,10}, \
+ { 159,11}, { 95,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 143,10}, \
+ { 287, 9}, { 575,10}, { 303,11}, { 159,12}, \
+ { 95,13}, { 63,12}, { 127,11}, { 255,10}, \
+ { 511,11}, { 271,10}, { 543,11}, { 287,10}, \
+ { 575,11}, { 303,12}, { 159,11}, { 319,10}, \
+ { 639,11}, { 335,10}, { 671,11}, { 351,10}, \
+ { 703,11}, { 367,10}, { 735,12}, { 191,11}, \
+ { 383,10}, { 767,11}, { 415,12}, { 223,11}, \
+ { 447,10}, { 895,13}, { 127,12}, { 255,11}, \
+ { 511,10}, { 1023,11}, { 543,12}, { 287,11}, \
+ { 575,10}, { 1151,11}, { 607,12}, { 319,11}, \
+ { 671,12}, { 351,11}, { 703,10}, { 1407,11}, \
+ { 735,13}, { 191,12}, { 383,11}, { 767,10}, \
+ { 1535,12}, { 415,11}, { 831,12}, { 447,11}, \
+ { 895,12}, { 479,14}, { 127,13}, { 255,12}, \
+ { 511,11}, { 1023,12}, { 543,11}, { 1087,12}, \
+ { 575,11}, { 1151,12}, { 607,13}, { 319,12}, \
+ { 639,11}, { 1279,12}, { 671,11}, { 1343,12}, \
+ { 703,11}, { 1407,12}, { 735,13}, { 383,12}, \
+ { 767,11}, { 1535,12}, { 799,11}, { 1599,12}, \
+ { 831,13}, { 447,12}, { 895,11}, { 1791,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2047,12}, { 1087,13}, { 575,12}, { 1215,13}, \
+ { 639,12}, { 1343,13}, { 703,12}, { 1407,14}, \
+ { 383,13}, { 767,12}, { 1599,13}, { 831,12}, \
+ { 1727,13}, { 895,12}, { 1791,13}, { 959,15}, \
+ { 255,14}, { 511,13}, { 1023,12}, { 2047,13}, \
+ { 1087,12}, { 2175,13}, { 1215,14}, { 639,13}, \
+ { 1343,12}, { 2687,13}, { 1471,14}, { 767,13}, \
+ { 1599,12}, { 3199,13}, { 1727,14}, { 895,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,14}, \
+ { 1151,13}, { 2431,12}, { 4863,14}, { 1279,13}, \
+ { 2687,14}, { 1407,13}, { 2815,15}, { 767,14}, \
+ { 1535,13}, { 3199,14}, { 1663,13}, { 3455,14}, \
+ { 1919,16}, { 511,15}, { 1023,14}, { 2175,13}, \
+ { 4479,14}, { 2431,13}, { 4863,15}, { 1279,14}, \
+ { 2943,13}, { 5887,15}, { 1535,14}, { 3455,13}, \
+ { 6911,15}, { 1791,14}, { 3839,16}, { 1023,15}, \
+ { 2047,14}, { 4479,15}, { 2303,14}, { 4863,15}, \
+ { 2559,14}, { 5119,15}, { 2815,14}, { 5887,16}, \
+ { 1535,15}, { 3327,14}, { 6911,15}, { 3839,17}, \
+ { 1023,16}, { 2047,15}, { 4351,14}, { 8959,15}, \
+ { 4863,16}, { 2559,15}, { 5887,14}, { 11775,16}, \
+ { 3071,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 230
+#define SQR_FFT_THRESHOLD 3264
+
+#define MULLO_BASECASE_THRESHOLD 3
+#define MULLO_DC_THRESHOLD 39
+#define MULLO_MUL_N_THRESHOLD 7246
+#define SQRLO_BASECASE_THRESHOLD 6
+#define SQRLO_DC_THRESHOLD 40
+#define SQRLO_SQR_THRESHOLD 6440
+
+#define DC_DIV_QR_THRESHOLD 30
+#define DC_DIVAPPR_Q_THRESHOLD 88
+#define DC_BDIV_QR_THRESHOLD 35
+#define DC_BDIV_Q_THRESHOLD 62
+
+#define INV_MULMOD_BNM1_THRESHOLD 79
+#define INV_NEWTON_THRESHOLD 11
+#define INV_APPR_THRESHOLD 11
+
+#define BINV_NEWTON_THRESHOLD 264
+#define REDC_1_TO_REDC_2_THRESHOLD 8
+#define REDC_2_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1442
+#define MU_DIVAPPR_Q_THRESHOLD 1470
+#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_BDIV_QR_THRESHOLD 1470
+#define MU_BDIV_Q_THRESHOLD 1652
+
+#define POWM_SEC_TABLE 1,16,151,839
+
+#define GET_STR_DC_THRESHOLD 7
+#define GET_STR_PRECOMPUTE_THRESHOLD 15
+#define SET_STR_DC_THRESHOLD 406
+#define SET_STR_PRECOMPUTE_THRESHOLD 885
+
+#define FAC_DSC_THRESHOLD 179
+#define FAC_ODD_THRESHOLD 53
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD2_DIV1_METHOD 1 /* 9.10% faster than 3 */
+#define HGCD_THRESHOLD 45
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 2479
+#define GCD_DC_THRESHOLD 321
+#define GCDEXT_DC_THRESHOLD 258
+#define JACOBI_BASE_METHOD 4 /* 15.45% faster than 1 */
+
+/* Tuneup completed successfully, took 179422 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,126 @@
+dnl Power9 mpn_mul_1.
+
+dnl Copyright 2017, 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C POWER3/PPC630 ?
+C POWER4/PPC970 ?
+C POWER5 ?
+C POWER6 ?
+C POWER7 ?
+C POWER8 ?
+C POWER9 2.47
+
+C TODO
+C * Schedule for Power9 pipeline.
+C * Unroll 4x if that proves beneficial.
+C * This is marginally faster (but much smaller) than ../mul_1.asm.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5')
+define(`v0', `r6')
+
+ASM_START()
+PROLOGUE(mpn_mul_1c)
+ b L(ent)
+EPILOGUE()
+PROLOGUE(mpn_mul_1)
+ li r7, 0
+L(ent): ld r11, 0(up)
+ cmpdi cr6, n, 2
+ addi r0, n, -1 C FIXME: postpone
+ srdi r0, r0, 1 C FIXME: postpone
+ mtctr r0 C FIXME: postpone
+ rldicl. r12, n, 0,63 C r0 = n & 3, set cr0
+ bne cr0, L(b1)
+
+L(b0): ld r0, 8(up)
+ maddld( r9, r11, v0, r7)
+ maddhdu(r7, r11, v0, r7)
+ ble cr6, L(2)
+ ld r12, 16(up)
+ mulld r8, r0, v0
+ mulhdu r5, r0, v0
+ addic up, up, 16
+ addi rp, rp, -8
+ b L(mid)
+
+L(b1): ld r0, 0(up)
+ ble cr6, L(1)
+ ld r12, 8(up)
+ maddld( r8, r11, v0, r7)
+ maddhdu(r5, r11, v0, r7)
+ ld r0, 16(up)
+ mulld r9, r12, v0
+ mulhdu r7, r12, v0
+ addic up, up, 24
+ bdz L(end)
+
+ ALIGN(16)
+L(top): ld r12, 0(up)
+ std r8, 0(rp)
+ adde r9, r5, r9
+ mulld r8, r0, v0
+ mulhdu r5, r0, v0
+L(mid): ld r0, 8(up)
+ std r9, 8(rp)
+ adde r8, r7, r8
+ mulld r9, r12, v0
+ mulhdu r7, r12, v0
+ addi rp, rp, 16
+ addi up, up, 16
+ bdnz L(top)
+
+L(end): std r8, 0(rp)
+ mulld r8, r0, v0
+ adde r9, r5, r9
+ mulhdu r5, r0, v0
+ std r9, 8(rp)
+ adde r8, r7, r8
+ std r8, 16(rp)
+ addze r3, r5
+ blr
+
+L(2): mulld r8, r0, v0
+ mulhdu r5, r0, v0
+ std r9, 0(rp)
+ addc r8, r7, r8
+ std r8, 8(rp)
+ addze r3, r5
+ blr
+
+L(1): maddld( r8, r0, v0, r7)
+ std r8, 0(rp)
+ maddhdu(r3, r0, v0, r7)
+ blr
+EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_2.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_2.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_2.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,170 @@
+dnl Power9 mpn_mul_2.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2018 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU Lesser General Public License as published
+dnl by the Free Software Foundation; either version 3 of the License, or (at
+dnl your option) any later version.
+
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
+dnl License for more details.
+
+dnl You should have received a copy of the GNU Lesser General Public License
+dnl along with the GNU MP Library. If not, see http://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C power9: 1.58
+
+C STATUS
+C * Not written with any power9 pipeline understanding.
+C * The 4x unrolling was not motivated by any timing tests.
+C * No local scheduling for performance tweaking has been done.
+C * Decrease load scheduling!
+
+define(`rp', `r3')
+define(`up', `r4')
+define(`n', `r5') C Note: Reused as scratch
+define(`vp', `r6') C Note: Reused for v1
+
+define(`v0', `r7')
+define(`v1', `r6')
+
+
+ASM_START()
+PROLOGUE(mpn_mul_2)
+ std r28, -32(r1)
+ std r29, -24(r1)
+ std r30, -16(r1)
+ std r31, -8(r1)
+
+ subfic r0, n, 0 C clear CA
+ subfo r0, r0, r0 C clear OV and r0
+
+ cmpdi cr7, n, 4
+
+ ld v0, 0(vp)
+ ld v1, 8(vp)
+
+ srdi r10, n, 2
+ mtctr r10
+
+ rldicl. r9, n, 0, 63
+ bne cr0, L(bx1)
+
+L(bx0): rldicl. r9, n, 63, 63
+
+ ld r8, 0(up)
+ ld r9, 8(up)
+ li r11, 0
+ mulld r28, r8, v0
+ mulhdu r31, r8, v0
+ blt cr7, L(2)
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ bne cr0, L(b10)
+
+L(b00): addi up, up, -8
+ addi rp, rp, -24
+ b L(lo0)
+
+L(b10): addi up, up, 8
+ addi rp, rp, -8
+ b L(lo2)
+
+L(2): addi rp, rp, -8
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ b L(cj2)
+
+L(bx1): rldicl. r9, n, 63, 63
+
+ ld r9, 0(up)
+ ld r8, 8(up)
+ li r10, 0
+ mulld r29, r9, v0
+ mulhdu r30, r9, v0
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ bne cr0, L(b11)
+
+L(b01): addi rp, rp, -16
+ b L(lo1)
+L(b11): addi up, up, 16
+ blt cr7, L(end)
+
+L(top): ld r9, 0(up)
+ maddld( r28, r8, v0, r10) C 0 4 -> adde
+ maddhdu(r31, r8, v0, r10) C 1 5
+ adde r0, r29, r0 C 7 11
+ std r0, 0(rp)
+ mulld r5, r8, v1 C 1 5 -> addex
+ mulhdu r10, r8, v1 C 2 6
+ addex( r0, r12, r30, 0) C 8 12
+L(lo2): ld r8, 8(up)
+ maddld( r29, r9, v0, r11) C 1 5 -> adde
+ maddhdu(r30, r9, v0, r11) C 2 6
+ adde r0, r28, r0 C 8 12
+ std r0, 8(rp)
+ mulld r12, r9, v1 C 2 6 -> addex
+ mulhdu r11, r9, v1 C 3 7
+ addex( r0, r5, r31, 0) C 5 9 13
+L(lo1): ld r9, 16(up)
+ maddld( r28, r8, v0, r10) C 2 6 -> adde
+ maddhdu(r31, r8, v0, r10) C 3 7
+ adde r0, r29, r0 C 5 9 13
+ std r0, 16(rp)
+ mulld r5, r8, v1 C 3 7 -> addex
+ mulhdu r10, r8, v1 C 4 8
+ addex( r0, r12, r30, 0) C 6 10
+L(lo0): ld r8, 24(up)
+ maddld( r29, r9, v0, r11) C 3 7 -> adde
+ maddhdu(r30, r9, v0, r11) C 4 8
+ adde r0, r28, r0 C 6 10
+ std r0, 24(rp)
+ mulld r12, r9, v1 C 4 8 -> addex
+ mulhdu r11, r9, v1 C 5 9
+ addex( r0, r5, r31, 0) C 7 11
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): ld r9, 0(up)
+ maddld( r28, r8, v0, r10) C 0 4
+ maddhdu(r31, r8, v0, r10) C 1 5
+ adde r0, r29, r0 C 7 11
+ std r0, 0(rp) C -4
+ mulld r5, r8, v1 C 1 5
+ mulhdu r10, r8, v1 C 2 6
+ addex( r0, r12, r30, 0) C 8 12
+L(cj2): maddld( r29, r9, v0, r11) C 1 5 -2
+ maddhdu(r30, r9, v0, r11) C 2 6 -1
+ adde r0, r28, r0 C 8 12 -3
+ std r0, 8(rp) C -3
+ mulld r12, r9, v1 C 2 6 -1
+ mulhdu r11, r9, v1 C 3 7 0 = return limb
+ addex( r0, r5, r31, 0) C 5 9 13
+ adde r0, r29, r0 C 5 9 13 -2
+ std r0, 16(rp) C -2
+ addex( r0, r12, r30, 0) C 6 10 -1
+ adde r0, r0, r10 C -1
+ std r0, 24(rp) C -1
+ li r4, 0
+ addze r3, r11
+ addex( r3, r3, r4, 0)
+
+L(ret): ld r28, -32(r1)
+ ld r29, -24(r1)
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+EPILOGUE()
+ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_basecase.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_basecase.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/mul_basecase.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,415 @@
+dnl Power9 mpn_mul_basecase.
+
+dnl Copyright 1999-2001, 2003-2006, 2008, 2017-2018 Free Software Foundation,
+dnl Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 -
+C POWER8 -
+C POWER9 1.62
+
+C TODO
+C * Check if (inner) loop alignment affects performance.
+C * Could we schedule loads less in addmul_2/mul_2? That would save some regs
+C and make the tail code more manageable.
+C * Postpone some register saves to main loop.
+C * Perhaps write more small operands (3x1, 3x2, 3x3) code.
+C * Consider restoring rp,up after loop using arithmetic, eliminating rp2, up2.
+C On the other hand, the current rp,up restore register are useful for OSP.
+C * Do OSP. This should save a lot with the current deep addmul_2 pipeline.
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`un', `r5')
+define(`vp', `r6')
+define(`vn', `r7')
+
+define(`v0', `r0')
+define(`v1', `r7')
+define(`rp2', `r24')
+define(`up2', `r25')
+
+ASM_START()
+PROLOGUE(mpn_mul_basecase)
+ cmpdi cr0, un, 2
+ bgt cr0, L(un_gt2)
+ cmpdi cr6, vn, 1
+ ld r7, 0(vp)
+ ld r5, 0(up)
+ mulld r8, r5, r7 C weight 0
+ mulhdu r9, r5, r7 C weight 1
+ std r8, 0(rp)
+ beq cr0, L(2x)
+ std r9, 8(rp)
+ blr
+ ALIGN(16)
+L(2x): ld r0, 8(up)
+ mulld r8, r0, r7 C weight 1
+ mulhdu r10, r0, r7 C weight 2
+ addc r9, r9, r8
+ addze r10, r10
+ bne cr6, L(2x2)
+ std r9, 8(rp)
+ std r10, 16(rp)
+ blr
+ ALIGN(16)
+L(2x2): ld r6, 8(vp)
+ mulld r8, r5, r6 C weight 1
+ mulhdu r11, r5, r6 C weight 2
+ addc r9, r9, r8
+ std r9, 8(rp)
+ adde r11, r11, r10
+ mulld r12, r0, r6 C weight 2
+ mulhdu r0, r0, r6 C weight 3
+ addze r0, r0
+ addc r11, r11, r12
+ addze r0, r0
+ std r11, 16(rp)
+ std r0, 24(rp)
+ blr
+
+L(un_gt2):
+ std r22, -80(r1)
+ std r23, -72(r1)
+ std r24, -64(r1)
+ std r25, -56(r1)
+ std r26, -48(r1)
+ std r27, -40(r1)
+ std r28, -32(r1)
+ std r29, -24(r1)
+ std r30, -16(r1)
+ std r31, -8(r1)
+ mr rp2, r3 C rp
+ mr up2, r4 C up
+ srdi r22, r5, 2 C un
+ subfic r23, r7, 0 C -vn, clear CA
+ subfo r0, r0, r0 C clear OV (and r0)
+
+ cmpdi cr6, un, 3
+ rldicl r0, un, 0, 63 C r0 = un & 1
+ cmpdi cr7, r0, 0
+ rldicl r0, un, 63, 63 C FIXME: unused for vn = 1
+ cmpdi cr5, r0, 0 C FIXME: unused for vn = 1
+
+ ld v0, 0(vp)
+ rldicl. r9, vn, 0, 63
+ beq cr0, L(vn_evn)
+
+L(vn_odd):
+ addi r10, un, -2
+ ld r5, 0(up)
+ srdi r10, r10, 1
+ mtctr r10
+ bne cr7, L(m1_b1)
+
+L(m1_b0):
+ ld r10, 8(up)
+ mulld r9, r5, v0
+ mulhdu r11, r5, v0
+ ld r12, 16(up)
+ mulld r8, r10, v0
+ mulhdu r5, r10, v0
+ addi rp, rp, -8
+ b L(m1_mid)
+
+L(m1_b1):
+ ld r12, 8(up)
+ mulld r8, r5, v0
+ mulhdu r5, r5, v0
+ ld r10, 16(up)
+ mulld r9, r12, v0
+ mulhdu r11, r12, v0
+ addi up, up, 8
+ beq cr6, L(m1_end) C jump taken means un = 3, vn = {1,3}
+
+ ALIGN(16)
+L(m1_top):
+ ld r12, 16(up)
+ std r8, 0(rp)
+ adde r9, r5, r9
+ mulld r8, r10, v0
+ mulhdu r5, r10, v0
+L(m1_mid):
+ ld r10, 24(up)
+ std r9, 8(rp)
+ adde r8, r11, r8
+ mulld r9, r12, v0
+ mulhdu r11, r12, v0
+ addi rp, rp, 16
+ addi up, up, 16
+ bdnz L(m1_top)
+
+L(m1_end):
+ std r8, 0(rp)
+ mulld r8, r10, v0
+ adde r9, r5, r9
+ mulhdu r5, r10, v0
+ std r9, 8(rp)
+ adde r8, r11, r8
+ std r8, 16(rp)
+ addze r10, r5
+ std r10, 24(rp)
+
+ addi rp2, rp2, 8
+ addi vp, vp, 8
+ addic. r23, r23, 1
+ b L(do_outer)
+
+L(vn_evn):
+ ld v1, 8(vp)
+ addi r23, r23, 2
+ mtctr r22
+ bne cr7, L(m2_bx1)
+
+L(m2_bx0):
+ ld r8, 0(up)
+ ld r9, 8(up)
+ li r11, 0
+ mulld r28, r8, v0
+ mulhdu r31, r8, v0
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ li r12, 0
+ bne cr5, L(m2_b10)
+
+L(m2_b00):
+ addi up, up, -8
+ addi rp, rp, -24
+ b L(m2_lo0)
+
+L(m2_b10):
+ addi up, up, 8
+ addi rp, rp, -8
+ b L(m2_lo2)
+
+L(m2_bx1):
+ ld r9, 0(up)
+ ld r8, 8(up)
+ li r10, 0
+ mulld r29, r9, v0
+ mulhdu r30, r9, v0
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ li r5, 0
+ bne cr5, L(m2_b11)
+
+L(m2_b01):
+ addi rp, rp, -16
+ b L(m2_lo1)
+L(m2_b11):
+ addi up, up, 16
+ beq cr6, L(m2_end) C taken means un = 3, vn = 2. We're done.
+
+L(m2_top):
+ ld r9, 0(up)
+ maddld( r28, r8, v0, r10)
+ maddhdu(r31, r8, v0, r10)
+ adde r5, r29, r5
+ std r5, 0(rp)
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ addex( r12, r12, r30, 0)
+L(m2_lo2):
+ ld r8, 8(up)
+ maddld( r29, r9, v0, r11)
+ maddhdu(r30, r9, v0, r11)
+ adde r12, r28, r12
+ std r12, 8(rp)
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ addex( r5, r5, r31, 0)
+L(m2_lo1):
+ ld r9, 16(up)
+ maddld( r28, r8, v0, r10)
+ maddhdu(r31, r8, v0, r10)
+ adde r5, r29, r5
+ std r5, 16(rp)
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ addex( r12, r12, r30, 0)
+L(m2_lo0):
+ ld r8, 24(up)
+ maddld( r29, r9, v0, r11)
+ maddhdu(r30, r9, v0, r11)
+ adde r12, r28, r12
+ std r12, 24(rp)
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ addex( r5, r5, r31, 0)
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(m2_top)
+
+L(m2_end):
+ ld r9, 0(up)
+ maddld( r28, r8, v0, r10)
+ maddhdu(r31, r8, v0, r10)
+ adde r5, r29, r5
+ std r5, 0(rp)
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ b L(cj)
+
+L(outer):
+ ld v0, 0(vp)
+ ld v1, 8(vp)
+ addi r23, r23, 2
+ mtctr r22
+ bne cr7, L(bx1)
+
+L(bx0): ld r26, 0(rp2)
+ ld r8, 0(up2)
+ ld r11, 8(rp2)
+ ld r9, 8(up2)
+ maddld( r28, r8, v0, r26)
+ maddhdu(r31, r8, v0, r26)
+ ld r26, 16(rp2)
+ mulld r5, r8, v1
+ mulhdu r10, r8, v1
+ li r12, 0
+ bne cr5, L(b10)
+
+L(b00): addi up, up2, -8
+ addi rp, rp2, -24
+ b L(lo0)
+
+L(b10): addi up, up2, 8
+ addi rp, rp2, -8
+ b L(lo2)
+
+L(bx1): ld r27, 0(rp2)
+ ld r9, 0(up2)
+ ld r10, 8(rp2)
+ ld r8, 8(up2)
+ maddld( r29, r9, v0, r27)
+ maddhdu(r30, r9, v0, r27)
+ ld r27, 16(rp2)
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ li r5, 0
+ bne cr5, L(b11)
+
+L(b01): addi up, up2, 0
+ addi rp, rp2, -16
+ b L(lo1)
+L(b11): addi up, up2, 16
+ addi rp, rp2, 0
+ beq cr6, L(end) C taken means un = 3, vn = 3. We're done.
+
+L(top): ld r9, 0(up)
+ maddld( r28, r8, v0, r10)
+ maddhdu(r31, r8, v0, r10)
+ adde r5, r29, r5
+ ld r26, 24(rp)
+ std r5, 0(rp)
+ maddld( r5, r8, v1, r27)
+ maddhdu(r10, r8, v1, r27)
+ addex( r12, r12, r30, 0)
+L(lo2): ld r8, 8(up)
+ maddld( r29, r9, v0, r11)
+ maddhdu(r30, r9, v0, r11)
+ adde r12, r28, r12
+ ld r27, 32(rp)
+ std r12, 8(rp)
+ maddld( r12, r9, v1, r26)
+ maddhdu(r11, r9, v1, r26)
+ addex( r5, r5, r31, 0)
+L(lo1): ld r9, 16(up)
+ maddld( r28, r8, v0, r10)
+ maddhdu(r31, r8, v0, r10)
+ adde r5, r29, r5
+ ld r26, 40(rp)
+ std r5, 16(rp)
+ maddld( r5, r8, v1, r27)
+ maddhdu(r10, r8, v1, r27)
+ addex( r12, r12, r30, 0)
+L(lo0): ld r8, 24(up)
+ maddld( r29, r9, v0, r11)
+ maddhdu(r30, r9, v0, r11)
+ adde r12, r28, r12
+ ld r27, 48(rp)
+ std r12, 24(rp)
+ maddld( r12, r9, v1, r26)
+ maddhdu(r11, r9, v1, r26)
+ addex( r5, r5, r31, 0)
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): ld r9, 0(up)
+ maddld( r28, r8, v0, r10)
+ maddhdu(r31, r8, v0, r10)
+ adde r5, r29, r5
+ std r5, 0(rp)
+ maddld( r5, r8, v1, r27)
+ maddhdu(r10, r8, v1, r27)
+L(cj): addex( r12, r12, r30, 0)
+ maddld( r29, r9, v0, r11)
+ maddhdu(r30, r9, v0, r11)
+ adde r12, r28, r12
+ std r12, 8(rp)
+ mulld r12, r9, v1
+ mulhdu r11, r9, v1
+ addex( r5, r5, r31, 0)
+ adde r5, r29, r5
+ std r5, 16(rp)
+ addex( r12, r12, r30, 0)
+ adde r12, r12, r10
+ std r12, 24(rp)
+ li r4, 0
+ addze r5, r11
+ addex( r5, r5, r4, 0)
+ std r5, 32(rp)
+
+ cmpdi cr0, r23, 0
+ addi rp2, rp2, 16
+ addi vp, vp, 16
+L(do_outer):
+ bne cr0, L(outer)
+L(ret):
+ ld r22, -80(r1)
+ ld r23, -72(r1)
+ ld r24, -64(r1)
+ ld r25, -56(r1)
+ ld r26, -48(r1)
+ ld r27, -40(r1)
+ ld r28, -32(r1)
+ ld r29, -24(r1)
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+EPILOGUE()
+ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/sqr_basecase.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/sqr_basecase.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/mode64/p9/sqr_basecase.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,555 @@
+dnl Power9 mpn_sqr_basecase.
+
+dnl Copyright 1999-2001, 2003-2006, 2008, 2017-2018 Free Software Foundation,
+dnl Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C POWER3/PPC630 -
+C POWER4/PPC970 -
+C POWER5 -
+C POWER6 -
+C POWER7 -
+C POWER8 -
+C POWER9 1.62
+
+C TODO
+C * Completely separate evn and odd code into two outer loops. Also consider
+C unrolling these two outer loops and thereby eliminate all branches.
+C * Avoid the reloading of u1 before every loop start.
+C * Reduce register usage.
+C * Consider getting rid of cy and instead load 3 u limbs, use addc+adde+adde.
+C * Consider skewing conditional adjustments to allow mask creation with subfe
+C like in the un=3 code. It might streamline the adjustments (or not).
+
+C INPUT PARAMETERS
+define(`rp', `r3')
+define(`up', `r4')
+define(`un', `r5')
+
+define(`u0', `r0')
+define(`u1', `r7')
+define(`rp2', `r24')
+define(`up2', `r25')
+define(`cy', `r6')
+
+define(`LSHU1U0',`
+ addc u0, u0, u0
+ adde u1, u1, u1
+ li cy, 0
+ addze cy, cy
+')
+define(`LSHU1U',`
+ addc u0, u0, u0
+ add u0, u0, cy
+ adde u1, u1, u1
+ li cy, 0
+ addze cy, cy
+')
+define(`LSHU1UF',`
+ addc u0, u0, u0
+ add u0, u0, cy
+ adde u1, u1, u1
+')
+define(`LSHU1UHF',`
+ add u0, u0, u0
+ add u0, u0, cy
+')
+C These are cleverer replacements, but they tend to leave CA set, disturbing
+C the main accumulation code! Breaking that false dependency might have a
+C positive performance impact. Note that the subfe here results in a mask for
+C our adjustments.
+define(`xLSHU1U0',`
+ addc u0, u0, u0
+ adde u1, u1, u1
+ subfe cy, cy, cy
+')
+define(`xLSHU1U',`
+ subfic cy, cy, 0
+ adde u0, u0, u0
+ adde u1, u1, u1
+ subfe cy, cy, cy
+')
+define(`xLSHU1U',`
+ subfic cy, cy, 0
+ adde u0, u0, u0
+')
+
+ASM_START()
+PROLOGUE(mpn_sqr_basecase)
+ ld r0, 0(up) C n = 1
+ mulld r8, r0, r0 C weight 0
+ mulhdu r9, r0, r0 C weight 1
+ std r8, 0(rp)
+ cmpdi cr0, un, 2
+ bge cr0, L(ge2)
+ std r9, 8(rp)
+ blr
+
+L(ge2): bgt cr0, L(gt2)
+ ld r6, 8(up)
+ mulld r10, r6, r6 C u1 * u1
+ mulhdu r11, r6, r6 C u1 * u1
+ mulld r4, r6, r0 C u1 * u0
+ mulhdu r5, r6, r0 C u1 * u0
+ addc r4, r4, r4
+ adde r5, r5, r5
+ addze r11, r11
+ addc r9, r9, r4
+ adde r10, r10, r5
+ addze r11, r11
+ std r9, 8(rp)
+ std r10, 16(rp)
+ std r11, 24(rp)
+ blr
+
+L(gt2): cmpdi cr0, un, 3
+ bgt cr0, L(gt3)
+ std r30, -16(r1)
+ std r31, -8(r1)
+ subfo r12, r12, r12 C clear OV (and result register)
+ ld r8, 8(r4)
+ mulld r5, r8, r8 C W2
+ mulhdu r10, r8, r8 C W3
+ sradi r11, u0, 63 C CAUTION: clobbers CA
+ and r11, r11, r8 C W3
+ addc u0, u0, u0
+ adde u1, r8, r8
+ subfe r6, r6, r6 C mask
+ ld r4, 16(r4) C W2
+ mulld r12, r8, u0 C W1 u1 x u0
+ mulhdu r8, r8, u0 C W2 u1 x u0
+ maddld( r31, r4, u0, r11) C W2
+ maddhdu(r30, r4, u0, r11) C W3
+ andc r6, r4, r6 C W4
+ addc r9, r12, r9 C W1
+ std r9, 8(rp) C W1
+ mulld r9, r4, u1 C W3
+ mulhdu r11, r4, u1 C W4
+ addex( r5, r5, r8, 0) C W2
+ adde r5, r31, r5 C W2
+ std r5, 16(rp) C W2
+ maddld( r5, r4, r4, r6) C W4 u2^2
+ maddhdu(r6, r4, r4, r6) C W5 u2^2
+ addex( r9, r9, r30, 0) C W3
+ adde r9, r9, r10 C W3
+ std r9, 24(rp) C W3
+ adde r5, r5, r11 C W4
+ addze r6, r6 C W5
+ li r8, 0
+ addex( r5, r5, r8, 0) C W4
+ std r5, 32(rp) C W4
+ addex( r6, r6, r8, 0) C W5
+ std r6, 40(rp) C W5
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+
+L(gt3): std r22, -80(r1)
+ std r23, -72(r1)
+ std r24, -64(r1)
+ std r25, -56(r1)
+ std r26, -48(r1)
+ std r27, -40(r1)
+ std r28, -32(r1)
+ std r29, -24(r1)
+ std r30, -16(r1)
+ std r31, -8(r1)
+
+ mr rp2, rp
+ mr up2, up
+ addi r22, un, -1 C count for loop FIXME: Adjust
+ subfo r0, r0, r0 C clear OV (and r0)
+ rldicl r0, un, 0, 63 C r0 = un & 1
+ cmpdi cr7, r0, 0
+
+ ld u0, 0(up2)
+ ld u1, 8(up2)
+
+ cmpdi cr5, r22, 4
+ srdi r31, r22, 2
+ addi r22, r22, -2
+ mtctr r31
+
+ beq cr7, L(m2_evn)
+L(m2_odd):
+ rldicl. r31, r22, 63, 63 C r22 & 2
+ mulld r23, u0, u0
+ mulhdu r12, u0, u0
+ mulld r5, u1, u1
+ mulhdu r10, u1, u1
+
+ sradi r11, u0, 63
+ and r11, r11, u1
+
+ LSHU1U0
+
+ ld r8, 8(up2)
+ ld r9, 16(up2)
+ mulld r28, r8, u0 C W u1 x u0
+ mulhdu r31, r8, u0 C W u1 x u0
+ std r23, 0(rp2)
+
+ bne cr0, L(m2_11)
+L(m2_01):
+ addi up, up2, 16
+ addi rp, rp2, 0
+ b L(m2_lo2)
+L(m2_11):
+ addi up, up2, 0
+ addi rp, rp2, -16
+ b L(m2_lo0)
+
+L(m2_evn):
+ rldicl. r31, r22, 63, 63 C r22 & 2
+ mulld r23, u0, u0
+ mulhdu r5, u0, u0
+ mulld r12, u1, u1
+ mulhdu r11, u1, u1
+
+ sradi r10, u0, 63
+ and r10, r10, u1
+
+ LSHU1U0
+
+ ld r9, 8(up2)
+ ld r8, 16(up2)
+ mulld r29, r9, u0 C W u1 x u0
+ mulhdu r30, r9, u0 C W u1 x u0
+ std r23, 0(rp2)
+
+ beq cr0, L(m2_10)
+L(m2_00):
+ addi up, up2, 8
+ addi rp, rp2, -8
+ b L(m2_lo1)
+L(m2_10):
+ addi up, up2, 24
+ addi rp, rp2, 8
+ ble cr5, L(m2_end)
+
+L(m2_top):
+ ld r9, 0(up)
+ maddld( r28, r8, u0, r10)
+ maddhdu(r31, r8, u0, r10)
+ adde r5, r29, r5
+ std r5, 0(rp)
+ mulld r5, r8, u1
+ mulhdu r10, r8, u1
+ addex( r12, r12, r30, 0)
+L(m2_lo2):
+ ld r8, 8(up)
+ maddld( r29, r9, u0, r11)
+ maddhdu(r30, r9, u0, r11)
+ adde r12, r28, r12
+ std r12, 8(rp)
+ mulld r12, r9, u1
+ mulhdu r11, r9, u1
+ addex( r5, r5, r31, 0)
+L(m2_lo1):
+ ld r9, 16(up)
+ maddld( r28, r8, u0, r10)
+ maddhdu(r31, r8, u0, r10)
+ adde r5, r29, r5
+ std r5, 16(rp)
+ mulld r5, r8, u1
+ mulhdu r10, r8, u1
+ addex( r12, r12, r30, 0)
+L(m2_lo0):
+ ld r8, 24(up)
+ maddld( r29, r9, u0, r11)
+ maddhdu(r30, r9, u0, r11)
+ adde r12, r28, r12
+ std r12, 24(rp)
+ mulld r12, r9, u1
+ mulhdu r11, r9, u1
+ addex( r5, r5, r31, 0)
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(m2_top)
+
+L(m2_end):
+ ld r9, 0(up)
+ maddld( r28, r8, u0, r10)
+ maddhdu(r31, r8, u0, r10)
+ adde r5, r29, r5
+ std r5, 0(rp)
+ mulld r5, r8, u1
+ mulhdu r10, r8, u1
+ b L(cj) C jump to addmul_2 tail
+
+L(outer):
+ addi up2, up2, 16
+ addi rp2, rp2, 32
+
+ ld u0, 0(up2)
+ ld u1, 8(up2)
+
+ cmpdi cr5, r22, 4
+ srdi r31, r22, 2
+ addi r22, r22, -2
+ mtctr r31
+
+ ld r26, 0(rp2)
+ ld r27, 16(rp2)
+
+ rldicl. r31, r22, 63, 63 C r22 & 2
+ beq cr7, L(evn)
+
+L(odd): maddld( r23, u0, u0, r26) C W u2^2
+ maddhdu(r12, u0, u0, r26) C W u2^2
+ maddld( r5, u1, u1, r27) C W u3^2
+ maddhdu(r10, u1, u1, r27) C W u3^2
+ ld r26, 8(rp2)
+
+ ld r8, -8(up2)
+ sradi r8, r8, 63 C CAUTION: clobbers CA
+ and r8, r8, u0
+ sradi r11, u0, 63 C CAUTION: clobbers CA
+ and r11, r11, u1
+
+ LSHU1U
+
+ addc r23, r23, r8
+
+ ld r8, 8(up2)
+ ld r9, 16(up2)
+ maddld( r28, r8, u0, r26) C W u3 x u2
+ maddhdu(r31, r8, u0, r26) C W u3 x u2
+ ld r26, 24(rp2)
+ std r23, 0(rp2) C W0
+
+ bne cr0, L(11)
+L(01):
+ addi up, up2, 16
+ addi rp, rp2, 0
+ b L(lo2)
+L(11):
+ addi up, up2, 0
+ addi rp, rp2, -16
+ b L(lo0)
+
+L(evn): maddld( r23, u0, u0, r26) C W u2^2
+ maddhdu(r5, u0, u0, r26) C W u2^2
+ maddld( r12, u1, u1, r27) C W u3^2
+ maddhdu(r11, u1, u1, r27) C W u3^2
+ ld r27, 8(rp2)
+
+ ld r9, -8(up2)
+ sradi r9, r9, 63 C CAUTION: clobbers CA
+ and r9, r9, u0
+ sradi r10, u0, 63 C CAUTION: clobbers CA
+ and r10, r10, u1
+
+ LSHU1U
+
+ addc r23, r23, r9
+
+ ld r9, 8(up2)
+ ld r8, 16(up2)
+ maddld( r29, r9, u0, r27) C W u3 x u2
+ maddhdu(r30, r9, u0, r27) C W u3 x u2
+ ld r27, 24(rp2)
+ std r23, 0(rp2) C W0
+
+ beq cr0, L(10)
+L(00):
+ addi up, up2, 8
+ addi rp, rp2, -8
+ b L(lo1)
+L(10):
+ addi up, up2, 24
+ addi rp, rp2, 8
+ ble cr5, L(end)
+
+L(top): ld r9, 0(up)
+ maddld( r28, r8, u0, r10)
+ maddhdu(r31, r8, u0, r10)
+ adde r5, r29, r5
+ ld r26, 24(rp)
+ std r5, 0(rp)
+ maddld( r5, r8, u1, r27)
+ maddhdu(r10, r8, u1, r27)
+ addex( r12, r12, r30, 0)
+L(lo2): ld r8, 8(up)
+ maddld( r29, r9, u0, r11)
+ maddhdu(r30, r9, u0, r11)
+ adde r12, r28, r12
+ ld r27, 32(rp)
+ std r12, 8(rp)
+ maddld( r12, r9, u1, r26)
+ maddhdu(r11, r9, u1, r26)
+ addex( r5, r5, r31, 0)
+L(lo1): ld r9, 16(up)
+ maddld( r28, r8, u0, r10)
+ maddhdu(r31, r8, u0, r10)
+ adde r5, r29, r5
+ ld r26, 40(rp)
+ std r5, 16(rp)
+ maddld( r5, r8, u1, r27)
+ maddhdu(r10, r8, u1, r27)
+ addex( r12, r12, r30, 0)
+L(lo0): ld r8, 24(up)
+ maddld( r29, r9, u0, r11)
+ maddhdu(r30, r9, u0, r11)
+ adde r12, r28, r12
+ ld r27, 48(rp)
+ std r12, 24(rp)
+ maddld( r12, r9, u1, r26)
+ maddhdu(r11, r9, u1, r26)
+ addex( r5, r5, r31, 0)
+ addi up, up, 32
+ addi rp, rp, 32
+ bdnz L(top)
+
+L(end): ld r9, 0(up)
+ maddld( r28, r8, u0, r10)
+ maddhdu(r31, r8, u0, r10)
+ adde r5, r29, r5
+ std r5, 0(rp)
+ maddld( r5, r8, u1, r27)
+ maddhdu(r10, r8, u1, r27)
+L(cj): addex( r12, r12, r30, 0)
+ maddld( r29, r9, u0, r11)
+ maddhdu(r30, r9, u0, r11)
+ adde r12, r28, r12
+ std r12, 8(rp)
+ mulld r12, r9, u1
+ mulhdu r11, r9, u1
+ addex( r5, r5, r31, 0)
+ adde r5, r29, r5
+ std r5, 16(rp)
+ addex( r12, r12, r30, 0)
+ adde r12, r12, r10
+ std r12, 24(rp)
+ li r4, 0
+ addze r5, r11
+ addex( r5, r5, r4, 0)
+ std r5, 32(rp)
+ bgt cr5, L(outer)
+
+L(corner):
+ ld u0, 16(up2)
+ ld u1, 24(up2)
+ ld r26, 32(rp2)
+ bne cr7, L(corner_odd)
+
+L(corner_evn):
+ ld r27, 40(rp2)
+ maddld( r23, u0, u0, r26) C W u2^2
+ maddhdu(r5, u0, u0, r26) C W u2^2
+ mulld r12, u1, u1 C W u3^2
+ mulhdu r11, u1, u1 C W u3^2
+
+ ld r9, 8(up2)
+ sradi r9, r9, 63 C CAUTION: clobbers CA
+ and r9, r9, u0
+ sradi r10, u0, 63 C CAUTION: clobbers CA
+ and r10, r10, u1
+
+ LSHU1UHF
+
+ addc r23, r23, r9
+
+ ld r9, 24(up2)
+ maddld( r29, r9, u0, r27) C W u3 x u2
+ maddhdu(r30, r9, u0, r27) C W u3 x u2
+ std r23, 32(rp2)
+ adde r5, r29, r5
+ std r5, 40(rp2)
+ addex( r12, r12, r30, 0)
+ adde r12, r12, r10 C W FIXME can this co?
+ std r12, 48(rp2)
+ li r4, 0
+ addex( r5, r11, r4, 0)
+ addze r5, r5
+ std r5, 56(rp2)
+ b L(ret)
+
+L(corner_odd):
+ ld r27, 48(rp2)
+ maddld( r23, u0, u0, r26) C W u2^2
+ maddhdu(r12, u0, u0, r26) C W u2^2
+ maddld( r5, u1, u1, r27) C W u3^2
+ maddhdu(r10, u1, u1, r27) C W u3^2
+ ld r26, 40(rp2)
+
+ ld r8, 8(up2)
+ sradi r8, r8, 63 C CAUTION: clobbers CA
+ and r8, r8, u0
+ sradi r11, u0, 63 C CAUTION: clobbers CA
+ and r11, r11, u1
+
+ LSHU1UF
+
+ addc r23, r23, r8
+
+ ld r8, 24(up2)
+ ld r9, 32(up2)
+ maddld( r28, r8, u0, r26) C W u3 x u2
+ maddhdu(r31, r8, u0, r26) C W u3 x u2
+ std r23, 32(rp2)
+ maddld( r29, r9, u0, r11)
+ maddhdu(r30, r9, u0, r11)
+ adde r12, r28, r12
+ std r12, 40(rp2)
+ mulld r12, r9, u1
+ mulhdu r11, r9, u1
+ addex( r5, r5, r31, 0)
+ adde r5, r29, r5
+ std r5, 48(rp2)
+ addex( r12, r12, r30, 0)
+ adde r12, r12, r10
+ std r12, 56(rp2)
+ mulld r23, r9, r9 C W u2^2
+ mulhdu r12, r9, r9 C W u2^2
+ adde r23, r23, r11
+ addze r12, r12
+ sradi r4, r8, 63 C CAUTION: clobbers CA
+ and r4, r4, r9
+ addex( r23, r23, r4, 0)
+ std r23, 64(rp2)
+ li r4, 0
+ addex( r12, r12, r4, 0)
+ std r12, 72(rp2)
+
+L(ret): ld r22, -80(r1)
+ ld r23, -72(r1)
+ ld r24, -64(r1)
+ ld r25, -56(r1)
+ ld r26, -48(r1)
+ ld r27, -40(r1)
+ ld r28, -32(r1)
+ ld r29, -24(r1)
+ ld r30, -16(r1)
+ ld r31, -8(r1)
+ blr
+EPILOGUE()
+ASM_END()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/hamdist.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/hamdist.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/hamdist.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
dnl PowerPC-64 mpn_hamdist.
-dnl Copyright 2012 Free Software Foundation, Inc.
+dnl Copyright 2012, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -64,7 +64,7 @@
ld r8, 0(vp)
addi vp, vp, 8
xor r10, r6, r8
- popcntd r0, r10
+ popcntd(r0, r10)
bdz L(e1)
L(evn): ld r6, 0(up)
@@ -85,12 +85,12 @@
ld r6, 0(up)
ld r8, 0(vp)
xor r11, r7, r9
- popcntd r30, r10
+ popcntd(r30, r10)
add r12, r12, r31
ld r7, 8(up)
ld r9, 8(vp)
xor r10, r6, r8
- popcntd r31, r11
+ popcntd(r31, r11)
addi up, up, 16
addi vp, vp, 16
bdnz L(top)
@@ -97,9 +97,9 @@
L(end): add r0, r0, r30
xor r11, r7, r9
- popcntd r30, r10
+ popcntd(r30, r10)
add r12, r12, r31
- popcntd r31, r11
+ popcntd(r31, r11)
add r0, r0, r30
add r12, r12, r31
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/popcount.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/popcount.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/powerpc64/p7/popcount.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
dnl PowerPC-64 mpn_popcount.
-dnl Copyright 2012 Free Software Foundation, Inc.
+dnl Copyright 2012, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -56,13 +56,13 @@
L(odd): ld r4, 0(up)
addi up, up, 8
- popcntd r0, r4
+ popcntd(r0, r4)
bdz L(e1)
L(evn): ld r4, 0(up)
ld r5, 8(up)
- popcntd r8, r4
- popcntd r9, r5
+ popcntd(r8, r4)
+ popcntd(r9, r5)
bdz L(e2)
ld r4, 16(up)
@@ -71,18 +71,18 @@
addi up, up, 32
L(top): add r0, r0, r8
- popcntd r8, r4
+ popcntd(r8, r4)
ld r4, 0(up)
add r12, r12, r9
- popcntd r9, r5
+ popcntd(r9, r5)
ld r5, 8(up)
addi up, up, 16
bdnz L(top)
L(e4): add r0, r0, r8
- popcntd r8, r4
+ popcntd(r8, r4)
add r12, r12, r9
- popcntd r9, r5
+ popcntd(r9, r5)
L(e2): add r0, r0, r8
add r12, r12, r9
L(e1): add r3, r0, r12
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aors_n.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,89 @@
+dnl RISC-V/64 mpn_add_n and mpn_sub_n.
+
+dnl Copyright 2016 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+define(`rp', `a0')
+define(`up', `a1')
+define(`vp', `a2')
+define(`n', `a3')
+
+ifdef(`OPERATION_add_n',`
+ define(`ADDSUB', `add')
+ define(`CMPCY', `sltu $1, $2, $3')
+ define(`func', `mpn_add_n')
+')
+ifdef(`OPERATION_sub_n',`
+ define(`ADDSUB', `sub')
+ define(`CMPCY', `sltu $1, $3, $2')
+ define(`func', `mpn_sub_n')
+')
+
+MULFUNC_PROLOGUE(mpn_add_n mpn_sub_n)
+
+ASM_START()
+PROLOGUE(func)
+ li t6, 0
+
+ andi t0, n, 1
+ beq t0, x0, L(top)
+ addi up, up, 8
+ addi vp, vp, -8
+ addi rp, rp, -8
+ addi n, n, -1
+ j L(mid)
+
+L(top): ld a4, 0(up)
+ ld a6, 0(vp)
+ addi n, n, -2 C bookkeeping
+ addi up, up, 16 C bookkeeping
+ ADDSUB t0, a4, a6
+ CMPCY( t2, t0, a4)
+ ADDSUB t4, t0, t6 C cycle 3, 9, ...
+ CMPCY( t3, t4, t0) C cycle 4, 10, ...
+ sd t4, 0(rp)
+ add t6, t2, t3 C cycle 5, 11, ...
+L(mid): ld a5, -8(up)
+ ld a7, 8(vp)
+ addi vp, vp, 16 C bookkeeping
+ addi rp, rp, 16 C bookkeeping
+ ADDSUB t1, a5, a7
+ CMPCY( t2, t1, a5)
+ ADDSUB t4, t1, t6 C cycle 0, 6, ...
+ CMPCY( t3, t4, t1) C cycle 1, 7, ...
+ sd t4, -8(rp)
+ add t6, t2, t3 C cycle 2, 8, ...
+ bne n, x0, L(top) C bookkeeping
+
+L(end): mv a0, t6
+ ret
+EPILOGUE()
+ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aorsmul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aorsmul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/aorsmul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,75 @@
+dnl RISC-V/64 mpn_addmul_1 and mpn_submul_1.
+
+dnl Copyright 2016 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+define(`rp', `a0')
+define(`up', `a1')
+define(`n', `a2')
+define(`v0', `a3')
+
+ifdef(`OPERATION_addmul_1',`
+ define(`ADDSUB', `add')
+ define(`CMPCY', `sltu $1, $2, $3')
+ define(`func', `mpn_addmul_1')
+')
+ifdef(`OPERATION_submul_1',`
+ define(`ADDSUB', `sub')
+ define(`CMPCY', `sltu $1, $3, $2')
+ define(`func', `mpn_submul_1')
+')
+
+MULFUNC_PROLOGUE(mpn_addmul_1 mpn_submul_1)
+
+ASM_START()
+PROLOGUE(func)
+ li a6, 0
+
+L(top): ld a7, 0(up)
+ addi up, up, 8 C bookkeeping
+ ld a4, 0(rp)
+ addi rp, rp, 8 C bookkeeping
+ mul a5, a7, v0
+ addi n, n, -1 C bookkeeping
+ mulhu a7, a7, v0
+ ADDSUB a5, a4, a5
+ ADDSUB a6, a5, a6 C cycle 0, 3, ...
+ CMPCY( a4, a5, a4)
+ add a4, a4, a7
+ CMPCY( a5, a6, a5) C cycle 1, 4, ...
+ sd a6, -8(rp)
+ add a6, a4, a5 C cycle 2, 5, ...
+ bne n, x0, L(top) C bookkeeping
+
+L(end): mv a0, a6
+ ret
+EPILOGUE()
+ASM_END()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/mul_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/mul_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/riscv/64/mul_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,58 @@
+dnl RISC-V/64 mpn_mul_1.
+
+dnl Copyright 2016 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C INPUT PARAMETERS
+define(`rp', `a0')
+define(`up', `a1')
+define(`n', `a2')
+define(`v0', `a3')
+
+ASM_START()
+PROLOGUE(mpn_mul_1)
+ li a6, 0
+
+L(top): ld a7, 0(up)
+ addi up, up, 8 C bookkeeping
+ addi rp, rp, 8 C bookkeeping
+ mul a5, a7, v0
+ addi n, n, -1 C bookkeeping
+ mulhu a7, a7, v0
+ add a6, a5, a6 C cycle 0, 3, ...
+ sltu a5, a6, a5 C cycle 1, 4, ...
+ sd a6, -8(rp)
+ add a6, a7, a5 C cycle 2, 5, ...
+ bne n, x0, L(top) C bookkeeping
+
+L(end): mv a0, a6
+ ret
+EPILOGUE()
+ASM_END()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,177 +31,147 @@
#define GMP_LIMB_BITS 32
#define GMP_LIMB_BYTES 4
-/* 4400 MHz IBM z10 running in 32-bit mode */
-/* FFT tuning limit = 15000000 */
-/* Generated by tuneup.c, 2014-03-12, gcc 4.7 */
+/* 4400 MHz IBM z196 running in 32-bit mode */
+/* FFT tuning limit = 0.5M */
+/* Generated by tuneup.c, 2017-01-02, gcc 4.9 */
-#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
-#define MOD_1_1P_METHOD 1
-#define MOD_1_NORM_THRESHOLD 4
-#define MOD_1_UNNORM_THRESHOLD 8
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 16
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1_1P_METHOD 2
+#define MOD_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 45
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 18
#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
-#define MOD_1_2_TO_MOD_1_4_THRESHOLD 38
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 30
-#define USE_PREINV_DIVREM_1 1
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD MP_SIZE_T_MAX
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 3
+#define USE_PREINV_DIVREM_1 0
#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DIVEXACT_1_THRESHOLD 0 /* always */
-#define BMOD_1_TO_MOD_1_THRESHOLD 56
+#define DIVEXACT_1_THRESHOLD 6
+#define BMOD_1_TO_MOD_1_THRESHOLD 0 /* always */
-#define MUL_TOOM22_THRESHOLD 8
-#define MUL_TOOM33_THRESHOLD 59
-#define MUL_TOOM44_THRESHOLD 88
-#define MUL_TOOM6H_THRESHOLD 125
-#define MUL_TOOM8H_THRESHOLD 169
+#define DIV_1_VS_MUL_1_PERCENT 320
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 57
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 55
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 57
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 56
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 82
+#define MUL_TOOM22_THRESHOLD 12
+#define MUL_TOOM33_THRESHOLD 81
+#define MUL_TOOM44_THRESHOLD 130
+#define MUL_TOOM6H_THRESHOLD 173
+#define MUL_TOOM8H_THRESHOLD 260
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 91
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 83
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 86
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 112
+
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
-#define SQR_TOOM2_THRESHOLD 14
-#define SQR_TOOM3_THRESHOLD 90
-#define SQR_TOOM4_THRESHOLD 144
-#define SQR_TOOM6_THRESHOLD 196
-#define SQR_TOOM8_THRESHOLD 309
+#define SQR_TOOM2_THRESHOLD 18
+#define SQR_TOOM3_THRESHOLD 69
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 254
+#define SQR_TOOM8_THRESHOLD 406
-#define MULMID_TOOM42_THRESHOLD 24
+#define MULMID_TOOM42_THRESHOLD 30
#define MULMOD_BNM1_THRESHOLD 12
-#define SQRMOD_BNM1_THRESHOLD 10
+#define SQRMOD_BNM1_THRESHOLD 7
-#define MUL_FFT_MODF_THRESHOLD 252 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 276 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 252, 5}, { 9, 6}, { 5, 5}, { 13, 6}, \
- { 7, 5}, { 15, 6}, { 13, 7}, { 7, 6}, \
- { 15, 7}, { 9, 6}, { 19, 7}, { 11, 6}, \
- { 23, 7}, { 13, 8}, { 7, 7}, { 15, 6}, \
- { 31, 7}, { 19, 8}, { 11, 7}, { 23, 9}, \
- { 7, 8}, { 15, 7}, { 31, 8}, { 19, 7}, \
- { 39, 8}, { 27, 9}, { 15, 8}, { 39, 9}, \
- { 23,10}, { 15, 9}, { 31, 8}, { 63, 9}, \
- { 39, 8}, { 79, 9}, { 47,10}, { 31, 9}, \
- { 79,10}, { 47,11}, { 31,10}, { 63, 9}, \
- { 127, 8}, { 255,10}, { 79, 8}, { 319, 9}, \
- { 175, 8}, { 351, 7}, { 703, 6}, { 1407,10}, \
- { 95, 9}, { 191, 8}, { 383, 9}, { 207, 8}, \
- { 415, 7}, { 831, 9}, { 223,11}, { 63,10}, \
- { 127, 9}, { 255,10}, { 143, 9}, { 287, 8}, \
- { 575, 9}, { 319,10}, { 175, 9}, { 351, 8}, \
- { 703, 7}, { 1407,11}, { 95,10}, { 191, 9}, \
- { 383,10}, { 207, 9}, { 415, 8}, { 831,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 575,11}, \
- { 159,10}, { 351, 9}, { 703, 8}, { 1407,11}, \
- { 191,10}, { 415, 9}, { 831,11}, { 223,10}, \
- { 447, 9}, { 895, 8}, { 1791,10}, { 479, 9}, \
- { 959,12}, { 127,11}, { 287,10}, { 575,11}, \
- { 351,10}, { 703, 9}, { 1407,12}, { 191,11}, \
- { 415,10}, { 831,11}, { 447,10}, { 895, 9}, \
- { 1791,11}, { 479,10}, { 959,13}, { 127,12}, \
- { 255,11}, { 575,12}, { 319,11}, { 703,10}, \
- { 1407,12}, { 383,11}, { 831,12}, { 447,11}, \
- { 895,10}, { 1791,11}, { 959,10}, { 1919, 9}, \
- { 3839,13}, { 255,12}, { 575,11}, { 1215,10}, \
- { 2431,12}, { 703,11}, { 1407,13}, { 383,12}, \
- { 895,11}, { 1791,12}, { 959,11}, { 1919,10}, \
- { 3839,14}, { 255,13}, { 511,12}, { 1215,11}, \
- { 2431,13}, { 639,12}, { 1471,13}, { 895,12}, \
- { 1919,11}, { 3839,10}, { 7679,14}, { 511,13}, \
- { 1023,12}, { 2047,13}, { 1151,12}, { 2431,13}, \
- { 1407,14}, { 767,13}, { 8192,14}, { 16384,15}, \
+ { { 276, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 9, 5}, { 19, 6}, { 13, 7}, { 7, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 11, 6}, \
+ { 23, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
+ { 11, 7}, { 25, 8}, { 15, 7}, { 31, 8}, \
+ { 19, 7}, { 39, 8}, { 23, 9}, { 15, 8}, \
+ { 39, 9}, { 23,10}, { 15, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47,10}, \
+ { 31, 9}, { 71, 8}, { 143, 9}, { 79,10}, \
+ { 47,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255, 7}, { 511, 9}, { 143,10}, { 79, 9}, \
+ { 159, 8}, { 319, 9}, { 175, 8}, { 351,10}, \
+ { 95, 9}, { 191, 8}, { 383,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511,10}, { 143, 9}, \
+ { 287, 8}, { 575,10}, { 159, 9}, { 319,10}, \
+ { 175, 9}, { 351,11}, { 95,10}, { 191, 9}, \
+ { 383,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543, 8}, { 1087,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 351, 9}, \
+ { 703, 8}, { 1407,11}, { 191,10}, { 415, 9}, \
+ { 831,11}, { 223,10}, { 479, 9}, { 959, 8}, \
+ { 1919,12}, { 4096,13}, { 8192,14}, { 16384,15}, \
{ 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 149
-#define MUL_FFT_THRESHOLD 2240
+#define MUL_FFT_TABLE3_SIZE 89
+#define MUL_FFT_THRESHOLD 2688
-#define SQR_FFT_MODF_THRESHOLD 244 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 240 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 244, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
- { 7, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
- { 11, 5}, { 23, 6}, { 13, 7}, { 7, 6}, \
- { 16, 7}, { 9, 6}, { 19, 7}, { 11, 6}, \
- { 23, 7}, { 13, 8}, { 7, 7}, { 19, 8}, \
- { 11, 7}, { 23, 9}, { 7, 8}, { 15, 7}, \
- { 31, 8}, { 19, 7}, { 39, 8}, { 23, 9}, \
- { 15, 8}, { 39, 9}, { 23,10}, { 15, 9}, \
- { 31, 8}, { 63, 9}, { 39, 8}, { 79, 9}, \
- { 47,10}, { 31, 9}, { 63, 8}, { 127, 9}, \
- { 71, 8}, { 143, 7}, { 287,10}, { 47,11}, \
- { 31,10}, { 63, 9}, { 127, 8}, { 255, 9}, \
- { 143, 8}, { 287,10}, { 79, 9}, { 159, 8}, \
- { 319, 9}, { 175, 8}, { 351, 7}, { 703, 6}, \
- { 1407,10}, { 95, 9}, { 191, 8}, { 383,11}, \
- { 63,10}, { 127, 9}, { 255,10}, { 143, 9}, \
+ { { 240, 5}, { 17, 6}, { 17, 7}, { 9, 6}, \
+ { 19, 7}, { 11, 6}, { 23, 7}, { 13, 8}, \
+ { 7, 7}, { 19, 8}, { 11, 7}, { 25, 8}, \
+ { 15, 7}, { 33, 8}, { 19, 7}, { 39, 8}, \
+ { 23, 9}, { 15, 8}, { 39, 9}, { 23,10}, \
+ { 15, 9}, { 31, 8}, { 63, 9}, { 47,10}, \
+ { 31, 9}, { 63, 8}, { 127, 9}, { 71, 8}, \
+ { 143,10}, { 47,11}, { 31,10}, { 63, 9}, \
+ { 127, 8}, { 255, 7}, { 511, 9}, { 143,10}, \
+ { 79, 9}, { 159, 8}, { 319, 9}, { 175, 8}, \
+ { 351, 7}, { 703,10}, { 95, 9}, { 191, 8}, \
+ { 383, 9}, { 207, 8}, { 415,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511,10}, { 143, 9}, \
{ 287, 8}, { 575,10}, { 159, 9}, { 319,10}, \
{ 175, 9}, { 351, 8}, { 703, 7}, { 1407,11}, \
- { 95,10}, { 191, 9}, { 383,10}, { 207,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
- { 287, 9}, { 575,11}, { 159,10}, { 351, 9}, \
- { 703, 8}, { 1407,11}, { 191,10}, { 415,11}, \
- { 223,10}, { 447, 9}, { 895, 8}, { 1791,10}, \
- { 479, 9}, { 959,12}, { 127,11}, { 255,10}, \
- { 511,11}, { 287,10}, { 575,11}, { 319,10}, \
- { 639,11}, { 351,10}, { 703, 9}, { 1407,12}, \
- { 191,11}, { 415,10}, { 831,11}, { 447,10}, \
- { 895, 9}, { 1791,11}, { 479,13}, { 127,12}, \
- { 255,11}, { 575,12}, { 319,11}, { 703,10}, \
- { 1407,12}, { 383,11}, { 831,12}, { 447,11}, \
- { 895,10}, { 1791,11}, { 959,10}, { 1919,13}, \
- { 255,12}, { 511,11}, { 1023,12}, { 575,11}, \
- { 1215,10}, { 2431,12}, { 703,11}, { 1407,13}, \
- { 383,12}, { 895,11}, { 1791,12}, { 959,11}, \
- { 1919,14}, { 255,13}, { 511,12}, { 1215,11}, \
- { 2431,13}, { 639,12}, { 1471,11}, { 2943,10}, \
- { 5887,13}, { 895,12}, { 1919,11}, { 3839,10}, \
- { 7679,14}, { 511,13}, { 1023,12}, { 2047,13}, \
- { 1151,12}, { 2431,13}, { 1407,12}, { 2943,11}, \
- { 5887,14}, { 767,13}, { 8192,14}, { 16384,15}, \
- { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 161
-#define SQR_FFT_THRESHOLD 1728
+ { 95,10}, { 191, 9}, { 383,10}, { 207, 9}, \
+ { 415,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 287, 9}, { 575,11}, { 159,10}, \
+ { 351, 9}, { 703, 8}, { 1407,11}, { 191,10}, \
+ { 415, 9}, { 831,11}, { 223,10}, { 479,12}, \
+ { 4096,13}, { 8192,14}, { 16384,15}, { 32768,16} }
+#define SQR_FFT_TABLE3_SIZE 84
+#define SQR_FFT_THRESHOLD 1856
#define MULLO_BASECASE_THRESHOLD 0 /* always */
-#define MULLO_DC_THRESHOLD 33
-#define MULLO_MUL_N_THRESHOLD 4392
+#define MULLO_DC_THRESHOLD 27
+#define MULLO_MUL_N_THRESHOLD 5240
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 65
+#define SQRLO_SQR_THRESHOLD 3470
-#define DC_DIV_QR_THRESHOLD 43
-#define DC_DIVAPPR_Q_THRESHOLD 150
-#define DC_BDIV_QR_THRESHOLD 38
-#define DC_BDIV_Q_THRESHOLD 107
+#define DC_DIV_QR_THRESHOLD 32
+#define DC_DIVAPPR_Q_THRESHOLD 135
+#define DC_BDIV_QR_THRESHOLD 32
+#define DC_BDIV_Q_THRESHOLD 80
-#define INV_MULMOD_BNM1_THRESHOLD 14
-#define INV_NEWTON_THRESHOLD 165
-#define INV_APPR_THRESHOLD 149
+#define INV_MULMOD_BNM1_THRESHOLD 42
+#define INV_NEWTON_THRESHOLD 177
+#define INV_APPR_THRESHOLD 139
-#define BINV_NEWTON_THRESHOLD 147
-#define REDC_1_TO_REDC_N_THRESHOLD 43
+#define BINV_NEWTON_THRESHOLD 179
+#define REDC_1_TO_REDC_N_THRESHOLD 39
-#define MU_DIV_QR_THRESHOLD 777
-#define MU_DIVAPPR_Q_THRESHOLD 942
-#define MUPI_DIV_QR_THRESHOLD 69
-#define MU_BDIV_QR_THRESHOLD 654
-#define MU_BDIV_Q_THRESHOLD 777
+#define MU_DIV_QR_THRESHOLD 872
+#define MU_DIVAPPR_Q_THRESHOLD 998
+#define MUPI_DIV_QR_THRESHOLD 66
+#define MU_BDIV_QR_THRESHOLD 748
+#define MU_BDIV_Q_THRESHOLD 906
-#define POWM_SEC_TABLE 3,32,126,692,1486
+#define POWM_SEC_TABLE 9,34,257,946,2913
-#define MATRIX22_STRASSEN_THRESHOLD 17
-#define HGCD_THRESHOLD 103
-#define HGCD_APPR_THRESHOLD 144
-#define HGCD_REDUCE_THRESHOLD 1437
-#define GCD_DC_THRESHOLD 275
-#define GCDEXT_DC_THRESHOLD 206
-#define JACOBI_BASE_METHOD 4
+#define GET_STR_DC_THRESHOLD 10
+#define GET_STR_PRECOMPUTE_THRESHOLD 16
+#define SET_STR_DC_THRESHOLD 1045
+#define SET_STR_PRECOMPUTE_THRESHOLD 1800
-#define GET_STR_DC_THRESHOLD 9
-#define GET_STR_PRECOMPUTE_THRESHOLD 20
-#define SET_STR_DC_THRESHOLD 532
-#define SET_STR_PRECOMPUTE_THRESHOLD 999
+#define FAC_DSC_THRESHOLD 77
+#define FAC_ODD_THRESHOLD 24
-#define FAC_DSC_THRESHOLD 156
-#define FAC_ODD_THRESHOLD 24
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 121
+#define HGCD_APPR_THRESHOLD 142
+#define HGCD_REDUCE_THRESHOLD 1679
+#define GCD_DC_THRESHOLD 389
+#define GCDEXT_DC_THRESHOLD 285
+#define JACOBI_BASE_METHOD 4
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/sqr_basecase.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/sqr_basecase.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/s390_32/esame/sqr_basecase.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -169,7 +169,7 @@
st %r1, 12(rp)
st %r0, 16(rp)
-C sqr_dia_addlsh1 ============================================================
+C sqr_diag_addlsh1 ============================================================
define(`up', `up_saved')
define(`rp', `rp_saved')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/README
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/README 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/README 2020-01-19 23:36:31 UTC (rev 53461)
@@ -28,7 +28,7 @@
-There are 5 generations of 64-but s390 processors, z900, z990, z9,
+There are 5 generations of 64-bit s390 processors, z900, z990, z9,
z10, and z196. The current GMP code was optimised for the two oldest,
z900 and z990.
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/s390_64/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -31,145 +31,151 @@
#define GMP_LIMB_BITS 64
#define GMP_LIMB_BYTES 8
-/* 1200 MHz z990 */
+/* 4400 MHz z196 */
+/* Generated by tuneup.c, 2017-01-02, gcc 4.9 */
-#define DIVREM_1_NORM_THRESHOLD 0 /* always */
-#define DIVREM_1_UNNORM_THRESHOLD 0 /* always */
+#define DIVREM_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVREM_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define MOD_1_1P_METHOD 2
-#define MOD_1_NORM_THRESHOLD 0 /* always */
-#define MOD_1_UNNORM_THRESHOLD 0 /* always */
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 9
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 62
-#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 17
-#define USE_PREINV_DIVREM_1 1
+#define MOD_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 14
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 15
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 31
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 2
+#define USE_PREINV_DIVREM_1 0
#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 1
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DIVEXACT_1_THRESHOLD 0 /* always */
-#define BMOD_1_TO_MOD_1_THRESHOLD 98
+#define DIV_QR_2_PI2_THRESHOLD 10
+#define DIVEXACT_1_THRESHOLD 4
+#define BMOD_1_TO_MOD_1_THRESHOLD 0 /* always */
-#define MUL_TOOM22_THRESHOLD 10
-#define MUL_TOOM33_THRESHOLD 41
-#define MUL_TOOM44_THRESHOLD 105
-#define MUL_TOOM6H_THRESHOLD 149
-#define MUL_TOOM8H_THRESHOLD 212
+#define DIV_1_VS_MUL_1_PERCENT 317
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 65
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 69
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 72
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 64
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 55
+#define MUL_TOOM22_THRESHOLD 14
+#define MUL_TOOM33_THRESHOLD 45
+#define MUL_TOOM44_THRESHOLD 121
+#define MUL_TOOM6H_THRESHOLD 177
+#define MUL_TOOM8H_THRESHOLD 260
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 81
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 78
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 81
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 88
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 118
+
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
-#define SQR_TOOM2_THRESHOLD 16
-#define SQR_TOOM3_THRESHOLD 57
-#define SQR_TOOM4_THRESHOLD 153
-#define SQR_TOOM6_THRESHOLD 204
-#define SQR_TOOM8_THRESHOLD 309
+#define SQR_TOOM2_THRESHOLD 13
+#define SQR_TOOM3_THRESHOLD 89
+#define SQR_TOOM4_THRESHOLD 242
+#define SQR_TOOM6_THRESHOLD 363
+#define SQR_TOOM8_THRESHOLD 482
-#define MULMID_TOOM42_THRESHOLD 20
+#define MULMID_TOOM42_THRESHOLD 38
-#define MULMOD_BNM1_THRESHOLD 10
-#define SQRMOD_BNM1_THRESHOLD 11
+#define MULMOD_BNM1_THRESHOLD 9
+#define SQRMOD_BNM1_THRESHOLD 9
-#define MUL_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 236 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 220, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
- { 7, 5}, { 15, 6}, { 13, 7}, { 7, 6}, \
- { 15, 7}, { 8, 6}, { 17, 7}, { 9, 6}, \
- { 19, 7}, { 13, 8}, { 7, 7}, { 17, 8}, \
- { 9, 7}, { 19, 8}, { 13, 9}, { 7, 8}, \
- { 19, 9}, { 11, 8}, { 23,10}, { 7, 9}, \
- { 15, 8}, { 33, 9}, { 19, 8}, { 39, 9}, \
- { 23,10}, { 15, 9}, { 39,10}, { 23,11}, \
- { 15,10}, { 31, 9}, { 63,10}, { 39, 9}, \
- { 79,10}, { 47,11}, { 31,10}, { 63, 9}, \
- { 127, 8}, { 255,10}, { 71, 9}, { 143, 8}, \
- { 287,10}, { 79,11}, { 47,12}, { 31,11}, \
- { 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
- { 143, 9}, { 287,11}, { 79,10}, { 159, 9}, \
- { 319,10}, { 175, 9}, { 351, 8}, { 703, 7}, \
- { 1407,11}, { 95,10}, { 191, 9}, { 383,10}, \
- { 207,11}, { 111,10}, { 223,12}, { 63,11}, \
- { 127,10}, { 255, 9}, { 511,11}, { 143,10}, \
- { 287, 9}, { 575, 8}, { 1151,10}, { 319,11}, \
- { 175,10}, { 351, 9}, { 703,12}, { 95,11}, \
- { 191,10}, { 383, 9}, { 767,11}, { 207,10}, \
- { 415,11}, { 223,13}, { 8192,14}, { 16384,15}, \
- { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
- { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
- {8388608,24} }
-#define MUL_FFT_TABLE3_SIZE 97
-#define MUL_FFT_THRESHOLD 1728
-
-#define SQR_FFT_MODF_THRESHOLD 212 /* k = 5 */
-#define SQR_FFT_TABLE3 \
- { { 212, 5}, { 7, 4}, { 15, 5}, { 13, 6}, \
- { 7, 5}, { 15, 6}, { 15, 7}, { 8, 6}, \
- { 17, 7}, { 13, 8}, { 7, 7}, { 17, 8}, \
- { 9, 7}, { 19, 8}, { 11, 7}, { 23, 8}, \
+ { { 236, 5}, { 11, 6}, { 6, 5}, { 13, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 8, 6}, \
+ { 17, 7}, { 17, 8}, { 9, 7}, { 19, 8}, \
{ 13, 9}, { 7, 8}, { 19, 9}, { 11, 8}, \
- { 25,10}, { 7, 9}, { 15, 8}, { 31, 9}, \
+ { 25,10}, { 7, 9}, { 15, 8}, { 33, 9}, \
{ 19, 8}, { 39, 9}, { 23,10}, { 15, 9}, \
- { 39,10}, { 23,11}, { 15,10}, { 31, 9}, \
- { 63,10}, { 47,11}, { 31,10}, { 63, 9}, \
- { 127, 8}, { 255,10}, { 71, 9}, { 143, 8}, \
- { 287,10}, { 79,11}, { 47,12}, { 31,11}, \
+ { 39,10}, { 23, 9}, { 47,11}, { 15,10}, \
+ { 31, 9}, { 67,10}, { 39, 9}, { 79,10}, \
+ { 47,11}, { 31,10}, { 63, 9}, { 127, 8}, \
+ { 255,10}, { 71, 9}, { 143, 8}, { 287, 7}, \
+ { 575, 9}, { 159,11}, { 47,12}, { 31,11}, \
{ 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
{ 143, 9}, { 287,11}, { 79,10}, { 159, 9}, \
{ 319, 8}, { 639,10}, { 175, 9}, { 351, 8}, \
- { 703,10}, { 191, 9}, { 383, 8}, { 767,10}, \
- { 207, 9}, { 415,11}, { 111,10}, { 223,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511,11}, \
- { 143,10}, { 287, 9}, { 575, 8}, { 1151,11}, \
- { 159,10}, { 319,11}, { 175,10}, { 351, 9}, \
- { 703,11}, { 191,10}, { 383,11}, { 207,10}, \
- { 415,11}, { 223,13}, { 8192,14}, { 16384,15}, \
- { 32768,16}, { 65536,17}, { 131072,18}, { 262144,19}, \
- { 524288,20}, {1048576,21}, {2097152,22}, {4194304,23}, \
- {8388608,24} }
-#define SQR_FFT_TABLE3_SIZE 93
-#define SQR_FFT_THRESHOLD 1600
+ { 703,11}, { 95,10}, { 191, 9}, { 383, 8}, \
+ { 767,10}, { 207, 9}, { 415, 8}, { 831,10}, \
+ { 223,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,11}, { 143,10}, { 287, 9}, { 575, 8}, \
+ { 1151,11}, { 159,10}, { 319, 9}, { 639,11}, \
+ { 175,10}, { 351, 9}, { 703, 8}, { 1407,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,11}, \
+ { 207,10}, { 415, 9}, { 831,11}, { 223,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 99
+#define MUL_FFT_THRESHOLD 2240
-#define MULLO_BASECASE_THRESHOLD 2
-#define MULLO_DC_THRESHOLD 33
-#define MULLO_MUL_N_THRESHOLD 3176
+#define SQR_FFT_MODF_THRESHOLD 220 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 220, 5}, { 7, 4}, { 15, 5}, { 13, 6}, \
+ { 7, 5}, { 15, 6}, { 8, 5}, { 17, 6}, \
+ { 13, 7}, { 7, 6}, { 15, 7}, { 8, 6}, \
+ { 17, 7}, { 9, 6}, { 19, 7}, { 13, 8}, \
+ { 7, 7}, { 17, 8}, { 9, 7}, { 20, 8}, \
+ { 11, 7}, { 23, 8}, { 13, 9}, { 7, 8}, \
+ { 19, 9}, { 11, 8}, { 23, 9}, { 15, 8}, \
+ { 31, 9}, { 19, 8}, { 39, 9}, { 23,10}, \
+ { 15, 9}, { 39,10}, { 23,11}, { 15,10}, \
+ { 31, 9}, { 63,10}, { 47,11}, { 31,10}, \
+ { 63, 9}, { 127, 8}, { 255,10}, { 71, 9}, \
+ { 143, 8}, { 287,11}, { 47,12}, { 31,11}, \
+ { 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
+ { 143, 9}, { 287, 8}, { 575, 7}, { 1151,10}, \
+ { 159, 9}, { 319, 8}, { 639,10}, { 175, 9}, \
+ { 351, 8}, { 703,11}, { 95,10}, { 191, 9}, \
+ { 383,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,11}, { 143,10}, { 287, 9}, { 575, 8}, \
+ { 1151,11}, { 159,10}, { 319, 9}, { 639,11}, \
+ { 175,10}, { 351, 9}, { 703,12}, { 95,11}, \
+ { 191,10}, { 383,11}, { 207,13}, { 8192,14}, \
+ { 16384,15}, { 32768,16}, { 65536,17}, { 131072,18}, \
+ { 262144,19}, { 524288,20}, {1048576,21}, {2097152,22}, \
+ {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 94
+#define SQR_FFT_THRESHOLD 1728
-#define DC_DIV_QR_THRESHOLD 28
-#define DC_DIVAPPR_Q_THRESHOLD 107
-#define DC_BDIV_QR_THRESHOLD 31
-#define DC_BDIV_Q_THRESHOLD 78
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 38
+#define MULLO_MUL_N_THRESHOLD 4392
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 54
+#define SQRLO_SQR_THRESHOLD 3176
-#define INV_MULMOD_BNM1_THRESHOLD 43
-#define INV_NEWTON_THRESHOLD 129
-#define INV_APPR_THRESHOLD 117
+#define DC_DIV_QR_THRESHOLD 42
+#define DC_DIVAPPR_Q_THRESHOLD 148
+#define DC_BDIV_QR_THRESHOLD 46
+#define DC_BDIV_Q_THRESHOLD 107
-#define BINV_NEWTON_THRESHOLD 149
-#define REDC_1_TO_REDC_N_THRESHOLD 38
+#define INV_MULMOD_BNM1_THRESHOLD 34
+#define INV_NEWTON_THRESHOLD 163
+#define INV_APPR_THRESHOLD 131
-#define MU_DIV_QR_THRESHOLD 748
-#define MU_DIVAPPR_Q_THRESHOLD 748
-#define MUPI_DIV_QR_THRESHOLD 65
-#define MU_BDIV_QR_THRESHOLD 562
-#define MU_BDIV_Q_THRESHOLD 734
+#define BINV_NEWTON_THRESHOLD 183
+#define REDC_1_TO_REDC_N_THRESHOLD 43
-#define POWM_SEC_TABLE 4,23,274,961,2783
+#define MU_DIV_QR_THRESHOLD 807
+#define MU_DIVAPPR_Q_THRESHOLD 942
+#define MUPI_DIV_QR_THRESHOLD 78
+#define MU_BDIV_QR_THRESHOLD 680
+#define MU_BDIV_Q_THRESHOLD 828
-#define MATRIX22_STRASSEN_THRESHOLD 11
-#define HGCD_THRESHOLD 79
-#define HGCD_APPR_THRESHOLD 70
-#define HGCD_REDUCE_THRESHOLD 1094
-#define GCD_DC_THRESHOLD 183
-#define GCDEXT_DC_THRESHOLD 148
-#define JACOBI_BASE_METHOD 4
+#define POWM_SEC_TABLE 3,35,285,1603
-#define GET_STR_DC_THRESHOLD 30
-#define GET_STR_PRECOMPUTE_THRESHOLD 41
-#define SET_STR_DC_THRESHOLD 402
-#define SET_STR_PRECOMPUTE_THRESHOLD 1104
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 1391
+#define SET_STR_PRECOMPUTE_THRESHOLD 2872
-#define FAC_DSC_THRESHOLD 842
-#define FAC_ODD_THRESHOLD 0 /* always */
+#define FAC_DSC_THRESHOLD 151
+#define FAC_ODD_THRESHOLD 23
+
+#define MATRIX22_STRASSEN_THRESHOLD 15
+#define HGCD_THRESHOLD 135
+#define HGCD_APPR_THRESHOLD 169
+#define HGCD_REDUCE_THRESHOLD 1437
+#define GCD_DC_THRESHOLD 469
+#define GCDEXT_DC_THRESHOLD 342
+#define JACOBI_BASE_METHOD 4
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc32/sparc-defs.m4
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc32/sparc-defs.m4 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc32/sparc-defs.m4 2020-01-19 23:36:31 UTC (rev 53461)
@@ -3,7 +3,7 @@
dnl m4 macros for SPARC assembler (32 and 64 bit).
-dnl Copyright 2002, 2011, 2013 Free Software Foundation, Inc.
+dnl Copyright 2002, 2011, 2013, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -62,6 +62,15 @@
dnl Use whatever 64-bit code sequence is appropriate to load "symbol" into
dnl register "reg", potentially using register "pic_reg" to perform the
dnl calculations.
+dnl
+dnl Caveat: We used to use the setx pseudo insn here, but some GNU/Linux
+dnl releases causes invalid code or relocs for that.
+dnl
+dnl Optimisation 1: Use thunk call instead of RDPC which causes pipeline
+dnl replay for some sparcs.
+dnl
+dnl Optimisation 2: Do the two symbol building sequences in parallel instead
+dnl of one after the other. That might need one more scratch register.
define(LEA64,
m4_assert_numargs(3)
@@ -71,9 +80,14 @@
sethi %hi(_GLOBAL_OFFSET_TABLE_+4), %`$3'
add %`$3', %lo(_GLOBAL_OFFSET_TABLE_+8), %`$3'
add %`$2', %`$3', %`$3'
- sethi %hi(`$1'), %`$2'
- or %`$2', %lo(`$1'), %`$2'
- ldx [%`$3' + %`$2'], %`$2'',`
- setx `$1', %`$3', %`$2'')')
+ sethi %gdop_hix22(`$1'), %`$2'
+ xor %`$2', %gdop_lox10(`$1'), %`$2'
+ ldx [%`$3' + %`$2'], %`$2', %gdop(`$1')
+',`
+ sethi %h44(`$1'), %`$2'
+ or %`$2', %m44(`$1'), %`$2'
+ sllx %`$2', 12, %`$2'
+ or %`$2', %l44(`$1'), %$2
+')')
divert
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/dive_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/dive_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/dive_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -4,7 +4,7 @@
CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN
FUTURE GNU MP RELEASES.
-Copyright 2000, 2001, 2003 Free Software Foundation, Inc.
+Copyright 2000, 2001, 2003, 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
@@ -88,17 +87,21 @@
{
count_trailing_zeros (rshift, divisor);
divisor >>= rshift;
+ lshift = 64 - rshift;
+
+ lshift_mask = MP_LIMB_T_MAX;
}
else
- rshift = 0;
+ {
+ rshift = 0;
+ /* rshift==0 means no shift, so must mask out other part in this case */
+ lshift = 0;
+ lshift_mask = 0;
+ }
+
binvert_limb (inverse, divisor);
- lshift = 64 - rshift;
-
- /* lshift==64 means no shift, so must mask out other part in this case */
- lshift_mask = (rshift == 0 ? 0 : MP_LIMB_T_MAX);
-
c = 0;
divisor_h = HIGH32 (divisor);
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/divrem_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/divrem_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/divrem_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Deleted: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,135 +0,0 @@
-dnl SPARC64 mpn_gcd_1.
-
-dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for SPARC by Torbjörn
-dnl Granlund.
-
-dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
-
-dnl This file is part of the GNU MP Library.
-dnl
-dnl The GNU MP Library is free software; you can redistribute it and/or modify
-dnl it under the terms of either:
-dnl
-dnl * the GNU Lesser General Public License as published by the Free
-dnl Software Foundation; either version 3 of the License, or (at your
-dnl option) any later version.
-dnl
-dnl or
-dnl
-dnl * the GNU General Public License as published by the Free Software
-dnl Foundation; either version 2 of the License, or (at your option) any
-dnl later version.
-dnl
-dnl or both in parallel, as here.
-dnl
-dnl The GNU MP Library is distributed in the hope that it will be useful, but
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
-dnl for more details.
-dnl
-dnl You should have received copies of the GNU General Public License and the
-dnl GNU Lesser General Public License along with the GNU MP Library. If not,
-dnl see https://www.gnu.org/licenses/.
-
-include(`../config.m4')
-
-
-C cycles/bit (approx)
-C UltraSPARC 1&2: 5.1
-C UltraSPARC 3: 5.0
-C UltraSPARC T1: 11.4
-C UltraSPARC T3: 10
-C UltraSPARC T4: 6
-C Numbers measured with: speed -CD -s32-64 -t32 mpn_gcd_1
-
-C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
-
-deflit(MAXSHIFT, 7)
-deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
-
- RODATA
- TYPE(ctz_table,object)
-ctz_table:
- .byte MAXSHIFT
-forloop(i,1,MASK,
-` .byte m4_count_trailing_zeros(i)
-')
- SIZE(ctz_table,.-ctz_table)
-
-C Threshold of when to call bmod when U is one limb. Should be about
-C (time_in_cycles(bmod_1,1) + call_overhead) / (cycles/bit).
-define(`BMOD_THRES_LOG2', 14)
-
-C INPUT PARAMETERS
-define(`up', `%i0')
-define(`n', `%i1')
-define(`v0', `%i2')
-
-
-ASM_START()
- REGISTER(%g2,#scratch)
- REGISTER(%g3,#scratch)
-PROLOGUE(mpn_gcd_1)
- save %sp, -192, %sp
- ldx [up+0], %g1 C U low limb
- mov -1, %i4
- or v0, %g1, %g2 C x | y
-
-L(twos):
- inc %i4
- andcc %g2, 1, %g0
- bz,a %xcc, L(twos)
- srlx %g2, 1, %g2
-
-L(divide_strip_y):
- andcc v0, 1, %g0
- bz,a %xcc, L(divide_strip_y)
- srlx v0, 1, v0
-
- cmp n, 1 C if n > 1 we need
- bnz %xcc, L(bmod) C to call bmod_1
- nop
-
-C Both U and V are single limbs, reduce with bmod if u0 >> v0.
- srlx %g1, BMOD_THRES_LOG2, %g2
- cmp %g2, v0
- bleu %xcc, L(noreduce)
- mov %g1, %o0
-
-L(bmod):
- mov up, %o0
- mov n, %o1
- mov v0, %o2
- call mpn_modexact_1c_odd
- mov 0, %o3
-
-L(noreduce):
-
- LEA64(ctz_table, i5, g4)
-
- cmp %o0, 0
- bnz %xcc, L(mid)
- and %o0, MASK, %g3 C
-
- return %i7+8
- sllx %o2, %o4, %o0 C CAUTION: v0 alias for o2
-
- ALIGN(16)
-L(top): movcc %xcc, %l4, v0 C v = min(u,v)
- movcc %xcc, %l2, %o0 C u = |v - u]
-L(mid): ldub [%i5+%g3], %g5 C
- brz,a,pn %g3, L(shift_alot) C
- srlx %o0, MAXSHIFT, %o0
- srlx %o0, %g5, %l4 C new u, odd
- subcc v0, %l4, %l2 C v - u, set flags for branch and movcc
- sub %l4, v0, %o0 C u - v
- bnz,pt %xcc, L(top) C
- and %l2, MASK, %g3 C extract low MAXSHIFT bits from (v-u)
-
- return %i7+8
- sllx %o2, %o4, %o0 C CAUTION: v0 alias for o2
-
-L(shift_alot):
- b L(mid)
- and %o0, MASK, %g3 C
-EPILOGUE()
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_11.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_11.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/gcd_11.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,88 @@
+dnl SPARC64 mpn_gcd_11.
+
+dnl Based on the K7 gcd_1.asm, by Kevin Ryde. Rehacked for SPARC by Torbjörn
+dnl Granlund.
+
+dnl Copyright 2000-2002, 2005, 2009, 2011-2013 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+
+C cycles/bit (approx)
+C UltraSPARC 1&2: 5.1
+C UltraSPARC 3: 5.0
+C UltraSPARC T1: 11.4
+C UltraSPARC T3: 10
+C UltraSPARC T4: 6
+C Numbers measured with: speed -CD -s32-64 -t32 mpn_gcd_1
+
+C ctz_table[n] is the number of trailing zeros on n, or MAXSHIFT if n==0.
+
+deflit(MAXSHIFT, 7)
+deflit(MASK, eval((m4_lshift(1,MAXSHIFT))-1))
+
+ RODATA
+ TYPE(ctz_table,object)
+ctz_table:
+ .byte MAXSHIFT
+forloop(i,1,MASK,
+` .byte m4_count_trailing_zeros(i)
+')
+ SIZE(ctz_table,.-ctz_table)
+
+define(`u0', `%o0')
+define(`v0', `%o1')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_gcd_11)
+ LEA64(ctz_table, o5, g4)
+ b L(odd)
+ mov u0, %o4
+
+ ALIGN(16)
+L(top): movcc %xcc, %o4, v0 C v = min(u,v)
+ movcc %xcc, %o2, %o0 C u = |v - u]
+L(mid): ldub [%o5+%g3], %g5 C
+ brz,a,pn %g3, L(shift_alot) C
+ srlx %o0, MAXSHIFT, %o0
+ srlx %o0, %g5, %o4 C new u, odd
+L(odd): subcc v0, %o4, %o2 C v - u, set flags for branch and movcc
+ sub %o4, v0, %o0 C u - v
+ bnz,pt %xcc, L(top) C
+ and %o2, MASK, %g3 C extract low MAXSHIFT bits from (v-u)
+
+ retl
+ mov v0, %o0
+
+L(shift_alot):
+ b L(mid)
+ and %o0, MASK, %g3 C
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -29,7 +29,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1_4.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1_4.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mod_1_4.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -37,7 +37,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mode1o.c
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mode1o.c 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/mode1o.c 2020-01-19 23:36:31 UTC (rev 53461)
@@ -32,7 +32,6 @@
GNU Lesser General Public License along with the GNU MP Library. If not,
see https://www.gnu.org/licenses/. */
-#include "gmp.h"
#include "gmp-impl.h"
#include "longlong.h"
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/sparc64.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/sparc64.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/sparc64.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -215,5 +215,3 @@
(r) = _r; \
(q) = _q; \
} while (0)
-
-
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/bdiv_q_1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/bdiv_q_1.asm (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/bdiv_q_1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,137 @@
+dnl SPARC T3/T4/T5 mpn_bdiv_q_1.
+
+dnl Contributed to the GNU project by Torbjörn Granlund.
+
+dnl Copyright 2013, 2017 Free Software Foundation, Inc.
+
+dnl This file is part of the GNU MP Library.
+dnl
+dnl The GNU MP Library is free software; you can redistribute it and/or modify
+dnl it under the terms of either:
+dnl
+dnl * the GNU Lesser General Public License as published by the Free
+dnl Software Foundation; either version 3 of the License, or (at your
+dnl option) any later version.
+dnl
+dnl or
+dnl
+dnl * the GNU General Public License as published by the Free Software
+dnl Foundation; either version 2 of the License, or (at your option) any
+dnl later version.
+dnl
+dnl or both in parallel, as here.
+dnl
+dnl The GNU MP Library is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+dnl for more details.
+dnl
+dnl You should have received copies of the GNU General Public License and the
+dnl GNU Lesser General Public License along with the GNU MP Library. If not,
+dnl see https://www.gnu.org/licenses/.
+
+include(`../config.m4')
+
+C cycles/limb
+C UltraSPARC T3: 31
+C UltraSPARC T4/T5: 20-26 hits 20 early, then sharply drops
+
+C INPUT PARAMETERS
+define(`qp', `%i0')
+define(`ap', `%i1')
+define(`n', `%i2')
+define(`d', `%i3')
+define(`dinv',`%i4')
+define(`cnt', `%i5')
+
+define(`tnc', `%o2')
+
+ASM_START()
+ REGISTER(%g2,#scratch)
+ REGISTER(%g3,#scratch)
+PROLOGUE(mpn_bdiv_q_1)
+ save %sp, -176, %sp
+ ldx [ap], %o5
+ add d, -1, %g1
+ andn %g1, d, %g1
+ popc %g1, cnt
+
+ srlx d, cnt, d
+ srlx d, 1, %g1
+ and %g1, 127, %g1
+ LEA64(binvert_limb_table, g2, g4)
+ ldub [%g2+%g1], %g1
+ add %g1, %g1, %g2
+ mulx %g1, %g1, %g1
+ mulx %g1, d, %g1
+ sub %g2, %g1, %g2
+ add %g2, %g2, %g1
+ mulx %g2, %g2, %g2
+ mulx %g2, d, %g2
+ sub %g1, %g2, %g1
+ add %g1, %g1, %o7
+ mulx %g1, %g1, %g1
+ mulx %g1, d, %g1
+ add n, -2, n
+ brz,pt cnt, L(norm)
+ sub %o7, %g1, dinv
+
+ brlz,pt n, L(edu)
+ srlx %o5, cnt, %o5
+ b L(eee)
+ mov 0, %g4
+EPILOGUE()
+
+PROLOGUE(mpn_pi1_bdiv_q_1)
+ save %sp, -176, %sp
+ ldx [ap], %o5
+
+ brz,pt cnt, L(norm)
+ add n, -2, n
+
+L(unorm):
+ brlz,pt n, L(edu)
+ srlx %o5, cnt, %o5
+ mov 0, %g4
+L(eee): sub %g0, cnt, tnc
+
+L(tpu): ldx [ap+8], %g3
+ add ap, 8, ap
+ sllx %g3, tnc, %g5
+ or %g5, %o5, %g5
+ srlx %g3, cnt, %o5
+ subcc %g5, %g4, %g4
+ mulx %g4, dinv, %g1
+ stx %g1, [qp]
+ add qp, 8, qp
+ umulxhi(d, %g1, %g1)
+ addxc( %g1, %g0, %g4)
+ brgz,pt n, L(tpu)
+ add n, -1, n
+
+ sub %o5, %g4, %o5
+L(edu): mulx %o5, dinv, %g1
+ return %i7+8
+ stx %g1, [%o0]
+
+L(norm):
+ mulx dinv, %o5, %g1
+ brlz,pt n, L(edn)
+ stx %g1, [qp]
+ add qp, 8, qp
+ addcc %g0, 0, %g4
+
+L(tpn): umulxhi(d, %g1, %g1)
+ ldx [ap+8], %g5
+ add ap, 8, ap
+ addxc( %g1, %g0, %g1)
+ subcc %g5, %g1, %g1
+ mulx %g1, dinv, %g1
+ stx %g1, [qp]
+ add qp, 8, qp
+ brgz,pt n, L(tpn)
+ add n, -1, n
+
+L(edn): return %i7+8
+ nop
+EPILOGUE()
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/cnd_aors_n.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/cnd_aors_n.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/cnd_aors_n.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -2,7 +2,7 @@
dnl Contributed to the GNU project by David Miller and Torbjörn Granlund.
-dnl Copyright 2013 Free Software Foundation, Inc.
+dnl Copyright 2013, 2017 Free Software Foundation, Inc.
dnl This file is part of the GNU MP Library.
dnl
@@ -62,7 +62,8 @@
ifdef(`OPERATION_cnd_add_n',`
define(`LOGOP', `and $1, $2, $3')
define(`MAKEMASK',`cmp %g0, $1
- subc %g0, %g0, $2')
+ addxc( %g0, %g0, $2)
+ neg $2, $2')
define(`INITCY', `addcc %g0, 0, %g0')
define(`RETVAL', `addxc( %g0, %g0, %i0)')
define(`func', `mpn_cnd_add_n')
@@ -70,7 +71,8 @@
ifdef(`OPERATION_cnd_sub_n',`
define(`LOGOP', `orn $2, $1, $3')
define(`MAKEMASK',`cmp $1, 1
- subc %g0, %g0, $2')
+ addxc( %g0, %g0, $2)
+ neg $2, $2')
define(`INITCY', `subcc %g0, 1, %g0')
define(`RETVAL', `addxc( %g0, %g0, %i0)
xor %i0, 1, %i0')
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct3/sqr_diag_addlsh1.asm 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,4 +1,4 @@
-dnl SPARC v9 mpn_sqr_dial_addlsh1 for T3/T4/T5.
+dnl SPARC v9 mpn_sqr_diag_addlsh1 for T3/T4/T5.
dnl Contributed to the GNU project by Torbjörn Granlund.
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct45/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct45/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct45/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,173 @@
+/* Sparc64 T4-T5 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 64
+#define GMP_LIMB_BYTES 8
+
+/* 3600 MHz ultrasparct5 running GNU/Linux */
+/* FFT tuning limit = 0.5 M */
+/* Generated by tuneup.c, 2019-10-01, gcc 7.4 */
+
+#define DIVREM_1_NORM_THRESHOLD 3
+#define DIVREM_1_UNNORM_THRESHOLD 3
+#define MOD_1_1P_METHOD 2 /* 0.34% faster than 1 */
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 3
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 8
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
+#define USE_PREINV_DIVREM_1 1
+#define DIV_QR_1N_PI1_METHOD 2 /* 27.84% faster than 1 */
+#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1_UNNORM_THRESHOLD 2
+#define DIV_QR_2_PI2_THRESHOLD 5
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 19
+
+#define DIV_1_VS_MUL_1_PERCENT 654
+
+#define MUL_TOOM22_THRESHOLD 40
+#define MUL_TOOM33_THRESHOLD 129
+#define MUL_TOOM44_THRESHOLD 372
+#define MUL_TOOM6H_THRESHOLD 494
+#define MUL_TOOM8H_THRESHOLD 656
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 126
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 247
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 225
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 219
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 188
+
+#define SQR_BASECASE_THRESHOLD 20
+#define SQR_TOOM2_THRESHOLD 59
+#define SQR_TOOM3_THRESHOLD 107
+#define SQR_TOOM4_THRESHOLD 298
+#define SQR_TOOM6_THRESHOLD 399
+#define SQR_TOOM8_THRESHOLD 562
+
+#define MULMID_TOOM42_THRESHOLD 48
+
+#define MULMOD_BNM1_THRESHOLD 25
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 555 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 555, 5}, { 29, 6}, { 31, 7}, { 31, 8}, \
+ { 17, 7}, { 36, 8}, { 19, 7}, { 39, 8}, \
+ { 21, 7}, { 43, 8}, { 29, 9}, { 15, 8}, \
+ { 31, 7}, { 63, 8}, { 35, 9}, { 19, 8}, \
+ { 43, 9}, { 23, 8}, { 51, 9}, { 27, 8}, \
+ { 57,10}, { 15, 8}, { 61, 9}, { 31, 8}, \
+ { 67, 9}, { 35, 8}, { 71, 9}, { 39, 8}, \
+ { 81, 9}, { 43,10}, { 23, 9}, { 59,11}, \
+ { 15,10}, { 31, 9}, { 71,10}, { 39, 9}, \
+ { 87,10}, { 47, 9}, { 99,10}, { 55, 9}, \
+ { 115,11}, { 31,10}, { 63, 9}, { 131,10}, \
+ { 87,11}, { 47,10}, { 111, 9}, { 223,12}, \
+ { 31,11}, { 63,10}, { 135,11}, { 79,10}, \
+ { 159,11}, { 95,10}, { 191,11}, { 111,12}, \
+ { 63,11}, { 143,10}, { 287,11}, { 159,12}, \
+ { 95,11}, { 191,10}, { 383, 9}, { 767,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define MUL_FFT_TABLE3_SIZE 75
+#define MUL_FFT_THRESHOLD 5760
+
+#define SQR_FFT_MODF_THRESHOLD 372 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 372, 5}, { 23, 6}, { 12, 5}, { 25, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 25, 8}, \
+ { 13, 7}, { 28, 8}, { 15, 7}, { 31, 8}, \
+ { 27, 9}, { 15, 8}, { 35, 9}, { 19, 8}, \
+ { 41, 9}, { 23, 8}, { 47, 9}, { 27,10}, \
+ { 15, 9}, { 39,10}, { 23, 9}, { 51,11}, \
+ { 15,10}, { 31, 9}, { 67,10}, { 39, 9}, \
+ { 79,10}, { 47, 9}, { 95,10}, { 55,11}, \
+ { 31,10}, { 79,11}, { 47,10}, { 95,12}, \
+ { 31,11}, { 63,10}, { 135,11}, { 79,10}, \
+ { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
+ { 383,11}, { 111,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 143,10}, \
+ { 287, 9}, { 575,10}, { 303, 9}, { 607,11}, \
+ { 159,10}, { 319, 9}, { 639,12}, { 95,11}, \
+ { 191,10}, { 383, 9}, { 767,11}, { 207,13}, \
+ { 8192,14}, { 16384,15}, { 32768,16}, { 65536,17}, \
+ { 131072,18}, { 262144,19}, { 524288,20}, {1048576,21}, \
+ {2097152,22}, {4194304,23}, {8388608,24} }
+#define SQR_FFT_TABLE3_SIZE 75
+#define SQR_FFT_THRESHOLD 3776
+
+#define MULLO_BASECASE_THRESHOLD 0 /* always */
+#define MULLO_DC_THRESHOLD 35
+#define MULLO_MUL_N_THRESHOLD 11278
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 168
+#define SQRLO_SQR_THRESHOLD 7511
+
+#define DC_DIV_QR_THRESHOLD 36
+#define DC_DIVAPPR_Q_THRESHOLD 103
+#define DC_BDIV_QR_THRESHOLD 28
+#define DC_BDIV_Q_THRESHOLD 88
+
+#define INV_MULMOD_BNM1_THRESHOLD 78
+#define INV_NEWTON_THRESHOLD 181
+#define INV_APPR_THRESHOLD 118
+
+#define BINV_NEWTON_THRESHOLD 296
+#define REDC_1_TO_REDC_2_THRESHOLD 4
+#define REDC_2_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1970
+#define MU_DIVAPPR_Q_THRESHOLD 1970
+#define MUPI_DIV_QR_THRESHOLD 82
+#define MU_BDIV_QR_THRESHOLD 1528
+#define MU_BDIV_Q_THRESHOLD 1970
+
+#define POWM_SEC_TABLE 1,58,102,1509
+
+#define GET_STR_DC_THRESHOLD 15
+#define GET_STR_PRECOMPUTE_THRESHOLD 29
+#define SET_STR_DC_THRESHOLD 686
+#define SET_STR_PRECOMPUTE_THRESHOLD 2717
+
+#define FAC_DSC_THRESHOLD 336
+#define FAC_ODD_THRESHOLD 24
+
+#define MATRIX22_STRASSEN_THRESHOLD 32
+#define HGCD2_DIV1_METHOD 1 /* 0.66% faster than 3 */
+#define HGCD_THRESHOLD 57
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 386
+#define GCDEXT_DC_THRESHOLD 288
+#define JACOBI_BASE_METHOD 4 /* 2.50% faster than 3 */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/sparc64/ultrasparct45/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/atom/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/atom/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/atom/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* Intel Atom/32 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 2000-2011, 2014-2015 Free Software Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,73 +32,75 @@
#define GMP_LIMB_BYTES 4
/* 1600 MHz Diamondville (Atom 330) */
-/* FFT tuning limit = 50 M */
-/* Generated by tuneup.c, 2015-10-09, gcc 4.7 */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-18, gcc 8.3 */
#define MOD_1_NORM_THRESHOLD 3
#define MOD_1_UNNORM_THRESHOLD 5
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 10
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 11
#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 17
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 4
+#define DIV_QR_1N_PI1_METHOD 1 /* 72.60% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 31
+#define BMOD_1_TO_MOD_1_THRESHOLD 35
-#define MUL_TOOM22_THRESHOLD 20
+#define DIV_1_VS_MUL_1_PERCENT 236
+
+#define MUL_TOOM22_THRESHOLD 22
#define MUL_TOOM33_THRESHOLD 81
#define MUL_TOOM44_THRESHOLD 178
#define MUL_TOOM6H_THRESHOLD 270
-#define MUL_TOOM8H_THRESHOLD 381
+#define MUL_TOOM8H_THRESHOLD 399
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 120
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
#define MUL_TOOM32_TO_TOOM53_THRESHOLD 126
#define MUL_TOOM42_TO_TOOM53_THRESHOLD 115
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 127
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 106
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 129
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 115
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_TOOM2_THRESHOLD 32
-#define SQR_TOOM3_THRESHOLD 121
-#define SQR_TOOM4_THRESHOLD 184
-#define SQR_TOOM6_THRESHOLD 303
+#define SQR_TOOM3_THRESHOLD 117
+#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM6_THRESHOLD 366
#define SQR_TOOM8_THRESHOLD 527
-#define MULMID_TOOM42_THRESHOLD 54
+#define MULMID_TOOM42_THRESHOLD 50
-#define MULMOD_BNM1_THRESHOLD 16
+#define MULMOD_BNM1_THRESHOLD 13
#define SQRMOD_BNM1_THRESHOLD 17
-#define MUL_FFT_MODF_THRESHOLD 380 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 404 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 380, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
- { 12, 5}, { 25, 6}, { 21, 7}, { 11, 6}, \
- { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
- { 31, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
- { 15, 7}, { 35, 8}, { 19, 7}, { 39, 8}, \
- { 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
- { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
- { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
- { 47, 8}, { 99, 9}, { 55,10}, { 31, 9}, \
- { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
- { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
- { 95, 9}, { 191,10}, { 111,11}, { 63,10}, \
- { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
+ { { 404, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
+ { 12, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 21, 7}, { 11, 6}, { 25, 7}, { 13, 6}, \
+ { 27, 7}, { 15, 6}, { 31, 7}, { 21, 8}, \
+ { 11, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 39, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 9}, { 15, 8}, { 39, 9}, { 23, 8}, \
+ { 51,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
+ { 39, 8}, { 79, 9}, { 47, 8}, { 95,10}, \
+ { 31, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 159,10}, { 95, 9}, { 191,10}, { 111,11}, \
+ { 63,10}, { 127, 9}, { 255, 8}, { 511,10}, \
{ 143, 9}, { 287, 8}, { 575, 9}, { 303,10}, \
- { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
- { 383,12}, { 63,11}, { 127,10}, { 255, 9}, \
- { 511,10}, { 271, 9}, { 543,10}, { 287, 9}, \
- { 575,10}, { 303,11}, { 159,10}, { 319, 9}, \
- { 639,10}, { 351,11}, { 191,10}, { 383, 9}, \
+ { 159,11}, { 95,10}, { 191, 9}, { 383,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
+ { 271, 9}, { 543,10}, { 287, 9}, { 575,10}, \
+ { 303,11}, { 159,10}, { 351, 9}, { 703,10}, \
+ { 367, 9}, { 735,11}, { 191,10}, { 383, 9}, \
{ 767,10}, { 415,11}, { 223,10}, { 447,12}, \
{ 127,11}, { 255,10}, { 543,11}, { 287,10}, \
- { 607,11}, { 319,10}, { 639,11}, { 351,10}, \
- { 703,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 607,11}, { 319,10}, { 671,11}, { 351,10}, \
+ { 735,12}, { 191,11}, { 383,10}, { 767,11}, \
{ 415,10}, { 831,11}, { 447,13}, { 127,12}, \
{ 255,11}, { 543,10}, { 1087,11}, { 607,12}, \
{ 319,11}, { 735,12}, { 383,11}, { 831,12}, \
@@ -105,103 +107,108 @@
{ 447,11}, { 959,13}, { 255,12}, { 511,11}, \
{ 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
{ 1279,12}, { 703,11}, { 1407,13}, { 383,12}, \
- { 959,14}, { 255,13}, { 511,12}, { 1215,13}, \
- { 639,12}, { 1471,13}, { 767,12}, { 1599,13}, \
- { 895,12}, { 1791,14}, { 511,13}, { 1023,12}, \
- { 2111,13}, { 1151,12}, { 2431,13}, { 1407,14}, \
- { 767,13}, { 1663,12}, { 3455,13}, { 1791,15}, \
- { 511,14}, { 1023,13}, { 2431,14}, { 1279,13}, \
- { 2943,12}, { 5887,14}, { 1535,13}, { 3455,14}, \
- { 1791,13}, { 3839,15}, { 1023,14}, { 2047,13}, \
- { 4223,14}, { 2303,13}, { 4991,12}, { 9983,14}, \
- { 2815,13}, { 5887,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 155
+ { 831,11}, { 1663,12}, { 959,14}, { 255,13}, \
+ { 511,12}, { 1215,13}, { 639,12}, { 1471,13}, \
+ { 767,12}, { 1599,13}, { 895,12}, { 1791,14}, \
+ { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
+ { 2431,13}, { 1407,14}, { 767,13}, { 1663,12}, \
+ { 3455,13}, { 1791,15}, { 511,14}, { 1023,13}, \
+ { 2431,14}, { 1279,13}, { 2943,12}, { 5887,14}, \
+ { 1535,13}, { 3455,14}, { 1791,13}, { 3839,15}, \
+ { 1023,14}, { 2047,13}, { 4223,14}, { 2303,13}, \
+ { 4991,12}, { 9983,14}, { 2815,13}, { 5887,15}, \
+ { 1535,14}, { 3839,16} }
+#define MUL_FFT_TABLE3_SIZE 158
#define MUL_FFT_THRESHOLD 4544
-#define SQR_FFT_MODF_THRESHOLD 340 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 368 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 340, 5}, { 21, 6}, { 11, 5}, { 23, 6}, \
- { 12, 5}, { 25, 6}, { 21, 7}, { 11, 6}, \
- { 25, 7}, { 13, 6}, { 28, 7}, { 15, 6}, \
- { 31, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
+ { { 368, 5}, { 23, 6}, { 12, 5}, { 25, 6}, \
+ { 13, 5}, { 27, 6}, { 25, 7}, { 13, 6}, \
+ { 28, 7}, { 15, 6}, { 31, 7}, { 17, 6}, \
+ { 35, 7}, { 21, 8}, { 11, 7}, { 27, 8}, \
{ 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
{ 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
{ 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
- { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
+ { 31, 8}, { 63, 9}, { 39, 8}, { 79, 9}, \
{ 47,10}, { 31, 9}, { 79,10}, { 47, 9}, \
{ 95,11}, { 31,10}, { 63, 9}, { 127, 8}, \
- { 255, 7}, { 511, 9}, { 135, 8}, { 271, 9}, \
- { 143,10}, { 79, 8}, { 319, 7}, { 639,10}, \
- { 95, 9}, { 191, 8}, { 383,10}, { 111,11}, \
- { 63,10}, { 127, 9}, { 255, 8}, { 511, 9}, \
- { 271, 8}, { 543,10}, { 143, 9}, { 287, 8}, \
- { 607, 9}, { 319,11}, { 95,10}, { 191,12}, \
- { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
- { 271, 9}, { 543,10}, { 287, 9}, { 575,10}, \
- { 303, 9}, { 607,10}, { 319, 9}, { 639,10}, \
- { 335, 9}, { 671,10}, { 351, 9}, { 703,11}, \
- { 191,10}, { 383, 9}, { 767,10}, { 415,11}, \
- { 223,10}, { 447,12}, { 127,11}, { 255,10}, \
- { 543,11}, { 287,10}, { 607,11}, { 319,10}, \
- { 671,11}, { 351,10}, { 703,12}, { 191,11}, \
- { 383,10}, { 767,11}, { 415,10}, { 831,11}, \
- { 479,13}, { 127,12}, { 255,11}, { 543,10}, \
- { 1087,11}, { 607,12}, { 319,11}, { 671,10}, \
- { 1343,11}, { 735,12}, { 383,11}, { 831,12}, \
- { 447,11}, { 959,13}, { 255,12}, { 511,11}, \
- { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
- { 1343,12}, { 703,13}, { 383,12}, { 959,14}, \
- { 255,13}, { 511,12}, { 1215,13}, { 639,12}, \
- { 1471,13}, { 767,12}, { 1599,13}, { 895,14}, \
- { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
- { 2431,13}, { 1407,14}, { 767,13}, { 1663,12}, \
- { 3455,15}, { 511,14}, { 1023,13}, { 2431,14}, \
+ { 255, 9}, { 135,10}, { 79, 9}, { 159, 8}, \
+ { 319,10}, { 95, 9}, { 191,11}, { 63,10}, \
+ { 127, 9}, { 255, 8}, { 511, 9}, { 271,10}, \
+ { 143, 9}, { 287, 8}, { 575, 9}, { 303,10}, \
+ { 159, 9}, { 319,11}, { 95,10}, { 191, 9}, \
+ { 383,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287, 9}, \
+ { 575,10}, { 303, 9}, { 607,11}, { 159,10}, \
+ { 319, 9}, { 639,10}, { 335, 9}, { 671,10}, \
+ { 351, 9}, { 703,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 415,11}, { 223,10}, { 447,12}, \
+ { 127,11}, { 255,10}, { 543,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 671,11}, { 351,10}, \
+ { 703,12}, { 191,11}, { 383,10}, { 767,11}, \
+ { 415,10}, { 831,11}, { 447,13}, { 127,12}, \
+ { 255,11}, { 543,10}, { 1087,11}, { 607,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 735,12}, \
+ { 383,11}, { 831,12}, { 447,11}, { 959,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1215,12}, { 639,11}, { 1343,12}, { 703,13}, \
+ { 383,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1215,13}, { 639,12}, { 1471,13}, { 767,12}, \
+ { 1599,13}, { 895,14}, { 511,13}, { 1023,12}, \
+ { 2111,13}, { 1151,12}, { 2431,13}, { 1407,14}, \
+ { 767,13}, { 1663,12}, { 3455,15}, { 511,14}, \
+ { 1023,13}, { 2175,12}, { 4351,13}, { 2431,14}, \
{ 1279,13}, { 2943,12}, { 5887,14}, { 1535,13}, \
{ 3455,14}, { 1791,13}, { 3839,15}, { 1023,14}, \
{ 2047,13}, { 4351,14}, { 2303,13}, { 4991,12}, \
- { 9983,14}, { 2815,13}, { 5887,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 160
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3839,16} }
+#define SQR_FFT_TABLE3_SIZE 161
#define SQR_FFT_THRESHOLD 3712
#define MULLO_BASECASE_THRESHOLD 0 /* always */
#define MULLO_DC_THRESHOLD 56
#define MULLO_MUL_N_THRESHOLD 8907
-#define SQRLO_BASECASE_THRESHOLD 0 /* always */
-#define SQRLO_DC_THRESHOLD 114
+#define SQRLO_BASECASE_THRESHOLD 6
+#define SQRLO_DC_THRESHOLD 111
#define SQRLO_SQR_THRESHOLD 6654
-#define DC_DIV_QR_THRESHOLD 71
-#define DC_DIVAPPR_Q_THRESHOLD 250
-#define DC_BDIV_QR_THRESHOLD 68
+#define DC_DIV_QR_THRESHOLD 67
+#define DC_DIVAPPR_Q_THRESHOLD 252
+#define DC_BDIV_QR_THRESHOLD 63
#define DC_BDIV_Q_THRESHOLD 172
-#define INV_MULMOD_BNM1_THRESHOLD 38
+#define INV_MULMOD_BNM1_THRESHOLD 42
#define INV_NEWTON_THRESHOLD 250
#define INV_APPR_THRESHOLD 250
-#define BINV_NEWTON_THRESHOLD 264
-#define REDC_1_TO_REDC_N_THRESHOLD 71
+#define BINV_NEWTON_THRESHOLD 276
+#define REDC_1_TO_REDC_N_THRESHOLD 68
-#define MU_DIV_QR_THRESHOLD 1442
+#define MU_DIV_QR_THRESHOLD 1334
#define MU_DIVAPPR_Q_THRESHOLD 1442
-#define MUPI_DIV_QR_THRESHOLD 114
-#define MU_BDIV_QR_THRESHOLD 1017
-#define MU_BDIV_Q_THRESHOLD 1210
+#define MUPI_DIV_QR_THRESHOLD 116
+#define MU_BDIV_QR_THRESHOLD 1142
+#define MU_BDIV_Q_THRESHOLD 1341
-#define POWM_SEC_TABLE 3,16,96,416,1985
+#define POWM_SEC_TABLE 1,16,98,376,1259
-#define GET_STR_DC_THRESHOLD 13
-#define GET_STR_PRECOMPUTE_THRESHOLD 25
-#define SET_STR_DC_THRESHOLD 396
-#define SET_STR_PRECOMPUTE_THRESHOLD 1105
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 23
+#define SET_STR_DC_THRESHOLD 298
+#define SET_STR_PRECOMPUTE_THRESHOLD 1037
-#define FAC_DSC_THRESHOLD 224
-#define FAC_ODD_THRESHOLD 29
+#define FAC_DSC_THRESHOLD 171
+#define FAC_ODD_THRESHOLD 34
#define MATRIX22_STRASSEN_THRESHOLD 17
-#define HGCD_THRESHOLD 126
-#define HGCD_APPR_THRESHOLD 165
+#define HGCD2_DIV1_METHOD 3 /* 3.71% faster than 1 */
+#define HGCD_THRESHOLD 128
+#define HGCD_APPR_THRESHOLD 186
#define HGCD_REDUCE_THRESHOLD 2479
-#define GCD_DC_THRESHOLD 511
-#define GCDEXT_DC_THRESHOLD 333
-#define JACOBI_BASE_METHOD 2
+#define GCD_DC_THRESHOLD 465
+#define GCDEXT_DC_THRESHOLD 339
+#define JACOBI_BASE_METHOD 3 /* 2.58% faster than 2 */
+
+/* Tuneup completed successfully, took 214190 seconds */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd1/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd1/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd1/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
-/* AMD bd2 gmp-mparam.h -- Compiler/machine parameter header file.
+/* AMD bd1 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 2000-2005, 2008-2010, 2014 Free Software
-Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,177 +31,181 @@
#define GMP_LIMB_BITS 32
#define GMP_LIMB_BYTES 4
-/* 3600 MHz Bulldozer Zambezi */
-/* FFT tuning limit = 25000000 */
-/* Generated by tuneup.c, 2014-03-13, gcc 4.5 */
+/* 3600-3800 MHz Bulldozer Zambezi */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-27, gcc 8.3 */
#define MOD_1_NORM_THRESHOLD 0 /* always */
-#define MOD_1_UNNORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 16
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 15
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1N_PI1_METHOD 1 /* 59.59% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 5
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
#define BMOD_1_TO_MOD_1_THRESHOLD 27
+#define DIV_1_VS_MUL_1_PERCENT 245
+
#define MUL_TOOM22_THRESHOLD 32
-#define MUL_TOOM33_THRESHOLD 65
+#define MUL_TOOM33_THRESHOLD 89
#define MUL_TOOM44_THRESHOLD 154
#define MUL_TOOM6H_THRESHOLD 230
-#define MUL_TOOM8H_THRESHOLD 354
+#define MUL_TOOM8H_THRESHOLD 351
#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
#define MUL_TOOM32_TO_TOOM53_THRESHOLD 110
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 93
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 102
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 101
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 111
#define MUL_TOOM43_TO_TOOM54_THRESHOLD 130
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
-#define SQR_TOOM2_THRESHOLD 48
+#define SQR_TOOM2_THRESHOLD 46
#define SQR_TOOM3_THRESHOLD 87
-#define SQR_TOOM4_THRESHOLD 204
-#define SQR_TOOM6_THRESHOLD 315
-#define SQR_TOOM8_THRESHOLD 430
+#define SQR_TOOM4_THRESHOLD 216
+#define SQR_TOOM6_THRESHOLD 294
+#define SQR_TOOM8_THRESHOLD 442
-#define MULMID_TOOM42_THRESHOLD 48
+#define MULMID_TOOM42_THRESHOLD 50
-#define MULMOD_BNM1_THRESHOLD 21
-#define SQRMOD_BNM1_THRESHOLD 23
+#define MULMOD_BNM1_THRESHOLD 22
+#define SQRMOD_BNM1_THRESHOLD 26
-#define MUL_FFT_MODF_THRESHOLD 840 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 636 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 840, 5}, { 28, 6}, { 15, 5}, { 33, 6}, \
- { 28, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
+ { { 636, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 28, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
{ 35, 7}, { 19, 6}, { 39, 7}, { 23, 6}, \
- { 47, 7}, { 29, 8}, { 15, 7}, { 31, 6}, \
- { 63, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
- { 23, 7}, { 51, 8}, { 27, 7}, { 55, 8}, \
- { 31, 7}, { 63, 8}, { 39, 7}, { 79, 9}, \
- { 23, 8}, { 55, 9}, { 31, 8}, { 67, 9}, \
- { 39, 8}, { 79, 9}, { 47, 8}, { 95, 9}, \
- { 55,10}, { 31, 9}, { 63, 8}, { 127, 9}, \
- { 79,10}, { 47, 9}, { 103,11}, { 31,10}, \
- { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
- { 95, 9}, { 191,10}, { 111,11}, { 63,10}, \
- { 127, 9}, { 255,10}, { 159,11}, { 95,10}, \
- { 191,12}, { 63,11}, { 127,10}, { 271,11}, \
- { 159,10}, { 319, 9}, { 639,11}, { 191,10}, \
- { 383, 9}, { 767,11}, { 223,12}, { 127,11}, \
- { 255,10}, { 511,11}, { 287,10}, { 607,11}, \
- { 319,10}, { 639,12}, { 191,11}, { 383,10}, \
- { 799,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 47, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
+ { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
+ { 191,11}, { 63, 7}, { 1023, 8}, { 543,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271,11}, { 159,10}, \
+ { 319, 9}, { 639,10}, { 335,11}, { 191,10}, \
+ { 399,11}, { 223,12}, { 127,11}, { 255,10}, \
+ { 543,11}, { 287,10}, { 607,11}, { 319,10}, \
+ { 639,12}, { 191,11}, { 383,10}, { 799,11}, \
+ { 415,13}, { 127,12}, { 255,11}, { 543,10}, \
{ 1087,11}, { 607,12}, { 319,11}, { 671,10}, \
- { 1343,11}, { 735,10}, { 1471, 9}, { 2943,12}, \
- { 383,11}, { 799,10}, { 1599,11}, { 863,10}, \
- { 1727,12}, { 447,13}, { 255,12}, { 511,11}, \
- { 1087,12}, { 575,11}, { 1215,10}, { 2431,12}, \
- { 639,11}, { 1343,12}, { 703,11}, { 1471,10}, \
- { 2943,13}, { 383,12}, { 767,11}, { 1599,12}, \
- { 831,11}, { 1727,10}, { 3455,14}, { 255,13}, \
- { 511,12}, { 1087,11}, { 2239,12}, { 1215,11}, \
- { 2431,13}, { 639,12}, { 1471,11}, { 2943,13}, \
+ { 1343,11}, { 735,12}, { 383,11}, { 799,10}, \
+ { 1599,11}, { 863,12}, { 447,11}, { 895,13}, \
+ { 255,12}, { 511,11}, { 1087,12}, { 575,11}, \
+ { 1215,12}, { 639,11}, { 1343,12}, { 703,11}, \
+ { 1471,13}, { 383,12}, { 767,11}, { 1599,12}, \
+ { 831,11}, { 1727,12}, { 895,14}, { 255,13}, \
+ { 511,12}, { 1087,11}, { 2239,10}, { 4479,12}, \
+ { 1215,13}, { 639,12}, { 1471,11}, { 2943,13}, \
{ 767,12}, { 1727,11}, { 3455,13}, { 895,12}, \
- { 1919,11}, { 3839,12}, { 1983,11}, { 3967,10}, \
- { 7935,14}, { 511,13}, { 1023,12}, { 2239,13}, \
- { 1151,12}, { 2495,11}, { 4991,13}, { 1279,12}, \
- { 2623,13}, { 1407,12}, { 2943,14}, { 767,13}, \
- { 1535,12}, { 3071,13}, { 1663,12}, { 3455,13}, \
- { 1791,12}, { 3583,13}, { 1919,12}, { 3967,11}, \
- { 7935,15}, { 511,14}, { 1023,13}, { 2175,12}, \
- { 4479,13}, { 2431,12}, { 4991,14}, { 1279,13}, \
- { 2943,12}, { 6015,14}, { 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 160
-#define MUL_FFT_THRESHOLD 7808
+ { 1919,14}, { 511,13}, { 1023,12}, { 2239,11}, \
+ { 4479,13}, { 1151,12}, { 2495,11}, { 4991,13}, \
+ { 1279,12}, { 2623,13}, { 1407,12}, { 2943,14}, \
+ { 767,13}, { 1663,12}, { 3455,13}, { 1919,15}, \
+ { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
+ { 2431,12}, { 4991,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
+ { 3967,12}, { 7935,15}, { 1023,14}, { 2047,13}, \
+ { 4479,14}, { 2303,13}, { 4991,12}, { 9983,14}, \
+ { 2815,13}, { 5887,15}, { 1535,14}, { 3327,13}, \
+ { 6911,14}, { 3839,13}, { 7935,16} }
+#define MUL_FFT_TABLE3_SIZE 159
+#define MUL_FFT_THRESHOLD 6784
-#define SQR_FFT_MODF_THRESHOLD 690 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 565 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 690, 5}, { 28, 6}, { 15, 5}, { 32, 6}, \
- { 29, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
- { 35, 7}, { 19, 6}, { 40, 7}, { 21, 6}, \
- { 43, 7}, { 23, 6}, { 47, 7}, { 35, 8}, \
- { 19, 7}, { 43, 8}, { 23, 7}, { 49, 8}, \
- { 27, 7}, { 55, 8}, { 31, 7}, { 63, 8}, \
- { 39, 7}, { 79, 8}, { 43, 9}, { 23, 8}, \
+ { { 565, 5}, { 29, 6}, { 15, 5}, { 32, 6}, \
+ { 17, 5}, { 35, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 23, 6}, { 47, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 7}, { 55, 8}, { 43, 9}, { 23, 8}, \
{ 55, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
{ 79, 9}, { 47, 8}, { 95, 9}, { 55,10}, \
- { 31, 9}, { 63, 8}, { 127, 9}, { 79,10}, \
- { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
- { 127,10}, { 79, 9}, { 167,10}, { 95, 9}, \
- { 191,10}, { 111,11}, { 63,10}, { 159,11}, \
- { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
- { 271,11}, { 159,10}, { 319, 9}, { 639,11}, \
- { 191,10}, { 383,11}, { 223,12}, { 127,11}, \
- { 255,10}, { 511, 9}, { 1023,10}, { 543,11}, \
- { 287,10}, { 607, 9}, { 1215,11}, { 319,10}, \
- { 639,12}, { 191,11}, { 383,10}, { 799,11}, \
- { 415,13}, { 127,12}, { 255,11}, { 511,10}, \
- { 1023,11}, { 543,10}, { 1087,11}, { 607,10}, \
- { 1215,12}, { 319,11}, { 671,10}, { 1343,11}, \
- { 735,10}, { 1471,12}, { 383,11}, { 799,10}, \
- { 1599,11}, { 863,12}, { 447,11}, { 927,13}, \
- { 255,12}, { 511,11}, { 1055,10}, { 2111,11}, \
- { 1087,12}, { 575,11}, { 1215,10}, { 2431,12}, \
- { 639,11}, { 1343,12}, { 703,11}, { 1471,13}, \
- { 383,12}, { 767,11}, { 1599,12}, { 831,11}, \
- { 1727,10}, { 3455,12}, { 895,14}, { 255,13}, \
- { 511,12}, { 1023,11}, { 2111,12}, { 1087,11}, \
- { 2239,10}, { 4479,12}, { 1215,11}, { 2431,13}, \
+ { 31, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 159,10}, { 95,11}, { 63,10}, { 159,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 335, 9}, { 671,11}, { 191,10}, { 415,11}, \
+ { 223,12}, { 127,11}, { 255,10}, { 543,11}, \
+ { 287,10}, { 607,11}, { 319,10}, { 671,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 831,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 607,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 735,12}, { 383,11}, { 863,12}, \
+ { 447,11}, { 959,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
+ { 1343,12}, { 703,13}, { 383,12}, { 767,11}, \
+ { 1535,12}, { 831,11}, { 1727,12}, { 895,11}, \
+ { 1791,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1087,11}, { 2239,10}, { 4479,12}, { 1215,13}, \
{ 639,12}, { 1471,11}, { 2943,13}, { 767,12}, \
- { 1727,11}, { 3455,13}, { 895,12}, { 1983,11}, \
- { 3967,14}, { 511,13}, { 1023,12}, { 2239,11}, \
- { 4479,13}, { 1151,12}, { 2495,11}, { 4991,10}, \
- { 9983,13}, { 1279,12}, { 2623,13}, { 1407,12}, \
- { 2943,14}, { 767,13}, { 1663,12}, { 3455,13}, \
- { 1791,12}, { 3583,13}, { 1919,12}, { 3967,15}, \
- { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
- { 2431,12}, { 4991,11}, { 9983,14}, { 1279,13}, \
- { 2687,12}, { 5375,13}, { 2943,12}, { 5887,14}, \
- { 16384,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 166
-#define SQR_FFT_THRESHOLD 6784
+ { 1727,13}, { 895,12}, { 1919,14}, { 511,13}, \
+ { 1023,12}, { 2239,11}, { 4479,13}, { 1151,12}, \
+ { 2495,11}, { 4991,13}, { 1279,12}, { 2623,13}, \
+ { 1407,12}, { 2943,14}, { 767,13}, { 1663,12}, \
+ { 3455,13}, { 1919,15}, { 511,14}, { 1023,13}, \
+ { 2175,12}, { 4479,13}, { 2431,12}, { 4991,14}, \
+ { 1279,13}, { 2943,12}, { 5887,14}, { 1535,13}, \
+ { 3455,14}, { 1791,13}, { 3967,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3327,13}, { 6783,14}, { 3839,13}, { 7679,16} }
+#define SQR_FFT_TABLE3_SIZE 152
+#define SQR_FFT_THRESHOLD 5760
-#define MULLO_BASECASE_THRESHOLD 5
+#define MULLO_BASECASE_THRESHOLD 3
#define MULLO_DC_THRESHOLD 31
-#define MULLO_MUL_N_THRESHOLD 14709
+#define MULLO_MUL_N_THRESHOLD 13463
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 33
+#define SQRLO_SQR_THRESHOLD 11278
-#define DC_DIV_QR_THRESHOLD 53
-#define DC_DIVAPPR_Q_THRESHOLD 230
-#define DC_BDIV_QR_THRESHOLD 50
-#define DC_BDIV_Q_THRESHOLD 136
+#define DC_DIV_QR_THRESHOLD 52
+#define DC_DIVAPPR_Q_THRESHOLD 198
+#define DC_BDIV_QR_THRESHOLD 48
+#define DC_BDIV_Q_THRESHOLD 126
-#define INV_MULMOD_BNM1_THRESHOLD 78
-#define INV_NEWTON_THRESHOLD 202
+#define INV_MULMOD_BNM1_THRESHOLD 82
+#define INV_NEWTON_THRESHOLD 212
#define INV_APPR_THRESHOLD 202
-#define BINV_NEWTON_THRESHOLD 236
+#define BINV_NEWTON_THRESHOLD 238
#define REDC_1_TO_REDC_N_THRESHOLD 55
-#define MU_DIV_QR_THRESHOLD 1442
-#define MU_DIVAPPR_Q_THRESHOLD 1652
-#define MUPI_DIV_QR_THRESHOLD 81
-#define MU_BDIV_QR_THRESHOLD 1787
-#define MU_BDIV_Q_THRESHOLD 1685
+#define MU_DIV_QR_THRESHOLD 1652
+#define MU_DIVAPPR_Q_THRESHOLD 1528
+#define MUPI_DIV_QR_THRESHOLD 110
+#define MU_BDIV_QR_THRESHOLD 1442
+#define MU_BDIV_Q_THRESHOLD 1528
-#define POWM_SEC_TABLE 1,22,194,376,692,2657
+#define POWM_SEC_TABLE 1,20,96,386,1221,2698
-#define MATRIX22_STRASSEN_THRESHOLD 21
-#define HGCD_THRESHOLD 85
-#define HGCD_APPR_THRESHOLD 50
-#define HGCD_REDUCE_THRESHOLD 4455
-#define GCD_DC_THRESHOLD 456
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 21
+#define SET_STR_DC_THRESHOLD 100
+#define SET_STR_PRECOMPUTE_THRESHOLD 762
+
+#define FAC_DSC_THRESHOLD 118
+#define FAC_ODD_THRESHOLD 34
+
+#define MATRIX22_STRASSEN_THRESHOLD 16
+#define HGCD2_DIV1_METHOD 4 /* 1.22% faster than 3 */
+#define HGCD_THRESHOLD 67
+#define HGCD_APPR_THRESHOLD 150
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 483
#define GCDEXT_DC_THRESHOLD 345
-#define JACOBI_BASE_METHOD 4
+#define JACOBI_BASE_METHOD 4 /* 5.07% faster than 1 */
-#define GET_STR_DC_THRESHOLD 17
-#define GET_STR_PRECOMPUTE_THRESHOLD 27
-#define SET_STR_DC_THRESHOLD 100
-#define SET_STR_PRECOMPUTE_THRESHOLD 960
-
-#define FAC_DSC_THRESHOLD 208
-#define FAC_ODD_THRESHOLD 26
+/* Tuneup completed successfully, took 65358 seconds */
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd2/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd2/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd2/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,7 +1,6 @@
/* AMD bd2 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 2000-2005, 2008-2010, 2014, 2015 Free
-Software Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -32,180 +31,184 @@
#define GMP_LIMB_BITS 32
#define GMP_LIMB_BYTES 4
-/* 4000 MHz Piledriver Vishera */
-/* FFT tuning limit = 40000000 */
+/* 4000-4200 MHz Piledriver Vishera */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-23, gcc 8.3 */
-#define MOD_1_NORM_THRESHOLD 0 /* always */
-#define MOD_1_UNNORM_THRESHOLD 3
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 7
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 5
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 19
+#define MOD_1_NORM_THRESHOLD 3
+#define MOD_1_UNNORM_THRESHOLD 4
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 18
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 12
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1N_PI1_METHOD 1 /* 40.87% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 5
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
#define BMOD_1_TO_MOD_1_THRESHOLD 24
-#define MUL_TOOM22_THRESHOLD 30
-#define MUL_TOOM33_THRESHOLD 81
-#define MUL_TOOM44_THRESHOLD 153
+#define DIV_1_VS_MUL_1_PERCENT 254
+
+#define MUL_TOOM22_THRESHOLD 32
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 151
#define MUL_TOOM6H_THRESHOLD 222
-#define MUL_TOOM8H_THRESHOLD 357
+#define MUL_TOOM8H_THRESHOLD 351
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 89
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 99
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 96
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 85
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 110
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 100
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 110
#define MUL_TOOM43_TO_TOOM54_THRESHOLD 130
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
-#define SQR_TOOM2_THRESHOLD 38
-#define SQR_TOOM3_THRESHOLD 89
-#define SQR_TOOM4_THRESHOLD 196
-#define SQR_TOOM6_THRESHOLD 290
-#define SQR_TOOM8_THRESHOLD 454
+#define SQR_TOOM2_THRESHOLD 44
+#define SQR_TOOM3_THRESHOLD 93
+#define SQR_TOOM4_THRESHOLD 212
+#define SQR_TOOM6_THRESHOLD 318
+#define SQR_TOOM8_THRESHOLD 466
-#define MULMID_TOOM42_THRESHOLD 68
+#define MULMID_TOOM42_THRESHOLD 66
-#define MULMOD_BNM1_THRESHOLD 19
-#define SQRMOD_BNM1_THRESHOLD 22
+#define MULMOD_BNM1_THRESHOLD 20
+#define SQRMOD_BNM1_THRESHOLD 23
-#define MUL_FFT_MODF_THRESHOLD 636 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 595 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 636, 5}, { 27, 6}, { 27, 7}, { 15, 6}, \
+ { { 595, 5}, { 27, 6}, { 29, 7}, { 15, 6}, \
{ 33, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
{ 39, 7}, { 23, 6}, { 47, 7}, { 29, 8}, \
{ 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
- { 23, 7}, { 49, 8}, { 27, 7}, { 55, 9}, \
- { 15, 8}, { 31, 7}, { 63, 8}, { 43, 9}, \
- { 23, 8}, { 55, 9}, { 31, 8}, { 67, 9}, \
- { 39, 8}, { 79, 9}, { 47, 8}, { 95, 9}, \
- { 55,10}, { 31, 9}, { 63, 8}, { 127, 9}, \
- { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
- { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
- { 95, 9}, { 191,11}, { 63,10}, { 127, 6}, \
- { 2111, 5}, { 4351, 6}, { 2239, 7}, { 1215, 9}, \
- { 311, 8}, { 639,10}, { 175, 8}, { 703,10}, \
- { 191,12}, { 63,11}, { 127,10}, { 255, 9}, \
- { 511,10}, { 271, 9}, { 543,10}, { 287,11}, \
- { 159, 9}, { 671,11}, { 191,10}, { 383, 9}, \
- { 799,11}, { 223,12}, { 127,11}, { 255,10}, \
- { 543, 9}, { 1087,11}, { 287,10}, { 607,11}, \
- { 319,10}, { 671,12}, { 191,11}, { 383,10}, \
- { 799,11}, { 415,13}, { 127,12}, { 255,11}, \
- { 543,10}, { 1087,11}, { 607,10}, { 1215,12}, \
+ { 23, 7}, { 49, 8}, { 31, 7}, { 63, 8}, \
+ { 39, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 83, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
+ { 191,11}, { 63,10}, { 143, 7}, { 1215, 9}, \
+ { 319, 8}, { 639, 9}, { 335, 8}, { 671, 9}, \
+ { 351,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 271,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 335,11}, { 191,10}, { 399,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 543,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 671,12}, { 191,11}, \
+ { 383,10}, { 799,11}, { 415,13}, { 127,12}, \
+ { 255,11}, { 543,10}, { 1087,11}, { 607,12}, \
{ 319,11}, { 671,10}, { 1343,11}, { 735,10}, \
{ 1471,12}, { 383,11}, { 799,10}, { 1599,11}, \
{ 863,12}, { 447,11}, { 895,13}, { 255,12}, \
- { 511,11}, { 1087,12}, { 575,11}, { 1215,10}, \
- { 2431,12}, { 639,11}, { 1343,12}, { 703,11}, \
- { 1471,13}, { 383,12}, { 767,11}, { 1599,12}, \
- { 831,11}, { 1727,10}, { 3455,12}, { 895,14}, \
- { 255,13}, { 511,12}, { 1023,11}, { 2047,12}, \
- { 1087,11}, { 2239,10}, { 4479,12}, { 1215,11}, \
- { 2431,13}, { 639,12}, { 1471,11}, { 2943,13}, \
- { 767,12}, { 1727,11}, { 3455,13}, { 895,12}, \
- { 1919,14}, { 511,13}, { 1023,12}, { 2239,11}, \
- { 4479,13}, { 1151,12}, { 2495,11}, { 4991,13}, \
- { 1279,12}, { 2623,13}, { 1407,12}, { 2943,14}, \
- { 767,13}, { 1535,12}, { 3071,13}, { 1663,12}, \
- { 3455,13}, { 1919,15}, { 511,14}, { 1023,13}, \
- { 2175,12}, { 4479,13}, { 2431,12}, { 4991,14}, \
- { 1279,13}, { 2943,12}, { 5887,14}, { 1535,13}, \
- { 3455,14}, { 1791,13}, { 3967,12}, { 7935,11}, \
- { 15871,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
- { 2303,13}, { 8192,14}, { 16384,15}, { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 172
+ { 511,11}, { 1087,12}, { 575,11}, { 1215,12}, \
+ { 639,11}, { 1343,12}, { 703,11}, { 1471,13}, \
+ { 383,12}, { 767,11}, { 1599,12}, { 831,11}, \
+ { 1727,12}, { 895,14}, { 255,13}, { 511,12}, \
+ { 1087,11}, { 2239,12}, { 1215,13}, { 639,12}, \
+ { 1471,11}, { 2943,13}, { 767,12}, { 1727,13}, \
+ { 895,12}, { 1919,14}, { 511,13}, { 1023,12}, \
+ { 2239,13}, { 1151,12}, { 2431,13}, { 1279,12}, \
+ { 2623,13}, { 1407,12}, { 2943,14}, { 767,13}, \
+ { 1535,12}, { 3135,13}, { 1663,12}, { 3455,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4479,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
+ { 3967,12}, { 7935,11}, { 15871,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3839,13}, { 7935,12}, { 15871,16} }
+#define MUL_FFT_TABLE3_SIZE 155
#define MUL_FFT_THRESHOLD 6784
-#define SQR_FFT_MODF_THRESHOLD 606 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 555 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 606, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
- { 29, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
- { 35, 7}, { 19, 6}, { 39, 7}, { 23, 6}, \
- { 47, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
- { 19, 7}, { 41, 8}, { 23, 7}, { 49, 8}, \
- { 31, 7}, { 63, 8}, { 43, 9}, { 23, 8}, \
- { 51, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
- { 79, 9}, { 47, 8}, { 95,10}, { 31, 9}, \
- { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
- { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
- { 95, 9}, { 191,11}, { 63,10}, { 159,11}, \
- { 95,10}, { 191, 6}, { 3135, 5}, { 6399, 6}, \
- { 3455, 8}, { 895, 9}, { 479, 8}, { 991,10}, \
- { 255, 9}, { 575,11}, { 159, 9}, { 639,10}, \
- { 335, 8}, { 1343,10}, { 351,11}, { 191, 9}, \
- { 799,11}, { 223,12}, { 127,11}, { 255,10}, \
- { 543,11}, { 287,10}, { 607, 9}, { 1215,10}, \
- { 671,12}, { 191,11}, { 383,10}, { 767, 9}, \
- { 1535,10}, { 799,11}, { 415,10}, { 863,13}, \
- { 127,12}, { 255,11}, { 511,10}, { 1023,11}, \
- { 543,10}, { 1087,11}, { 607,12}, { 319,11}, \
- { 671,10}, { 1343,11}, { 735,12}, { 383,11}, \
- { 799,10}, { 1599,11}, { 863,12}, { 447,11}, \
- { 927,13}, { 255,12}, { 511,11}, { 1087,12}, \
- { 575,11}, { 1215,12}, { 639,11}, { 1343,12}, \
- { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
- { 1599,12}, { 831,11}, { 1727,12}, { 895,11}, \
- { 1791,12}, { 959,14}, { 255,13}, { 511,12}, \
- { 1087,11}, { 2239,10}, { 4479,12}, { 1215,13}, \
- { 639,12}, { 1471,11}, { 2943,13}, { 767,12}, \
- { 1727,13}, { 895,12}, { 1919,14}, { 511,13}, \
- { 1023,12}, { 2239,11}, { 4479,13}, { 1151,12}, \
- { 2495,11}, { 4991,13}, { 1279,12}, { 2623,13}, \
+ { { 555, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 16, 5}, { 33, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 23, 6}, { 47, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 43, 8}, \
+ { 23, 7}, { 49, 8}, { 31, 7}, { 63, 8}, \
+ { 43, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95,11}, \
+ { 63,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { 95,10}, { 191, 6}, { 3071, 5}, { 6399, 6}, \
+ { 3455, 7}, { 1791, 8}, { 959,10}, { 255, 9}, \
+ { 511,10}, { 271,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 335, 9}, { 671,10}, { 351,11}, \
+ { 191,10}, { 399, 9}, { 799,10}, { 415,11}, \
+ { 223,12}, { 127,11}, { 255,10}, { 543,11}, \
+ { 287,10}, { 607,11}, { 319,10}, { 671,11}, \
+ { 351,12}, { 191,11}, { 383,10}, { 799,11}, \
+ { 415,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 607,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 735,12}, { 383,11}, { 799,10}, \
+ { 1599,11}, { 863,12}, { 447,11}, { 927,13}, \
+ { 255,12}, { 511,11}, { 1055,10}, { 2111,11}, \
+ { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
+ { 1343,12}, { 703,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,10}, { 3455,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2111,12}, { 1087,11}, { 2239,10}, { 4479,12}, \
+ { 1215,13}, { 639,12}, { 1471,11}, { 2943,13}, \
+ { 767,12}, { 1727,11}, { 3455,13}, { 895,12}, \
+ { 1855,14}, { 511,13}, { 1023,12}, { 2239,13}, \
+ { 1151,12}, { 2495,13}, { 1279,12}, { 2623,13}, \
{ 1407,12}, { 2943,14}, { 767,13}, { 1663,12}, \
- { 3455,13}, { 1791,12}, { 3583,13}, { 1919,15}, \
- { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
- { 2431,12}, { 4991,14}, { 1279,13}, { 2943,12}, \
- { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
- { 3967,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
- { 2303,13}, { 8192,14}, { 16384,15}, { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 160
+ { 3455,13}, { 1791,15}, { 511,14}, { 1023,13}, \
+ { 2175,12}, { 4479,13}, { 2431,14}, { 1279,13}, \
+ { 2943,12}, { 5887,14}, { 1535,13}, { 3455,14}, \
+ { 1791,13}, { 3967,12}, { 7935,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3839,13}, { 7935,16} }
+#define SQR_FFT_TABLE3_SIZE 166
#define SQR_FFT_THRESHOLD 5760
#define MULLO_BASECASE_THRESHOLD 3
#define MULLO_DC_THRESHOLD 34
#define MULLO_MUL_N_THRESHOLD 13463
-#define SQRLO_BASECASE_THRESHOLD 7
+#define SQRLO_BASECASE_THRESHOLD 8
#define SQRLO_DC_THRESHOLD 43
#define SQRLO_SQR_THRESHOLD 11278
-#define DC_DIV_QR_THRESHOLD 67
-#define DC_DIVAPPR_Q_THRESHOLD 196
-#define DC_BDIV_QR_THRESHOLD 67
-#define DC_BDIV_Q_THRESHOLD 112
+#define DC_DIV_QR_THRESHOLD 75
+#define DC_DIVAPPR_Q_THRESHOLD 200
+#define DC_BDIV_QR_THRESHOLD 71
+#define DC_BDIV_Q_THRESHOLD 119
-#define INV_MULMOD_BNM1_THRESHOLD 70
-#define INV_NEWTON_THRESHOLD 262
-#define INV_APPR_THRESHOLD 222
+#define INV_MULMOD_BNM1_THRESHOLD 74
+#define INV_NEWTON_THRESHOLD 266
+#define INV_APPR_THRESHOLD 214
-#define BINV_NEWTON_THRESHOLD 288
-#define REDC_1_TO_REDC_N_THRESHOLD 67
+#define BINV_NEWTON_THRESHOLD 278
+#define REDC_1_TO_REDC_N_THRESHOLD 71
-#define MU_DIV_QR_THRESHOLD 1718
-#define MU_DIVAPPR_Q_THRESHOLD 1652
+#define MU_DIV_QR_THRESHOLD 1652
+#define MU_DIVAPPR_Q_THRESHOLD 1589
#define MUPI_DIV_QR_THRESHOLD 122
-#define MU_BDIV_QR_THRESHOLD 1387
-#define MU_BDIV_Q_THRESHOLD 1528
+#define MU_BDIV_QR_THRESHOLD 1442
+#define MU_BDIV_Q_THRESHOLD 1597
-#define POWM_SEC_TABLE 1,16,69,508,1378,2657,2825
+#define POWM_SEC_TABLE 1,22,96,289,1259
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 20
+#define SET_STR_DC_THRESHOLD 173
+#define SET_STR_PRECOMPUTE_THRESHOLD 454
+
+#define FAC_DSC_THRESHOLD 90
+#define FAC_ODD_THRESHOLD 34
+
#define MATRIX22_STRASSEN_THRESHOLD 19
-#define HGCD_THRESHOLD 61
+#define HGCD2_DIV1_METHOD 1 /* 5.80% faster than 3 */
+#define HGCD_THRESHOLD 74
#define HGCD_APPR_THRESHOLD 50
#define HGCD_REDUCE_THRESHOLD 3389
-#define GCD_DC_THRESHOLD 492
+#define GCD_DC_THRESHOLD 456
#define GCDEXT_DC_THRESHOLD 345
-#define JACOBI_BASE_METHOD 4
+#define JACOBI_BASE_METHOD 4 /* 17.07% faster than 1 */
-#define GET_STR_DC_THRESHOLD 9
-#define GET_STR_PRECOMPUTE_THRESHOLD 21
-#define SET_STR_DC_THRESHOLD 189
-#define SET_STR_PRECOMPUTE_THRESHOLD 541
-
-#define FAC_DSC_THRESHOLD 141
-#define FAC_ODD_THRESHOLD 29
+/* Tuneup completed successfully, took 53914 seconds */
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd4/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd4/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd4/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,225 @@
+/* AMD bd4 gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+/* 3800-4200 MHz Excavator/Bristol Ridge */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-23, gcc 8.3 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 27
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 50
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 13
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1 /* 28.45% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 4
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD 13
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 28
+
+#define DIV_1_VS_MUL_1_PERCENT 314
+
+#define MUL_TOOM22_THRESHOLD 32
+#define MUL_TOOM33_THRESHOLD 73
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 270
+#define MUL_TOOM8H_THRESHOLD 357
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 69
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 114
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 103
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 121
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 154
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 42
+#define SQR_TOOM3_THRESHOLD 89
+#define SQR_TOOM4_THRESHOLD 208
+#define SQR_TOOM6_THRESHOLD 306
+#define SQR_TOOM8_THRESHOLD 454
+
+#define MULMID_TOOM42_THRESHOLD 68
+
+#define MULMOD_BNM1_THRESHOLD 19
+#define SQRMOD_BNM1_THRESHOLD 18
+
+#define MUL_FFT_MODF_THRESHOLD 570 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 570, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 25, 7}, { 13, 6}, { 27, 7}, { 15, 6}, \
+ { 32, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
+ { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
+ { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
+ { 47, 8}, { 95,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95, 9}, \
+ { 191,11}, { 63,10}, { 143, 6}, { 2303, 5}, \
+ { 4735, 4}, { 9471, 5}, { 4863, 7}, { 1279, 9}, \
+ { 335, 8}, { 671, 9}, { 351, 8}, { 703,10}, \
+ { 191,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,11}, { 159,10}, \
+ { 319, 9}, { 639,10}, { 335, 9}, { 671, 8}, \
+ { 1343,10}, { 351, 9}, { 703,10}, { 367, 9}, \
+ { 735,11}, { 191,10}, { 383, 9}, { 767,10}, \
+ { 399, 9}, { 799, 8}, { 1599,10}, { 415,11}, \
+ { 223,12}, { 127,11}, { 255,10}, { 543, 9}, \
+ { 1087,11}, { 287,10}, { 607, 9}, { 1215,11}, \
+ { 319,10}, { 671, 9}, { 1343,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 863,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 607,10}, { 1215, 9}, { 2431,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 735,10}, \
+ { 1471, 9}, { 2943,12}, { 383,11}, { 799,10}, \
+ { 1599,11}, { 863,10}, { 1727,12}, { 447,11}, \
+ { 959,10}, { 1919,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1215,10}, { 2431,12}, \
+ { 639,11}, { 1343,12}, { 703,11}, { 1471,10}, \
+ { 2943,13}, { 383,12}, { 767,11}, { 1599,12}, \
+ { 831,11}, { 1727,10}, { 3455,12}, { 959,11}, \
+ { 1919,10}, { 3839,13}, { 511,12}, { 1087,11}, \
+ { 2239,12}, { 1215,11}, { 2431,13}, { 639,12}, \
+ { 1471,11}, { 2943,10}, { 5887,13}, { 767,12}, \
+ { 1727,11}, { 3455,13}, { 895,12}, { 1919,11}, \
+ { 3839,14}, { 511,13}, { 1023,12}, { 2239,13}, \
+ { 1151,12}, { 2431,13}, { 1279,12}, { 2559,13}, \
+ { 1407,12}, { 2943,11}, { 5887,14}, { 767,13}, \
+ { 1663,12}, { 3455,13}, { 1919,12}, { 3839,15}, \
+ { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
+ { 2431,14}, { 1279,13}, { 2943,12}, { 5887,14}, \
+ { 1535,13}, { 3455,14}, { 1791,13}, { 3967,12}, \
+ { 7935,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
+ { 2303,13}, { 4991,12}, { 9983,14}, { 2815,13}, \
+ { 5887,15}, { 1535,14}, { 3839,13}, { 7935,16} }
+#define MUL_FFT_TABLE3_SIZE 192
+#define MUL_FFT_THRESHOLD 5760
+
+#define SQR_FFT_MODF_THRESHOLD 476 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 476, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 16, 5}, { 33, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 9}, { 15, 8}, { 39, 9}, { 23, 8}, \
+ { 51, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 79, 9}, { 47, 8}, { 95,10}, { 31, 9}, \
+ { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
+ { 63, 9}, { 135,10}, { 95, 9}, { 191,10}, \
+ { 111,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 143, 9}, { 287, 8}, { 575,10}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287, 9}, \
+ { 575,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 335, 9}, { 671,10}, { 351, 9}, { 735,11}, \
+ { 191,10}, { 383, 9}, { 767,10}, { 399, 9}, \
+ { 799,10}, { 415, 9}, { 863,12}, { 127,11}, \
+ { 255,10}, { 511, 9}, { 1023,10}, { 543,11}, \
+ { 287,10}, { 607, 9}, { 1215,11}, { 319,10}, \
+ { 671, 9}, { 1343,11}, { 351,10}, { 735,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 863,13}, { 127,12}, { 255,11}, { 511,10}, \
+ { 1055,11}, { 543,10}, { 1087,11}, { 607,10}, \
+ { 1215,12}, { 319,11}, { 671,10}, { 1343,11}, \
+ { 735,10}, { 1471,12}, { 383,11}, { 799,10}, \
+ { 1599,11}, { 863,10}, { 1727,12}, { 447,11}, \
+ { 959,13}, { 255,12}, { 511,11}, { 1087,12}, \
+ { 575,11}, { 1215,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,12}, { 959,11}, \
+ { 1919,14}, { 255,13}, { 511,12}, { 1023,11}, \
+ { 2047,12}, { 1087,11}, { 2239,12}, { 1215,11}, \
+ { 2431,13}, { 639,12}, { 1471,11}, { 2943,13}, \
+ { 767,12}, { 1727,13}, { 895,12}, { 1983,14}, \
+ { 511,13}, { 1023,12}, { 2239,13}, { 1151,12}, \
+ { 2431,13}, { 1279,12}, { 2559,13}, { 1407,12}, \
+ { 2943,14}, { 767,13}, { 1663,12}, { 3455,13}, \
+ { 1919,12}, { 3839,15}, { 511,14}, { 1023,13}, \
+ { 2175,12}, { 4479,13}, { 2431,14}, { 1279,13}, \
+ { 2943,12}, { 5887,14}, { 1535,13}, { 3455,14}, \
+ { 1791,13}, { 3967,15}, { 1023,14}, { 2047,13}, \
+ { 4479,14}, { 2303,13}, { 4991,12}, { 9983,14}, \
+ { 2815,13}, { 5887,15}, { 1535,14}, { 3839,16} }
+#define SQR_FFT_TABLE3_SIZE 176
+#define SQR_FFT_THRESHOLD 4736
+
+#define MULLO_BASECASE_THRESHOLD 3
+#define MULLO_DC_THRESHOLD 54
+#define MULLO_MUL_N_THRESHOLD 10950
+#define SQRLO_BASECASE_THRESHOLD 10
+#define SQRLO_DC_THRESHOLD 77
+#define SQRLO_SQR_THRESHOLD 9449
+
+#define DC_DIV_QR_THRESHOLD 84
+#define DC_DIVAPPR_Q_THRESHOLD 252
+#define DC_BDIV_QR_THRESHOLD 79
+#define DC_BDIV_Q_THRESHOLD 80
+
+#define INV_MULMOD_BNM1_THRESHOLD 71
+#define INV_NEWTON_THRESHOLD 254
+#define INV_APPR_THRESHOLD 266
+
+#define BINV_NEWTON_THRESHOLD 294
+#define REDC_1_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1652
+#define MU_DIVAPPR_Q_THRESHOLD 1528
+#define MUPI_DIV_QR_THRESHOLD 122
+#define MU_BDIV_QR_THRESHOLD 1387
+#define MU_BDIV_Q_THRESHOLD 1528
+
+#define POWM_SEC_TABLE 1,16,96,480,960
+
+#define GET_STR_DC_THRESHOLD 12
+#define GET_STR_PRECOMPUTE_THRESHOLD 19
+#define SET_STR_DC_THRESHOLD 264
+#define SET_STR_PRECOMPUTE_THRESHOLD 542
+
+#define FAC_DSC_THRESHOLD 91
+#define FAC_ODD_THRESHOLD 29
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD2_DIV1_METHOD 1 /* 9.73% faster than 3 */
+#define HGCD_THRESHOLD 55
+#define HGCD_APPR_THRESHOLD 50
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 562
+#define GCDEXT_DC_THRESHOLD 416
+#define JACOBI_BASE_METHOD 4 /* 16.50% faster than 1 */
+
+/* Tuneup completed successfully, took 49179 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bd4/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt1/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt1/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt1/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,218 @@
+/* x86/bobcat gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+/* NOTE: In a fat binary build SQR_TOOM2_THRESHOLD here cannot be greater than
+ the value in mpn/x86/k7/gmp-mparam.h. The latter is used as a hard limit in
+ k7/sqr_basecase.asm. */
+
+/* 1600 MHz AMD Bobcat Zacate E-350 */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-17, gcc 8.3 */
+
+#define MOD_1_NORM_THRESHOLD 0 /* always */
+#define MOD_1_UNNORM_THRESHOLD 0 /* always */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 10
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 6
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 16
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 21
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1 /* 57.16% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 36
+
+#define DIV_1_VS_MUL_1_PERCENT 199
+
+#define MUL_TOOM22_THRESHOLD 28
+#define MUL_TOOM33_THRESHOLD 93
+#define MUL_TOOM44_THRESHOLD 166
+#define MUL_TOOM6H_THRESHOLD 270
+#define MUL_TOOM8H_THRESHOLD 478
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 102
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 177
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 169
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 113
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 143
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 50
+#define SQR_TOOM3_THRESHOLD 89
+#define SQR_TOOM4_THRESHOLD 248
+#define SQR_TOOM6_THRESHOLD 342
+#define SQR_TOOM8_THRESHOLD 470
+
+#define MULMID_TOOM42_THRESHOLD 72
+
+#define MULMOD_BNM1_THRESHOLD 20
+#define SQRMOD_BNM1_THRESHOLD 21
+
+#define MUL_FFT_MODF_THRESHOLD 630 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 630, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 15, 5}, { 31, 6}, { 27, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 23, 6}, { 47, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 7}, { 55, 9}, \
+ { 15, 8}, { 31, 7}, { 63, 8}, { 43, 9}, \
+ { 23, 8}, { 55, 9}, { 31, 8}, { 67, 9}, \
+ { 39, 8}, { 79, 9}, { 47, 8}, { 95, 9}, \
+ { 55,10}, { 31, 9}, { 79,10}, { 47, 6}, \
+ { 767, 7}, { 399, 6}, { 799, 7}, { 415, 8}, \
+ { 235, 7}, { 479, 9}, { 135,10}, { 79, 9}, \
+ { 159,10}, { 95, 9}, { 191,11}, { 63,10}, \
+ { 159,11}, { 95,10}, { 191,12}, { 63,11}, \
+ { 127,10}, { 255, 9}, { 511,10}, { 271, 9}, \
+ { 543,11}, { 159,10}, { 319, 9}, { 639,10}, \
+ { 335, 9}, { 671,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 399, 9}, { 799,11}, { 223,12}, \
+ { 127,11}, { 255,10}, { 543, 9}, { 1087,11}, \
+ { 287,10}, { 607, 9}, { 1215,11}, { 319,10}, \
+ { 671,11}, { 351,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1087,11}, { 607,10}, { 1215,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 735,10}, \
+ { 1471,12}, { 383,11}, { 799,10}, { 1599,11}, \
+ { 863,12}, { 447,11}, { 991,13}, { 255,12}, \
+ { 511,11}, { 1087,12}, { 575,11}, { 1215,12}, \
+ { 639,11}, { 1343,12}, { 703,11}, { 1471,13}, \
+ { 383,12}, { 767,11}, { 1599,12}, { 831,11}, \
+ { 1727,12}, { 959,14}, { 255,13}, { 511,12}, \
+ { 1215,13}, { 639,12}, { 1471,13}, { 767,12}, \
+ { 1727,13}, { 895,12}, { 1919,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2431,13}, \
+ { 1407,14}, { 767,13}, { 1663,12}, { 3455,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4479,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
+ { 3967,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
+ { 2303,13}, { 4991,12}, { 9983,14}, { 2815,13}, \
+ { 5887,15}, { 1535,14}, { 3839,16} }
+#define MUL_FFT_TABLE3_SIZE 159
+#define MUL_FFT_THRESHOLD 7424
+
+#define SQR_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 500, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 28, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
+ { 35, 7}, { 19, 6}, { 39, 7}, { 23, 6}, \
+ { 47, 7}, { 27, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 47, 8}, \
+ { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
+ { 39, 9}, { 23, 8}, { 51, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 127, 6}, { 1087, 7}, { 575, 8}, { 303, 9}, \
+ { 159,10}, { 95,11}, { 63,10}, { 127, 9}, \
+ { 255,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
+ { 255, 9}, { 511,10}, { 271, 9}, { 543,10}, \
+ { 287, 9}, { 575,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 335, 9}, { 671,10}, { 351,11}, \
+ { 191,10}, { 383, 9}, { 767,10}, { 399, 9}, \
+ { 799,10}, { 415, 9}, { 831,12}, { 127,11}, \
+ { 255,10}, { 543,11}, { 287,10}, { 607,11}, \
+ { 319,10}, { 671,11}, { 351,10}, { 703,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 831,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 607,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 735,10}, { 1471,12}, { 383,11}, \
+ { 799,10}, { 1599,11}, { 863,12}, { 447,11}, \
+ { 959,13}, { 255,12}, { 511,11}, { 1087,12}, \
+ { 575,11}, { 1215,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1215,13}, { 639,12}, \
+ { 1471,13}, { 767,12}, { 1727,13}, { 895,12}, \
+ { 1919,14}, { 511,13}, { 1023,12}, { 2111,13}, \
+ { 1151,12}, { 2431,13}, { 1407,14}, { 767,13}, \
+ { 1663,12}, { 3455,13}, { 1919,15}, { 511,14}, \
+ { 1023,13}, { 2175,12}, { 4479,13}, { 2431,14}, \
+ { 1279,13}, { 2943,12}, { 5887,14}, { 1535,13}, \
+ { 3455,14}, { 1791,13}, { 3839,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3839,16} }
+#define SQR_FFT_TABLE3_SIZE 161
+#define SQR_FFT_THRESHOLD 5760
+
+#define MULLO_BASECASE_THRESHOLD 9
+#define MULLO_DC_THRESHOLD 48
+#define MULLO_MUL_N_THRESHOLD 14281
+#define SQRLO_BASECASE_THRESHOLD 7
+#define SQRLO_DC_THRESHOLD 146
+#define SQRLO_SQR_THRESHOLD 11278
+
+#define DC_DIV_QR_THRESHOLD 77
+#define DC_DIVAPPR_Q_THRESHOLD 240
+#define DC_BDIV_QR_THRESHOLD 83
+#define DC_BDIV_Q_THRESHOLD 182
+
+#define INV_MULMOD_BNM1_THRESHOLD 74
+#define INV_NEWTON_THRESHOLD 252
+#define INV_APPR_THRESHOLD 252
+
+#define BINV_NEWTON_THRESHOLD 252
+#define REDC_1_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1787
+#define MU_DIVAPPR_Q_THRESHOLD 1718
+#define MUPI_DIV_QR_THRESHOLD 122
+#define MU_BDIV_QR_THRESHOLD 1470
+#define MU_BDIV_Q_THRESHOLD 1713
+
+#define POWM_SEC_TABLE 1,16,96,563,1317,1867
+
+#define GET_STR_DC_THRESHOLD 19
+#define GET_STR_PRECOMPUTE_THRESHOLD 32
+#define SET_STR_DC_THRESHOLD 254
+#define SET_STR_PRECOMPUTE_THRESHOLD 907
+
+#define FAC_DSC_THRESHOLD 224
+#define FAC_ODD_THRESHOLD 55
+
+#define MATRIX22_STRASSEN_THRESHOLD 23
+#define HGCD2_DIV1_METHOD 3 /* 3.59% faster than 5 */
+#define HGCD_THRESHOLD 85
+#define HGCD_APPR_THRESHOLD 152
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 531
+#define GCDEXT_DC_THRESHOLD 386
+#define JACOBI_BASE_METHOD 3 /* 0.92% faster than 1 */
+
+/* Tuneup completed successfully, took 159946 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt1/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt2/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt2/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt2/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,214 @@
+/* x86/bobcat gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+/* NOTE: In a fat binary build SQR_TOOM2_THRESHOLD here cannot be greater than
+ the value in mpn/x86/k7/gmp-mparam.h. The latter is used as a hard limit in
+ k7/sqr_basecase.asm. */
+
+/* 2050 MHz AMD Jaguar/Kabini */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-24, gcc 8.3 */
+
+#define MOD_1_NORM_THRESHOLD 4
+#define MOD_1_UNNORM_THRESHOLD 6
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 18
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 9
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1 /* 47.53% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 27
+
+#define DIV_1_VS_MUL_1_PERCENT 243
+
+#define MUL_TOOM22_THRESHOLD 32
+#define MUL_TOOM33_THRESHOLD 90
+#define MUL_TOOM44_THRESHOLD 154
+#define MUL_TOOM6H_THRESHOLD 286
+#define MUL_TOOM8H_THRESHOLD 478
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 97
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 152
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 103
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 113
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 154
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 38
+#define SQR_TOOM3_THRESHOLD 126
+#define SQR_TOOM4_THRESHOLD 220
+#define SQR_TOOM6_THRESHOLD 318
+#define SQR_TOOM8_THRESHOLD 502
+
+#define MULMID_TOOM42_THRESHOLD 68
+
+#define MULMOD_BNM1_THRESHOLD 19
+#define SQRMOD_BNM1_THRESHOLD 25
+
+#define MUL_FFT_MODF_THRESHOLD 570 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 570, 5}, { 25, 6}, { 13, 5}, { 27, 6}, \
+ { 15, 5}, { 31, 6}, { 28, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 35, 7}, { 19, 6}, \
+ { 39, 7}, { 23, 6}, { 47, 7}, { 27, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
+ { 23, 7}, { 49, 8}, { 31, 7}, { 63, 8}, \
+ { 39, 9}, { 23, 8}, { 55, 9}, { 31, 8}, \
+ { 67, 9}, { 39, 8}, { 79, 9}, { 47, 8}, \
+ { 95, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95,11}, \
+ { 63,10}, { 159,11}, { 95,10}, { 191,12}, \
+ { 63,11}, { 127,10}, { 255, 9}, { 511,10}, \
+ { 271, 9}, { 543,10}, { 287,11}, { 159,10}, \
+ { 319, 9}, { 639,10}, { 335, 9}, { 671,11}, \
+ { 191,10}, { 383, 9}, { 767,10}, { 399, 9}, \
+ { 799,10}, { 415,11}, { 223,12}, { 127,11}, \
+ { 255,10}, { 543,11}, { 287,10}, { 607, 9}, \
+ { 1215,11}, { 319,10}, { 671,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,13}, \
+ { 127,12}, { 255,11}, { 543,10}, { 1087,11}, \
+ { 607,10}, { 1215,12}, { 319,11}, { 671,10}, \
+ { 1343,11}, { 735,10}, { 1471,12}, { 383,11}, \
+ { 799,10}, { 1599,11}, { 863,12}, { 447,11}, \
+ { 991,13}, { 255,12}, { 511,11}, { 1087,12}, \
+ { 575,11}, { 1215,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1471,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1215,13}, { 639,12}, \
+ { 1471,13}, { 767,12}, { 1727,13}, { 895,12}, \
+ { 1919,14}, { 511,13}, { 1023,12}, { 2111,13}, \
+ { 1151,12}, { 2431,13}, { 1407,14}, { 767,13}, \
+ { 1663,12}, { 3455,13}, { 1919,15}, { 511,14}, \
+ { 1023,13}, { 2175,12}, { 4479,13}, { 2431,14}, \
+ { 1279,13}, { 2943,12}, { 5887,14}, { 1535,13}, \
+ { 3455,14}, { 1791,13}, { 3967,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3839,16} }
+#define MUL_FFT_TABLE3_SIZE 153
+#define MUL_FFT_THRESHOLD 5760
+
+#define SQR_FFT_MODF_THRESHOLD 530 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 530, 5}, { 27, 6}, { 15, 5}, { 31, 6}, \
+ { 28, 7}, { 15, 6}, { 33, 7}, { 17, 6}, \
+ { 35, 7}, { 19, 6}, { 39, 7}, { 23, 6}, \
+ { 47, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 41, 8}, { 23, 7}, { 49, 8}, \
+ { 31, 7}, { 63, 8}, { 39, 9}, { 23, 8}, \
+ { 55, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 79, 9}, { 47, 8}, { 95, 9}, { 55,10}, \
+ { 31, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 95,11}, \
+ { 63,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { 95,12}, { 63,11}, { 127,10}, { 255, 9}, \
+ { 511,10}, { 271, 9}, { 543,10}, { 287,11}, \
+ { 159,10}, { 319, 9}, { 639,10}, { 335, 9}, \
+ { 671,10}, { 351,11}, { 191,10}, { 383, 9}, \
+ { 767,10}, { 399, 9}, { 799,12}, { 127,11}, \
+ { 255,10}, { 543,11}, { 287,10}, { 607, 9}, \
+ { 1215,11}, { 319,10}, { 671,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 831,13}, { 127,12}, { 255,11}, { 543,10}, \
+ { 1087,11}, { 607,10}, { 1215,12}, { 319,11}, \
+ { 671,10}, { 1343,11}, { 735,10}, { 1471,12}, \
+ { 383,11}, { 799,10}, { 1599,11}, { 863,12}, \
+ { 447,11}, { 991,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
+ { 1343,12}, { 703,11}, { 1471,13}, { 383,12}, \
+ { 767,11}, { 1599,12}, { 831,11}, { 1727,12}, \
+ { 959,11}, { 1919,14}, { 255,13}, { 511,12}, \
+ { 1215,13}, { 639,12}, { 1471,13}, { 767,12}, \
+ { 1727,13}, { 895,12}, { 1919,14}, { 511,13}, \
+ { 1023,12}, { 2111,13}, { 1151,12}, { 2495,13}, \
+ { 1407,14}, { 767,13}, { 1663,12}, { 3455,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4479,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
+ { 3967,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
+ { 2303,13}, { 4991,12}, { 9983,14}, { 2815,13}, \
+ { 5887,15}, { 1535,14}, { 3839,16} }
+#define SQR_FFT_TABLE3_SIZE 151
+#define SQR_FFT_THRESHOLD 4736
+
+#define MULLO_BASECASE_THRESHOLD 8
+#define MULLO_DC_THRESHOLD 44
+#define MULLO_MUL_N_THRESHOLD 11278
+#define SQRLO_BASECASE_THRESHOLD 13
+#define SQRLO_DC_THRESHOLD 62
+#define SQRLO_SQR_THRESHOLD 8907
+
+#define DC_DIV_QR_THRESHOLD 79
+#define DC_DIVAPPR_Q_THRESHOLD 228
+#define DC_BDIV_QR_THRESHOLD 75
+#define DC_BDIV_Q_THRESHOLD 136
+
+#define INV_MULMOD_BNM1_THRESHOLD 90
+#define INV_NEWTON_THRESHOLD 260
+#define INV_APPR_THRESHOLD 236
+
+#define BINV_NEWTON_THRESHOLD 294
+#define REDC_1_TO_REDC_N_THRESHOLD 80
+
+#define MU_DIV_QR_THRESHOLD 1787
+#define MU_DIVAPPR_Q_THRESHOLD 1718
+#define MUPI_DIV_QR_THRESHOLD 118
+#define MU_BDIV_QR_THRESHOLD 1442
+#define MU_BDIV_Q_THRESHOLD 1652
+
+#define POWM_SEC_TABLE 1,16,96,615,865,1442
+
+#define GET_STR_DC_THRESHOLD 16
+#define GET_STR_PRECOMPUTE_THRESHOLD 27
+#define SET_STR_DC_THRESHOLD 252
+#define SET_STR_PRECOMPUTE_THRESHOLD 638
+
+#define FAC_DSC_THRESHOLD 141
+#define FAC_ODD_THRESHOLD 39
+
+#define MATRIX22_STRASSEN_THRESHOLD 19
+#define HGCD2_DIV1_METHOD 1 /* 13.65% faster than 3 */
+#define HGCD_THRESHOLD 81
+#define HGCD_APPR_THRESHOLD 66
+#define HGCD_REDUCE_THRESHOLD 3389
+#define GCD_DC_THRESHOLD 531
+#define GCDEXT_DC_THRESHOLD 345
+#define JACOBI_BASE_METHOD 1 /* 0.84% faster than 4 */
+
+/* Tuneup completed successfully, took 103818 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/bt2/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/core2/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/core2/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/core2/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* x86/core2 gmp-mparam.h -- Compiler/machine parameter header file.
-Copyright 1991, 1993, 1994, 2000-2011, 2014 Free Software Foundation, Inc.
+Copyright 2019 Free Software Foundation, Inc.
This file is part of the GNU MP Library.
@@ -31,170 +31,180 @@
#define GMP_LIMB_BITS 32
#define GMP_LIMB_BYTES 4
-/* 2133 MHz Core 2 (65nm) */
-/* FFT tuning limit = 25000000 */
-/* Generated by tuneup.c, 2014-03-14, gcc 4.5 */
+/* 3000 MHz Penryn */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-20, gcc 8.3 */
-#define MOD_1_NORM_THRESHOLD 4
-#define MOD_1_UNNORM_THRESHOLD 4
-#define MOD_1N_TO_MOD_1_1_THRESHOLD 5
-#define MOD_1U_TO_MOD_1_1_THRESHOLD 4
-#define MOD_1_1_TO_MOD_1_2_THRESHOLD 10
+#define MOD_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 9
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 9
#define MOD_1_2_TO_MOD_1_4_THRESHOLD 0 /* never mpn_mod_1s_2p */
-#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 10
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 3
#define USE_PREINV_DIVREM_1 1 /* native */
-#define DIV_QR_1N_PI1_METHOD 1
-#define DIV_QR_1_NORM_THRESHOLD 3
+#define DIV_QR_1N_PI1_METHOD 2 /* 22.20% faster than 1 */
+#define DIV_QR_1_NORM_THRESHOLD MP_SIZE_T_MAX /* never */
#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
-#define DIV_QR_2_PI2_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD 9
#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
-#define BMOD_1_TO_MOD_1_THRESHOLD 19
+#define BMOD_1_TO_MOD_1_THRESHOLD 18
-#define MUL_TOOM22_THRESHOLD 26
-#define MUL_TOOM33_THRESHOLD 90
-#define MUL_TOOM44_THRESHOLD 144
-#define MUL_TOOM6H_THRESHOLD 286
-#define MUL_TOOM8H_THRESHOLD 430
+#define DIV_1_VS_MUL_1_PERCENT 277
-#define MUL_TOOM32_TO_TOOM43_THRESHOLD 93
-#define MUL_TOOM32_TO_TOOM53_THRESHOLD 140
-#define MUL_TOOM42_TO_TOOM53_THRESHOLD 89
-#define MUL_TOOM42_TO_TOOM63_THRESHOLD 102
-#define MUL_TOOM43_TO_TOOM54_THRESHOLD 136
+#define MUL_TOOM22_THRESHOLD 24
+#define MUL_TOOM33_THRESHOLD 93
+#define MUL_TOOM44_THRESHOLD 136
+#define MUL_TOOM6H_THRESHOLD 300
+#define MUL_TOOM8H_THRESHOLD 478
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 91
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 153
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 93
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 94
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 130
+
#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
#define SQR_TOOM2_THRESHOLD 34
-#define SQR_TOOM3_THRESHOLD 114
-#define SQR_TOOM4_THRESHOLD 178
+#define SQR_TOOM3_THRESHOLD 117
+#define SQR_TOOM4_THRESHOLD 184
#define SQR_TOOM6_THRESHOLD 262
-#define SQR_TOOM8_THRESHOLD 357
+#define SQR_TOOM8_THRESHOLD 597
-#define MULMID_TOOM42_THRESHOLD 66
+#define MULMID_TOOM42_THRESHOLD 70
-#define MULMOD_BNM1_THRESHOLD 15
-#define SQRMOD_BNM1_THRESHOLD 21
+#define MULMOD_BNM1_THRESHOLD 17
+#define SQRMOD_BNM1_THRESHOLD 25
-#define MUL_FFT_MODF_THRESHOLD 600 /* k = 5 */
+#define MUL_FFT_MODF_THRESHOLD 505 /* k = 5 */
#define MUL_FFT_TABLE3 \
- { { 600, 5}, { 25, 6}, { 13, 5}, { 28, 6}, \
- { 25, 7}, { 13, 6}, { 29, 7}, { 15, 6}, \
- { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
- { 39, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
- { 19, 7}, { 43, 8}, { 23, 7}, { 47, 8}, \
- { 27, 9}, { 15, 8}, { 31, 7}, { 63, 8}, \
- { 43, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
- { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
- { 47, 8}, { 95, 9}, { 55,10}, { 31, 9}, \
- { 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
- { 63, 9}, { 135,10}, { 79, 9}, { 159,10}, \
- { 95, 9}, { 191,11}, { 63,10}, { 159,11}, \
- { 95,10}, { 191,12}, { 63,11}, { 127,10}, \
- { 271, 9}, { 543, 8}, { 1087,11}, { 159,10}, \
- { 319, 9}, { 639,10}, { 335, 9}, { 671,10}, \
- { 351,11}, { 191,10}, { 383, 9}, { 767,10}, \
- { 399, 9}, { 799,11}, { 223,12}, { 127,11}, \
- { 255,10}, { 543, 9}, { 1087,11}, { 287,10}, \
- { 607, 9}, { 1215,11}, { 319,10}, { 671,11}, \
- { 351,12}, { 191,11}, { 383,10}, { 799, 9}, \
- { 1599,13}, { 127,12}, { 255,11}, { 543,10}, \
- { 1087,11}, { 607,10}, { 1215,12}, { 319,11}, \
- { 671,10}, { 1343,11}, { 735,12}, { 383,11}, \
- { 799,10}, { 1599,11}, { 863,10}, { 1727,12}, \
+ { { 505, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 29, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
+ { 35, 7}, { 19, 6}, { 39, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 43, 8}, \
+ { 23, 7}, { 47, 8}, { 27, 9}, { 15, 8}, \
+ { 31, 7}, { 63, 8}, { 43, 9}, { 23, 8}, \
+ { 55, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 79, 9}, { 55,10}, { 31, 9}, { 79,10}, \
+ { 47, 9}, { 95,11}, { 31,10}, { 63, 9}, \
+ { 135,10}, { 79, 9}, { 159,10}, { 95,11}, \
+ { 63, 9}, { 255,10}, { 159,11}, { 95,10}, \
+ { 191,12}, { 63,11}, { 127,10}, { 271, 9}, \
+ { 543,10}, { 287,11}, { 159,10}, { 335, 9}, \
+ { 671,10}, { 351,11}, { 191,10}, { 399, 9}, \
+ { 799,11}, { 223,12}, { 127,11}, { 255,10}, \
+ { 543,11}, { 287,10}, { 607,11}, { 319,10}, \
+ { 671,11}, { 351,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1087,11}, { 607,12}, { 319,11}, \
+ { 671,10}, { 1343,11}, { 735,10}, { 1471,12}, \
+ { 383,11}, { 799,10}, { 1599,11}, { 863,12}, \
{ 447,11}, { 959,13}, { 255,12}, { 511,11}, \
{ 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
- { 1343,12}, { 703,13}, { 383,12}, { 767,11}, \
- { 1599,12}, { 831,11}, { 1727,12}, { 959,14}, \
- { 255,13}, { 511,12}, { 1087,11}, { 2239,10}, \
- { 4479,12}, { 1215,13}, { 639,12}, { 1471,11}, \
+ { 1343,12}, { 703,11}, { 1471,13}, { 383,12}, \
+ { 767,11}, { 1599,12}, { 831,11}, { 1727,12}, \
+ { 959,14}, { 255,13}, { 511,12}, { 1087,11}, \
+ { 2239,12}, { 1215,13}, { 639,12}, { 1471,11}, \
{ 2943,13}, { 767,12}, { 1727,13}, { 895,12}, \
- { 1983,14}, { 511,13}, { 1023,12}, { 2239,11}, \
- { 4479,13}, { 1151,12}, { 2495,13}, { 1279,12}, \
- { 2623,13}, { 1407,12}, { 2815,14}, { 767,13}, \
- { 1663,12}, { 3455,13}, { 1919,15}, { 511,14}, \
- { 1023,13}, { 2175,12}, { 4479,13}, { 2431,14}, \
- { 1279,13}, { 2943,12}, { 5887,14}, { 16384,15}, \
- { 32768,16} }
-#define MUL_FFT_TABLE3_SIZE 149
+ { 1919,14}, { 511,13}, { 1023,12}, { 2239,13}, \
+ { 1151,12}, { 2431,13}, { 1407,12}, { 2943,14}, \
+ { 767,13}, { 1663,12}, { 3455,13}, { 1919,15}, \
+ { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
+ { 2431,14}, { 1279,13}, { 2943,12}, { 5887,14}, \
+ { 1535,13}, { 3455,14}, { 1791,13}, { 3967,12}, \
+ { 7935,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
+ { 2303,13}, { 4991,12}, { 9983,14}, { 2815,13}, \
+ { 5887,15}, { 1535,14}, { 3839,16} }
+#define MUL_FFT_TABLE3_SIZE 147
#define MUL_FFT_THRESHOLD 6784
-#define SQR_FFT_MODF_THRESHOLD 500 /* k = 5 */
+#define SQR_FFT_MODF_THRESHOLD 464 /* k = 5 */
#define SQR_FFT_TABLE3 \
- { { 500, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
- { 28, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
+ { { 464, 5}, { 28, 6}, { 15, 5}, { 31, 6}, \
+ { 29, 7}, { 15, 6}, { 32, 7}, { 17, 6}, \
{ 35, 7}, { 19, 6}, { 39, 7}, { 29, 8}, \
{ 15, 7}, { 35, 8}, { 19, 7}, { 41, 8}, \
{ 23, 7}, { 49, 8}, { 27, 9}, { 15, 8}, \
- { 31, 7}, { 63, 8}, { 39, 9}, { 23, 8}, \
- { 51,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
- { 39, 8}, { 79, 9}, { 55,10}, { 31, 9}, \
+ { 39, 9}, { 23, 8}, { 51,10}, { 15, 9}, \
+ { 31, 8}, { 67, 9}, { 39, 8}, { 79, 9}, \
+ { 47, 8}, { 95, 9}, { 55,10}, { 31, 9}, \
{ 79,10}, { 47, 9}, { 95,11}, { 31,10}, \
{ 63, 9}, { 127,10}, { 79, 9}, { 159,10}, \
- { 95,11}, { 63,10}, { 143, 9}, { 287,10}, \
- { 159,11}, { 95,12}, { 63,11}, { 127,10}, \
- { 271, 9}, { 543,10}, { 287,11}, { 159,10}, \
- { 319, 9}, { 639,10}, { 335, 9}, { 671,10}, \
- { 351, 9}, { 703,11}, { 191,10}, { 383, 9}, \
+ { 95,11}, { 63,10}, { 127, 9}, { 255,10}, \
+ { 143, 9}, { 287, 5}, { 4863, 6}, { 2495, 7}, \
+ { 1343, 8}, { 703, 9}, { 367,12}, { 63,11}, \
+ { 127,10}, { 303,11}, { 159,10}, { 319, 9}, \
+ { 639,10}, { 335, 9}, { 671,10}, { 351, 9}, \
+ { 703,10}, { 367,11}, { 191,10}, { 383, 9}, \
{ 767,10}, { 399, 9}, { 799,10}, { 415, 9}, \
- { 831,10}, { 431,11}, { 223,12}, { 127,11}, \
- { 255,10}, { 543, 9}, { 1087,11}, { 287,10}, \
- { 607,11}, { 319,10}, { 671,11}, { 351,10}, \
- { 703,12}, { 191,11}, { 383,10}, { 799,11}, \
- { 415,10}, { 863,13}, { 127,12}, { 255,11}, \
- { 543,10}, { 1087,11}, { 607,10}, { 1215,12}, \
+ { 831,12}, { 127,11}, { 255,10}, { 543,11}, \
+ { 287,10}, { 607,11}, { 319,10}, { 671,11}, \
+ { 351,10}, { 703,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,10}, { 863,13}, { 127,12}, \
+ { 255,11}, { 543,10}, { 1087,11}, { 607,12}, \
{ 319,11}, { 671,10}, { 1343,11}, { 735,10}, \
{ 1471,12}, { 383,11}, { 799,10}, { 1599,11}, \
{ 863,12}, { 447,11}, { 959,13}, { 255,12}, \
{ 511,11}, { 1087,12}, { 575,11}, { 1215,12}, \
- { 639,11}, { 1343,12}, { 703,11}, { 1471,13}, \
- { 383,12}, { 831,11}, { 1727,12}, { 959,14}, \
- { 255,13}, { 511,12}, { 1087,11}, { 2239,12}, \
+ { 639,11}, { 1343,12}, { 703,11}, { 1407,13}, \
+ { 383,12}, { 767,11}, { 1599,12}, { 831,11}, \
+ { 1727,12}, { 959,14}, { 255,13}, { 511,12}, \
{ 1215,13}, { 639,12}, { 1471,11}, { 2943,13}, \
- { 767,12}, { 1727,13}, { 895,12}, { 1983,14}, \
- { 511,13}, { 1023,12}, { 2239,13}, { 1151,12}, \
- { 2495,13}, { 1407,12}, { 2943,14}, { 767,13}, \
+ { 767,12}, { 1727,13}, { 895,12}, { 1919,14}, \
+ { 511,13}, { 1023,12}, { 2111,13}, { 1151,12}, \
+ { 2431,13}, { 1407,12}, { 2943,14}, { 767,13}, \
{ 1663,12}, { 3455,13}, { 1919,15}, { 511,14}, \
{ 1023,13}, { 2175,12}, { 4479,13}, { 2431,14}, \
- { 1279,13}, { 2943,12}, { 5887,14}, { 16384,15}, \
- { 32768,16} }
-#define SQR_FFT_TABLE3_SIZE 145
+ { 1279,13}, { 2943,12}, { 5887,14}, { 1535,13}, \
+ { 3455,14}, { 1791,13}, { 3967,15}, { 1023,14}, \
+ { 2047,13}, { 4479,14}, { 2303,13}, { 4991,12}, \
+ { 9983,14}, { 2815,13}, { 5887,15}, { 1535,14}, \
+ { 3839,16} }
+#define SQR_FFT_TABLE3_SIZE 157
#define SQR_FFT_THRESHOLD 5312
#define MULLO_BASECASE_THRESHOLD 0 /* always */
-#define MULLO_DC_THRESHOLD 29
+#define MULLO_DC_THRESHOLD 36
#define MULLO_MUL_N_THRESHOLD 13463
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 140
+#define SQRLO_SQR_THRESHOLD 10393
-#define DC_DIV_QR_THRESHOLD 21
-#define DC_DIVAPPR_Q_THRESHOLD 50
-#define DC_BDIV_QR_THRESHOLD 79
-#define DC_BDIV_Q_THRESHOLD 174
+#define DC_DIV_QR_THRESHOLD 32
+#define DC_DIVAPPR_Q_THRESHOLD 116
+#define DC_BDIV_QR_THRESHOLD 76
+#define DC_BDIV_Q_THRESHOLD 180
-#define INV_MULMOD_BNM1_THRESHOLD 50
-#define INV_NEWTON_THRESHOLD 39
-#define INV_APPR_THRESHOLD 37
+#define INV_MULMOD_BNM1_THRESHOLD 46
+#define INV_NEWTON_THRESHOLD 138
+#define INV_APPR_THRESHOLD 123
-#define BINV_NEWTON_THRESHOLD 318
-#define REDC_1_TO_REDC_N_THRESHOLD 87
+#define BINV_NEWTON_THRESHOLD 306
+#define REDC_1_TO_REDC_N_THRESHOLD 82
-#define MU_DIV_QR_THRESHOLD 1099
-#define MU_DIVAPPR_Q_THRESHOLD 792
-#define MUPI_DIV_QR_THRESHOLD 0 /* always */
+#define MU_DIV_QR_THRESHOLD 1499
+#define MU_DIVAPPR_Q_THRESHOLD 1442
+#define MUPI_DIV_QR_THRESHOLD 63
#define MU_BDIV_QR_THRESHOLD 1442
#define MU_BDIV_Q_THRESHOLD 1589
-#define POWM_SEC_TABLE 3,32,95,480,597,2657
+#define POWM_SEC_TABLE 1,22,66,428,1035
-#define MATRIX22_STRASSEN_THRESHOLD 21
-#define HGCD_THRESHOLD 83
-#define HGCD_APPR_THRESHOLD 159
-#define HGCD_REDUCE_THRESHOLD 3389
-#define GCD_DC_THRESHOLD 379
-#define GCDEXT_DC_THRESHOLD 309
-#define JACOBI_BASE_METHOD 4
+#define GET_STR_DC_THRESHOLD 13
+#define GET_STR_PRECOMPUTE_THRESHOLD 18
+#define SET_STR_DC_THRESHOLD 732
+#define SET_STR_PRECOMPUTE_THRESHOLD 1118
-#define GET_STR_DC_THRESHOLD 10
-#define GET_STR_PRECOMPUTE_THRESHOLD 25
-#define SET_STR_DC_THRESHOLD 442
-#define SET_STR_PRECOMPUTE_THRESHOLD 1104
+#define FAC_DSC_THRESHOLD 115
+#define FAC_ODD_THRESHOLD 50
-#define FAC_DSC_THRESHOLD 155
-#define FAC_ODD_THRESHOLD 34
+#define MATRIX22_STRASSEN_THRESHOLD 25
+#define HGCD2_DIV1_METHOD 1 /* 5.78% faster than 3 */
+#define HGCD_THRESHOLD 121
+#define HGCD_APPR_THRESHOLD 151
+#define HGCD_REDUCE_THRESHOLD 3259
+#define GCD_DC_THRESHOLD 368
+#define GCDEXT_DC_THRESHOLD 306
+#define JACOBI_BASE_METHOD 4 /* 14.19% faster than 1 */
+
+/* Tuneup completed successfully, took 67142 seconds */
Added: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreibwl/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreibwl/gmp-mparam.h (rev 0)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreibwl/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -0,0 +1,216 @@
+/* x86/coreibwl gmp-mparam.h -- Compiler/machine parameter header file.
+
+Copyright 2019 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of either:
+
+ * 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.
+
+or
+
+ * the GNU General Public License as published by the Free Software
+ Foundation; either version 2 of the License, or (at your option) any
+ later version.
+
+or both in parallel, as here.
+
+The GNU MP 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 General Public License
+for more details.
+
+You should have received copies of the GNU General Public License and the
+GNU Lesser General Public License along with the GNU MP Library. If not,
+see https://www.gnu.org/licenses/. */
+
+#define GMP_LIMB_BITS 32
+#define GMP_LIMB_BYTES 4
+
+/* 3400-3800 MHz Intel Xeon E3-1285Lv4 Broadwell */
+/* FFT tuning limit = 67,000,000 */
+/* Generated by tuneup.c, 2019-10-20, gcc 8.3 */
+
+#define MOD_1_NORM_THRESHOLD 15
+#define MOD_1_UNNORM_THRESHOLD 16
+#define MOD_1N_TO_MOD_1_1_THRESHOLD 10
+#define MOD_1U_TO_MOD_1_1_THRESHOLD 8
+#define MOD_1_1_TO_MOD_1_2_THRESHOLD 0 /* never mpn_mod_1_1p */
+#define MOD_1_2_TO_MOD_1_4_THRESHOLD 10
+#define PREINV_MOD_1_TO_MOD_1_THRESHOLD 11
+#define USE_PREINV_DIVREM_1 1 /* native */
+#define DIV_QR_1N_PI1_METHOD 1 /* 21.34% faster than 2 */
+#define DIV_QR_1_NORM_THRESHOLD 14
+#define DIV_QR_1_UNNORM_THRESHOLD MP_SIZE_T_MAX /* never */
+#define DIV_QR_2_PI2_THRESHOLD 29
+#define DIVEXACT_1_THRESHOLD 0 /* always (native) */
+#define BMOD_1_TO_MOD_1_THRESHOLD 19
+
+#define DIV_1_VS_MUL_1_PERCENT 295
+
+#define MUL_TOOM22_THRESHOLD 26
+#define MUL_TOOM33_THRESHOLD 97
+#define MUL_TOOM44_THRESHOLD 220
+#define MUL_TOOM6H_THRESHOLD 306
+#define MUL_TOOM8H_THRESHOLD 454
+
+#define MUL_TOOM32_TO_TOOM43_THRESHOLD 93
+#define MUL_TOOM32_TO_TOOM53_THRESHOLD 153
+#define MUL_TOOM42_TO_TOOM53_THRESHOLD 154
+#define MUL_TOOM42_TO_TOOM63_THRESHOLD 169
+#define MUL_TOOM43_TO_TOOM54_THRESHOLD 136
+
+#define SQR_BASECASE_THRESHOLD 0 /* always (native) */
+#define SQR_TOOM2_THRESHOLD 44
+#define SQR_TOOM3_THRESHOLD 134
+#define SQR_TOOM4_THRESHOLD 242
+#define SQR_TOOM6_THRESHOLD 342
+#define SQR_TOOM8_THRESHOLD 502
+
+#define MULMID_TOOM42_THRESHOLD 98
+
+#define MULMOD_BNM1_THRESHOLD 20
+#define SQRMOD_BNM1_THRESHOLD 23
+
+#define MUL_FFT_MODF_THRESHOLD 540 /* k = 5 */
+#define MUL_FFT_TABLE3 \
+ { { 540, 5}, { 29, 6}, { 15, 5}, { 31, 6}, \
+ { 16, 5}, { 33, 6}, { 17, 5}, { 36, 6}, \
+ { 25, 7}, { 13, 6}, { 29, 7}, { 15, 6}, \
+ { 33, 7}, { 17, 6}, { 36, 7}, { 19, 6}, \
+ { 39, 7}, { 21, 6}, { 43, 7}, { 23, 6}, \
+ { 47, 7}, { 29, 8}, { 15, 7}, { 35, 8}, \
+ { 19, 7}, { 43, 8}, { 23, 7}, { 49, 8}, \
+ { 27, 7}, { 55, 9}, { 15, 8}, { 31, 7}, \
+ { 63, 8}, { 43, 9}, { 23, 8}, { 55,10}, \
+ { 15, 9}, { 31, 8}, { 67, 9}, { 39, 8}, \
+ { 83, 9}, { 47, 8}, { 95, 9}, { 55,10}, \
+ { 31, 9}, { 79,10}, { 47, 9}, { 95,11}, \
+ { 31,10}, { 63, 9}, { 135,10}, { 79, 9}, \
+ { 159,10}, { 95, 9}, { 191,10}, { 111,11}, \
+ { 63,10}, { 143, 9}, { 287,10}, { 159,11}, \
+ { 95, 7}, { 1599, 8}, { 831, 9}, { 431, 8}, \
+ { 863, 9}, { 447,10}, { 239, 9}, { 479,10}, \
+ { 255, 9}, { 511,10}, { 287,11}, { 159,10}, \
+ { 319, 9}, { 639,10}, { 335, 9}, { 671,11}, \
+ { 191,10}, { 383, 9}, { 767,10}, { 399,11}, \
+ { 223,12}, { 127,11}, { 255,10}, { 511, 9}, \
+ { 1023,11}, { 287,10}, { 607,11}, { 319,10}, \
+ { 671,11}, { 351,12}, { 191,11}, { 383,10}, \
+ { 799,11}, { 415,13}, { 127,12}, { 255,11}, \
+ { 543,10}, { 1119,11}, { 607,12}, { 319,11}, \
+ { 671,10}, { 1343,11}, { 735,12}, { 383,11}, \
+ { 799,10}, { 1599,11}, { 863,12}, { 447,11}, \
+ { 959,13}, { 255,12}, { 511,11}, { 1119,12}, \
+ { 575,11}, { 1215,12}, { 639,11}, { 1343,12}, \
+ { 703,11}, { 1407,13}, { 383,12}, { 767,11}, \
+ { 1599,12}, { 831,11}, { 1727,12}, { 959,14}, \
+ { 255,13}, { 511,12}, { 1215,13}, { 639,12}, \
+ { 1471,13}, { 767,12}, { 1727,13}, { 895,12}, \
+ { 1919,14}, { 511,13}, { 1023,12}, { 2239,13}, \
+ { 1151,12}, { 2431,13}, { 1279,12}, { 2623,13}, \
+ { 1407,12}, { 2815,14}, { 767,13}, { 1535,12}, \
+ { 3135,13}, { 1663,12}, { 3455,13}, { 1919,15}, \
+ { 511,14}, { 1023,13}, { 2175,12}, { 4479,13}, \
+ { 2431,14}, { 1279,13}, { 2943,12}, { 5887,14}, \
+ { 1535,13}, { 3455,14}, { 1791,13}, { 3839,15}, \
+ { 1023,14}, { 2047,13}, { 4479,14}, { 2303,13}, \
+ { 4991,12}, { 9983,14}, { 2559,13}, { 5247,14}, \
+ { 2815,13}, { 5887,15}, { 1535,14}, { 3839,16} }
+#define MUL_FFT_TABLE3_SIZE 172
+#define MUL_FFT_THRESHOLD 7424
+
+#define SQR_FFT_MODF_THRESHOLD 472 /* k = 5 */
+#define SQR_FFT_TABLE3 \
+ { { 472, 5}, { 29, 6}, { 15, 5}, { 33, 6}, \
+ { 37, 7}, { 19, 6}, { 40, 7}, { 29, 8}, \
+ { 15, 7}, { 35, 8}, { 19, 7}, { 43, 8}, \
+ { 23, 7}, { 49, 8}, { 27, 9}, { 15, 8}, \
+ { 31, 7}, { 63, 8}, { 43, 9}, { 23, 8}, \
+ { 55,10}, { 15, 9}, { 31, 8}, { 67, 9}, \
+ { 39, 8}, { 83, 9}, { 47, 8}, { 95, 9}, \
+ { 55,10}, { 31, 9}, { 79,10}, { 47, 9}, \
+ { 95,11}, { 31,10}, { 63, 9}, { 135,10}, \
+ { 79, 9}, { 159,10}, { 95,11}, { 63,10}, \
+ { 127, 9}, { 255,10}, { 143, 9}, { 287,10}, \
+ { 159,11}, { 95,12}, { 63,11}, { 127,10}, \
+ { 271, 9}, { 543, 6}, { 4479, 7}, { 2431, 8}, \
+ { 1247, 7}, { 2495, 8}, { 1279,10}, { 351,11}, \
+ { 191,10}, { 399, 9}, { 799,10}, { 415,12}, \
+ { 127,11}, { 255,10}, { 543,11}, { 287,10}, \
+ { 607,11}, { 319,10}, { 639,11}, { 351,12}, \
+ { 191,11}, { 383,10}, { 799,11}, { 415,10}, \
+ { 831,13}, { 127,12}, { 255,11}, { 511,10}, \
+ { 1023,11}, { 543,10}, { 1087,11}, { 607,12}, \
+ { 319,11}, { 671,10}, { 1343,11}, { 735,12}, \
+ { 383,11}, { 799,10}, { 1599,11}, { 863,12}, \
+ { 447,11}, { 927,13}, { 255,12}, { 511,11}, \
+ { 1087,12}, { 575,11}, { 1215,12}, { 639,11}, \
+ { 1343,12}, { 703,11}, { 1471,13}, { 383,12}, \
+ { 767,11}, { 1599,12}, { 831,11}, { 1663,12}, \
+ { 895,11}, { 1855,14}, { 255,13}, { 511,12}, \
+ { 1023,11}, { 2047,12}, { 1087,11}, { 2239,12}, \
+ { 1215,13}, { 639,12}, { 1471,13}, { 767,12}, \
+ { 1663,13}, { 895,12}, { 1983,14}, { 511,13}, \
+ { 1023,12}, { 2239,13}, { 1151,12}, { 2495,13}, \
+ { 1279,12}, { 2623,13}, { 1407,14}, { 767,13}, \
+ { 1535,12}, { 3135,13}, { 1663,12}, { 3455,13}, \
+ { 1919,15}, { 511,14}, { 1023,13}, { 2175,12}, \
+ { 4479,13}, { 2431,14}, { 1279,13}, { 2943,12}, \
+ { 5887,14}, { 1535,13}, { 3455,14}, { 1791,13}, \
+ { 3839,15}, { 1023,14}, { 2047,13}, { 4479,14}, \
+ { 2303,13}, { 4991,12}, { 9983,14}, { 2815,13}, \
+ { 5887,15}, { 1535,14}, { 3327,13}, { 6783,14}, \
+ { 3839,16} }
+#define SQR_FFT_TABLE3_SIZE 157
+#define SQR_FFT_THRESHOLD 5568
+
+#define MULLO_BASECASE_THRESHOLD 16
+#define MULLO_DC_THRESHOLD 37
+#define MULLO_MUL_N_THRESHOLD 14281
+#define SQRLO_BASECASE_THRESHOLD 0 /* always */
+#define SQRLO_DC_THRESHOLD 137
+#define SQRLO_SQR_THRESHOLD 10821
+
+#define DC_DIV_QR_THRESHOLD 54
+#define DC_DIVAPPR_Q_THRESHOLD 146
+#define DC_BDIV_QR_THRESHOLD 98
+#define DC_BDIV_Q_THRESHOLD 218
+
+#define INV_MULMOD_BNM1_THRESHOLD 50
+#define INV_NEWTON_THRESHOLD 173
+#define INV_APPR_THRESHOLD 165
+
+#define BINV_NEWTON_THRESHOLD 278
+#define REDC_1_TO_REDC_N_THRESHOLD 79
+
+#define MU_DIV_QR_THRESHOLD 1787
+#define MU_DIVAPPR_Q_THRESHOLD 1787
+#define MUPI_DIV_QR_THRESHOLD 78
+#define MU_BDIV_QR_THRESHOLD 1589
+#define MU_BDIV_Q_THRESHOLD 1830
+
+#define POWM_SEC_TABLE 1,16,126,416,932
+
+#define GET_STR_DC_THRESHOLD 11
+#define GET_STR_PRECOMPUTE_THRESHOLD 17
+#define SET_STR_DC_THRESHOLD 306
+#define SET_STR_PRECOMPUTE_THRESHOLD 894
+
+#define FAC_DSC_THRESHOLD 141
+#define FAC_ODD_THRESHOLD 34
+
+#define MATRIX22_STRASSEN_THRESHOLD 20
+#define HGCD2_DIV1_METHOD 3 /* 5.97% faster than 1 */
+#define HGCD_THRESHOLD 73
+#define HGCD_APPR_THRESHOLD 123
+#define HGCD_REDUCE_THRESHOLD 3664
+#define GCD_DC_THRESHOLD 562
+#define GCDEXT_DC_THRESHOLD 465
+#define JACOBI_BASE_METHOD 1 /* 31.16% faster than 3 */
+
+/* Tuneup completed successfully, took 35114 seconds */
Property changes on: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreibwl/gmp-mparam.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreihwl/gmp-mparam.h
===================================================================
--- trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreihwl/gmp-mparam.h 2020-01-19 22:47:03 UTC (rev 53460)
+++ trunk/Build/source/libs/gmp/gmp-src/mpn/x86/coreihwl/gmp-mparam.h 2020-01-19 23:36:31 UTC (rev 53461)
@@ -1,6 +1,6 @@
/* x86/coreihwl gmp-mparam.h -- Compiler/machine parameter header file.
@@ Diff output truncated at 1234567 characters. @@
More information about the tex-live-commits
mailing list